Skip to main content

Command Palette

Search for a command to run...

Line-Scan Camera Selection and Encoder Setup

Updated
9 min readView as Markdown

Calculate cross-web resolution, line rate, exposure, encoder scaling, and frame assembly for continuous material or fast conveyor inspection.

A line-scan image looks correct at one conveyor speed, then stretches when the web slows and compresses when it accelerates. The camera still outputs the configured number of lines. The problem is that spatial sampling in the transport direction was tied to time rather than distance.

Line-scan design has two resolutions: across the sensor and along motion. A shaft encoder connects the second axis to physical travel.

What you will learn

  • Calculate cross-web millimetres per pixel.

  • Set line rate for square or intentional rectangular sampling.

  • Convert encoder pulses into lines.

  • Calculate exposure from transport-direction blur.

  • Assemble frames and detect missing or duplicated lines.

Technical foundation

How a line-scan camera forms a 2D image

A line-scan sensor captures one or several pixel rows. Relative motion between the object and camera provides the second image dimension. Software or a frame grabber stacks consecutive lines into a 2D image.

This architecture is well suited to continuous webs, sheets, print, surfaces on conveyors, and very wide/high-resolution inspection. It depends on stable illumination along a narrow line and accurate synchronization with motion.

Cross-web sampling

If an 8,192-pixel sensor views 1,200 mm:

Cross-web resolution = 1,200 mm / 8,192 px
                     = 0.1465 mm/px

Transport-direction sampling

For a free-running camera at line rate L and material speed v:

Transport mm/line = speed / line rate
Required line rate = speed / desired mm per line

To produce square sampling, desired mm/line equals cross-web mm/px. Square pixels are not mandatory, but intentional scale is.

Encoder-triggered acquisition

An encoder generates counts proportional to material travel. The system produces one line after a defined number—or rational fraction—of counts. This compensates for speed variation if the encoder accurately represents the inspected surface motion.

Basler and Allied Vision documentation describe encoder or external line-start triggering and warn that the configured rate must remain within the camera’s resulting acquisition line-rate capability.

Exposure and line period

The exposure must fit the acquisition mode and remain short enough for blur. At high line rates, the line period may leave little time for exposure and readout. Illumination therefore becomes a major design component.

[Suggested visual: line-scan image formation from successive encoder-triggered lines]

Purpose: Explain how conveyor distance becomes the vertical image axis.

Required elements: One sensor line, moving web, encoder wheel, equally spaced trigger marks, and stacked 2D image.

Suggested caption: “Encoder-triggered lines preserve spatial scale when transport speed changes.”

Accessible alt text: “A line camera captures repeated strips of a moving web, and an encoder controls the spacing before the strips are stacked into an image.”

Engineering workflow

1. Define the web or object geometry

Record inspection width, position wander, material thickness, camera-to-web distance, maximum object length, seam/gap behaviour, and required defect size in both axes.

Why it matters: the cross-web and transport requirements may be different.

2. Select cross-web sensor resolution and lens

Calculate mm/px across the web and verify pixels across the smallest relevant feature. Confirm the lens covers the long sensor and maintains focus, resolution, and illumination across the full width.

Common failure: checking centre sharpness while the ends of a long line sensor are defocused or under-illuminated.

3. Choose transport sampling

Decide whether square sampling is needed. Calculate the target mm/line and maximum line rate from the fastest speed.

Trade-off: finer transport sampling increases data rate and illumination demand.

4. Design encoder mechanics

Select measuring-wheel circumference, counts per revolution including quadrature, contact pressure, slip control, direction sensing, and mounting location. The encoder should represent the surface motion, not merely motor command.

5. Configure count-to-line scaling

Calculate counts/mm and counts/line. Use encoder multiplication/division features or a motion controller if the ratio is not an integer. Confirm behaviour during reversal, vibration, and stopped material.

6. Calculate exposure and light

Use transport mm/line or cross-web mm/px to set an allowed blur budget. Provide enough focused line-light intensity at the required exposure and aperture.

7. Define frame boundaries

Use a product sensor, seam mark, encoder length, or process event to start and stop a frame. Include part ID and encoder count. For endless material, process rolling blocks with overlap if algorithms require context.

8. Monitor acquisition integrity

Track accepted line rate, missed triggers, trigger overflow, line counters, frame height, encoder direction, buffer depth, and data-transfer errors.

Worked example: 1.2 m web at 2.5 m/s

Hypothetical application: an 8,192-pixel line sensor covers 1,200 mm. Web speed reaches 2.5 m/s, or 2,500 mm/s. Square object-space sampling is desired.

Cross-web scale:

1,200 mm / 8,192 px = 0.1465 mm/px

Required line rate:

2,500 mm/s / 0.1465 mm/line ≈ 17,067 lines/s

The selected camera, exposure, pixel format, interface, and host must sustain more than 17.1 kHz with margin.

For no more than 0.5 pixel of transport smear:

t_max = 0.5 × 0.1465 mm / 2,500 mm/s
t_max ≈ 29.3 µs

Assume a 4,096-count/revolution encoder after quadrature and a 200 mm measuring-wheel circumference:

Counts/mm = 4,096 / 200 = 20.48 counts/mm
Counts/line = 20.48 × 0.1465 ≈ 3.00 counts/line

This is a convenient ratio: one line for every three counts gives nearly square sampling. A 600 mm-long product requires approximately:

600 mm / 0.1465 mm/line ≈ 4,096 lines

The resulting image is about 8,192 × 4,096 pixels. At 8-bit monochrome it is about 33.6 MB before overhead, so buffer and processing requirements must be included.

[Suggested visual: complete worked-example calculation sheet]

Purpose: Provide a reusable line-scan sizing reference.

Required elements: 1,200 mm width, 8,192 pixels, 2,500 mm/s speed, 17.1 kHz line rate, 29.3 µs exposure, and 3 encoder counts/line.

Suggested caption: “Cross-web sampling determines the target line spacing; speed then determines line rate.”

Accessible alt text: “A calculation diagram connects web width and camera pixels to line spacing, line rate, exposure, and encoder counts.”

Line-scan design checklist

Element Calculation or evidence Common failure
Cross-web scale FOV / sensor pixels Edge regions ignored
Transport scale Speed / line rate or encoder counts Image stretch/compression
Maximum line rate Camera query/spec at final settings Overtriggered lines
Exposure Allowed smear × mm/line / speed Dark or blurred image
Encoder Counts/mm and slip test Motor speed used as web motion
Frame height Object length / mm/line Cropped or mixed products
Data rate pixels/line × bits × lines/s Buffer or interface loss
Illumination Uniform focused line at exposure limit Centre bright, edges weak

Common mistakes

  1. Running at a fixed line rate on variable-speed material. The image scale changes with speed.

  2. Mounting the encoder where it slips relative to the inspected surface. Counts no longer represent travel.

  3. Assuming square pixels are automatic. Cross-web and transport sampling are independent.

  4. Ignoring maximum line rate at the final settings. Exposure, width, bit depth, and interface can reduce it.

  5. Underestimating line-light requirements. Short exposure over a wide line demands high irradiance and alignment.

  6. Failing to handle reversal. Backward motion can duplicate or corrupt image regions.

  7. Building frames by time alone. Product gaps and speed variation change image height.

  8. Testing only a short run. Buffer growth and thermal drift appear in sustained operation.

Validate under production conditions

Run speed ramps, steady speed extremes, starts, stops, reversals if possible, minimum and maximum web tension, wander, seams, gaps, and encoder contact changes. Inspect a calibrated grid or artifact to measure scale in both axes.

Measure missing/duplicate lines, spatial scale, aspect ratio, exposure uniformity, edge focus, defect detection, line-rate margin, buffer depth, and processing time. Challenge the system at maximum data rate for an extended period.

Mark and measure known features over a long distance to detect accumulated encoder-scale error. Define maintenance checks for measuring-wheel wear, contamination, pressure, alignment, and lighting focus.

Key takeaways

  • Line-scan images have independent cross-web and transport sampling.

  • Encoder triggering preserves transport scale when speed changes.

  • Maximum speed and desired mm/line determine required line rate.

  • Exposure and focused illumination often constrain practical performance.

  • Validate geometry, acquisition integrity, and sustained data handling together.

Follow this Hashnode blog for more practical line-scan engineering, and connect with Kivanc Ekici on LinkedIn. For related machine-vision and automation information, visit ITAGE.

Frequently asked questions

When should I use a line-scan camera?

It is a strong choice for continuous webs, sheets, cylindrical surfaces with controlled rotation, or very wide high-resolution inspection where motion can provide the second image axis.

How do I calculate line rate?

Divide maximum material speed by the desired distance per image line. Use consistent units and verify the camera’s resulting line-rate limit.

Why is my line-scan image stretched?

The line spacing does not match material travel—often because speed changed while line rate stayed fixed or encoder scaling is wrong.

Does a line-scan camera need an encoder?

Not always. A stable fixed-speed process can use a controlled line rate, but an encoder is preferred when speed varies or dimensional scale matters.

How is a line-scan frame started?

Use a product sensor, seam/mark detector, encoder length, PLC event, or rolling-block strategy, depending on whether material is discrete or continuous.

Sources

More from this blog