Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
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
您可以使用以下copyTo功能:
copyTo
B.copyTo(A, mask)