← Image Processing for EveryoneToolsInVisionLearning Center
Image Foundations · Lesson 1

A Picture Is a Grid of Measurements

A small scratch appears on a metal part moving past an inspection camera.

Watch the lesson

A Picture Is a Grid of Measurements explained visually

1:55

A small scratch appears on a metal part moving past an inspection camera. English captions are optional and start off. The complete transcript follows the written lesson.

Lesson overview

What you will learn

A small scratch appears on a metal part moving past an inspection camera.

  1. The scratched part
  2. Locate a pixel
  3. What the value means
  4. Keep the original
01

The scratched part

We're looking at a metal part as it passes an inspection camera. There is a thin scratch on its surface. Before deciding whether that scratch matters, let's ask a simpler question: what did the camera give us? It gave us a grid of measurements. On a screen, our eyes join those measurements into a picture. Zoom in far enough, and you can see the individual pixels. One pixel represents a small patch of the image; it does not describe the whole part.

02

Locate a pixel

Suppose the image is six hundred and forty pixels wide and four hundred and eighty high. Multiply those dimensions and you get three hundred and seven thousand, two hundred pixel locations. We can find one location with an x coordinate across the image and a y coordinate down it. If we start counting at zero, the top-left pixel is zero, zero, and the bottom-right pixel is six hundred and thirty-nine, four hundred and seventy-nine. Some software asks for row and then column instead, so check the order before placing an annotation.

03

What the value means

The value at a pixel tells us something else. A grayscale pixel usually holds one intensity; a color pixel often holds three channel values. We can use those values to make the scratch easier to see. But a pixel count alone cannot tell us the scratch's width in millimeters. That takes a physical scale or a calibration target.

04

Keep the original

For this inspection, keep the original picture, its dimensions, and its coordinate convention together. Now we have a reliable starting point. Next, we'll see why adding more pixel locations and storing more intensity levels solve different problems.

Worked example

For a 640-pixel-wide and 480-pixel-high image, there are 307,200 pixel locations. With zero-based indexing, valid columns run from zero through 639, and valid rows run from zero through 479. The bottom-right pixel is therefore at column 639, row 479.

Knowledge check

Quick check: test your understanding

Try it yourself: Write the last valid row and column of a 100-by-60 image. Then explain why x equals 100 is outside it.

Check the reasoning

The last row is 59 and the last column is 99. Starting at zero means the width is one greater than the last valid column.

Does a bright pixel necessarily mean a hot object?

No. Its meaning depends on the sensor and calibration; ordinary image brightness is not a temperature measurement.

Where is the bottom-right pixel in a 640 × 480 grid?

At (639, 479) in zero-based (x, y) coordinates.

Can brightness alone measure a physical width?

No. A scale or calibration is required.

Further reading

Digital Image Processing, 4th edition — Rafael C. Gonzalez and Richard E. Woods.

Original ToolsInVision teaching examples. Editorial approach · Suggest a correction

Accessible referenceLesson 1 transcript268 words · Video transcript · Matches the published narration and captionsOpen transcript

We're looking at a metal part as it passes an inspection camera. There is a thin scratch on its surface. Before deciding whether that scratch matters, let's ask a simpler question: what did the camera give us? It gave us a grid of measurements. On a screen, our eyes join those measurements into a picture. Zoom in far enough, and you can see the individual pixels. One pixel represents a small patch of the image; it does not describe the whole part.

Suppose the image is six hundred and forty pixels wide and four hundred and eighty high. Multiply those dimensions and you get three hundred and seven thousand, two hundred pixel locations. We can find one location with an x coordinate across the image and a y coordinate down it. If we start counting at zero, the top-left pixel is zero, zero, and the bottom-right pixel is six hundred and thirty-nine, four hundred and seventy-nine. Some software asks for row and then column instead, so check the order before placing an annotation.

The value at a pixel tells us something else. A grayscale pixel usually holds one intensity; a color pixel often holds three channel values. We can use those values to make the scratch easier to see. But a pixel count alone cannot tell us the scratch's width in millimeters. That takes a physical scale or a calibration target.

For this inspection, keep the original picture, its dimensions, and its coordinate convention together. Now we have a reliable starting point. Next, we'll see why adding more pixel locations and storing more intensity levels solve different problems.