How to improve accuracy of image 'area' detection?

10 Ansichten (letzte 30 Tage)
A Kite
A Kite am 17 Mär. 2019
Beantwortet: Image Analyst am 18 Mai 2021
I've been following a very helpful tutorial by someone on here known as 'Image Analyst'. He's recently been active on the forum so I'm really hoping he stumbles across this and if so hi!
I'm trying to write a code that can accurately predict area of an irregular shape from a PNG image. The code works currently but when tested on known areas is generally out by about a cm^2. Is there any way to improve accuracy of this function?
I'm following the typical process from what I can tell of creating a binary image, defining the boundaries etc and using
blobArea = blobMeasurements(k).Area;
to pull area.
At a point of defining the 'blobs' from the image we set a threshold which I think is to do with intensity and we set to 100. Would altering this number help?
  1 Kommentar
Ahmed Sewify
Ahmed Sewify am 18 Mai 2021
Have you figued out how to tune the optimizer and metric yet? I'd also like to know.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Image Analyst
Image Analyst am 18 Mai 2021
There are several ways of defining area.
  1. One uses a pixel count, like regionprops().
  2. Another, bwarea() uses a weighted pixel summation based on the shape of the boundary.
Of course each depends on you having segmented the image accurately to begin with. Of course changing the threshold on a gray level image will change the number of pixels that get selected in the binary (segmented) image. You can try different thresholds to see which gives you the accurate area, and then use that.

Community Treasure Hunt

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

Start Hunting!

Translated by