1
votes

Using OpenCV 2.4.2 C/C++

I am trying to use the copyTo function to add a binary CV_8UC1 image to a RGB CV_8UC3 image. However, it seems to crash the program whenever I do this. I'm assuming that the difference in the number of channels doesn't allow me to add them. Is there some type of conversion that can allow me to use this copyTo function? I'm stitching a camera feed with its thresholded image side by side.

I'm using src.copyTo(dst(Rect(x,y,w,h))); as the copying code, and inRange(src,Scalar(#,#,#),Scalar(#,#,#),dst) as the thresholding operation.

I've tried to use the convertTo function but not having much luck with it. Can anyone give some advice?

Thanks

1
Could you post the relevant code?Sassa

1 Answers

0
votes

You should use cv::cvtColor function, which can convert from one color space to another. Look here for details.