Filter löschen
Filter löschen

how to calculate the area of an object?

3 Ansichten (letzte 30 Tage)
marwa za
marwa za am 19 Mai 2019
Kommentiert: marwa za am 22 Mai 2019
I have a set of images: 5 images, I calculated the suface of these images and then I saved them in a matrix and I have another set of images that contains 5 images, I calucled in another scipt their areas and I saved them in a matrix.
here are the surface values of each group of images :
but the problem when I calul the area of 2 groups of images in a single script, the values will be unorganized, here is:
that is, I want the values of the images to remain like this:
  107, 410, 281, 200, 266, 20, 25, 13, 23, 16
  10 Kommentare
Rik
Rik am 21 Mai 2019
You have a list of 10 files. What are their exact names and in what order do you want to have their results in the output array?
marwa za
marwa za am 21 Mai 2019
Their names are P1, P2, P3 ... P10 and I want the values of their area remain in the following order: 107, 410, 281, 200, 266, 20, 25, 13, 23, 16

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Image Analyst
Image Analyst am 20 Mai 2019
You shouldn't calculate areas based on the grayscale image. You must segment it first into foreground and background areas and pass in the binary image to regionprops(). See my Image Segmentation Tutorial: in my File Exchange
  5 Kommentare
Image Analyst
Image Analyst am 21 Mai 2019
Save each areas matrix to a mat file, then read in all the mat files and stitch them together
s1 = load(filename1);
areas1 = s1.areas
s2 = load(filename1);
areas2 = s2.areas
allAreas = [areas1, areas2]
marwa za
marwa za am 22 Mai 2019
ok thanks

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Geometric Transformation and Image Registration finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by