May 23 2015

Extracting an image overlay

Category: Anime,Overmix,Programs,SoftwareSpiller @ 05:15

I’m getting close to having a Super-Resolution implementation, but I took a small detour using what I have learned to a slightly easier problem, extracting overlayed images. Here is an example:
Background merged with overlay
The character is looking into a glass cage and the reflection is added by adding the face as a semi-transparent layer. We also have the background image, i.e. the image without the overlay:
Background layer
A simple way of trying to extract the overlayed image is to subtract the background image, and indeed we can somewhat improve the situation:
Extracted overlay using Gimp
Another approach is to try estimate the overlayed image, which when overlayed on top on the background image will produce the merged image.
This is done starting with a semi-random estimate and then iteratively improve your estimation. (The initial estimate is just the merged image in this case.)
For each iteration we take our estimation and overlays it on the background. If our estimation is off it will obviously differ from our merged image, so we find the difference between the two and use that difference to improve our estimate. After doing enough iterations, we end up with the following:
Extracted overlay using estimation
While not perfect, this is quite a bit better. I still haven’t added regularization which stabilizes the image and thus could improve it, but I’m not quite sure how it affects the image in this context.

Super-Resolution works in a similar fashion, just instead of overlaying an image, it downscales a high-resolution estimate and compares it against the low-resolution images. It just so happens that I never implemented downscaling…


May 04 2015

6×6 off-roader

Category: Lego,Mindstorms,TechnicsSpiller @ 22:17

I have been meaning to get this out a long time ago, but this model was characterized by delays, long delays.
Alternative front view Back view
This was supposed to be a quick attempt on making a 6 wheeled vehicle with steering on both front and back wheels, and all wheels having power. My initial model is a clear indication of my ambitions with this project:
First prototype
Somewhere along the road I decided to try to add pendular suspension and it slowly turned into a full blown project. Then I started delaying the project, with me not even touching it for periods of up to 6 months.

The steering module is the most important part of the build, with steering and drive being controlled from each side of the axle it suspends on. I tried to keep it small and strong, while including a differential. I tried to figure out how to get the power through the steering, but I didn’t manage to find a solution which was small enough, so I ended up using those Universal Joints. It is not a good solution, as only a little bit of friction actually holds the wheel in place.
Pendular module with steering Steering
To improve the amount of distance the suspension can work with, I made the connection to the spring so it can detach when the spring on the other side is being pressed together.
drop suspension Suspension example, diagonal view
Suspension example, front view Suspension example, side view

To keep the overall height of the model down, I placed the NXT motors between the modules, which worked rather well. As a side effect it also gave the build a very low center of gravity. One thing which required special attention was to keep a smooth surface to prevent the modules getting stuck on the motors.
The modules and motor drive
I do really hate the shape of the NXT motors though, it makes them nearly impossible to incorporate them into a space-efficient model.

All in all, I can’t really say I’m satisfied with the build. While the entire model is very robust, the wheels can easily pop off making the strength of the rest of the model kinda pointless. Also the suspension on the middle wheels should really have been something else than pendular suspension, as it causes the front or back wheels to lift off the ground.
One of my goals with the project was to learn how to do wireless bluetooth communication in C++ from my computer to the NXT. I did succeed, but I never got it polished up with joystick support as I wanted…

No webgl

Download LDraw file here