Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

Convert all elements of a certain value in a Mat to another value

$
0
0
I am converting some matlab code to java using OpenCV 3.1 I am converting a matrix made up of 0 and 1 elements to a matrix of -1 and 1 elements by converting all elements of value 0 to value -1 Here is the line of code that does this in matlab: - keySequence(keySequence(:,:)==0)=-1; Is there any OpenCV functions could accomplish this? I am not really sure how to iterate over every element. Any help would be very appreciated, thank you!

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>