Text printed or embossed around a rim — a cap, a bottle closure, a filter ring, a machined shoulder — is the most common curved-text job on an assembly line. Flat-row OCR fails on it because the characters lie along an arc and lean over as they go. The fix needs no custom code on most engines: the OCR setup tool of a fixed code reader or smart camera accepts a ring-shaped (annulus) region of interest and resamples it internally into a flat band, so the trainer sees upright characters and draws a box on each one. This guide walks the training, the box-by-box check, and the camera, lens and ring light numbers that make the band readable.
Let the annulus ROI do the unwrap
Do not write unwrap code until you have tried the ring ROI. Pick the annulus tool in the reader's OCR setup environment and draw two concentric circles: the inner one just inside the text line, the outer one just outside. The tool samples the ring and presents a straight band, and segmentation, training and reading all run on that band. While it trains, the software draws a bounding box around every character it segments — the overlay you watch to know the set is good.
Flat OCR fails on these parts for two reasons: each glyph leans along the arc, and the baseline bends, so a row-trained engine drops characters toward the top and bottom of the ring. Published work on curved-text alignment starts from exactly that failure of commercial engines. Unwrapping first is the whole fix. When your tool offers only rectangular ROIs, a polar remap is a short coordinate transform — NumPy alone will do it — and some polar unwrap tools take an angle span beyond ±360°, so a string that runs past its own start still lands in one band.
Whatever comes off the band goes into a character set file. If the marks are a house font rather than a standard typeface, custom OCR font training walks that file; the annulus only changes how pixels reach it.
The three numbers that decide the read
Character height in pixels is the first. Set 20 pixels of character height as the working floor for a trainable engine and design at 40, so a threshold shift that thins strokes by half still leaves solid glyphs. What happens below the floor is covered in minimum font size for OCR.
Shear is the second. Unwrapping maps one radius to a horizontal line, so the two edges of a wide band arrive at different scales; the shear is roughly the band height divided by the ring's mid-radius. Hold it under about 15 percent: a 2.5 mm band on a 20 mm mid-radius gives 12.5 percent, which trains cleanly, while the same band on a 12 mm mid-radius gives 21 percent and starts merging neighbours.
Illumination evenness is the third. A ring light on the lens axis puts every rotation of the part under the same brightness, which is what makes circular text a ring-light job. Side lighting brightens one half of the band and starves the other, and no amount of training fixes a black arc.
Hardware: camera, lens and ring light
Work the camera choice backward from the band. At a 60 mm field of view, 5 MP gives comfortable margin and 1.3 MP is the floor when lighting is locked down. The LS-CRD-0028 is a 2560 x 2048 reader: 5 MP on a 1/1.7" sensor, an 8 mm lens, 30 fps and 60 codes/s over Fast Ethernet.
- Interface
- Fast Ethernet
- Resolution
- 5 MP
- Sensor format
- 1/1.7"
- Shutter
- Global
On a tighter station, the LS-SMC-0063 is a 1.6 MP smart camera with a 16 mm lens and a polarized white light already in the housing, running at 60 fps over GigE. When the on-device OCR tool has no ring ROI, the LS-SMC-0017 is an 8.8 MP global-shutter camera with a C-mount on an X86 platform, so your own polar remap and any trainable OCR library run on the device.
- Interface
- GigE
- Resolution
- Up to 3 MP
- Interface
- USB 2.0
- Resolution
- 6-10 MP
For lighting, match the beam to the mark. Printed ink on a glossy rim needs diffusion: a diffuser or a 30° beam removes the arc-shaped hot spot a bare ring leaves on a curved face. Embossed characters want a low beam angle that turns raised strokes bright on a dark background. Polished surfaces add cross polarization to cut surface glare on top. The LS-RNG-0426 is a 120 mm diffused white ring light with a low 0° beam at 24 V; the LS-RNG-0143 is a 100 mm ring light with diffuser at 30°, also 24 V. For moving parts, strobe the ring below one millisecond and drive it as described in LED overdrive and current control. The two geometries to choose between:
| Specification | LS-RNG-0426 | LS-RNG-0143 |
|---|---|---|
| Color | White | red/white/blue/green |
| Color temperature | 6000 ~ 7500K | red: -; white: 6000K-6500K; blue: -; green |
| Cable length | 1 m | 0.5 m |
| Price | $369.00 | $169.00 |
Values as printed in each product's data sheet; open a part for its drawing and full specifications.
Train the character set in six steps
- Fixture the part, then set exposure and focus manually and leave them fixed. Auto exposure drifting between training and runtime changes the strokes the classifier sees; runtime camera parameter control lists the settings that must stay put.
- Select the annulus ROI tool. Put the inner circle just inside the text and the outer circle just outside, then set the start angle so the first character lands at the left edge of the band. A tight ring keeps background texture out of the band and shortens the read — the same discipline as setting an ROI for inline code reading.
- Create a new, empty character set file so nothing trained on another part follows you in.
- Adjust the threshold until every stroke is solid with no breaks. The classifier never sees the gray image — it reads the binary glyph, so this adjustment decides whether training works at all.
- Run segmentation and inspect the overlay. The trainer draws a bounding box around each character it finds; zoom in and compare box to glyph, one by one. Merge boxes that split a single glyph, split boxes that join two, and move the minimum and maximum character size until every box lands exactly on its glyph. That inspection is the training step most people skip.
- Label each boxed character, save the set, then read ten fresh parts including the worst rotation you expect. When a character drops, add that appearance to the set instead of starting over.
Worked example: rim text on a 50 mm cap
Inputs: a 50 mm diameter cap, white characters 2.5 mm tall with a 0.5 mm stroke, printed on a ring of 20 mm mid-radius. Part height varies ±2 mm, and the belt runs 50 mm/s during transfer. Camera: 2560 x 2048 on a 1/1.7" sensor — 7.6 mm wide on the standard optical-format table, about 3 µm pixels — behind an 8 mm lens with a selectable aperture.
Field of view and resolution. Cover the 50 mm cap with 5 mm of margin per side: FOV = 60 mm. Pixel scale = 60 mm / 2560 px = 23 µm per pixel, so character height = 2.5 mm / 23 µm = 107 px, five times the floor. The sizing sum above, (60 / 2.5) × 40 = 960 px, says a 1280-pixel sensor also clears the 40 px design target; the 5 MP sensor is what you order when lighting drifts between shifts.
Working distance and aperture. With magnification m = sensor width / FOV = 7.6 mm / 60 mm = 0.127:
The depth of field uses a circle of confusion of two sensor pixels, 6 µm. At f/8 that gives ±3.4 mm, which covers the ±2 mm height variation; at f/4 it gives ±1.7 mm and the tallest parts blur. Order the lens at f/8 and hold the fixture near 71 mm. The thin-lens working distance is an estimate, so measure it on the bench before you cut the stand.
Exposure. At 50 mm/s, one pixel of blur allows t = 0.023 mm / 50 mm/s = 0.47 ms. Strobe the ring light at 0.3 ms and motion blur drops to 15 µm, under one pixel. If your line indexes to a full stop instead, take a 5 ms exposure and run the light continuously.
The band. One full turn at a 20 mm mid-radius is 2π × 20 mm = 126 mm, about 5,400 px after resampling, with 12.5 percent shear from the inner to the outer edge. Train on the unwrapped band so the runtime shear equals the training shear — that is why this geometry reads without any per-character deskew.
Decision. Order the 5 MP station: 8 mm lens at f/8, 71 mm working distance, diffused ring light strobed at 0.3 ms, annulus ROI, character set trained on the band.
Check the set before release
Read 20 fresh parts spanning every rotation the line produces; the set is releasable when all 20 match exactly with nothing dropped. Gate the output on read confidence so a smeared character rejects instead of reading as its nearest neighbour — how to judge whether a read is trustworthy gives the signals to gate on. Missing characters usually come from text filtering rather than the font: diagnosing missing characters. A set that reads on the bench and fails on the line has runtime parameters that differ from training: set every runtime parameter. When the string must land on a screen rather than a PLC register, image text recognition options for HMI screens covers where that reading can run.
When the annulus ROI is the wrong tool
Small rings shear too much. Shear grows as band height over mid-radius, and under a 10 mm mid-radius with 2.5 mm characters you pass 25 percent. Split the ring into four arcs read as four flat ROIs, or move to an engine built for curved text: published detectors model a curved string as a tube around its centre line, and recent work on large-curvature annular marks does the recognition in polar coordinates for the same reason.
Two text rows need two annuli at different radii — two reads from one image, concatenated downstream. A part that wanders ±1 mm off centre clips the band at the strokes: locate the part first with a circle or blob finder and anchor the annulus to that feature wherever the tool supports a referenced ROI.
Checklist before you order
- Character height at your field of view: design at 40 px, never below 20 px — the resolution calculator above prints the pixels.
- Camera: global shutter whenever parts move; a rolling shutter bends a moving band.
- Lens: a focal length that puts the working distance where the fixture needs it — the lens focal length calculator does the trade.
- Light: a diffused ring on the lens axis and a controller able to overdrive it for sub-millisecond pulses.
- Marking: if you can influence it, OCR font selection removes half of these problems before printing starts.
- Schedule a training day: ten captures per character at the line's worst rotation, plus a retraining run after the first light change.
Size the station in the configurator with these numbers. If the ring geometry is unusual, bring the part to us through the contact page — annular text is a bench-solvable problem, and the unwrap is already in the tool.
Questions
How many characters do I have to train for a full alphanumeric ring?
Worst case 36: 26 letters and 10 digits. Count the characters that actually appear on the part, including separators, and train each one from at least ten captures taken at different ring rotations. One sample per character survives only while lighting, exposure and print density never drift; production lines drift, so add new appearances to the set as they show up instead of starting over.
Can I reuse one character set file on a second identical station?
Only when the second station reproduces the first one's pixels. The classifier reads thresholded strokes, so a camera with a different pixel scale, a lens at a different working distance, or a replacement light changes the strokes and the set misreads. Copy the file as a starting point, read 20 known-good parts, and add any appearance that fails before you release the line.
Why do characters at the inner edge of the ring read worse than the rest?
Unwrapping maps one radius to the band, so the inner edge of a wide band stretches relative to the outer edge by roughly the band height divided by the ring's mid-radius. A 2.5 mm band on a 20 mm mid-radius shears about 13 percent, and training on the band absorbs it because runtime and training see the same shear. Past about 20 percent, narrow the band or split the ring into arcs.
What if the text wraps more than once around the part?
Some polar unwrap tools accept an angle span beyond 360 degrees or below minus 360, so a string that continues past its starting point still lands in one straight band; set the span to 720 degrees and the second pass follows the first. If your tool stops at one turn, train two annuli with start angles 180 degrees apart and concatenate the two strings downstream.
Do I need a dome light instead of a ring light for curved text?
A ring light centred on the part's axis is the first choice for text that runs around a rim, because every rotation of the part sees the same illumination. A dome wins when the surface is both curved and mirror-smooth, such as polished metal, and the ring still returns hot spots. Try cross polarization on the ring before changing the light family.
How do I let my customer retrain characters without my software?
Redistribute the vendor's OCR training interface alongside your executable. At least one major vision suite ships its trainer as a stand-alone application that edits the same character set file the runtime reads, so your program launches it from a maintenance screen and reloads the set afterwards. Gate that screen behind an engineer login: the training interface can change the set, not just view it.


