I used regionprops to find euler number and area. How do i get area of euler number 0

조회 수: 1 (최근 30일)
clc
clear all
close all
I = imread('GGGG.tif');
originalImage=rgb2gray(I);
labeledImage = bwlabel(originalImage);
blobMeasurements = regionprops(labeledImage, originalImage, 'EulerNumber','Area');
numberOfBlobs = size(blobMeasurements, 1);
I used regionprops to get euler number and area of a picture. What is the code to get the area of euler number 0 and store it in another variable
  댓글 수: 2
Image Analyst
Image Analyst 2015년 5월 4일
What do you mean the area of euler number 0? That doesn't make any sense. A blob (which are numbered starting at 1) can have an area and an Euler number. The Euler number is what it is - you don't code up anything to make the blob have an Euler number of 0. And an Euler number is just a number so it does not have an area - why do you think it has an area? It would be like saying you want the weight of your temperature, or the temperature of your name - it just doesn't make any sense.
Chok Chuan
Chok Chuan 2015년 5월 6일
What I meant what to find the area of the object with euler number 0 :D

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

채택된 답변

Walter Roberson
Walter Roberson 2015년 5월 4일
enumbers = [blobMeasurements.EulerNumber];
want_blob = enumbers == 0;
wanted_blobs = blobMeasurements[want_blob];
wanted_areas = [wanted_blobs.Area];
is one of the ways.
  댓글 수: 1
Chok Chuan
Chok Chuan 2015년 5월 6일
Hi for example I have 9 balls how do I implement this code in a for loop? I can't seem to get it right

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Number Theory에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by