Reputation: 5030
Assume two Mat CV_8UC1
images, mask
, and label
, how to do the following operation in OpenCV (C++):
mask(label==5) = 255; // this is allowed in Matlab
// or
mask[label==5] = 255; // this is allowed in Python
Upvotes: 0
Views: 142
Reputation: 15365
It's literally just...
mask.setTo(255, label == 5);
Second argument is the mask
argument.
Upvotes: 3