DJI M210 calibrate front stereo cameras for depth perception - c++

I'm trying to get the calibration values to put in the m210_stereo_param.yaml, like it's suggested in the official developer website (OnboardSDK for Linux). The objective is to have good values to test the depth perception sample. The website suggest different approach for the calibration, and I chose the OpenCV one.
I found an example of calibration on this Github repository: Opencv - stereo_calibrate_rc (some explanations are given on this link: Stereo Camera Calibration in Opencv 3)
The problem is that after getting the final Matrix (in the intrinsics.yaml and extrinsics.yaml), I modified the values in the m210_stereo_param.yaml, and tried to run the sample. I got this result (which is not correct, even the default values of the m210_stereo_param.yaml had a better result).
Do you have any idea of what is going wrong with the calibration ? It's quite complicated to found a clear approach to get values to put in the yaml.

Solve, the problem was that the xml file containing the list of images need to looks like this :
"data/left01.jpg"
"data/right01.jpg"
"data/left02.jpg"
"data/right02.jpg"
"data/left03.jpg"
...
And mine xml file was more like this :
"data/left01.jpg"
"data/left02.jpg"
"data/left03.jpg"
...
"data/right01.jpg"
"data/right02.jpg"
So, if you use this example, check if your xml file alternate left-right pictures.

I asked the the tech support of DJI and he told me that the M210 does not support the calibration. In this case, you should not have these problems. Just use the original one.

Related

Disparity Map post processing in OpenFrameworks

After long hours I finally managed to get a stereo disparity map with a single camera. The result is rather spotty as one would expect, so I would like to apply some filter to improve the quality. The problem is that I'm not using pure OpenCV, but the plugin for OpenFrameworks (ofxCv), meaning I can't use this:
http://docs.opencv.org/3.1.0/d3/d14/tutorial_ximgproc_disparity_filtering.html
There has to be a way how I can apply the WLS filter, or something similar in this situation. WLS appears to be implemented in OpenCV, but I can't access it through the plugin, and direct access also doesn't seem to work.
Does anybody know how I can apply that filter, or has any other, general, disparity map post-processing advice?
I'm not sure what OpenCV functionality is available to you. But just a suggestion, maybe use the implementation from OpenCV in your project. Look at the file: https://raw.githubusercontent.com/opencv/opencv_contrib/master/modules/ximgproc/src/disparity_filters.cpp
Copy any additional files you may need to your project and try building. With basic OpenCV support you might be able to make it work.

Perspective transform (warp) of an image

I'm stuck trying to get perspective transformation to work.
I want to draw an image so it fits 4 given points. It's something like you have in Photoshop and it's used to change the perspective of image (see image below).
I have an image in byte array and I'm not using any additional libraries.
Everything I've found so far was either for OpenCV or didn't do what I wanted.
I have found some open-source program PhotoDemon and it does exactly what I want, and there is a code for that. I was trying to get it to work for many hours but it gives me completly weird results (second line on the image below).
Could someone provide me with some code or step-by-step math of what and how to do or even just a pseudo-code. I'm a little bit sick of it. It seems easy but I need some help.

Making 3D model from pictures - writing the stereo matching part

I did not took computer vision in college but I'd like to give it a try.
I want to make 3D model from a set of pictures.
I know you can do it with 123d catch or agisoft photoscan. doing it is not the point, it's writing the software.
At first I want to do stereo image matching then reconstruction from those 2 image, then multi view image matching and reconstruction.
According to this :
http://vision.middlebury.edu/stereo/eval/
The best algorythm is TSGO.
However I can't find any information about this TSGO algoritm, would any of you would know what TSGO stand for?
or if you know a better one.
Thanks.
The link on the page refers to a yet-to-be published paper:
[143] Anonymous. Accurate stereo matching by two step global
optimization. ECCV 2014 submission 74.
You'll have to wait until ECCV 2014 (September 6-12, 2014) to read it.
Meanwhile, you can take a look at OpenCV. It implements several stereo algorithms and get help you get up and running with the setup. Once you write your own implementation, you can contribute it to the community via OpenCV.
The paper and code is available at
http://www.cvc.uab.es/~mozerov/Stereo/index.htm
But it is not the best now...

Extracting part of a scanned document (personal ID) - which library and method to choose?

I have to process a lot of scanned IDs and I need to extract photos from them for further processing.
Here's a fictional example:
The problem is that the scans are not perfectly aligned (rotated up to 10 degrees). So I need to find their position, rotate them and cut out the photo. This turned out to be a lot harder than I originally thought.
I checked OpenCV and the only thing I found was rectangle detection but it didn't give me good results: the rectangle not always matches good enough on samples. Also its image matching algorithm works only for not-rotated image since it's just a brute force comparison.
So I though about using ARToolkit (augmented reality lib) because I know that it's able to very precisely locate given marker on an image. But it it seems that the markers have to be very simple, so I can't use a constant part of the document for this purpose (please correct me if I'm wrong). Also, I found it super-hard to compile it on Ubuntu 11.10.
OCR - haven't tried this one yet and before I start my research I'd be thankful for any suggestions what to look for.
I look for a C(preferable)/C++ solution. Python is an option too.
If you don't find another ideal solution, one method I ended up using for OCR preprocessing in the past was to convert the source images to PPM and use unpaper in Ubuntu. You can attempt to deskew the image based on whichever sides you specify as having clearly-defined edges, and there is an option to bypass the filters that would normally be applied to black and white text. You probably don't want those for images.
Example for images skewed no more than 15 degrees, using the bottom and right edges to detect rotation:
unpaper -n -dn bottom,right -dr 15 input.ppm output.ppm
unpaper was written in C, if the source is any help to you.

stitching aerial images to create a map

I am working on a project to stitch together around 400 high resolution aerial images around 36000x2600 to create a map. I am currently using OpenCV and so far I have obtained the match points between the images. Now I am at a lost in figuring out how to get the matrix transformation of the images so I can begin the stitching process. I have absolutely no background in working with images nor graphics so this is a first time for me. Can I get some advice on how I would approach this?
The images that I received also came with a data sheet showing longitude, latitude, airplane wing angle, altitude, etc. of each image. I am unsure how accurate these data are, but I am wondering if I can use these information to perform the proper matrix transformation that I need.
Thanks
Do you want to understand the math behind the process or just have an superficial idea of whats going on and just use it?
The regular term for "image snitching" is image alignment. Feed google with it and you'll find tons of sources.
For example, here.
Best regards,
zhengtonic
In recent opencv 2.3 release...they implemented a whole process of image stitching. Maybe it is worth looking at.