8

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

Example Image:

Irregular Shape

  • 2
    See http://en.wikipedia.org/wiki/Monte_Carlo_method. – Martín-Blas Pérez Pinilla Mar 01 '14 at 16:37
  • 1
    If you could express the boundary as a closed curve, then you could calculate the area. – Ian Coley Mar 01 '14 at 16:37
  • Do you know how to take an integral? – recursive recursion Mar 01 '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 01 '14 at 16:39
  • 2
    @Lubin The name for this device is a planimeter. – Erick Wong Mar 01 '14 at 17:09
  • I don't even know how to define the area of an irregular shape without dividing it into small pieces. What does it mean to say that an irregular shape has an area, if not that you can cut it into small pieces and rearrange them into a square? – MJD Mar 01 '14 at 17:23
  • The definition of area (basically outer measure) of a set: You cover the set with rectangles (for these we know the area, base times height) and then take the covering that has the smallest sum of the areas of the rectangles (infimum, actually). – ploosu2 Mar 01 '14 at 17:29
  • That is the same as cutting the region into small pieces; in this case narrow strips. – MJD Mar 01 '14 at 19:35
  • @MJD Do you mean that all the shapes are discrete ? – Premnath D Mar 02 '14 at 02:13

3 Answers3

7

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.stack.imgur.com/ZriDw.jpg"];
data = MorphologicalComponents[Binarize[img]];
N[Count[Flatten[data], 1]/Times @@ Dimensions[data]]

(* Out: 0.466297 *)
Mark McClure
  • 30,510
  • 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 08:19
4

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

ploosu2
  • 8,707
2

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

Lucian
  • 48,334
  • 2
  • 83
  • 154