Finally got a working command out of my opencv experiment. I still need to work on some additional aspects. but the overall src is already finished. I ended up with 3 major states for the command:
- video_demo: This state shows the capability of the imageadjust command in a video. I thought it would be nice to see it real-time with a feed from the camera of from a video file. It’s very cool to compare the original video feed with the changed image. ./imageadjust –cw # –ch # –video_demo [–video FILE | -c 0].
- create_conf: Its used to create the configuration file from a series of pictures, a video file or a video feed. This is good because (i thing) the command runs faster when you give it the configuration parameters. It all depends on opencv internals that I don’t understand quite yet. ./imageadjust –cw # –ch # –create_conf [IMAGES | -c 0 | –video FILE ]
- image_adjust: It’s the main objective of the command. You give it a list of images and, optionally, a configuration file. And it will create a directory and put all the adjusted images there. For the moment there is a bug related with the configuration file code. So the resulting images when executing the command with –ininput is not so good. The angle of the images is not adjusted correctly. Will fix that shortly :)
At the end the distance and angle are adjusted to an undefined position. That is, the use cannot define the resulting angle nor distance. This could be something that can be added in the future, but I’m happy with the way things are for the moment. The distance is defined by the largest distance from the image plane of the list of images. It means that all the images will be adjusted to have the distance of the image with the most distance from the camera. Not really sure what the angle is. On all the images the chessboard ends up with the longest side in the vertical position.
Going to fix the remaining outstanding issues and start using the command tomorrow :)
This is the git snapshot:
http://github.com/Joelgranados/imageadjust/tree/94028b5dad9a46b690b75d185cbc77153a86b695