node-opencv icon indicating copy to clipboard operation
node-opencv copied to clipboard

convertGrayscale is failing for me.

Open eric-radiant opened this issue 7 years ago • 1 comments

I feel like this was working a few days ago, maybe I'm doing something super stupid. I load an RGB image, then do image.convertGrayscale() and get:

OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /tmp/opencv@2-20171017-62128-193wa5b/opencv-2.4.13.4/modules/imgproc/src/color.cpp, line 3783 libc++abi.dylib: terminating with uncaught exception of type cv::Exception: /tmp/opencv@2-20171017-62128-193wa5b/opencv-2.4.13.4/modules/imgproc/src/color.cpp:3783: error: (-215) scn == 3 || scn == 4 in function cvtColor

I've tried printing out image.channels() and that is 3 (and there is a check for that in the wrapper anyway) so not sure what could be causing this error. Any ideas?

eric-radiant avatar Nov 17 '17 00:11 eric-radiant

Good grief...I had a flow that was working, I wanted to try doing something that needed grayscale so I put in convertGrayscale and it started dying with that error, which looks like an error with the convertGrayscale. And it is, but not when I convert to grayscale, the goodfeaturestotrack wrapper also tries to run convertGrayscale which then dies because it is already grayscale.

eric-radiant avatar Nov 17 '17 00:11 eric-radiant