How to plot an intensity profile within given pix depth?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi guys,
Would someone please help me to do the following thing: I have an image of a roughly elliptical object. I know the outline coordinates of it. I would like to:
- Plot as a heat-map only pixels of this object that are 10 pixels or so from the object outline inward.
- Average the intensities of these 10 pixels at every position and plot this as a heat-map.
- Plot #2 on a perimeter of a circle starting from the default position.
The idea is to make an intensity profile within the given depth from the object outline (#1 and #2) and to find the angular distribution of intensities; on X axis angle, on Y axis pix intensities.
Thanks in advance, jakub
댓글 수: 0
채택된 답변
Image Analyst
2013년 7월 15일
You can the the pixels 10 out from your boundary by getting a binary image from your coordinates first using poly2mask. Then use imdilate to grow that blob out by 10 pixels. Then use bwperim() to get the new boundary locations' pixel values (Untested)
binaryImage = poly2mask(x, y, rows, columns);
SE = strel('disk', R, N)
biggerBlob = imdilate(binaryImage, SE);
perimPixels = bwperim(biggerBlob)
meanGL = mean(grayImage(perimPixels));
댓글 수: 5
Image Analyst
2013년 7월 16일
To move inward you use imerode(). To move outward use imdilate(). Then use bwperim to get a mask of the outer layer of pixels and logical indexing like I showed you to get the mean value along that outer layer of pixels.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Red에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!