How to find avergae of thresholded elements only from a matrix?

5 vues (au cours des 30 derniers jours)
Tarunkishwor Yumnam
Tarunkishwor Yumnam le 20 Août 2019
I am trying to calculate average RGB of images with a uniform background. So I want to remove the background from the calculation. How do I select only elements belows above/below certain value (say <250) and calculate average of those only.
  2 commentaires
Jan
Jan le 20 Août 2019
@Tarunkishwor Yumnam: Please do not advertise questions in other threads. Imagine the clutter, if all users do this. Thanks.
Selva Karna
Selva Karna le 20 Août 2019
Avg=mean2(your image (:));

Connectez-vous pour commenter.

Réponse acceptée

KSSV
KSSV le 20 Août 2019
Let A be your matrix......say you want values below a threshold val.
idx = A<val ;
themean = mean(A(idx)) ;

Plus de réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by