Ask Your Question

Jony01's profile - activity

2020-07-01 09:47:21 -0600 received badge  Famous Question (source)
2020-07-01 09:17:55 -0600 asked a question cv::dilate Is it wanted behavior?

cv::dilate Is it wanted behavior? I create a short example of(in my opinion) bad behavior of dilate cv::Mat input(cv::S

2020-03-18 03:22:04 -0600 commented answer fit a circle to a cloud of points

Maximal distance is not a diameter !!!

2020-03-17 11:41:30 -0600 commented question fit a circle to a cloud of points

RANSAC could be the solution. Each triplet of points(random selected 3 points from cloud). Made a prediction of the circ

2019-03-14 07:59:28 -0600 received badge  Notable Question (source)
2018-06-19 15:31:54 -0600 received badge  Popular Question (source)
2018-05-17 01:52:07 -0600 received badge  Enthusiast
2017-04-10 06:57:20 -0600 received badge  Editor (source)
2015-07-14 02:58:59 -0600 asked a question How to Multiply cv::Mat with mask

I'd like multiply two arrays(cv::Mat) with mask for speed up application.

In add and subtraction exists

mask - optional operation mask - 8-bit single channel array, that specifies elements of the output array to be changed

Provide OpenCV similar functionality for multiplication and divide?

I can solve it for full image and then copy data to output. But this is slow down.

cv::Mat input1(size, CV_8U|CV_16S|CV_32F);
cv::Mat input2(size, CV_8U|CV_16S|CV_32F); // or cv::Scalar
cv::Mat mask(size, CV_8U);
cv::Mat output(size, CV_8U|CV_16S|CV_32F); 

// per pixel multiplication input1 and input2 
cv::multiply(input1, input2, output);
//cv::multiply(input1, input2, output, mask);

way around for same result:

cv::Mat multiplyFull;
cv::multiply(input1, input2, multiplyFull);

// clear data in output
output.setTo(cv::Scalar::all(0), mask);

// set in output only multiplication given by mask
cv::add(output, multiplyFull, output, mask);