Image Sensor Lab provides focus accuracy measurement capability including an optional checker pattern match for improved accuracy. The focus within an image is not usually uniform and it is common to take measurements in various regions throughout the image. The focus routines provided allow user-configurable grid size and cell selection. The example in the figure below shows the regions used in a typical production test specification. The focus in the center of the image is usually the most critical and often has stricter acceptance requirements than regions near the outer edge.
| |
|
|
 |
|
Focus accuracy is characterized by measuring the sharpness, or edge steepness, in an image. Targets containing sharp dark-to-light edges should be used when performing focus measurement tests. Checker patterns or bar patterns are common. |
The example below shows a checker pattern and the intensity profile extracted from a horizontal line through the center. |
| |
 |
| |
Edge steepness data is often extracted from the luminance plane or possibly a Bayer color plane. This focus measurement is measured in various regions of the image including the center and outer regions where focus can be a problem.
Focus Accuracy Algorithm
The Focus Accuracy algorithm can be configured to calculate focus scores for either horizontal edges, vertical edges, or both edge types found in the image region. An alternate algorithm using pattern matching, as shown below, is also provided and allow for improved accuracy and statistics. The pattern matching option also better accommodates target alignment variations.
Focus accuracy testing is often performed on the luminance plane or possibly a Bayer color plane. Raw, unaltered data is best for this test and the image sensor or camera should be configured to disable any edge enhancement or other automated image enhancement routines.
The Image Sensor Lab user interface, shown at right, allows for user configurable regions of interest (ROI) by specifying a grid pattern. A table of results lists the calculated edge steepness score for each region. Edge steepness histogram graphs are provided for improved visibility into how the algorithm is performing and to view the effects of certain image sensor image processing options on edges within the image.
|

Pattern Match Focus Algorithm |
| |
Focus Accuracy Interface |
 |
 |
Edge steepness data is broken down and independently calculated for black-to-white and white-to-black edges for both columns and rows. An optional 3D focus map can be displayed (example shown at left). When this option is selected the focus score is calculated for every cell in the specified grid. The resultant focus scores are then drawn as a 3D surface map in the image display. |
| 3D Focus Map |
|
|
| |
|
|
Edge Steepness Algorithm
The focus algorithm used in Image Sensor Lab measures edge steepness from horizontal and vertical intensity profiles extracted from the image. Users can specify ROIs for focus accuracy reporting. The algorithm expects a sharp edged checkerboard pattern target, in which sizes of the black and white squares are smaller than the user defined measurement regions.
Edge steepness calculations are based on the number of horizontal or vertical pixels it takes to rise (or fall) from 10% amplitude to 90% (or 90% to 10%) amplitude (black to white edge or white to black edges). The intensity along the profiles is first interpolated for improved sub-pixel accuracy.
Image Sensor Lab provides a pattern matching option for improved accuracy. When this option is selected, the algorithm first searches the user defined regions for the specified image template and then extracts intensity profiles that are precisely aligned in the middle of the square edges so as to avoid profile data near the corners, which adversely skews the results. When this option is not selected, the algorithm searches for edges in every row and column of the specified regions then statistically removes outliers before averaging the results.
|