Ask Your Question

Sanaullah's profile - activity

2018-07-03 22:24:01 -0500 marked best answer subtract method replace negative values with zeros

I am doing subtraction of grayscale images. i want to keep negative values. but subtract method in opencv replace negative values with zeros. User Mat types are CV_32S, CV_32F.

public double corr2(Mat img1, Mat img2){

        Mat grayImg1,grayImg2;
        grayImg1=new Mat(300,300,CV_32S);
        grayImg2=new Mat(300,300,CV_32S);
        Imgproc.cvtColor(img1,grayImg1,COLOR_RGB2GRAY);
        Imgproc.cvtColor(img2,grayImg2,COLOR_RGB2GRAY);
        Scalar img1mean=Core.mean(grayImg1);
        Scalar img2mean=Core.mean(grayImg2);
        Core.subtract(grayImg1,img1mean,grayImg1);
2018-07-03 22:24:01 -0500 received badge  Scholar (source)
2018-07-03 22:23:49 -0500 commented answer subtract method replace negative values with zeros

thanks. it works

2018-07-03 07:19:44 -0500 asked a question any alternative of corr2 in opencv to measure similarity of two images

any alternative of corr2 in opencv to measure similarity of two images i have used corr2 in matlab. it shows similarity

2018-07-03 07:15:12 -0500 received badge  Editor (source)
2018-07-03 07:15:12 -0500 edited question subtract method replace negative values with zeros

subtract method replace negative values with zeros I am doing subtraction of grayscale images. i want to keep negative v

2018-07-03 06:34:18 -0500 asked a question subtract method replace negative values with zeros

subtract method replace negative values with zeros I am doing subtraction of grayscale images. i want to keep negative v