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

조회 수: 4 (최근 30일)
Tarunkishwor Yumnam
Tarunkishwor Yumnam 2019년 8월 20일
댓글: Tarunkishwor Yumnam 2019년 8월 21일
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
Jan
Jan 2019년 8월 20일
@Tarunkishwor Yumnam: Please do not advertise questions in other threads. Imagine the clutter, if all users do this. Thanks.
Selva Karna
Selva Karna 2019년 8월 20일
Avg=mean2(your image (:));

댓글을 달려면 로그인하십시오.

채택된 답변

KSSV
KSSV 2019년 8월 20일
Let A be your matrix......say you want values below a threshold val.
idx = A<val ;
themean = mean(A(idx)) ;

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by