aspect ratio

can any one give me code to find the aspect ratio of human or any genral code to find aspect ratio.....
plzz relpy soon

 Accepted Answer

Jan
Jan on 3 Apr 2011
Another "plzz reply soon" question. If you are in a hurry spending the time to insert any details in your question would be a good idea.
Height = 180 % in cm
Width = 50 % in cm
AspectRatio = Height / Width
This is an aspect ratio of a human. I do not think, that this helps a lot, but it is all I can guess reading your question.

9 Comments

shafaq
shafaq on 4 Apr 2011
sir actually the problem i am having is that i want to track human,i identified the object but when i track it ,its not tracking human sum times i started tracking other conecting elemnts as well.for that now i will make a check on that if u find the aspect ratio of human then track it...
is it rite approach???if yes thn tell me the right way plzzzz
Jan
Jan on 4 Apr 2011
@shafaq: Using "plzzz" is contraindicated in this forum. Because your question is definitely not clear enough tobe answered, let me ask for the basic things at first: What does "track human" mean? Do you have videos, pictures, or 3D data? Can you post any example pictures and more details, such that we have at least a chance to understand, what you are tring to achieve.
shafaq
shafaq on 4 Apr 2011
actually i am working on my final year project that is intelligent cam rite,
i have to detect and track motion,ande specifically i have to track the movement of human,
i am takng video from webcam ,for motion detection i am using algorithm mean avreagring,i hv subtrcted background and got the forground in the form of connecting elemnts, the problem i am having is that now i have to track the object but i only hav concting elemnts its not considerng aal the conecting elemnts as one object wen ever i aaaply bounding box to get its cordinates it gives bounding box on all the conecting elemnts not on human,
nw wot i thought its solution is that i will make check on it ,like i will find the aspect ratio of human if it find that aspct ratio then track it....
is it clear to u or still i have to expalin if its nt clear u cn ask me wot eva is the confusion
shafaq
shafaq on 4 Apr 2011
m waitng 4 ur help.........
Jan
Jan on 4 Apr 2011
@shafaq: When I write, that "plzzz" is contraindicated in this forum, I did not meant, that you should send me an email containing further "plzzz". I discuss problems here in the forum only and not by email.
I'm not a native speaker and correct English is hard enough for me already. Abbreviations like "u cn ask me wot eva is the confusion" are horrible to read. Such slang reduces my motivation to spend time for answering.
You have some very general questions and it is impossible to answer them directly. "Find the aspect ratio" does simply not involve the enough usable information. It would be easier if you can split your project into parts and solve one part after the other. If a question can be solved by 5 to 15 lines of code, getting help here is more likely.
shafaq
shafaq on 4 Apr 2011
oh sorry i will not say 'plz' again:)
u just tell me for the time being what should i do after gettng moved object (in form of binary image) to track it
Jan
Jan on 5 Apr 2011
This is still not possible to answer. "In form of a binary image" is not unique or descriptive. Speculating what your input data are would be inefficient.
shafaq
shafaq on 5 Apr 2011
:( should i send u my code
Jan
Jan on 5 Apr 2011
@shafaq: I will not react to sent code - as I have explained above. This is not an email forum! Please insert the code in the original question and most of all an example picture.

Sign in to comment.

More Answers (1)

Walter Roberson
Walter Roberson on 3 Apr 2011

0 votes

Identify the object and label it and regionprops the area; the aspect ratio can be approximated as the ratios of the sides of the bounding box. If the human isn't sitting or lying down or the picture isn't taken at an unusual angle...

7 Comments

Jan
Jan on 4 Apr 2011
If the OP is speaking about an image at all. It could be a 3D voxel data set also.
Walter Roberson
Walter Roberson on 4 Apr 2011
How is aspect ratio defined in 3D?
Jan
Jan on 4 Apr 2011
@Walter: ax = axes; cylinder(ax, 10); get(ax, 'DataAspectRatio'); >> [20, 20, 1]
shafaq
shafaq on 4 Apr 2011
@walter...
wot area has to do with it ?i didnt get properly
i identified objct regionprops the centroid,but y we need area?and i cudnt aply boundingbox on required object???
i mean it applies in al the conecting elemnts in an image wot to do???
Walter Roberson
Walter Roberson on 4 Apr 2011
"area" means "region" in this sense.
shafaq
shafaq on 4 Apr 2011
that i knw but wot it has to do with aspect ratio plz guide me
Walter Roberson
Walter Roberson on 4 Apr 2011
foo = double(get(imagesc(),'CData') > 20);
ans =
Area: 904
Centroid: [42.4977876106195 40.5995575221239]
BoundingBox: [15.5 1.5 48 63]
so the aspect ratio for this area is 48 : 63

Sign in to comment.

Asked:

on 3 Apr 2011

Community Treasure Hunt

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

Start Hunting!