5
$\begingroup$

I have a binary image with non-point objects.

Does anyone have any suggestions how to determine area of each Voronoi cell in Voronoi diagram (the goal is area distribution)?

Sample image

$\endgroup$
3
  • $\begingroup$ Are you asking how to calculate a Voronoi diagram for non-point objects? $\endgroup$ Oct 8, 2014 at 12:16
  • 2
    $\begingroup$ Related: (20696) $\endgroup$
    – C. E.
    Oct 8, 2014 at 12:17
  • $\begingroup$ They started and finished with images. I found difficult for me to derive numerical areas. $\endgroup$
    – Yuriy
    Oct 8, 2014 at 12:21

1 Answer 1

13
$\begingroup$

There is a one-liner (if you have wide enough screen)

Histogram@ComponentMeasurements[#, "Area"][[;; , 2]] &@
   WatershedComponents@DistanceTransform@Import@"http://i.stack.imgur.com/k0EUJ.png"

enter image description here

$\endgroup$
2
  • 4
    $\begingroup$ Now, that's terseness :D $\endgroup$ Oct 8, 2014 at 12:45
  • $\begingroup$ It's a One Line Mathematica Lesson®. $\endgroup$ Oct 8, 2014 at 15:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.