سؤال

If I know the median of an array, say the median is d, how can i remove all the values that are not greater than or equal to that value? I know you could binarize the image to a certain threshold but I want to still have a gradient so that I can see which pixels are more active than others. Thanks

هل كانت مفيدة؟

المحلول

Indexing with a boolean mask is good at this:

d = median(img);
img(img < d) = 0;
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top