2

I want to set certain pixels in a Mat to be equal to those in another Mat, according to a mask.
similar to this matlab code:

A(mask==1) = B(mask==1)  

How do I do it in OpenCV?

comment- using OpenCV 2.4.3

4

1 回答 1

6

您可以使用以下copyTo功能:

B.copyTo(A, mask)
于 2013-07-24T12:30:03.880 回答