Ask Your Question
0

Find the the minimum value from the depth data

asked 2017-08-04 05:02:18 -0600

vps gravatar image

Dear All, I want to find the minimum value and its position from the depth data. As Depth image contain some 0 values. I have to ignore 0 values and search the minimum value. Can you please suggest the way?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2017-08-04 05:11:07 -0600

LBerger gravatar image

Use mask in minMaxLoc :

Mat mask=depth>0;
minMaxLoc( depth,&minX,&maxX,&pMin,&pMax,mask);
edit flag offensive delete link more

Comments

1

@LBerger ..Awesome. thank you for your answer. Actually, I have used this function but didn't know about mask parameters.

vps gravatar imagevps ( 2017-08-04 06:16:26 -0600 )edit

@LBerger .now, I am using the original depth data (16UC1). So, I cannot use the minMaxLoc function because values are in the short format. It will be great , if you suggest any way. thanks.

vps gravatar imagevps ( 2017-09-13 02:36:11 -0600 )edit

minMaxLox doesn't work with type 16UC1 ?

LBerger gravatar imageLBerger ( 2017-09-13 07:14:57 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-08-04 05:02:18 -0600

Seen: 208 times

Last updated: Aug 04 '17