"In the world ye shall have tribulation: but be of good cheer; I have overcome the world." –John 16:33

Year: 2016 Page 3 of 13

A fascinating weekend

I have not been so consistent in my writing over the last several weeks, but interesting things are happening. Not so surprisingly, writing in this blog helps me sort through things a bit. Lorena, her mom and I all attended a church convention in Georgetown this weekend. We saw a lot of old friends from North Carolina and Mexico, ate some great food and got refocused on what is truly important. One of the really fun things that happened was a talk I had with an acquaintance who works in the very area of the Quantum Topology where that won a Nobel prize for three physicists who came up with and developed the idea. Microsoft is currently funding a very big effort called Station Q to build a quantum computer using these concepts. It could have huge impact on what it is possible to compute if they can get it to work. It will be fun to watch this, especially now that I know someone directly working on it.

24th Wedding Anniversary

Lorena and Ken sign wedding papers in Monterrey, Mexico 1992Lorena and I got married twenty-four years ago today. That was two days before the 500th anniversary of the discovery of America by Christopher Columbus. Lorena’s mother, Conchita–the best mother-in-law in the history of the world arrived in Dallas last night to help us celebrate. We are in a new era now that started a couple of years ago, but now we are really starting to accept that fact that the kids are gone, paying their own way and only really need us for moral support. It is a good place to be and I am thankful to be here with Lorena.

Gaugecam measures NC Hurricane Matthew Flooding

The following image speaks for itself. It shows the graph of water level from GaugeCam‘s camera viewing water level in a body of water near Goldsboro, NC at 6:30 AM yesterday morning in the face of flooding caused by Hurricane Matthew. There is an image that appears as you hover the mouse cursor (arrow) over the dots on the graph. It is an amazing visualization of the flood from which we are working on a video. The spikes in the middle of the curve are anomalies. On the far right side of the graph you can see the water rise dramatically.
Hurricane Matthew flooding captured by gaugecam in Goldsboro, NC

Kelly shopping for glasses

Kelly shopping for glassesThis may not sound like such a big deal, but when Kelly sent us pictures of the new glasses she tried on today, it dawned on me that she will get her new prescription and her new glasses with her own insurance that she earns at work at her new job. She starts on Monday. They have all the normal, new employee meetings and paperwork as the obligatory, take the new employee to lunch trip. I love the first day of a new job and this is Kelly’s first, not in internship, not at school job where she plans to be there for a number of years at the very least. How cool is that.

So, my struggles about finding things to write for this blog will get even harder because now she is not only out of homeschool, she is out of school altogether. It is all quite exciting.

Kelly takes a job

Kelly takes a jobThis is the semi-momentous announcement that marks an ending and a new beginning for Kelly. Kelly passed her PhD prelims (comprehensive exams) last month. That is a big deal because it moved her to PhD candidacy. She learned a lot in the last two years. She made significant improvements in her data analytics skills, especially with respect to applying them in the specific domain of Marketing. She also learned, though, that she did not want an academic career in Marketing. So she has decided to stop at an MS in Marketing, take a few years off to work, continue to improve here statistical skills (maybe even another Masters degree) and figure out what field might be in alignment with her career goals (probably something to do with Statistics). That is the big news. That and the fact that, after many, many interviews and some good offers, she has accepted a job that is just about perfect for her in downtown Seattle. All good stuff. So, in our homeschool journey, one kid is out of school for the time being and has a stellar “real” job. She might head back toward a PhD someday, but then again she might not. She is in a good place and we are thankful for such a great outcome even though it is not over yet. Gainful employment is always a good thing.

Coming soon: A semi-momentous anouncement

Some really good stuff is happening, some of which has to do with schooling and some with work. Lorena and I are spending most of the day indoors today, not because we want to be here on a beautiful sunny fall day (not to hot for a change), but because we have to work. I have taken on another project to help with a medical device for developing countries and Lorena is studying for her Statistics class. She has two classes this term, so she is pretty busy. That is all good stuff, but not the subject of this post. I just wanted to put up a marker because some good decisions were made to make a change, but the exact direction is not yet established. I think in a couple of days we can celebrate it and talk about it.

The evidence for the reliability of the scriptures just keeps piling up

It is amazing to me that in our day and age, new physical evidence continues to accumulate that shows the Biblical scripture did not change in any meaningful way from what was originally written. An article came out yesterday about technological advancements that allow previously unreadable scrolls from the first century AD to be read reliably. That in conjunction with the relatively new ability to recover Biblical text from, of all things, mummies masks that also go back to the first century. There was little doubt before we had these new confirmations that the Bible we read today is very, very close to what was initially written–nothing of any doctrinal consequence with respect to the foundation truths of Christianity was ever in question. Still, it is nice to have them.

More people killed by lightning than terror… Really?

I just read an article, ironically titled Question The Stories You Tell Yourself About Terror Attacks And Police Shootings, that said one’s chance of getting hit by lightning are greater than getting killed by a terrorist attack. That is neither true for the United States nor the world. On average, 51 people per year get struck by lighting in the US for 20 year average of 1020. For the years 1995 to 2014, 3264 people were killed in the US by terrorism for an average of over 163. Of course, that is greatly inflated by the 3000+ killed on 9/11, but the point remains. It is even worse for the rest of the world. It is hard to estimate the number of lighting strikes around the world, estimates ranging from 6000 to 24,000 per year. The number of terror attack deaths as estimated by the US State Department for 2015 was 28,328. This is a big and growing problem, not caused by the Amish nor the Lutherans.

Ode to Joy on Glock 22’s


I count this as a birthday gift from one of the blogs I read. The guy who writes the blog does not know I exist, but he is a fellow traveler, transplanted to Texas whose blog I visit at least a couple of times per day (h.t. Bayou Renaissance Man). To my friends in Klamath Falls, Southern Indiana and parts of North Carolina, this video needs no explanation (I did not mention Texas because that goes without saying). What is not to like about Ode to Joy on Glock 22’s, especially when Russians are involved?

Crazy coincidences and strange challenges

I am about to turn 61. A lot of funny little things, and I emphasize the word little, because they are of almost no importance, have been going on in my life. On that birthday theme, I found out today a guy that I have been helping get a business started in Kansas was born the day before me–the day before, the same year. In addition and very randomly, through Facebook, we learned that his daughters roommate in California is the first cousin of one of my daughter’s best friends in Seattle. There was no connection whatsoever between the two, we just found out about it after the fact. There are a couple of other non-coincidences like that about which I really do not have license to speak, but it surely seems odd that things work out serendipitously for great good for no material reason.

The other thing that just seems very random in my life is that the guy in the office next to me is one of those autodidact guys who claims he is an atheist. I called him on it–I really know of no rational person who claims they are atheist. He backed off of his statement. You would have had to been there to understand the context because my calling him on it was not really a heavy handed thing, but an outgrowth of a (relatively) thoughtful conversation. It was about as thoughtful a conversation as one could have with someone who absurdly claims, “No one has given me any good reason to believe there is a God.” That has always seemed to be a profoundly irrational claim, especially in light of the fairly recent, but very clear understanding that nothing existed–literally nothing, not even a quantum vacuum, no time, no space, nothing–then something started to exist. At the very least, that calls for some level of agnosticism. Really, there is no good reason to think there is not a God–much more so than that there is not one.

Life just seems a little surreal right now, but that is not a bad thing, just a little disorienting.

The Raspberry Pi 3 arrives from Amazon (ordered at 10AM, arrives at 6PM)

Lorena and I were amazed the Rasperry Pi 3 I ordered from Amazon at 10AM yesterday morning actually arrived on our doorstep at 6PM yesterday evening. I am working on it now. My job is to get it running with a 5 mega-pixel camera. In reading about it, I found that it runs hot so I installed the two heat sinks that came with it. The heat will probably not be so bad for the work I am doing on my day job, but it might create a challenge for the GaugeCam project where we need to run our system outdoors in all kinds of weather. The CPU gets throttled if the system runs too hot and the reason we switched from the Beaglebone Black to the Raspberry Pi three was for speed considerations having to do with how we plan to use the camera. It probably will not be a problem, but it is another thing we will have to give some fairly extensive testing. The things that came in the $49.99 purchase were the Raspberry Pi 3, the wall-wart power supply, the heat sinks and the case. It turns out that if we put the top on the case, it runs enough hotter that the CPU throttles, so the case will not do us much good. The Beaglebone Black to the left is the one we are replacing. It honestly worked great with the exception that it was not possible to capture the large format (not that large actually-1280×960) images we need for our projects.

Raspberry Pi 3 -- One day delivery from Amazon

Amazon: The good and the bad

Raspberry Pi 3 KitI ran into a brick wall on my Beaglebone Black (BBB) project. I love the BBB, but the hardware is not fast enough to do what I need it to do, so I looked around for something faster that could run the same code and thought I would try the Raspberry Pi 3. Amazon has a reputation as a terrible place to work, but the Raspberry Pi 3 I ordered has a promised arrival of this afternoon and I ordered it earlier this morning. Kind of an amazing thing. Also, the Raspberry Pi 3 is about the same price as the BBB, but has a quad-core, 1.2 GHz Arm 8 microprocessor while the BBB has a single core 1.0 GHz Arm 8 microprocessor. I looked around a little and had no trouble finding another board doing exactly what I need. I hope I can make it work.

Update: Just amazing. It arrived at 6:00 PM at my doorstep through the apartment security gate and it included the other stuff I had ordered the day before.

Danger in Brazil… and America?

My brother-in-law worked in São Paulo, Brazil for a couple years, right at the turn of the millennium. Here is an article from 2007 in Vanity Fair titled City of Fear. It talks about a very dangerous series of events that happened there five or six years after he returned to Mexico. There was a continuous string of attacks on the police that created chaos that caused a panic, shutting the city down for days with people locked in their homes cowering in fear with traffic jams everywhere until people got home. It is an interesting read about a scary situation. Peter Grant from the Bayou Renaissance Man blog makes the case that all the stars are aligning that could allow the same kind of event to happen here in the United States. In his article titled US cities are becoming much more dangerous places, he talks about how the BLM movement, the influx of illegals from many chaotic and violent places and the way the law enforcement community has had to respond to what is a no-win situation for them means some version of this kind of chaotic event could arrive in large cities in the US. Read the article. He makes a compelling case.

Update: Turns out, my brother-in-law was on a business trip in São Paulo when this was all happening. I cannot wait to get together with him and hear the story.

The Intellectual Yet Idiot: A seminal article on who is really “the problem”

A brilliant article titled The Intellectual Yet Idiot, written by a guy named Nassim Nicholas Taleb puts in words something that has been in my mind as well as the minds of others, more thoughtful than my myself for a long, long time. I have written about the pontifications of the likes of Neil deGrasse Tyson, Richard Dawkins, Mark Borg, Bart Ehrman and some others with respect to subjects in which I am interested, but the people about whom Taleb writes live in every segment of our society. At some level, they are all Social Justice Warriors. Even, if not especially, our the current president of these United States fits very comfortably into this category. The article starts off like this and just gets better and better the further one reads:

What we have been seeing worldwide, from India to the UK to the US, is the rebellion against the inner circle of no-skin-in-the-game policymaking “clerks” and journalists-insiders, that class of paternalistic semi-intellectual experts with some Ivy league, Oxford-Cambridge, or similar label-driven education who are telling the rest of us 1) what to do, 2) what to eat, 3) how to speak, 4) how to think… and 5) who to vote for.

But the problem is the one-eyed following the blind: these self-described members of the “intelligenzia” can’t find a coconut in Coconut Island, meaning they aren’t intelligent enough to define intelligence hence fall into circularities?—?but their main skill is capacity to pass exams written by people like them. With psychology papers replicating less than 40%, dietary advice reversing after 30 years of fatphobia, macroeconomic analysis working worse than astrology, the appointment of Bernanke who was less than clueless of the risks, and pharmaceutical trials replicating at best only 1/3 of the time, people are perfectly entitled to rely on their own ancestral instinct and listen to their grandmothers (or Montaigne and such filtered classical knowledge) with a better track record than these policymaking goons.

Update: This fascinating and fun article titled Global Warming Alarmists Promote XKCD Time Series Cartoon, Ignore Its Mistakes from The Stream perfectly makes the point with respect to global warming.

YUYV (YUV422) to BGR/RGB conversion (for Logitch C270 camera using openCV)

I had an irritating problem doing a simple image conversion for my GaugeCam project where I am capturing images with a USB camera that I want to process with OpenCV on a Beaglebone Black embedded computer. I am using a Logitech C270 camera for my development work on the desktop, but we will be using a different, more industrial quality camera when we get ready to put the devices we are building in the field. At any rate, I usually can just do an Internet search and find some code I can cut and paste to do this simply types of conversions so I though I would just put this out there in case anyone wants to use it. If you have questions on how to use it with OpenCV, just ask. Feel free to just cut and paste as needed–use at your own risk, it works in my application.This is not a tutorial, just a convenience for whoever can use it. I know the format is not great–I will get around to adding something to the blog for code pasting if I ever do any more of it.

A couple of additional notes:

  • I am converting this to BGR (for OpenCV) rather than the RGB specified in Wikipedia.
  • I am using the boost::algorithm::clamp method to do the clamping (using namespace boost::algorithm). You can do clamping with something like this if you like: MIN( 255, MAX( 0, x ) )
  • You might have to convert “u_char” to “unsigned char” depending on what other includes you use.
  • I am assuming the stride of both the source and destination buffers are equal to the width.
  • I am assuming the output buffer has been allocated.
  • I am assuming the input buffer is a YUYV buffer that is two-thirds the size of the output buffer in the format specified in the Wikipedia link.
  • The way I am using this is passing the cv::Mat data pointer into the method as the output buffer.

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Conversion algorithm from: https://en.wikipedia.org/wiki/YUV
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
int ConvertYUYV_2_BGR( const int nWidth, const int nHeight,
                       u_char *pPixSrc, u_char *pPixDst )

{
    if ( NULL == pPixSrc || NULL == pPixDst )
    {
        cerr << “FAIL: Cannot convert YUYV to BGR from/to NULL pixel buffers” << endl;
        return -1;
    }

    int nStrideSrc = nWidth * 2;
    int nStrideDst = nWidth * 3;
    u_char *pSrc = pPixSrc;
    u_char *pDst = pPixDst;
    int nRow, nCol, nColDst, c, d, e;
    for ( nRow = 0; nRow < nHeight; ++nRow )
    {
        for ( nCol = 0, nColDst = 0; nCol < nStrideSrc; nCol +=4, nColDst += 6 )
        {
            d  = ( int )pSrc[ nCol + 1 ] – 128;    // d = u – 128;
            e  = ( int )pSrc[ nCol + 3 ] – 128;    // e = v – 128;

           
            // c = y’ – 16 (for first pixel)
            c = 298 * ( ( int )pSrc[ nCol ] – 16 );

                     // B – Blue
            pDst[ nColDst     ] = ( u_char )clamp( ( c + 516 * d + 128 ) >> 8, 0, 255 );
           
// G -Green
            pDst[ nColDst + 1 ] = ( u_char )clamp( ( c – 100 * d – 208 * e + 128 ) >> 8, 0, 255 );
           
// R – Red
            pDst[ nColDst + 2 ] = ( u_char )clamp( ( c + 409 * e + 128 ) >> 8, 0, 255 );

            // c = y’ – 16 (for second pixel)
            c = 298 * ( ( int )pSrc[ nCol + 2 ] – 16 );

            // B – Blue
            pDst[ nColDst + 3 ] = ( u_char )clamp( ( c + 516 * d + 128 ) >> 8, 0, 255 );
                     // G -Green
            pDst[ nColDst + 4 ] = ( u_char )clamp( ( c – 100 * d – 208 * e + 128 ) >> 8, 0, 255 );

                     // R – Red
            pDst[ nColDst + 5 ] = ( u_char )clamp( ( c + 409 * e + 128 ) >> 8, 0, 255 );
        }
        pSrc += nStrideSrc;
        pDst += nStrideDst;
    }
    return 0;
}

What do you do the night of El Grito de Dolores?

Kiwi and Dad partying hard in celebration of Mexican Indepence DayKiwi and I are having a pretty exciting night on the eve of El Grito de Dolores. People all over Mexico will be in the central plazas of their cities and towns to celebrate Mexican Independence. Of course, we are also celebrating our friend Vanesa’s birthday. We are not sure which is most exciting. You can see from the picture at the right that we are partying pretty hard–so hard that I am almost certain we will not make it until midnight when all the shouting begins.

Not a retirement kind of guy

House plansI have always said I would like to work until I am at least 80 if I am healthy and can find gainful employment. The thought of going fishing, golfing or recreating full time, while I see nothing wrong with it, does not sound particularly appealing. I love my work. At the same time, it would be kind of nice to live exactly where Lorena wants to live, hopefully not too far from wherever our kids land. It would also be pretty nice to work from home at least half of the time after I pass 65 or so. I am not a spring chicken anymore and the kids are gone, so Lorena and I are looking at home plans and trying to figure out where we want to land in retirement. It is a hard thing when you have few facts and no certainty about the future. Still, we have identified a few places and are looking at house plans (we think we might want to build, but are not sure). It is going to fun but stressful.

Woo-hoo! Lorena starts back to college!

Clackamas Community CollegeWe found out today that Lorena made it past the waitlist and is now enrolled into two online classes at Clackamas Community College. She only has a few classes left and this was the best way to get her to her degree. It is a challenge because one of the classes is Statistics, a pretty hard class. I actually use statistics on a daily basis at my day job, but her best hope for good help is with Kelly (BS Statistics) and Christian (BS Applied Mathematics). We are very excited for Lorena and hope she can finish either this Spring or next Fall. After (in October) 24 years of marriage, I still relish the thought that we are paying for education. I hope it never ends.

Doing my one trick

It is not much of a joke, but in terms of my work, I describe myself as a one trick pony. I generally hired to fix one hard problem in the domain of machine vision and image processing. I do that one trick and then I am on to the next thing. I can do other stuff in the domain of certain specialized types of programming, but the one thing at which I am really good is that one trick. My single minded focus over the last couple of months has been to do that work in most of my spare time at home as well as at work. I figure I have one or two more months of that kind of work before I have all my volunteer work, contract work and other sundry efforts under control well enough to get back to a more normal life. I really do love it, but it gets in the way of exercise, reading and even eating well, so I need to get it all out of the way. I am writing this because 9/11 is a nice reminder to put some things into perspective. This is fun stuff that pays the rent, but it is still not nearly as important as what comes down to relationships, first with God, then with family, friends and neighbors. I guess it is time to make a plan to really get this stuff out of the way and get on with real life.

Good progress on webification of GaugeCam software

My work to develop a camera with a web interface for GaugeCam is progressing nicely. Right now, I am just working on GUI kinds of things. I have live images and snapshots from the camera working and have moved on to a good little chunk of work to get region-of-interest selection and ruler tool setup working on the web as it worked in the original software. Sadly, the hard drive on my computer at home went bad so I am fighting through that for a little while.
GaugeCam webification progresses

Page 3 of 13

Powered by WordPress & Theme by Anders Norén