Ask Your Question

Is there an easy way to get indices of zeros (value is zero)?

asked 2017-03-28 01:55:52 -0500

ririgo gravatar image

Hi, I'm using findEssentialMat method and trying to use the "mask" it gives. I know that there is a way to get non-zero elements' indices, but how can I get indices of elements that have zero as their values?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-03-28 02:58:19 -0500

LBerger gravatar image

mask values are 0 or 1. So you can substract 1 to mask

Mat idx;
mask = 1_mask;
findNonZero     (   mask,idx);
edit flag offensive delete link more



Thank you very much

ririgo gravatar imageririgo ( 2017-03-28 03:32:12 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-03-28 01:55:52 -0500

Seen: 977 times

Last updated: Mar 28 '17