Imatest Target Generator

The Imatest Target Generator Library is free software that provides virtual chart solutions to facilitate rapid, iterative lens and camera design by enabling simulations that can help a designer make better-informed decisions about what components are appropriate in advance of costly prototyping phases.

Select Add to cart and proceed to checkout to access the free software.

By downloading, you agree with the End User License Agreement.

Description

Quantitative and qualitative results from applying ray tracing, noise effects, and image signal processing to virtual charts aid engineers in communicating the impact of various lens and camera design parameters. Image quality deficiencies can be observed and mitigated using a virtual chart during the simulation phase. Virtual charts can aid engineers in comparing and resolving discrepancies between designs and builds.

Image augmentations can be applied to the generated targets along with other high-quality reference imagery for application-specific scenes such as facial recognition, bar code reading, optical character recognition, or object recognition/classification.  Having objective test target imagery along with domain-specific scene images enables the correlation of objective camera performance with the performance of the computer vision algorithm.

The Imatest Target Generator is available for free now as a Beta Python library with command-line interface

 

 

ImageMagick Dependence

This tool depends on Wand which is an ImageMagick binding and requires the separate installation of ImageMagick. Instructions to install ImageMagick are provided by Wand at https://docs.wand-py.org/en/0.6.7/guide/install.html .

 

Installation

Note: This tool is compatible with python 3.9.  

  1. Download the Imatest Target Generator imatest_target_generator-0.1.0-py3-none-any.whl. The Target Generator will be downloaded as a python wheel with .whl extension.

  2. Navigate to the location of the wheel file and then install it with the following command: python -m pip install .\imatest_target_generator-0.1.0-py3-none-any.whl

  3. Use the following command to show installation location: python -m pip show imatest_target_generator.

    The following text will be printed:

    Name: imatest-target-generator
    Version: 0.2.0
    Summary:
    Home-page: "https://www.imatest.com"
    Author: "Imatest LLC"
    Author-email: "support@imatest.com"
    License:
    Location: <installation location>
    Requires: numpy, Wand
    Required-by:
  4. Navigate to installation location then use python .\imatest_target.pyc -h to verify successful install by displaying the following help text:

    usage: imatest_target.pyc [-h] [-s WIDTH HEIGHT] [-r RESOLUTION] [-g GAMMA] [-f {bmp,png,tif}] [-d DIRECTORY]
                                        {checkerboard,dotpattern,esfriso2017,esfriso2022,logfcontrast,sfrplus,spilledcoins,star,0,1,2,3,4,5,6,7}
    
    Generate an Imatest target at desired size and resolution.
    
    positional arguments:
      {checkerboard,dotpattern,esfriso2017,esfriso2022,logfcontrast,sfrplus,spilledcoins,star,0,1,2,3,4,5,6,7}
                            Choose a target type:
                            [ 0 | checkerboard]
                            [ 1 | dotpattern  ]
                            [ 2 | esfriso2017 ]
                            [ 3 | esfriso2022 ]
                            [ 4 | logfcontrast]
                            [ 5 | sfrplus     ]
                            [ 6 | spilledcoins]
                            [ 7 | star        ]
    
    optional arguments:
      -h, --help            show this help message and exit
      -s WIDTH HEIGHT, --size WIDTH HEIGHT
                            Set size of target.
      -r RESOLUTION, --resolution RESOLUTION
                            Set resolution of target in dpi.
      -g GAMMA, --gamma GAMMA
                            Set gamma for target.
                            gamma = 1 is default.
      -f {bmp,png,tif}, --format {bmp,png,tif}
                            Set file format for target.
                            format = bmp is default.
      -d DIRECTORY, --directory DIRECTORY
                            Specify directory to save target to.
                            directory = <current directory> (current directory) is default.

 

Command Line Usage

python imatest_target.pyc checkerboard is equivalent to python imatest_target.pyc 0 and both commands will output a checkerboard target with the default parameters of size = 1500 x 1000, resolution = 72 dpi, gamma =1. The size, resolution, and gamma can be specified with the appropriate flags: python imatest_target.pyc checkerboard -s 800 1200 -r 100 -g 2.2

Python Package Usage

Import ImatestTarget.pyc at the beginning of a python script: from imatest_target_generator.ImatestTarget import ImatestTarget. Then help(ImatestTarget) can be used to print the following help text:

class ImatestTarget(builtins.object)
 |  ImatestTarget(target: Union[str, int], size: Optional[tuple[int, int]] = None, resolution: Optional[int] = None, gamma: Optional[float] = None, file_format: Optional[str] = None, directory: str = '<current directory>\\imatest_targets')
 |  
 |  ImatestTarget produces virtual Imatest charts at the desired size and resolution.
 |  ImatestTarget.ImatestTarget(target) will output a linear bitmap chart of type target with default
 |  size and resolution.
 |  
 |  Positional Argument:
 |      target: Union[str, int] {target = 0 | target = checkerboard}
 |              Available targets:
 |              [ 0 | checkerboard]
 |              [ 1 | dotpattern  ]
 |              [ 2 | esfriso2017 ]
 |              [ 3 | esfriso2022 ]
 |              [ 4 | logfcontrast]
 |              [ 5 | sfrplus     ]
 |              [ 6 | spilledcoins]
 |              [ 7 | star        ]
 |  
 |  Optional Arguments:
 |      size: tuple[int, int] {size = (width, height) pixels}
 |      resolution: int {resolution = 72 dpi}
 |      gamma: float {gamma = 1 (default)}
 |      file_format: str {bmp (default), png, tif}
 |      directory: str {directory = [path to folder]}

ImatestTarget(0) is equivalent to ImatestTarget("checkerboard")and both commands will output a checkerboard target with the default parameters of size = 1500 x 1000, resolution = 72 dpi, gamma =1.

The size, resolution, and gamma can be specified with the appropriate keyword arguments: ImatestTarget("checkerboard", size=(800,1200), resolution=100, gamma=2.2)

 

Available Targets

IndexTarget NameDefault OutputDefault Parameters
0checkerboardcheckerboard_size-1500x1000_resolution-72_gamma-1size: 1500 x 1000
resolution: 72 dpi
gamma: 1
1dotpatterndotpattern_size-1500x1000_resolution-72_gamma-1size: 1500 x 1000
resolution: 72 dpi
gamma: 1
2esfriso2017esfriso2017_size-1500x1000_resolution-72_gamma-1size: 1500 x 1000
resolution: 72 dpi
gamma: 1
3esfriso2022esfriso2022_size-1500x1000_resolution-72_gamma-1size: 1500 x 1000
resolution: 72 dpi
gamma: 1
4logfcontrastlogfcontrast_size-3780x2835_resolution-360_gamma-1size: 3780 x 2835
resolution: 360 dpi
gamma: 1
5sfrplussfrplus_size-900x500_resolution-72_gamma-1size: 900 x 500
resolution: 72 dpi
gamma: 1
6spilledcoinsspilledcoins_size-3780x2835_resolution-360_gamma-1size: 3780 x 2835
resolution: 360 dpi
gamma: 1
7starstar_size-3780x2835_resolution-360_gamma-1size: 3780 x 2835
resolution: 360 dpi
gamma: 1