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

San Pedro Garza Garcia

Month: September 2016

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

Christian heads home

Grauate text about Functional AnalysisIt pains me when I say Christian is headed home, not so much because he is going there, but that, after two years of graduate school away from our home–that of Lorena and I, his home is really his own and not ours. That is always a good thing, but leaves most parents with feelings of melancholy. We had a great time during his 21st birthday visit. We ate a lot of good food, discussed life and its trials vigorously and saw our now grown son in a different light than before. He is his own man. We look forward to his next visit, probably Thanksgiving and have plans to do more of the same–hang out, talk, eat and enjoy our children as adults.

The book at the right was from one of his classes, Functional Analysis in the Math Department. He studied pretty hard while he was here in Texas. His other class is a hard, graduate level physics class, Quantum Physics in the Physics Department. We asked him why he took such hard classes. He no longer has to do that if he does not want to, but believes taking easy classes are a waste of time–if they are easy, he can learn the material from a book.

Parents of adult children — Christian’s 21st birthday

Christian's 21st birthday -- Labor Day 2016Lorena and I are now, officially and with no caveats, the parents of adult children. We have pretty much been that for a couple of years now at least as the kids have been out of the house and on their own since they finished their undergraduate degrees, but it took us a couple of years to realize it all an now they are both adults with all the rights the law bestows and responsibilities the law demands. It seems like things are different now in a good buy melancholic way.

We are grateful Christian flew out to see us. We had a great time with him. He did not have to do it–there was a lot going on with friends in Arizona and Oregon the he missed to be here. We did some of the stuff we did when he was a little kid–went to the zoo and a museum–and a had a great time. It is fun to be at those kind of venues (although, it still seems creepy that they stuffed Trigger and have him on display), the best part being the chance to visit along the way.

Then, last night, we took him out to dinner and today he will be on his way home. His home. That is a good thing.

Bird’s of Prey at the Ft. Worth Zoo

Lorena, Christian and I had a GREAT experience today at the Ft. Worth Zoo today. We say lions, tigers, gorillas, bonobos, alligators, crocodiles, penguins and only made it half way through the zoo. We highly, highly, highly recommend the Ft. Worth Zoo. The most amazing thing we saw, though was a small bird stalking–slowly and very, very cautiously sneaking, step by slow, slow step–a dragon fly. Christian captured the sequence through a very dirty glass window with the wrong lens and no filter. It still came out pretty good. The fourth picture is a close-up, right after the catch.The dragonfly is small in the image, but you can see it well right before the step in the log toward the left of the image.

Dragonfly stalk 0

Dragonfly stalk 1

Dragonfly stalk 2

Dragonfly stalk 3

Dragonfly stalk 4

Dragonfly stalk 5

The homework never ends

Christian's last weekend as a twenty year oldChristian got on an airplane a little after midnight on Wednesday to arrive here in Texas at five in the morning yesterday. He is here to celebrate his last weekend as a twenty year old. He got now sleep last night, but had a homework assignment due at three (Texas time), so he did not get to go to bed until yesterday afternoon. The crazy part is that, the problem he was required to solve assumed some things that were not stated in the problem and that mathematicians can never assume. He ended up writing a note to the professor to say how he just did not know how to solve the problem “generally.” The professor wrote back and said he never intended for the problem to be solved generally, just in some important cases. So Christian, in the time-honored tradition of graduate students everywhere, got to waste a night solving a problem that was unsolvable based on the incomplete information provided in the problem statement.

Powered by WordPress & Theme by Anders Norén