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

Example Image:

Irregular Shape

  • 2
    $\begingroup$ See en.wikipedia.org/wiki/Monte_Carlo_method. $\endgroup$ Commented Mar 1, 2014 at 16:37
  • 1
    $\begingroup$ If you could express the boundary as a closed curve, then you could calculate the area. $\endgroup$
    – Ian Coley
    Commented Mar 1, 2014 at 16:37
  • $\begingroup$ Do you know how to take an integral? $\endgroup$ Commented Mar 1, 2014 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
    Commented Mar 1, 2014 at 16:39
  • 2
    $\begingroup$ @Lubin The name for this device is a planimeter. $\endgroup$
    – Erick Wong
    Commented Mar 1, 2014 at 17:09

3 Answers 3


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["https://i.sstatic.net/ZriDw.jpg"];
data = MorphologicalComponents[Binarize[img]];
N[Count[Flatten[data], 1]/Times @@ Dimensions[data]]

(* Out: 0.466297 *)
  • $\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
    Commented Jul 25, 2018 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:


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

  • $\begingroup$ Brilliant because it does not partition the surface as a Riemann integral would: +1 $\endgroup$ Commented Aug 20, 2017 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.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .