-
Notifications
You must be signed in to change notification settings - Fork 51
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 Error: Failed Assertion #2
Comments
Are you running this under a virtual environment? If you try running it
outside of a virtual environment does the error change?
ᐧ
…On Wed, Mar 15, 2017 at 6:26 PM, Jason Teeple ***@***.***> wrote:
Receiving the following error: OpenCV Error: Assertion failed (scn == 3 ||
scn == 4) in cvtColor, file /home/pi/opencv-3.1.0/modules/imgproc/src/color.cpp,
line 8000
Traceback (most recent call last):
File "/home/pi/rpotter.py", line 138, in FindWand
old_gray = cv2.cvtColor(old_frame, cv2.COLOR_BGR2GRAY)
cv2.error: /home/pi/opencv-3.1.0/modules/imgproc/src/color.cpp:8000:
error: (-215) scn == 3 || scn == 4 in function cvtColor
Using the Pi NoIR. Still searching for a solution.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABQi5Vjm2nyJKj1Oj_hhQOMH9Fl9rnbDks5rmHOMgaJpZM4MeqDG>
.
|
I am running in the virtual environment. warnings.filterwarnings("ignore", category=np.VisibleDeprecationWarning) |
Can you check your numpy version both inside and outside the virtual environment?
|
I am also having the same issue as TEEPLE31. And I am also in virtual environment when trying. I will also check my numpy versions. |
I have 1.8.2 in both environments |
1.12.0 in both. |
Initializing point tracking START incendio_pin ON and set switch off if video is running (Raspberry Potter:1189): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed (Raspberry Potter:1189): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed |
Ok - I'm rebuilding so I can dig into this... right now I'm thinking this is related to the virtual environment and the OpenCV python bindings... |
Thanks so much for the help.
…Sent from my iPhone
On Mar 18, 2017, at 12:08 PM, sean-obrien ***@***.***> wrote:
Ok - I'm rebuilding so I can dig into this... right now I'm thinking this is related to the virtual environment and the OpenCV python bindings...
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Everything I am reading is that OpenCV and PiCamera do not play well together. |
Something to try...
What version do you get when you run this outside the virtual env :
$ python
>> import cv2
>> cv2.__version__
ᐧ
…On Sat, Mar 18, 2017 at 3:16 PM, Jason Teeple ***@***.***> wrote:
Everything I am reading is that OpenCV and PiCamera do not play well
together.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABQi5Za46GvanktPXJkecnfWkHfcd2W1ks5rnDuSgaJpZM4MeqDG>
.
|
3.1 --- Just remembered to check my python instance outside of the virtual env. Outside of virtual env:
$ python
Inside virtual env: |
Import error no module named cv2. |
Problem solved for me. Need to make sure I am running python2.7 in virtual env. |
I am running 2.7.9 in both environments. Still have the problem though.
…Sent from my iPhone
On Mar 20, 2017, at 6:39 PM, Jason Teeple ***@***.***> wrote:
Problem solved for me. Need to make sure I am running python2.7 in virtual env.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
pi@raspberrypi:~ $ python
[1]+ Stopped python |
Try: |
Meant to say: $ source ~/.profile |
Yah buddy. You the man. Thanks so much for the help.
…Sent from my iPhone
On Mar 20, 2017, at 7:49 PM, Jason Teeple ***@***.***> wrote:
Meant to say:
$ source ~/.profile
$ workon cv
---assuming you are now in virtual env---
$ sudo pigpiod
$ sudo modprobe bcm2835-v4l2
$ python2.7 rpotter.py
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I am also getting a similar error. OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /home/pi/opencv-3.2.0/modules/imgproc/src/color.cpp, line 9748 sudo modprobe bcm2835-v4l2 fixed the first error, but I am not sure what to do about the 2nd error. Anyone have any other ideas on how to fix it? |
What version of python do you have installed for the VM?
…On Fri, Apr 21, 2017 at 5:53 PM sallyliest ***@***.***> wrote:
I am also getting a similar error.
Initializing point tracking
OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file
/home/pi/opencv-3.2.0/modules/imgproc/src/color.cpp, line 9748
Error: /home/pi/opencv-3.2.0/modules/imgproc/src/color.cpp:9748: error:
(-215) scn == 3 || scn == 4 in function cvtColor
OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file
/home/pi/opencv-3.2.0/modules/imgproc/src/color.cpp, line 9748
Traceback (most recent call last):
File "rpotter.py", line 204, in
TrackWand()
File "rpotter.py", line 133, in TrackWand
old_gray = cv2.cvtColor(old_frame, cv2.COLOR_BGR2GRAY)
cv2.error: /home/pi/opencv-3.2.0/modules/imgproc/src/color.cpp:9748:
error: (-215) scn == 3 || scn == 4 in function cvtColor
sudo modprobe bcm2835-v4l2 fixed the first error, but I am not sure what
to do about the 2nd error.
Anyone have any other ideas on how to fix it?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AJwyYvPhIGFhmNXRFRYMr9au_FhIHCGwks5rySVBgaJpZM4MeqDG>
.
|
Python 2.7 |
Anyone figure out this issue, same as sallyliest over here |
A friend of mine figured it out and we got it to work. Also make sure you use the code that's in the ollivanderslamp folder. I ran into a couple other issues with linking the python modules so if you had a problem with that just lmk. |
I've been working on this damn lamp for so long, and have finally gotten far enough to even understand how to follow your instructions. I have just gotten picture and tracking marks up on the pi via ssh and and pretty proud of myself, but of course I could have done none of it without you sharing your knowledge and experience. Thanks to you, my daughter will have her harry potter lamp under the tree this xmas. |
Receiving the following error: OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /home/pi/opencv-3.1.0/modules/imgproc/src/color.cpp, line 8000
Traceback (most recent call last):
File "/home/pi/rpotter.py", line 138, in FindWand
old_gray = cv2.cvtColor(old_frame, cv2.COLOR_BGR2GRAY)
cv2.error: /home/pi/opencv-3.1.0/modules/imgproc/src/color.cpp:8000: error: (-215) scn == 3 || scn == 4 in function cvtColor
Using the Pi NoIR. Still searching for a solution.
The text was updated successfully, but these errors were encountered: