# Calculation of centroide of an object in image

조회 수: 11 (최근 30일)
Beatriz 2024년 5월 11일
답변: Image Analyst 2024년 5월 11일
Hello everyone
i am currently working on a school project of medical image. I have an x-ray image of a head in lateral position with a brain tumor. i have to calculate the centroide of this tumor. the tumor has an higher contrast however so does other objects in the image. how can i do it?
i don't have much experience with matlab so i am a bit in a struggle
##### 댓글 수: 4이전 댓글 2개 표시이전 댓글 2개 숨기기
DGM 2024년 5월 11일
편집: DGM 2024년 5월 11일
What exactly do you mean when you say "higher contrast"? I'm no radiologist, but from the handful of images I've played with, I wouldn't think local contrast (i.e. a measure of variation) would abnormally high in tumor regions. A lot of the tumor images I've seen have very low contrast in tumor regions.
Maybe when you say "higher contrast" you mean the brighter regions? (Maybe that's a difference between radiology terms and more general image processing terminology). It might still be ambiguous, as there are also other bright regions, but we need to know which bridge we're even trying to cross.
Also, does the process need to be automated, and if so, to what degree?
DGM 2024년 5월 11일
I'm going to throw this out there based on the assumption I mentioned. This is not entirely automated, but the interactive part means I can't run it on the forum.
inpict = im2gray(inpict); % grayscale
% manually create a crude polygon selection loosely around the tumor
% it only needs to include the tumor and exclude non-tumor bright regions
imshow(inpict);
ROI = drawpolygon(gca);
% threshold the entire image
% based on the intensity distribution in the ROI
% refine the mask by excluding blobs outside the roi
% select the largest blob in the mask
% should the holes in the blob be left open or not?
% i'm going to fill them.
% get the centroid (or other properties)
% plot the calculated centroid on the original image
figure
imshow(inpict); hold on
plot(S.Centroid(1),S.Centroid(2),'gx','markersize',20,'linewidth',3)
Otherwise, trying to find any tumor in any image without the constraint provided by the human guidance is not a simple problem.

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

### 답변 (1개)

Image Analyst 2024년 5월 11일
It's a generic, general purpose demo of how to threshold an image to find blobs, and then measure things about the blobs, and extract certain blobs based on their areas or diameters.
Also, see my attached demo. Adapt as needed.

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

### 카테고리

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

### Community Treasure Hunt

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

Start Hunting!

Translated by