← Image Processing for EveryoneToolsInVisionLearning Center
Segmentation Methods · Lesson 61

Global Thresholds and Their Limits

A single cutoff works for bright cartons but fails in shadow.

Read the full lesson and open its transcript below. A narrated video will be added after production.

Lesson overview

What you will learn

A single cutoff works for bright cartons but fails in shadow.

  1. A practical question
  2. The useful idea
  3. Work through the example
  4. Limits and next step
01

A practical question

A packaging camera sees dark labels on bright cartons. Under even lighting, one intensity cutoff seems to separate them. Then a carton passes through a shadow, and part of its cardboard becomes darker than a lit label. A single threshold cannot distinguish those pixels by intensity alone.

02

The useful idea

A global threshold applies the same rule across every location. Plot or inspect values from labels and cardboard in both the bright and shaded areas. If their ranges overlap, moving the cutoff will trade one kind of error for another. That overlap is a limitation of the available evidence, not a sign that we haven't found the magical number yet.

03

Work through the example

Keep examples of a clear label and a shadowed carton. Set the cutoff using representative training images, and inspect errors on separate images. Lighting control may help more than further tuning. A mask that looks clean on one frame can still fail on the next carton. A single intensity cutoff is attractive because it is easy to explain. On a label lit unevenly, the same ink may appear bright on one side and dark on the other. Examine intensity values from both regions before choosing the threshold. If their ranges overlap the background, no single number can separate them reliably. Do not keep tuning on the final evaluation image; record failures and consider a method that accounts for local illumination. Now check the idea on a concrete example: Plot pixel values from both lit and shaded areas before choosing a cutoff. A possible trap is worth naming: When the distributions overlap, one global number cannot separate every case. The answer follows from that evidence: Global thresholding applies one intensity rule across the image.

04

Limits and next step

Record the threshold and the capture conditions. Next, we'll let the threshold respond to nearby lighting, while watching for new mistakes at label edges.

Worked example

Plot pixel values from both lit and shaded areas before choosing a cutoff.

Knowledge check

Quick check: test your understanding

Try it yourself: Consider this case: Plot pixel values from both lit and shaded areas before choosing a cutoff. Explain how you would check the result. In your answer, address this limitation: When the distributions overlap, one global number cannot separate every case.

Check the reasoning

Global thresholding applies one intensity rule across the image. When the distributions overlap, one global number cannot separate every case.

What is the main idea behind global thresholds and their limits?

Global thresholding applies one intensity rule across the image.

How is it used in the example?

Plot pixel values from both lit and shaded areas before choosing a cutoff.

What limitation should be checked?

When the distributions overlap, one global number cannot separate every case.

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 61 transcript304 words · Narration ready for the upcoming videoOpen transcript

A packaging camera sees dark labels on bright cartons. Under even lighting, one intensity cutoff seems to separate them. Then a carton passes through a shadow, and part of its cardboard becomes darker than a lit label. A single threshold cannot distinguish those pixels by intensity alone.

A global threshold applies the same rule across every location. Plot or inspect values from labels and cardboard in both the bright and shaded areas. If their ranges overlap, moving the cutoff will trade one kind of error for another. That overlap is a limitation of the available evidence, not a sign that we haven't found the magical number yet.

Keep examples of a clear label and a shadowed carton. Set the cutoff using representative training images, and inspect errors on separate images. Lighting control may help more than further tuning. A mask that looks clean on one frame can still fail on the next carton. A single intensity cutoff is attractive because it is easy to explain. On a label lit unevenly, the same ink may appear bright on one side and dark on the other. Examine intensity values from both regions before choosing the threshold. If their ranges overlap the background, no single number can separate them reliably. Do not keep tuning on the final evaluation image; record failures and consider a method that accounts for local illumination. Now check the idea on a concrete example: Plot pixel values from both lit and shaded areas before choosing a cutoff. A possible trap is worth naming: When the distributions overlap, one global number cannot separate every case. The answer follows from that evidence: Global thresholding applies one intensity rule across the image.

Record the threshold and the capture conditions. Next, we'll let the threshold respond to nearby lighting, while watching for new mistakes at label edges.