# How to find the area of any irregular shape?

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

Example Image:

• – Martín-Blas Pérez Pinilla Mar 1 '14 at 16:37
• If you could express the boundary as a closed curve, then you could calculate the area. – Ian Coley Mar 1 '14 at 16:37
• Do you know how to take an integral? – recursive recursion Mar 1 '14 at 16:39
• 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. – Lubin Mar 1 '14 at 16:39
• @Lubin The name for this device is a planimeter. – Erick Wong Mar 1 '14 at 17:09

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:

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 *)

• 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. – Babelfish Jul 25 '18 at 8:19

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.$$

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

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