stereo-calibration
stereo-calibration copied to clipboard
Visualizing Calibration Error.
This solves issue #8
To run the python file -
python visualize.py -w 9 -h 6 -n 27 -s 0.02423 -d "./calib_imgs/1/" -i "left" -o "cam_left.yml" -e "jpg"
@sourishg Please review the PR
@pushkalkatara sorry for the delay. Your PR looks good to me. I just have a few suggestions. Right now you're fetching the calibration error from the terminal by searching "Calibration error:" - this seems more like a quick hack (although it's fine). I would suggest you modify the C++ scripts by adding additional popt arguments to export important calibration parameters like calibration error to an external file. Then you should fetch data from that external file using python scripts and make the plots.
Also, you should put this script and further scripts inside a folder called scripts/. That way everything is nicely organized.
Like a .yml file for Calibration error and importing the .yml in python and further displaying the plots? I'll make a commit to create a new folder - scripts. Also, i saw a slack channel on kwoc's website for the project. is it active? Actually, i am learning about stereo vision, and want to extract objects using stereo vision from the camera by thresholding the disparity matrix. I would love to learn from you, can you please share some resources on how to start with? I have tried OpenCV's example but on sample images, i need to study it throughly and implement on a video feed.
You can write the calibration error in the existing YAML file that is being generated after calib_intrinsic.cpp is called. Just make sure you add a command line argument for it - we don't always want to export the calibration error. For generating plots you also need to export the number of images used. So I suggest you use one single command line arg (say, --stat) which exports all the information needed for statistical analysis in the same YAML file.
Create another script that can read the calibration error and number of images used from the YAML file and generate the plots.
And regarding your query of segmenting disparity maps, I would suggest that you first learn how to generate such disparity maps (just Google and you'll get a bunch of papers). I also have some open source code for generating disparity maps: https://github.com/sourishg/disparity-map
@sourishg Updated the branch. Please review
@pushkalkatara This update looks good. Few refinements that I would suggest are:
- Please use
POPT_ARG_NONEas usingPOPT_ARG_INTfor yourvoption forces the user to enter additional 0 or 1 argument with it. If the user has written-vin the command-line, it serves astruefor your code to write calibration errors to file. Here is how you can use it:
If the argInfo argument type is POPT_ARG_NONE, the popt library will set arg to 1 if the option is present on the command line. You should pass a pointer to an int if you want this set for you.
- In 'plot.py' script, add arguments to input the calibration filename.
- Now that you have the 'plot.py' file, you may go ahead and remove the 'visualize.py' files from root and scripts dir.
- Can you come up with some standards from the literate, so that users can compare the calibration error with some reference to judge how good or bad it is?
- Also, it would be awesome if you can look for calibration errors in stereo extrinsic calibrations.
@pushkalkatara please update the PR as requested by @ManashRaja
I am facing issue with POPT_ARG_NONE. I think it is related to
while((c = popt.getNextOpt()) >= 0) {} ?
@pushkalkatara no, that line is not the issue. What is the exact problem you're facing?
Check this file out. I've used POPT_ARG_NONE there.
Sorry for the delay. Please review the PR.