Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

@thdrksdfthmn How come getting different outputs from same code and input is normal? If it is a channel issue, then it should always give the same ridiculous output.

@thdrksdfthmn How come getting different outputs from same code and input is normal? If it is a channel issue, then it should always give the same ridiculous output.

@berak I added maskedImage.zeros(frame.rows, frame.cols, CV_8UC3); before copyTo() however it did not solve the problem.

@thdrksdfthmn How come getting different outputs from same code and input is normal? If it is a channel issue, then it should always give the same ridiculous output.output. Besides, I put that if check and it passed there. So it does have 3 channels.

@berak I added maskedImage.zeros(frame.rows, frame.cols, CV_8UC3); before copyTo() however it did not solve the problem.

@thdrksdfthmn How come getting different outputs from same code and input is normal? If it is a channel issue, then it should always give the same ridiculous output. Besides, I put that if check and it passed there. So it does have 3 channels.

@berak You were right. I added maskedImage.zeros(frame.rows, frame.cols, CV_8UC3); populated the matrix with zeros before feeding into the copyTo() however function, and it did not solve the problem.worked. No ridiculous output anymore. Thanks.

Mat maskedImage = Mat::zeros(frame.rows, frame.cols, CV_8UC3);
frame.copyTo(maskedImage, mask);