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.
我想将此 Matlab 代码翻译成 OpenCV:
img(mask == label) = val;
我以一种肮脏的方式做到了(只需访问掩码中的每个像素并分配值)。有什么快速又简洁的方法吗?
尝试:
img.setTo(val, mask==label);