How to classify these images as straight, left oriented, right oriented. Which method i can apply.? Couldn't find any methods after a lot of searching. can you help me.

Straight.png Left.png Right.png

4 commentaires

regionprops major and minor axis.
Can you explain in detail.
because i did something like this
I=imread('Straight.png');
s = regionprops(I,'MajorAxisLength');
s1 = regionprops(I,'MinorAxisLength');
i got a struct filed of 254*1 with values like
678.765981381250
706.407098735068
703.153770617981
722.642146437117
740.511840568930
744.442157744512
735.295116722087
724.275218610098
696.656066028366
667.212628375112
649.003146337243
627.582441148267
639.423215799620
606.877630359992
623.114349389287 and so on...
When i give these images as test images, it should tell me whethere it is straight or left or right oriented.? How i can do this with the above values. I am new in this, suggest me, i will do it.
Threshold to black and white. imfill() the holes. Then do the regionprops.
Now its 22*1 struct field with highest value at the 1st position.
MajorAxisLength = 446.005497994246
MinorAxisLength = 277.216494649624.
How can i further move on sir?
Also if we need to present according to degree orientation shown below. how to proceed. Any idea.?
180 degree <---- ------> 90 degree
|
0 degree

Connectez-vous pour commenter.

 Réponse acceptée

What I'd do is to extract the lower portion of the image. Then compute the location of the weighted centroid. If it's way off to the left, it's let facing. If it's to the right of the mid line, it's right facing. If it's reasonally close to the middle, it's symmetrical. Untested code
lowerRow = round(size(grayImage, 1) * 0.75);
subImage = grayImage(lowerRow:end, :)
mask = true(size(subImage));
props = regionprops(mask, subImage, 'WeightedCentroid');
xCentroid = props.WeightedCentroid(1); % Get x centroid.
columns = size(subImage, 2));
if xCentroid < 0.4 * columns
% Facing left
elseif xCentroid > 0.6 * columns
% Facing right
else
% Symmetrical so facing forward.
end
You might have to check the 04 and .6 with actual images to see where the centroid actually lies for a good sampling of real world images.

7 commentaires

I tried for about 10 left oriented images, its centroid values are - 168.77, 234.91, 268.32, 236.81, 228.93, 200.56, 250.53, 270.166, 183.49, 208.73.
So i changed 0.4 to 0.55. it worked fine for all cases.
But,
10 right oriented images, its centroid values are - 291.53, 324.90, 170.85 (482), 269.48 (509), 283.73, 258.83, 300.19, 114.19 (412) , 301.86, 269.05.
Columns are all 512 except for 3 images. change in columns are specified in brackets along with centroid values.
2 sample cases with centroid values 170.85 and 114.19 are having lesser value. So they are missed in classification.
How can i further move on sir?
Also if we need to present according to degree orientation shown below. how to proceed. Any idea.?
180 degree <---- ------> 90 degree
|
0 degree
For the frontal view, you might be able to use the Orientation from regionprops.
Not sure how you determine orientation for the side views. From the angle of the spine at the neck? Is so, that's difficult and I'll leave that time consuming task to you. Good luck. Actually I don't even know why it matters. Why do you care about that? Who cares how the patient was angles when they stepped up to, or laid down on, the x-ray instrument? You should be able to do your analysis regardless of the angle.
Can you upload the images that work and the ones that don't work in a .zip file?
after a proper classification of images i wanted to display the image view. After this step i have to do one more task sir. so this is the main step towards displaying the view of the image.
Here i have attached a zip file containing those two images with centroid values 170.85 and 114.19.
The images are not like the rest. These have significant brightness down low due to the shoulders. You will have to detect that and eliminate the shoulders first.
ok sir. Thanks for the notice. will try on it.
And what happened when you tried it? Did it work?
It works but 0.6 and 0.4 has to be varied accordingly for each images.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Medical Physics dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by