Image Processing ( calculate perimeter)

How do I now calculate the perimter of this hand . I've got the left image using bmarea and the one on the right is when imclose is used
How do I now find the perimeter as shown on the left? I've got the outline what should i do now ?
thank u

Respuestas (2)

Teja Muppirala
Teja Muppirala el 10 de Abr. de 2011
Use the REGIONPROPS function.
I = peaks(500) > 3;
imshow(I);
P = regionprops(I,'perimeter');
P.Perimeter

7 comentarios

Prashan
Prashan el 11 de Abr. de 2011
Movida: DGM el 29 de Dic. de 2023
when i ran the function you provided i get the following ouput .how do i give a variable i hve declared so i can find the peak values of that particular image . my imge is in a variable known as BWAREA now i need the peak values as you suggested above of this image. when iran your code i recieved the following output http://www.flickr.com/photos/60171113@N05/5608749401/
Teja Muppirala
Teja Muppirala el 11 de Abr. de 2011
Movida: DGM el 29 de Dic. de 2023
Sorry.
"peaks" has absolutely nothing to do with finding peaks in an image. "peaks" is just a test function that I (unfortunately) used to make a test image.
What I meant was, use:
regionprops( ??? ,'perimeter')
where ??? is whatever the variable name of your image is.
Prashan
Prashan el 11 de Abr. de 2011
Movida: DGM el 29 de Dic. de 2023
when i run that i got the following as an output which i dnt think i s appropriate Perimeter: 1.3613e+004
Sean de Wolski
Sean de Wolski el 11 de Abr. de 2011
Movida: DGM el 29 de Dic. de 2023
Why don't you think that's the perimeter? The perimeter of a square with 100 pixels if 400? Do you really think that a highly non-convex shape would make this perimeter a lot higher?
Prashan
Prashan el 11 de Abr. de 2011
Movida: DGM el 29 de Dic. de 2023
understood still confused about the e in the middle of the number what does that represent . i thought like in a normal calculator that e meant error ! .
Sean de Wolski
Sean de Wolski el 11 de Abr. de 2011
Movida: DGM el 29 de Dic. de 2023
e means *10^...
in this case 13613.
Prashan
Prashan el 13 de Abr. de 2011
Movida: DGM el 29 de Dic. de 2023
recieving this message when i run regionprops again since i tried to get the perimeter of another hand image how is this possible?
cprops =
6x1 struct array with fields:
Perimeter

Iniciar sesión para comentar.

Sean de Wolski
Sean de Wolski el 13 de Abr. de 2011

0 votos

cprops(:).Perimeter
Will list off the six perimeters (one for each of the six binary objects)

1 comentario

Prashan
Prashan el 16 de Abr. de 2011
thanks for this it worked.
now after all the steps i finally managed to get the images perimters calculated . however since im new to matlab i want to know how i could compile this into a program as code so i could scan an imge and run the code from a user interface without havig to declare variables and calculations all over again . the issue basically s that i wish to scan two palms simultaneously and calculate their perimters accordingly from the program how could i do this .

Iniciar sesión para comentar.

Categorías

Preguntada:

el 9 de Abr. de 2011

Movida:

DGM
el 29 de Dic. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by