필터 지우기
필터 지우기

Extracting sum of intensity values at various locations with various diameters

조회 수: 1 (최근 30일)
Hello. I have an image (grayscale) of spots, that have a spread of intensities and sizes.
I have the centroid location of each spot and an "size" of each spot obtained by my own encircled energy calculation for both x&y directions.
data =
8.35 8.14 43.00 2266.00
10.76 8.24 43.00 2362.00
8.96 11.07 43.00 2459.00
8.55 7.98 43.00 2555.00
where
col 1 is the size of my object in y
col 2 is the size in x
col 3 is the x centroid location
col 4 is the y centroid location
What I am trying to achieve is at each x,y centroid location, draw a circle with a diameter given by the average of the size in x & size in y, and then caluclate the integrated intensity in the circle. The circles (representing the size) may be different for each spot.
As a second request, I would also like to then consider a distance d, say 15 pixels from the x,y centroid location and obtain the background values from a square or circle that I can call background to then subtract from the integrated signal requested above to get the background subtracted integrated signal.
Thanks for any help Jason

채택된 답변

Image Analyst
Image Analyst 2017년 12월 13일
See the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_create_a_circle.3F to create a circle mask at each centroid.
You can locate the centroids by using thresholding and regionprops()
binaryImage = grayImage > someThreshold;
props = regionprops(binaryImage, grayImage, 'Centroid', 'BoundingBox', 'MeanIntensity', 'Area');
centroids = [props.Centroid];
xCentroids = centroids(1:2:end);
yCentroids = centroids(2:2:end);
allAreas = [props.Area];
allMeanIntensities = [props.MeanIntensity];
integratedGrayValue = allAreas .* allMeanIntensities
See my Image Segmentation Tutorial for a full demo.
Place a circle at each centroid using the FAQ to create a binary image, then use the code above.
To get the overall background intensity you can use the thresholded image
binaryImage = grayImage > someThreshold.
meanBackgroundIntensity = mean(grayImage(~binaryImage));
If you want a background intensity closer to each spot, then it's more complicated - you'll have to make a binary image mask that is a ring shape around each spot.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by