我想你想要这样的东西:
% let r_centroid be the centroid's row [r,c] = find( img == 1 ); gt_idx = find( r > r_centroid ); r( gt_idx ) % print the answer