Ask Your Question

ntb-werz's profile - activity

2020-10-22 03:11:02 -0600 received badge  Popular Question (source)
2017-02-09 02:41:51 -0600 received badge  Famous Question (source)
2016-02-11 13:32:35 -0600 received badge  Notable Question (source)
2015-10-20 08:52:31 -0600 received badge  Student (source)
2015-10-04 16:40:24 -0600 received badge  Popular Question (source)
2014-04-17 09:02:22 -0600 asked a question why is merge not working

Hello together

I wonder why merge isn't working on OpenCV-2.4.8 with android-ndk-r9d-windows-x86_64 picture 1

could it be that something with my includes is wrong? but split is working...?

ErrorCode:

Invalid arguments ' Candidates are: #2 merge(#0, #0, #1, #1, #2, #3) #2 merge(#0, #0, #1, #1, #2) void 
merge(const cv::_InputArray &, const cv::_OutputArray &) void merge(const 
std::vector<cv::Mat,std::allocator<cv::Mat>> &, const cv::_OutputArray &) void merge(const cv::Mat *, ?, const 
cv::_OutputArray &) '

Any suggestions? Thanks in advance!

2014-04-14 05:13:06 -0600 asked a question set color transparent in the android camera preview

Hello everybody

My target is to make an android application with openCV, that has a camera preview. In this preview i want to filter out a color range and set it transparent.

In the background of my application, (behind the camerapreview) is a static picture that should come through the transparent part of the camera preview.

For example, I want to filter out green and set it to transparent.

image from <a href=http://kotao-production.com">

Question 1: is it possible to make parts of the CvCameraViewFrame transparent?

Question 2: with respect to these answers: sustract color from Mat why is following code not working?

android activity:

    public Mat onCameraFrame(CvCameraViewFrame inputFrame){
        mRgba = inputFrame.rgba();
        RemovePink(mRgba.getNativeObjAddr());       
        return mRgba;
    }
   public native void RemovePink( long matAddrRgba);

and the jni:

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& mRgba = *(Mat*)addrRgba;
Mat alpha;   
inRange(mRgba , Scalar(0,0,250),  Scalar(0,0,255),alpha);    
bitwise_not(alpha,alpha);

//split source  
Mat bgr[4];   
split(mRgba ,bgr);   

//Merge to final image including alpha   
Mat tmp[4] = { bgr[0],bgr[1],bgr[2],alpha};   
merge(mRgba ,4,dst);   
}
}

thanks in advance for every kind of help!

2014-04-14 04:00:55 -0600 received badge  Scholar (source)
2014-04-11 07:06:48 -0600 commented answer subtract color from Mat

thank you really much for your help, I try to implement your solution. thank you

2014-04-11 07:06:36 -0600 commented answer subtract color from Mat

thank you really much for your help, I try to implement your solution. thank you

2014-04-11 07:02:24 -0600 received badge  Supporter (source)
2014-04-11 04:20:44 -0600 received badge  Editor (source)
2014-04-11 04:18:42 -0600 asked a question subtract color from Mat

Hello everybody

I'm new in OpenCV and I have a Question:

I have an Image like that: original image 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 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 redOnly correct? Now I want to substract the redOnly from the original image. how can I do that? Thanks for every kind of help!