ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Showing image with 2 channels

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

RosFan19 gravatar image


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

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

For questions about OpenCV, please use

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


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

Seen: 725 times

Last updated: Apr 30 '15