verify which one is the correct one to calculate

1 回表示 (過去 30 日間)
bay rem
bay rem 2016 年 2 月 3 日
コメント済み: Walter Roberson 2016 年 2 月 3 日
i tried both of those instruction to calculate variance of each blob in one image, both leads to different results, i dont know wich one is the correct one can you please help me
for i=1: numofblobs
croppedImage = frameRGB(bbox(i, 2):bbox(i, 2)+bbox(i, 4)-1, bbox(i, 1):bbox(i, 1)+bbox(i, 3)-1, :);
blobVariance(i) = var(double(croppedImage(:)));
end
OR
for i=1: numofblobs
blobVariance(i) = var(double(bbox(i,:)))
end
where
bbox = step(blobAnalysis, binaryimage);

採用された回答

Walter Roberson
Walter Roberson 2016 年 2 月 3 日
We would need to see the configuration of your blobanalysis to be sure, but the second code appears to be finding the variance in the coordinates of bounding boxes but the first one appears to be looking at the variance in the content of the images inside the bounding boxes
  2 件のコメント
bay rem
bay rem 2016 年 2 月 3 日
編集済み: bay rem 2016 年 2 月 3 日
thank you Here there is the configuration of blobAnalysis
blobAnalysis = vision.BlobAnalysis('BoundingBoxOutputPort', true, ...
'AreaOutputPort', false, 'CentroidOutputPort', false, ...
'MinimumBlobArea', 1700,'MaximumCount',2);
i really need help :(
Walter Roberson
Walter Roberson 2016 年 2 月 3 日
Your second code would only find the variance in the coordinates, not in the content. You want the first code.

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by