Monthly Archives: January 2018

Christian’s “defective” lens

Christian ordered an odd lens (Helios 44-2 58mm f/2) on ebay from a guy in the Ukraine the last time he came here to visit. It was over the holidays and it took quite a long time to get here. It is a cheap lens for which he had to get an adapter so it would fit his camera.  The reason he bought the thing is that it has an odd “defect” that makes it very interesting. Somehow, the lens “pixelates” stuff in the background. Because of this defect and the very cool effect manifested by image taken with it, it has become somewhat of a collectors item. Christian took the picture below to show us the effect. We thought it was pretty cool.

Weight loss–a third of the way to the goal


Today marks a small milestone on the weight loss program my buddy Jon and I are on. I am over 22 lbs or 10 kgs down and about a third of the way to my goal. Jon is right there, too, although it is harder for him because he infrequently has access to a consistent scale and is “on the road” all the time. I am amazed he is in about the same level of weight loss as I in such an uncontrolled environment. To butcher a phrase–onward and downward!

Bean sorter–Cross compiling for the Raspberry Pi

I got up to my office about 7:00 AM this morning and have been programming steadily since then. Well, I call it programming. Really what I was doing was trying to figure out how to get Raspberry Pi programs I write and build on my laptop (that I use as a desktop) to cross compile with Qt Creator so they will run on the Raspberry Pi which is what we started with on our coffee bean sorting project because it is cheap and we are cheap. I finally got it all to work about 12 hours later. I am wildly happy to have the bulk of this out of the way. Now I can bet back to thinking about coffee beans. Now the program I compiled previously on the Raspberry Pi should be fundamentally easier to debug.

The one good part about all this is that when I am programming I am generally not eating and the time flies. I did a pretty good job of staying on my diet.

Lorena’s new (to her) computer

The old laptop Lorena used as her main computer died yesterday, so in the middle of my day job and bean project, I got to build her a new computer. I have to admit I had quite a bit of fun with it. It is based around a Kangaroo $99 computer with an Atom processor, bluetooth, wifi, etc. The computer is that is the smart phone shaped thing between the coffee cup and the terabyte hard drive. We have the following things connected:

  • Monitor
  • Mouse
  • Keyboard
  • 1 TB drive
  • Webcam

I ordered a cheap USB speaker and will get a microphone so we can use the system for Skype. It hooked up to the wireless internet with no problem. We installed Xubuntu on it which is a lightweight version of Ubuntu. It is actually pretty snappy and just what Lorena needs to browse the web. I kind of wish I had one myself. I will just have to be satisfied with my Raspberry Pi.

Bean sorter program ported to Raspberry Pi


Got the bean sorter program running on the Raspberry Pi. It was WAY less trouble than I expected. I am not sure whether it is because I have more skills than before or they have just made it all easier. Probably a little of both. Next task is to disconnect the camera from my development computer and try to get it going on the RPi.

Update: Recognizing the camera, but taking black images so far. Giving up for the night.

The last of the upgrades for the house beside the need roof and the outside paint. The flooring on the left goes on the master bedroom and the engineered product on the right goes on the top floor. We like it a lot. What we did not know was that the wood needs to sit in the house for a week or so to “acclimate” so it installs better. That means the installation will not start for another week or two. We cannot wait to get started.

The delivery guy, a nice kid named Austin, drove through Portland traffic from Salem, Oregon to bring it to us. He will be helping Jamal with the installation when the wood is ready. Lorena continues to paint upstairs and just has a few items left to touch up. It will be nice to not have the house in upheaval for awhile. The next pass will have to wait for better weather.

We have decided to wait a year or so before we turn the bottom floor into an apartment. We have decided to try to add a fireplace in the living room after we let our resources recover a little bit more.

Diet Bluetooth/Wireless headset selfie

The other thing that arrived today is my new diet Logitech H800 Bluetooth/Wireless headset. It allows me to connect it to my computer with their little custom wireless dongle and to my telephone via Bluetooth. The reason it is a diet headset is that it allows me to not be tethered to my desk while I am talking on the phone or via skype. That is a FINE thing because I get in extra steps and it allows me to either eat more or drop weight more or both.

Bean sorter pre-proto lights and controllers arrive

Things are happening fast and furious with the bean sorter project. The pre-prototype lights Gene made for me arrived. They are just perfect. He had them all hooked up so all I have to do is flip a switch. In addition, two light controllers arrived in a separate package. Both of the are Pulse Width Modulated dimmers, but one is controlled manually with a dial and the other is controlled digital via a computer–in this case, a RaspberryPi. Can hardly wait for the weekend to see if I can get the control part of this thing going.

Bean sorter camera calibration

Yesterday, I spent my spare time on creating a camera calibration for our bean sorter project. The purpose of the calibration is to convert measurements of beans in captured images from pixel units to mm units. Images are made up of pixels, so when measurements are performed we know how big things are in terms of pixels. Something might be 20 pixels wide and 17.7 pixels high (subpixel calculations is a topic for another day). Knowing the width of something in an image is pretty worthless because the real world width ( e.g. in millimeters) of that object will vary greatly based on magnification, camera angle and a bunch of other stuff. That is a big problem if the camera moves around a lot.

Fortunately, in our case, the camera will be in a fixed location and the distance to the falling beans will always be the same. That allows us to make some fixed calculations to convert pixel units to millimeters. To that end, we put a “calibration target” in the cameras field of view at the position where through which the beans will fall. In our case that calibration target is a checkerboard pattern with squares of a known size. If we take a picture of the checkerboard pattern, then find the location of each square in the image in pixels, and store that information away.

Notice the red marks at each intersection of squares in the checkerboard–those are the found pixel positions (e.g. 133.73 pixels from the top of the image and 214.5 pixels from the left edge of the image). We can then convert the positions and sizes of found beans in the image from pixel units to mm units by using equations derived from the know mm sizes of the squares and the found position of the squares in the image as measured in pixel units. I used to have to hand write the equations to do this, but now there are open source libraries for this, so I was able to do the whole thing in an evening.

Bean sorter lights

Our bean sort project has heated back up–literally and figuratively. Gene finished the prototype light stands and shipped them out. Here is a picture of them working. They heat up a ton when they are under constant current, so I have ordered a manual PWM light driver (with a dial for brightness) and an PWM driver that I should be able to control with one of the DAC’s on the Raspberry Pi. All of that should arrive within the next few days which means I am the one who is holding everyone up because there are so many things that I have to do before I can test them. I can hardly wait to get them in my hands.

In the mean time, I am working on the pixel to world coordinate calibration model for the beans. I hope to have that done sometime today–by Thursday at latest. Then I can work on controlling the lights and capturing images with the Raspberry Pi.

Lorena hits a new PR on the Concept 2 rowing machine

After a month of upheaval, we have to admit we spent most of the weekend just trying to catch our breath and start in again. Now, though, Lorena is back in the game with her rowing. I think this has to be her personal best on the Concept II rowing machine down at Anytime Fitness. Only 400 more meters and she will have hit the goal she has worked on for over seven years now–12,000 meters in one hour. Kelly is on her game, too. She ran five miles on Saturday with plans to run six next Saturday on the way to a half marathon sometime in February. Last night, we called Christian, but he could not talk because he was at the gym. This is all good and well, but it is making me look pretty bad. I am still typing furiously most of the day, but have not lifted a finger to do anything other than to go on some medium distance (4-5 mile) walks and even that is awhile ago. I still have about 15 lbs. to lose on my current trajectory, but hope to be in the gym again before spring.

Dropping Beans: Finding the beans

Gene and I continue to make progress on our bean inspection project. Here is the first pass at measuring bean size as beans drop past the camera. This includes finding the bean in the image, calculating its contour and measuring how big it is in the image. The next step is to convert the bean size in the image measured in pixel units to the size in millimeters. I am half way into that.

The other thing I did this weekend was load up a Raspberry Pi with the latest Raspbian OS and got it running on the network. Right now, I am doing all my work on my Linux PC, but the idea is to move it over to the Raspberry Pi as soon as it is a little further up the development path because that is a much cheaper computer. There are some other options that might be even better (cheaper and faster), but I have a Raspberry Pi, so that is where we will start.

Gene is not sitting still either. He has built me up some prototype lighting, but I will save that for a post of its own.

Diet and blog update

We have been slammed since the first of the year so I have gotten behind on blogging and fell off the wagon on my diet at least a couple of times. Now however, the holidays are over, our annual church special meetings for the year are over, annual sales meeting up in Canada at my day job is complete so I will not have to try to lose weight on restaurant food or on big meals Lorena prepares for visitors. I actually did better than I usually do and currently at my lowest weight since I started the diet-16.5 lbs. lost. Only 44.5 lbs. to go.

In addition to the diet thing and my day job, I have a couple of side projects (a development project with my buddy Gene I plan to chronicle quite a bit more and a, believe or not, real estate project with my buddy Mark P.), and a three or four more remodel projects. So, I plan to write on all this until one of the side projects turns into a business and/or I retire and continue to try to find a work from home business. Over the next couple of days I will talk about the development stuff Gene and I are doing and the business idea/model behind it.

New flooring scheduled for install

We received an email from our flooring guy on Friday. It seems there is a sale on just the exact kind of flooring we want to put in the upstairs of our house. It should get shipped to the house within the next day or two after which it sits and “acclimates” in the house for a few days before it is installed. We were going to put it in the whole house, but decided we would only put it on the stairs and the top floor (money!), but we also decided that we would get rid of the nasty carpet in the master bedroom and replace it with the same stuff that is on the main floor of the living room and kitchen. We are excited to get started, but the house will be in upheaval again for a week or two more. We will have to get to the down stairs in a year or so.

Fun note on Christian’s college trajectory

This image from six years ago came up on our social media today. It is Christian’s Dean’s List notification for the first semester of his second year at Wake Technical Community College. I had completely blown it for the following semester by forgetting to pay for everyone’s classes by the deadline. Kelly was able to get the classes she needed, but I had to register Christian for Differential Equations and Calculus based Physics at Johnston Community College which was about a 40 minute drive from where we lived. The only class I could get him into at Wake Tech was Linear Algebra at Wake Tech. Fortunately, he was able to take another class on line from Central Carolina Community College. He actually had a 4.0 semester that semester and finished every math class he needed to get an engineering degree when he was 16 years old.

There was an added benefit in that he got to do the driving over to Johnston CC every day–a great thing for someone who just got their license, Lorena took two classes with him, so she went with him every day, and he got paid by the college for taking notes for a couple of members of his class who were not able to do it themselves.

Now the office is painted

Work in the home office has been somewhat chaotic over the last week. Lorena painted the whole thing “underneath” me. We shoved the furniture to the center as she went. Hopefully, we are only a few weeks from replacing all the dated carpet with hardwood and laminate flooring. In the mean time Kiwi continues to insert herself into the middle of everything. Notice her perched on my ever decreasing belly (Down 16 pounds now!) looking over my left shoulder. In a few minutes we are off to celebrate Lorena’s birthday.

Weight, travel, hobbies, and home improvement

Life is getting back to normal in the Chapman household. I guess I should make the caveat that it is about as normal as is possible based on adherence to the recently adopted New Year’s resolution to which I hope to stick. Lorena does not really have that first of the year resolution life modification thing because she sticks to what she is doing through thick and thin. Nevertheless, after one pretty big fall from the wagon and a brief smaller one, both due to visits and special circumstances, I am back in the game and hit a new “this diet” low in my quest to lose over sixty pounds.

My work is back in full swing with a trip to Canada and tentative trips to China and North Carolina in the works. I work on stuff that is of great interest to me and that is a gift. It is enough of a gift that I actually work on it as a hobby, too. Hopefully, within the next few months, I will be able to write about the hobby project some more because it is something that could have a fairly high level of interest for those in certain small businesses and maybe even for those with serious coffee snobbery. More on that when we (my buddy Gene and I) have more to show.

In the meantime, we continue with our home improvement projects. The entry to the house now looks less like an overgrown vacant lot, but only a little bit less like that. This month there is some good chance we will have all the new floors installed in our house, but that will depend on how often I have to travel and/or am stuck at home by myself while Lorena visits her mom in Mexico.

Back to normal after the holidays

Life is returning to normal now after the holidays. I am back on my diet–still 5 pounds over my pre-holiday high, there is too much work to do, company is coming for the weekend, Lorena returns to FINALLY finish up on the surgical work that started in North Carolina almost three years ago–after this she only returns to check on how it is all holding up, several short trips are planned after that, and we continue to work on getting the house fixed up. There are still four major remodel projects that I will try to post here. In the mean time, whenever I sit down to get a little reading, Kiwi lays on the arm I use to hold up my phone to read my book so I can move it until it finally starts going numb. When I finally move she is very disgusted with me and I deserve it.