Skip to main content
Designer and manufacturer of advanced imaging equipment
Thursday, 15 October 2026

Article

Bad pixels in ALTRON: learning the map and correcting in real time

rahni

You open the scanned image and see a thin bright line running from the top to the bottom of the image. You look at the next scan as well, and the same line is there, in exactly the same column. This is usually caused by one of the bad pixels of the sensor. In a line-scan camera, each pixel is repeated in every line, so a single defective pixel turns into a continuous line across the whole image. In inspection, this very line can be reported as a scratch or a product defect.

Line chart and scanned image from a line scan camera in ALTRON
Line chart and scanned image from a line scan camera in ALTRON

No sensor is completely flawless. The question is not whether we have bad pixels. The question is what to do about them.

Types of bad pixels

  • Dead: Always black or nearly black, no matter how much light reaches it.
  • Hot: Always bright, even in the dark.
  • Flickering (RTS): jumps between two levels and changes from one moment to the next. In a single scan it may not be visible at all.

One node for learning and correction

In ALTRON this is done with the BPC-Bad Pixel Correction node. Its settings panel opens with the title Runtime BPC. This node is not included in the ready-made line-scan camera graph. Add it in the graph editor, after black level correction and before gamma and the sharpeners.

The logic is simple. The node does not guess in each line which pixel is bad, because that guess could also erase real image detail. Instead, an exact map of the bad pixels is built once. From then on, only those known pixels are corrected.

Building the map

  1. Point the camera at a uniform scene.
  2. Click Start Learn. While learning, the button shows the amount of data collected.
  3. After a few moments, click the button again. The map is built and the program asks where to save the bpc file.
  4. Apply BPC is checked automatically and the file path is shown in Ref file.

Next time, just load the same file with Load Map. If you ever want to start over, clear the map with Clear.

Settings that determine correction quality

  • Edge-aware (directional): is on from the start and should stay on. It fills the bad pixel from healthy neighbors along the edge. Without it, a bad pixel lying on a sharp edge is filled with the average of both sides of the edge, which blurs the edge. In edge measurement, this difference matters.
  • RTS suppression (amp-gated): During learning, it also flags flickering pixels. It affects the next map you learn, not the current one.
  • Line-scan defective pixels: If you haven't built a map yet, the node uses these two numbers to detect bad pixels from their neighbors. Neighbor count is the number of neighbors on each side, and zero means off. Threshold % says how much a pixel must differ from the average of its neighbors to be considered bad. A low threshold also smooths out real fine detail. When a learned map is loaded, correction is based on that map, which is more accurate.

A common mistake: forgetting Set

If you change Apply BPC, Edge-aware, RTS suppression or the two line-scan-specific numbers, the change does not reach the node until you click Set. We have often seen someone change the threshold and wonder why the image hasn't changed.

Placement of the node in the graph

A bad pixel is a physical defect of the sensor, so its correction must come before cosmetic adjustments such as gamma and sharpeners. If you place it after them, the sharpener first creates a halo around the bad pixel, and after that it can no longer be cleaned up.

For thermal cameras: the same node is already present in the ready-made graph of the Thermal camera and you can capture the map on the same uniform scene you use for non-uniformity correction.

A short general source on defective pixels: Wikipedia (English).

See our line-scan cameras on the line scan cameras for more. If you see a line on your image that this method does not remove, get help from contact page to send us a picture of it.

Where our equipment is used

Organizations, universities, industries and companies that have used our products

  • Hedayat Hooshmand Nozhan Sepehr