Application 1: Contrast Enhancement Through Filtering
Application Requirements
During packaging, pharmaceutical pills of different colors need to be sorted. An automated imaging system, which distinguishes between the different colored pills, is essential in increasing production efficiency. In such a system, pills are inspected for specific characteristics as they travel down a trough-like conveyor belt prior to sorting. A minimum of 60% contrast is needed for the software to be able to differentiate between the different pills.

System Requirements Given by Customer:
Working Distance: ~350-450mm
Field of View: ~70mm
Minimum Contrast: 60%
Component Selection
The 35mm MVO® Double Gauss imaging lens, used with a 1/2" CCD format camera, yields an appropriate field of view and working distance for this application. The Sony XC-75 high resolution monochrome CCD camera offers a suitable amount of resolution and dynamic range (grayscales). A fiber optic area backlight is placed underneath the slotted trough to diffusely illuminate the pills. The Bandit capture board is used to digitize the camera signal for further image processing. In order to meet the minimum contrast level, filtering is required. The process of the filter selection is shown below.
Effects of Filtering
Monochrome cameras cannot inherently discriminate between different colors. In this example, both the red and green pills appear nearly identical when imaged with the Sony XC-75. Filtering can be used to improve the contrast between pills of different colors and enables the system to differentiate between them. The images, along with their associated grayscale profile curves, are illustrated below. All curves are generated only for the sampling area indicated.
SAMPLE UNDER INSPECTION:

NO FILTER:


RED FILTER:


GREEN FILTER:


Calculating Contrast
A visual interpretation of the images and grayscale profile curves can be quite subjective. However, a contrast value can be calculated from the curves to determine which filter offers the highest contrast.
| % Contrast = | Imax - Imin X 100 Imax + Imin | |
No Filter: |
Contrast = |
119 - 100 = 8.7% 119 + 100 |
Red Filter: |
Contrast = |
217 - 62 = 55.6% 217 + 62 |
Green Filter: |
Contrast = |
166 - 12 = 86.5% 166 + 12 |

Summary
In order to differentiate between the colored pills, the software needs a minimum of 60% contrast. A grayscale profile can be generated from the sample area in order to calculate the contrast. The original monochrome image only has a 8.7% contrast difference between the red and green pills. The contrast can be increased beyond the minimum requirement by ~25% by attaching a green filter to the front of the lens. This allows the user's customized software to operate on a go/no-go principle and accurately sort the pills.
Application 2: Correcting Perspective Errors with Telecentricity
![]() |
System Parameter Equations | |||
Eqn. 1: |
CCD Res. (µm) |
= |
1 2 x CCD Pixel Size (Horiz, µm) |
|
Eqn. 2: |
Primary Mag. (PMAG) |
= |
Sensor Size (Horiz, mm) FOV (Horiz, mm) |
|
Eqn. 3: |
Object Res. (µm) |
= |
CCD Resolution (µm) PMAG |
|
| Combining all of these expressions with the given values yields: | ||||
Eqn. 4: |
Object Res. (µm) |
= |
2 x Pixel Size (µm) x FOV (mm) Sensor Size (mm) |
|
Eqn. 5: |
Pixel Size (µm) Sensor Size (mm) |
= |
1 | |
| (for this example only) | ||||
Application Requirements
In this example, a system is required to inspect the prototype of a hardware computer key connector to verify the placement of its pins. This is a laboratory setup requiring no automation. A precise measurement between each pin is determined using measurement software.
System Requirements Given by Customer:
Expected Vertical Pin Separation (center-to-center): ~2.5mm
Number of Pins Viewable Simultaneously: ~7
Object Resolution to Meet Measurement Accuracy: 36µm
System Parameter Calculations
In order to accommodate the simultaneous inspection of multiple pins, the minimum Field of View (FOV) should be about 18mm. By using some basic equations, we can specify the parameters of our system and pick a suitable CCD camera. Our system requirements dictate an 18mm field of view and a 36µm object resolution. Using these values, Eqn. 4.0 can be reduced to a ratio (Eqn. 5.0). This ratio can be used to compare the resolution of different cameras for a specific field of view (while factoring in the sensor size). We can calculate this ratio for some of our high resolution digital and analog CCD monochrome cameras:
| Roper Scientific MEGAPLUS ES 1.0 | 9.0/9.07 | = 0.99 |
| Sony XC-ST30 | 6.4/4.8 | = 1.3 |
| Sony XC-ST50 | 8.4/6.4 | = 1.3 |
The Roper Scientific MEGAPLUS ES 1.0 camera is the best match to the desired ratio. Using Eqn. 2.0, we calculate PMAG = 0.5X for the imaging lens. And from Eqn. 1.0, the camera's resolution is 18µm. If we assume that the lens is not the limiting factor in the resolution of the system, the corresponding object resolution is 36µm (Eqn. 3.0).
Note: Although the Sony XC-ST30 camera has a higher resolution (13µm) it only yields about 50µm object resolution because it has a smaller sensor.
Component Selection
Since the camera has been selected, a 0.5X PMAG imaging lens needs to be decided on. Conventional lens designs suffer from perspective errors (see Application Notes Sect 2.4) which are noticeable when imaging objects with significant height/depth, as in this example. Telecentric lenses optically correct this problem as illustrated in the images below.
Measurement Software
Edge detection analysis at low depth of field (F2.8) was used to determine the center of the pins. The telecentric design (Image 2) maintains a symmetrical blurring within the pin diameter. The result is an accurate circular fit to the pin by the measurement software. On the other hand, the conventional design results in a perspective blur which yields an elliptical fit. This introduces error into the prediction of the pin center and also other measurements. For example, the conventional system measures 3.51mm center-to-center separation between two diagonally adjacent pins and the telecentric system measures a 3.21mm separation. The actual pin separation is 3.16mm.
Image 2: Telecentric |
Image 4: Conventional |
![]() |
![]() |
Telecentric Lens
Image 1: High DOF (F16)


Image 2: Low DOF (F2.8)


Conventional Lens
Image 1: High DOF (F16)


Image 2: Low DOF (F2.8)


Summary
The Roper Scientific MEGAPLUS, model ES 1.0 digital camera offers the best combination of high resolution and sensor size to meet the measurement accuracy requirement for this application. The telecentric lens was selected because it corrects for the perspective errors by maintaining constant magnification over the depth of field. Since the center of the object does not shift as it blurs, the telecentric lens offers a huge advantage when measuring center-to-center separation. In this example, the telecentric lens, in combination with the Roper Scientific MEGAPLUS camera, improves the overall measurement accuracy by 86%.
Application 3: Manipulating Distortion out of Your Image

Application Requirements
Precise measurements of plastic mesh fencing are needed during production runs to ensure that all dimensions fall within the specified tolerances. In this situation, the space reserved for the imaging system is extremely limited. The housing for the CCD and lens is integrated into the mounting of the machinery.
System Requirements Given by Customer:
Working Distance:
~50mm
Component Selection
Although their minimum working distance is longer than desired, the MVO® Micro Video lenses are compact, making them ideal for this application. The 4.3mm focal length MVO® Micro Video lens has a 60° angular field of view under normal conditions. By introducing 0.25mm of space between the lens and the camera, the horizontal field of view is reduced to 50mm at a 50mm working distance. A high resolution monochrome board camera offers the appropriate resolution and size. The illumination is provided by a fiber optic illuminator with a dual branch flexible light guide. Due to the macro configuration and wide angle of the lens, distortion has been introduced into the image. This distortion must be taken into account in order to make accurate measurements.
Calculating Distortion
Distortion (%) = Actual Distance (AD) - Predicted Distance (PD) X 100
Predicted Distance (PD)
Distortion is a geometric optical error (aberration) in which information about the object is misplaced in the image, but not actually lost. Using measurement software and a dot target of known size (shown below), we can measure the distortion at different distances from the center of the image.
Note: Distortion is not linearly correlated to the distance from the center of the field.


Factoring Distortion Out
Once the amount of distortion is calculated, it can be factored out in order to yield an undistorted image. In this example, -16% (barrel) distortion is measured at the edges of the field. The distortion has a negative value because the edge of the field is closer to the center of the image than it should be. Since we are using a 1/3" format CCD camera (6mm diagonal sensor size), the corner of the sensor is 3mm from the center. Based on the amount of distortion, this point would actually be located at a distance of 3.57mm in an undistorted image. Since distortion must be measured for each point on the image, repeated calculations are required. Once this is done, distortion can either be processed out of the image (as shown below) or taken into account during measurement. We can also calculate the corresponding positions on the object by dividing the image distances by the primary magnification (PMAG=0.096). The edge of the field of view, the part of the mesh measured to be 31.3mm (=3/0.096) from the center mark is actually 37.2mm (=3.57/0.096) away.
| Distorted Image: This is an initial distorted captured image in which the contrast is not ideal. | Binary Image: A binary image (black and white, no grays) can be generated through image processing. Note: It is not necessary to convert the image into binary to subtract distortion. | Corrected Image: Having measured the distortion accurately, it can be removed through image manipulations. The resulting image is a precise representation of the original object. | ||
![]() |
![]() |
![]() |
Summary
The MVO™ Micro Video lens and board level camera offer an ideal solution for this space-limited application. There is a high degree of distortion within the lens because of its large angular field of view. Once measured, this distortion can be factored out of the image in order to obtain more accurate measurements. In this example, we are interested in measuring the height of the mesh (center row). Without taking distortion into consideration, the height fluctuates from 16.5 to 18.0mm. Once the distortion is taken into account, we realize that the range of the height of the mesh is actually 17.9 - 18.3mm, well within the ±0.3mm tolerance.







