subtract color from Mat
Hello everybody
I'm new in OpenCV and I have a Question:
I have an Image like that: original image and i want to remove the red color and set this color to transparent. The result should look like this: image without red
till now, I have following code:
JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial2_Tutorial2Activity_RemovePink(JNIEnv*, jobject, jlong addrRgba);
JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial2_Tutorial2Activity_RemovePink(JNIEnv*, jobject, jlong addrRgba){
Mat& mRgb = *(Mat*)addrRgba;
Mat redOnly;
Scalar min_color = CV_RGB(0,0,0);
Scalar max_color = CV_RGB(0,0,255);
inRange(mRgb, min_color, max_color, redOnly);
}
which should give my a mat like that: redOnly correct? Now I want to substract the redOnly from the original image. how can I do that? Thanks for every kind of help!