How to 'walk' a mask/ROI over an image?

조회 수: 1 (최근 30일)
Kevin Semmelink
Kevin Semmelink 2017년 6월 27일
댓글: Kevin Semmelink 2017년 6월 29일
Hi,
At the moment, I am working at a script to determine the homogeneity of an image. For this, I want to 'move' an rectangular ROI (for example, 0.5cm x 0.5cm) over the image in steps of half ROI. I would like to determine for example, the mean pixel value for each ROI-selection.
So far, I can not really find a useful feature or script for this. I was wondering how this can be done the best and fastest?
Thanks in advance for the reply.
  댓글 수: 1
Adam
Adam 2017년 6월 27일
doc nlfilter
should be able to do this, although it does come with an embedded progress bar which is not always desirable.

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

채택된 답변

Walter Roberson
Walter Roberson 2017년 6월 27일
편집: Walter Roberson 2017년 6월 27일
blockproc(), and make sure you specify BorderSize. Be careful with TrimBorder when you use overlaps.
  댓글 수: 9
Walter Roberson
Walter Roberson 2017년 6월 29일
You could abbreviate that last line:
merged_fin = merged(1:end-1, 1:end-1);
Kevin Semmelink
Kevin Semmelink 2017년 6월 29일
You're completely right!

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

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by