For the following expressions in Matlab, what is the OpenCV equivalent?
A(2,:)=3;
From what I know, I can do it in OpenCV as follows:
Mat Arepeated;
repeat(value, 1, A.cols, Arepeated);
Arepeated.copyTo(A.row(1));
Here value is a 1x1 Mat with value 3. Is there a more efficient way than what I wrote above?
This post suggested about std::fill but the examples show its usage only for a vector object. I'm not sure if it can be applied for Mat objects as well, or is there any other function. Can someone guide please on this?
How about:
A.row(1).setTo(Scalar(value));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With