Ask Your Question
0

Showing image with 2 channels

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

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 -0500

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

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

Stats

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

Seen: 511 times

Last updated: Apr 30 '15