ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Showing image with 2 channels

asked 2015-04-30 15:13:28 -0600

RosFan19 gravatar image

Hi,

I'm using goodFeaturesToTrack() method to locate corners from an image. However when I try to view the image, using imshow(), I get an error:

OpenCV Error: Bad number of channels (Source image must have 1, 3 or 4 channels) in cvConvertImage

Here is the code:

Mat outPutImage;
goodFeaturesToTrack(src_gray, outPutImage, 20, 0.5, 500);
imshow("Output", outPutImage);

goodFeaturesToTrack takes in only a 1 channel image and outputs a 2 channel image. How can I convert the 2 channel to 3 channel or is there an alternative for imshow?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-04-30 19:27:56 -0600

For questions about OpenCV, please use answers.opencv.org.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-04-30 15:13:28 -0600

Seen: 780 times

Last updated: Apr 30 '15