1 | initial version |
Your if statement assigns the CvScalar value to hsv_min. You should probably run a minmax on thresholded array to find the pixels in range, or better still, perform an AND operation on thresholded and original to get the matching pixels in their original value.
If you want to stay with your current statement, the boolean type error is from the comma in there. Finally, notice the semicolon at the end of the if statement. You really need to be careful with your semantics.
2 | No.2 Revision |
Your if statement assigns the CvScalar value to hsv_min. hsv_min (and hsv_max). You should probably run a minmax on thresholded array to find the pixels in range, or better still, perform an AND operation on thresholded and original to get the matching pixels in their original value.
If you want to stay with your current statement, the boolean type error is from the comma in there. Finally, notice the semicolon at the end of the if statement. You really need to be careful with your semantics.