Reputation: 845
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?
Upvotes: 4
Views: 4574