8
$\begingroup$

how to find the area of any irregular shapes without dividing it into smaller regular shapes ?

Example Image:

Irregular Shape

$\endgroup$
  • 2
    $\begingroup$ See en.wikipedia.org/wiki/Monte_Carlo_method. $\endgroup$ – Martín-Blas Pérez Pinilla Mar 1 '14 at 16:37
  • 1
    $\begingroup$ If you could express the boundary as a closed curve, then you could calculate the area. $\endgroup$ – Ian Coley Mar 1 '14 at 16:37
  • $\begingroup$ Do you know how to take an integral? $\endgroup$ – recursive recursion Mar 1 '14 at 16:39
  • $\begingroup$ There are machines, I mean real-live analog devices, that perform this task. You trace over the curve, and when you get back to the starting point, the machine indicates the area enclosed. $\endgroup$ – Lubin Mar 1 '14 at 16:39
  • 2
    $\begingroup$ @Lubin The name for this device is a planimeter. $\endgroup$ – Erick Wong Mar 1 '14 at 17:09
7
$\begingroup$

You ask us to avoid breaking the image into smaller shapes, yet your input, a JPEG image, is essentially already just that. Even the suggestion to use integration relies on breaking the object up into infinitessimal parts. So I'm not not going to avoid the obvious.

Of course, we need a scale so here's another copy of your image:

enter image description here

Let's assume that the rectangle bounding this image has area 1. Then it's just a matter of counting the gray pixels and dividing by the total number of pixels. Applying a little Mathematica code to your original image, which has different dimensions from mine, we get

img = Import["http://i.stack.imgur.com/ZriDw.jpg"];
data = MorphologicalComponents[Binarize[img]];
N[Count[Flatten[data], 1]/Times @@ Dimensions[data]]

(* Out: 0.466297 *)
$\endgroup$
  • $\begingroup$ There is a similar method which was used historically (I think by some famous physicists): Print the shape, cut it out, weight it and calculate the area from the density of the paper. $\endgroup$ – Babelfish Jul 25 '18 at 8:19
4
$\begingroup$

Like noted in the comments, if you have a (piece-wise smooth, Jordan curve) parametrization $\gamma = (\gamma_1, \gamma_2) : [0,1]\to \mathbb{R}^2$ of the boundary, the area enclosed by $\gamma$ can be calculated by Green's theorem:

http://en.wikipedia.org/wiki/Green%27s_theorem

For example using $L=0$ and $M(x,y) = x$ we have the formula

$$A= \int_D 1= \int_{0}^1 \gamma_1(t) \gamma_2'(t)dt. $$

$\endgroup$
  • $\begingroup$ Brilliant because it does not partition the surface as a Riemann integral would: +1 $\endgroup$ – gen-z ready to perish Aug 20 '17 at 7:44
2
$\begingroup$

Approximate the figure by a polygonal line, draw a rectangular grid $\big($lattice$\big)$ inside the image, and apply Pick's theorem.

$\endgroup$

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.