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

OpenCV - calibrate_camera functionality #1

Open
filmo opened this issue Feb 10, 2018 · 2 comments
Open

OpenCV - calibrate_camera functionality #1

filmo opened this issue Feb 10, 2018 · 2 comments

Comments

@filmo
Copy link

filmo commented Feb 10, 2018

Hi,

I'm trying to run the code in 'calibrate_camera'

When I do so, I am getting the following error on my 'stock' donkey car install:

(dk) pi@d2:~/donkey_racing/calibrate_camera $ python capture_images.py
OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvWaitKey, file /home/pi/opencv-3.3.0/modules/highgui/src/window.cpp, line 676
Traceback (most recent call last):
  File "capture_images.py", line 9, in <module>
    cv2.waitKey(1)
cv2.error: /home/pi/opencv-3.3.0/modules/highgui/src/window.cpp:676: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvWaitKey

I ran the install.sh script on the donkey's raspberry pi, but am still getting the error.

In order to use your calibration code, do I need to recompile OpenCV on the donkeycar pi to fix this error? or am I doing something else wrong/neglected a step?

@jwatte
Copy link
Owner

jwatte commented Feb 11, 2018

You need a desktop/gui installed on the Pi, and started, if you haven't.
If it still doesn't work, then the opencv library you have is built without GUI support.

@filmo
Copy link
Author

filmo commented Feb 11, 2018

Thanks. That has helped. From the GUI desktop on the Pi, in a Terminal window I now run:

./capture_image.py

After a couple seconds I then get:

pi@d2:~/donkey_racing/calibrate_camera $ ./capture_images.py 
press a key for each picture (or wait 3 seconds)
Traceback (most recent call last):
  File "./capture_images.py", line 13, in <module>
    with capture.Capture() as c:
AttributeError: Capture instance has no attribute '__exit__' 

I'm using whatever install of openCV came with the default donkeycar installation. Did you compile openCV yourself or are you also using what came with the stock install? (I did run the install.sh script in your repository, so that may have altered the stock version??)

Thanks for your help.

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

No branches or pull requests

2 participants