Any suggestions to calculate the threshold of pixel intensity between two regions(the dip represents low intensity)

3 views (last 30 days)
%this code calculates the center of mass/gavity bewteen the pharyngeal wall and tongue root
imshow(matrix(:,:,1))
[x ,y]= ginput(2);
I = matrix(:,:,1);
for i=1:size(matrix,3)
I=matrix(:,:,i);
test = improfile(I(:,:,1), [x(1) x(2)] , [y(1) y(2)]);
end
plot(test);

Answers (1)

William Rose
William Rose on 29 Sep 2022
I need more information to understand and help. I see that your code gets two points (x1,y1 and x2,y2) on image 1 in a set of images. The points are specified by the user. The the script generates an intensity profile along a line from x1,y1 to x2,y2, in all the images in the set. The comment says that the code computes the center of gravity between pharygeal wall and tongue root. However, this is not true - it does not compute a center of mass.
You asked "any suggestion to calculate the threshold of pixel intensity between two regions(the dip represents low intensity)". You can use the min(test) to find the minimum intensuity between the two points. But this is not a threshold. Please epxlain what you are trying to do in more detail and supply a set of test images.

Community Treasure Hunt

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

Start Hunting!