Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visualizing Calibration Error. #9

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Visualizing Calibration Error. #9

wants to merge 4 commits into from

Conversation

pushkalkatara
Copy link

@pushkalkatara pushkalkatara commented Dec 11, 2017

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"

@pushkalkatara pushkalkatara changed the title Visualizing Error Visualizing Calibration Error. Dec 11, 2017
@pushkalkatara
Copy link
Author

@sourishg Please review the PR

@sourishg
Copy link
Owner

@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.

@pushkalkatara
Copy link
Author

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.

@sourishg
Copy link
Owner

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

@pushkalkatara
Copy link
Author

@sourishg Updated the branch. Please review

@mpdmanash
Copy link
Collaborator

@pushkalkatara This update looks good. Few refinements that I would suggest are:

  • Please use POPT_ARG_NONE as using POPT_ARG_INT for your v option forces the user to enter additional 0 or 1 argument with it. If the user has written -v in the command-line, it serves as true for 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.

@sourishg
Copy link
Owner

@pushkalkatara please update the PR as requested by @ManashRaja

@pushkalkatara
Copy link
Author

I am facing issue with POPT_ARG_NONE. I think it is related to
while((c = popt.getNextOpt()) >= 0) {} ?

@sourishg
Copy link
Owner

@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.

@pushkalkatara
Copy link
Author

Sorry for the delay. Please review the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants