Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Multiplying Intensity Image Subtraction

So I am creating an intensity image as follows:

void convertToGrayImg(Mat& img, Mat& result) {
  Mat gray_img;
  cvtColor(img, gray_img, CV_BGR2GRAY);
  result = gray_img;
}

Now I have to multiply the intensity image I by 0.5 and subtract it from each color channel. How can this be done?

I am confused, do I multiply every pixel with 0.5 or is there a function to do the same?

Thanks.

Multiplying Intensity Image Subtraction

So I am creating an intensity image as follows:

void convertToGrayImg(Mat& img, Mat& result) {
  Mat gray_img;
  cvtColor(img, gray_img, CV_BGR2GRAY);
  result = gray_img;
}

Now I have to multiply the intensity image I by 0.5 and subtract it from each color channel. How can this be done?

I am confused, do I multiply every pixel with 0.5 or is there a function to do the same?same? I am very new to OpenCV.

Thanks.