Determine lowest part in sub regions of image and segment the image

I want to segment object into head, torso and leg region.
There is a binary image and I want to:
- Calculate the sum of white pixels along each row
- Based on my knowledge from papers, head is located into 30% region of the image, torso 70%, and leg is the rest.
So I want to compare the sum of pixel in each row of each of the three regions, get the lowest pixel sum and its corresponding row in the image and then segment the image into the three parts.

답변 (1개)

Image Analyst
Image Analyst 2013년 6월 22일
First threshold the image to get a binary image of the silhouette, or use some other method that basically gives you the silhouette. Then get the vertical profile by summing horizontally:
verticalSum = sum(binaryImage, 2);
Then examine that with your algorithm to identify valleys in the profile that determine where the dividing lines from head-to-torso and torso-to-legs are.

댓글 수: 4

Dear image analyst, I have been able to use the line you provided and I have decided to go with the analysis I found in the paper that Head, torso and leg are 30%, 70% and rest of the image respectively but I have a problem with the leg region of this segmentation. it is not starting from the end of the torso region, rather from somewhere in the middle of the torso.
im=bww;
whole_image = size(bww,1); % size of the orignal bw image
head = bww(1:(0.3*(whole_image)),:,:); % head region as 30% of the image
torso = bww(size(head,1):(0.7*(size(bww))),:,:); % torso as 70% of the image
leg = bww(size(torso,1):end,:,:); % the rest is the leg region
subplot (331), imshow(head);
subplot (332), imshow(torso);
subplot (333), imshow(leg);
Please kindly assist me. Thanks
Please post your image so I can experiment. But I may not answer right away since I'm leaving for Europe in 45 minutes and may not have internet access until tomorrow night.
Dear Image Analyst, you can please try the code on an upright human image to see the problem I have in the code.
I currently dont possess the right to display the images I have for now.
Then I have nothing to try your code on.

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

카테고리

도움말 센터File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

질문:

2013년 6월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by