Spherical distortion, aka barrel distortion: it’s a problem. generally only a problem for wide angle lenses. Now I am using a wide angle lens so now it is a problem for me. I am adding barrel distortion to BBTouch, it is nearly done, but I havent been able to test it for many reasons mostly having to do with the newness and unfinishedness of my bigger and better table.
So I decided to blog about it a bit instead. (and get to the testing tomorrow).
Here is the new (unfinished) BBTouch barrel distortion defrakulator on the main config screen. The game here is to adjust the distortion amount (as well as dragging the ROI rectangle around) until your distorted (the green one) rectangle matches your surface. This is generally the opposite of many un-distorters out there in that they usually warp the whole image.
An important note: BBTouch never does any spherical calculations on the image itself. that is a bit silly (and a bit wasteful of the processor) instead it only adjusts the points that we care about, namely the blob positions. This way BBTouch only has to do a half-dozen calculations per cycle instead of trying to correct the entire image every cycle.
Now, that said, it would be totally cool to be able to see the undistorted camera image, and I may add that later (just during the config process, since it is a huge waste of processor otherwise) but for now, there will just be a bit of the draggy-stretchy.
One thing I did notice during the small amount of testing that I have done is that i will also need to implement a perspective distortion defrakulator as well. (if you look close in the above image, you can see that the barrel rectangle is not quite the same as the surface due to the perspective, which is of course amplified with the wide angle. ) so I guess i will be doing that in the next few days as well.