How to capture frames from a video stream or RTSP camera

Imatest is still working on implementing RTSP streaming support and other video stream protocols within the software. In the meantime if your streaming protocol has the capability of outputting MP4s or other common video file formats, you can load this video into Imatest to analyze. Alternatively, you can use a program like FFMPEG or VLC to split the video into its individual frames, then analyze the frame as an image in Imatest. Heres how.



  1. Download a static FFMPEG build from a reputable source.
  2. Install FFMPEG according to the directions of your current OS:


  1. Use a program like 7-Zip to unpack the files to your preferred location.
  2. Open up the command line with administrative privileges.
  3. Run the command:

setx /M PATH "path\to\ffmpeg\bin;%PATH%"


a. Install homebrew by running the following in a terminal:

/usr/bin/ruby -e "$(curl -fsSL"

b. Once homebrew is installed, just enter in a terminal:

brew install ffmpeg


a. Install ffmpeg

sudo add-apt-repository ppa:mc3man/trusty-media
sudo apt-get update
sudo apt-get install ffmpeg
sudo apt-get install frei0r-plugins

b. With FFMPEG installed you can now call it from a command line or bash terminal to split your video file into frames:

ffmpeg -i myfile.avi -f image2 image-%05d.png

Using VLC

coming soon

Read More

Megapixel suitability for test charts

Megapixel suitability is based on analysis of Modulation Transfer Function (MTF) obtained from a chart image captured using a 1:1 magnification lens (Canon 65mm f/2.8 1-5x macro) and a 6.5µm pixel size sensor (Canon EOS 6D). Conversion to megapixels is based on the Imatest Chart Quality Index (CQI) calculation which determines sensor height suitability using the equation:

2 * MTFxx (cycles per object mm) * vertical chart height (mm) where xx is 90, 70 or 50.

In order to consider performance throughout the camera’s range of expected sharpness, we photograph slanted-edges of transmissive and reflective substrates and take the sum of:

  • MTF90 (the spatial frequency where MTF is 90%) multiplied by 0.5,
  • MTF70 multiplied by 0.35, and
  • MTF50 multiplied by 0.15

Megapixel suitability calculations assume that:

  1. the lens is of high quality
  2. that the chart fills the vertical field of view (vFoV) of the camera system
  3. that the sensor aspect ratio is 3:2.

For 16:9 aspect ratio sensors (with pillarboxed framing, if applicable), multiply the megapixel suitability by 1.185.
For 4:3 aspect ratio sensors (with left/right sides of chart cropped), multiply megapixel suitability by 0.889.

Charts can be suitable for significantly higher megapixel counts if the minimum resolvable feature size of the lens is larger than the pixel size or the chart fills less than the full sensor vertical field of view.

Additions to Imatest 5.1

Imatest 5.1, to be released in April 2018, has some important enhancements that increase the megapixel suitability of most Imatest charts by up to a factor of 2. The MTF for most charts, which is a function of the chart media and printing technique, has been measured, and the measurements have been fit to a simple two-parameter function which can be used to correct MTF measurements by deconvolution (by dividing the measured camera MTF by the chart MTF function projected on the image sensor). The correction can be applied by entering an MTF correction file into the settings windows for any MTF calculations. For more details, see Compensating camera MTF measurements for chart and sensor MTF.

Chart Quality Calculator that uses the new MTF functions is also available. It provides a clearer and more accurate estimate of MTF suitability (including the expected MTF loss from the media without and with the correction) than the older Chart Quality Index.

See Also

Read More

Lightbox Uniformity Comparison


Lightbox Brightness Uniformity* CRI (spec.)
Viewing Area Dimensions Controls
ITI LED Lightbox 1 – 100,000 Lux ** 95.2% Over 97 260 mm x 220 mm 400 (W) x 380 (H) x 100mm (D) Bluetooth, USB
IQL LED Lightbox 10 – 40,000 Lux     254mm x 279.4mm 472.4 x 383.5 x 129.5mm Wireless via Android
GL-16e Lightbox Viewer 5750 Lux 63.6% 96-98 10 x 18″ (25 x 46 cm) 15x25x5″ (38x64x13cm) Manual
GL-20e Lightbox Viewer            
GL-30e Lightbox Viewer            
GL-44e Lightbox Viewer            
GLX-3044 Lightbox Viewer N/A N/A 96-98 30×42″ (76x107cm) 35x49x5″ (89x124x13cm) Manual
GLX-3856 LIghtbox Viewer N/A N/A 96-98 38×56″ (96x142cm) 43x63x5″ (109x160x13cm) Manual
GLE-10 Lightbox Viewer N/A TBC 96-98 8×10″ (20x25cm) 15.5×12.25×3.25″ (39x31x8cm) Manual
GLE GLX-30 Lightbox Viewer 5000 Lux 70.1% 96-98 16″ x 30″ (41 x 76cm) 21 x 37.5 x 5″  Manual
Artograph LightPad® 930 2820 Lux  77%   12×9″   On/Off
Artograph LightPad® 950 2740 Lux 78.5%   24×17″   On/Off

*measured using 9 rectangular regions, as described below.
** measured using 30-10,000 lux model, ultra bright version has 90% uniformity


A better color quality measurement?  The color quality of light sources is traditionally measured by CRI (Color Rendering Index), which has a maximum value of 100 (%). Recently, doubt has been cast on the accuracy of CRI, and a new Color Rendition measurement has been proposed: IES TM-30-15. It’s unfamiliar and the linked document doesn’t have an equation or algorithm for calculating it from the light spectrum. We’ll wait and see…

Lightbox Uniformity- Detailed Measurements

For the key measurement, the definition of uniformity is

Uniformity = 100%*(1 – (maximum of 9 regions- minimum of 9 regions) / maximum of 9 regions)

where the 9 rectangular regions (shown in the figures below) include the top, bottom, left, right, 4 corners, and center. The rectangular region dimensions are 10% of the crop width and height and (except for the center region) they are located 5% of the width and height from the boundaries, as described below.


Click on any of the images below to view full-sized.

ITI LED Lightbox

Uniformity = 95.2%

Response is very even, but unusual in that the center is slightly dimmer than the top and bottom.

Note that the contour line increments are 0.01 (1%), lower than the other lightboxes because the ITI is much more uniform. (0.02 contour increments wouldn’t show very much.)

The lightbox spectra for the standard 3100K and 5100K settings, provided by ITI, are shown below.

ITILED-3100k ITILED-5100k

GTI GL-16e Lightbox

Uniformity = 63.6%

The contour line increments are 0.02 (2%), double that of the ITI LED Lightbox. Both the GL-16e and GLX-30 have very wide aspect ratios. Their uniformity would be much better if less of the sides were included in the measurement.




Artograph 930 12×9 inch Light Pad

We use this inexpensive lightbox for non-critical applications like MTF measurements and for trade show demonstrations. It’s uniformity is quite good.

Uniformity = 77%


Artograph 950 24×17 inch Light Pad

We use this large, relatively inexpensive lightbox for non-critical applications like MTF measurements and for trade show demonstrations. It’s uniformity is quite good.

Uniformity = 78.5%

(Figure is darker because image was less exposed.) 


The control

The control for these measurements was made by capturing images immediately in front of the ITI lightbox (no more than 1cm distant). Results were repeatable when the camera was moved around the lightbox. Contour increments are very small: only 0.002 (0.5%).

Uniformity = 98.75%


GTI GLX-30 Lightbox

(No longer available in the Imatest Store)

Uniformity = 70.1%

The contour line increments are 0.02 (2%), double that of the ITI LED Lightbox.


GTI GLE 12e Lightbox

(No longer available in the Imatest Store)

Uniformity = 65.8%

The contour line increments are 0.02 (2%), double that of the ITI LED Lightbox.


How we made the measurements

We developed a methodology for measuring lightbox uniformity because we were not aware of any relevant standards.

  • Photograph the lightbox using a camera with a long focal length marco lens. Such lenses tend to be highly uniform, i.e., have very low vignetting. We used the Canon EOS-6D with the highly-regarded 100mm f/2.8 macro lens set at f/8. Be sure to capture raw images. We used manual focus because the EOS-6D didn’t focus well on this image.
  • Frame the lightbox so it occupies about the central 30% of the image (10% by area). This makes the already low vignetting insignificant. Here is the framing (and region selection) for two lightboxes.
Click on the images to display them larger.
ITI_uniformity_cropITI Lightbox GTI_uniformity_cropGTI Lightbox
  • Open Uniformity (or Uniformity Interactive) and read in the raw file, converting it to a gamma = 1 (linear) file. (This means it’s not a standard file, but pixel level will be proportional to illumination.) Here are the recommended settings from the Imatest dcraw GUI window. The key settings are Output gamma = 1.0 (Linear), Auto white level checked, and Normalize by 1.0.


  • Crop the images just inside the bright areas of the lightbox, as shown above. If there are areas of rapid illumination falloff close to the edges of the lightbox image, it’s OK to omit them.
  • Click Yes to open the Uniformity settings box. The key settings are shown inside the red rectangles. The corner and side regions (the rectangles) are 10% of the ROI (linearly), and the location of the regions is 5% (of the ROI size) from the ROI boundaries. We feel this is a reasonable summary metric since most tone and color measurements are made in the central two-thirds of the image. Uniformity is more important when measuring tone and color than it is for MTF, even though Imatest corrects for patch nonuniformity due to vignetting and uneven illumination.


  • After you click OK (not shown) Uniformity runs and the results figures appear. The key nonuniformity summary metric does not appear in the figures it’s in the CSV and JSON file output. Here is the relevant CSV output.

    Uniformity = 100%*(1 – (maximum of 9 squares – minimum of 9 squares) / maximum of 9 squares)

Nonuniformity LRTB sides ctr (%) 36.44
Uniformity LRTB sides ctr (%) 63.56
  • and here is the JSON output:

         “nonuniformity_LRTB_sides_ctr_pct”: [36.4],
         “uniformity_LRTB_sides_ctr_pct”: [63.56],


Read More

Measuring the impact of flare light on dynamic range


The dynamic range of recent HDR image sensors, defined as the range of exposure between saturation and 0 dB SNR, can be extremely high: 120 dB or more. But the dynamic range of real imaging systems is limited by veiling glare (flare light), arising from reflections inside the lens, and hence rarely approaches this level. Veiling glare measurements, such as ISO 18844, made with black cavities on white fields, result in large numbers that are difficult to relate to dynamic range. Camera dynamic range is typically measured from grayscale charts, where veiling glare depends on the design and layout of the chart, leading to inconsistent results. (more…)

Read More

How to convert a color image to grayscale

Sometimes an undemosaiced Bayer raw image gets improperly saved into a BMP or TIFF format that includes color channels that are all equal. In this case, Imatest will recognize the image as color, and not give you the monochrome read options that allow you to perform demosaicing or analyze the image as a Bayer raw.

Here are a variety of ways to convert a color image to grayscale:

Imagemagick command line utility

$ convert -type Grayscale rawcolor.bmp mono.bmp

GIMP / Photoshop

Image -> Mode -> Grayscale



From Image -> Tyoe -> Select the desired output bit depth


Ctrl-G or from the image menu select Convert to Grayscale


img = imread('rawcolor.bmp');
r = img(:, :, 1);
imwrite(r, 'mono.bmp');


Read More

Avoiding reflections on transmissive charts for dynamic range and flare testing

The testing of dynamic range and flare requires a proper test chart and environmental setup to get accurate results.High precision and high-density chart technologies such as photographic film or chrome on glass come with the disadvantage of glossiness which makes them susceptible to specular reflections on the target. This affects the use of dynamic range or contrast resolution and backlit flare targets that lack anti-reflective patches. 

The goal of the backlit test setup is to maximize the fraction of light that is coming directly from your light source, through your test target, and into your lens, Any additional light that is present in your system can disrupt your measurements either by causing reflections on the analysis patch of your target, or otherwise introducing additional flare (veiling glare) into the image.

As the optimal lens and camera body housing will be manufactured with anti-reflective coating, it is good to take a similar approach with your test environment.  Nothing is actually entirely black, but dark, opaque materials come in many different forms. These can be characterized by their total hemispherical reflectance (THR).

Here are how some dark materials compare:

Product THR (vis+NIR) Notes
Black Paint 5-6% Not dark enough
Black Felt 2.5% Flexible and low-cost
Acktar black 1.5% Comes on adhesive foil
Vantablack 0.17% Costly, not durable, dangerous to humans

For general testing purposes, we use black felt for covering our darkened test box

Block all light from entering or reflecting inside the testing environment

For accurate testing, you should create a dark space where no outside light is able to enter, and as much internally generated light is absorbed. Here is a diagram of a test environment:

Minimize internal direct reflections

The more that the surfaces in your test environment are lit up, the more they will become reflections in the glossy chart.

The body of the camera under test or even just glass of a camera lens can reflect back onto a test chart.This is especially important incident towards dark analysis regions.

If using Imatest charts that are properly centered, the reflection might not fall on to a dark analysis region for dynamic range measurement. Here is an example of a reflection of a dev kit PCB that would disrupt dynamic range or contrast resolution measurement:

Reflective camera parts should be blocked by black masks. The entire area behind your camera will directly be reflected back, so this environment should be made as dark as possible.

Minimize other internal light emissions

Sensor development kits often have blinking LED’s that reflect directly, Front facing cameras with displays that are not disabled or blocked off can be particularly problematic.

Read More

DMX Lighting Control Software

Lights such as the Kino Flo Select 31 LED use a DMX control interface to signal changes of light level and color temperature.

DMX is an open protocol and there are a large number of possibilities for hardware and software control. I’ve tried out several of these are more oriented to stage control
For DMX controller hardware I have personally tried and will recommend the Enttec Open DMX USB controller worked well for us, the DMX USB Pro seems nice also.
For computer control software with a user Interface, the one that has worked best for me so far is the Q Light Controller Plus (QLC+) which has nice cross-platform support.
For light control software that provides an automated API, the best one I have found, and the one we use to automatically control lights in our lab is the Open Lighting Architecture (OLA). The downside of this is that it only has good support for Linux. I have attached a python script that includes an example OLA calls, along with calls to an isolight puck, which you can overlook.  Here is a basic call to set the lights to middle color temp and maximum intensity:
from ola.ClientWrapper import ClientWrapper
intensity = 255
cct       = 127
universe = 1
data      = array.array('B') 
wrapper = ClientWrapper()
client = wrapper.Client()
client.SendDmx(universe, data, DmxSent)
Our goal for Imatest 5.2 is to have an instrument control interface built into Imatest Master that can directly communicate with DMX hardware.


Read More

Imatest Stops Working – Advanced Troubleshooting

Recovering Mathworks Log Files

Please recover this log file and send to

The log file name is called “mathworks_<username>.log”. Where <username> is the username of the user that ran the installer. Please see the instructions below to locate the log file depending on your OS.

Windows 10 \ Windows 8 \ Windows 7 \ Windows Vista

The installer log file will be located in the AppData\Local\Temp directory under the user account who ran the installer. The full path, as an example, is:


A shortcut to get to this path is to enter the following into the address bar of File Explorer window, then press Enter:


Windows XP:

The directory is:

C:\Documents and Settings\<username>\Local Settings\Temp\mathworks_<username>.log


The log file will be located at the following location:


Mac OS X:

Follow these steps to retrieve the installer log file on a Mac:

1. Log in as the user who ran the installer.

2. Open a Terminal window (you can use Spotlight Search to find Terminal)

3. Copy and paste the following command, and press enter to run it in Terminal. Do not edit the command, run it exactly how it appears below:

cp $TMPDIR/mathworks_$USER.log ~/Desktop

This will create a copy of the installer log file on the desktop. If the command fails, this means the installer log file is not being created. This could indicate that the installer is starting at all, and is thus not able to write the log file. If that is the case, additional information may be able to be obtained from the Console:

Applications – Utilities – Console (or use Spotlight Search to find the Console application)

Use the ‘Clear display’ button to clear out previous console messages. Then try running the installer again and see what is recorded in the console. You can save this information from console. This output may be helpful in addition to the installer log file.

All operating systems:

Forcing the creation of the log file in a specific location:

If the installer is not creating a log file, then you may need to create your own. You can run the installer in command prompt or terminal with a flag to force a log file to be created. You could use a command like the following to do this:


/full/path/to/setup.exe -outputfile “C:\path\to\logfile.log”



./install -outputfile /path/to/logfile.log

As a note, you can drag the installer into command prompt or terminal and command prompt will automatically populate the path of the installer for you. When defining where the log file will go, make sure it is a directory that you have write permissions. You may need to run command prompt as administrator (Windows) or the installer as sudo (Linux/Mac) in order to do this. 

Read More

Handling an Lightroom for iPhone RAW DNG file

Adobe DNG converter for windows & mac can be used to re-save iPhone RAW files into supported DNG formats using the following custom settings:

We soon hope to will be adding native support for LightroomiPhone DNG RAW.


Read More

Test Chart Substrate and Sizing Guide

This guide is intended to enumerate the various possibilities and constraints of our various printed materials, and give a rough idea of the resolution of each material.


Inkjet is the lowest resolution process we have available, but also the cheapest and most versatile. The minimum print size with inkjet is approximately 8” x 10”, and the maximum print size for a single sheet is 44” x 80”.

We have three different substrates available for inkjet prints. We can use Matte or Semigloss paper, both of which are reflective. We also have the option of using DisplayTrans, which is a transmissive media intended for use with a backlight. All inkjet options are roughly the same resolution.

Inkjet is best suited to cameras tested at a moderate distance in order to compensate for the low quality of the print. It also works for low-resolution or wide-angle systems where chart quality is less important. As the resolution is relatively low, the size of the chart needs to be much larger to accommodate a sensor of higher resolution.

We can produce custom charts and custom sizes of any of the charts we offer. Simply email with the requested sizing and information about your lens (Field of View, and testing distance) and sensor (pixel count and aspect ratio.) We need the pixel count to be certain that the size you are requesting will be adequate for your imaging system. If needed you can use our Chart Finder Tool to determine the size of your imaging plane at a specific testing distance.

We also have available the option to tile together multiple pieces of paper to create even larger charts for extremely wide angle imaging systems.  The constraints of the multi-sheet process are the number of columns that can print on each sheet, and the chart must be assembled on site by the customer due to the extremely large sizes. We have currently produced charts as large as 80” x 120” using this process. 

Photographic Paper (Silver Halide)

Photographic media offers high-resolution reflective prints for when using a transmissive target is not an option. These prints are over twice the resolution of inkjet media.

The minimum size of a photographic print is approximately 8” x 10” and the maximum size is approximately 40” x 50”.

We can do customized sizes on this media, however there is a substantial engineering fee ($3000) for the work required to customize these targets. We offer 3 standard sizes: 1x, 2x, and 4x. Soon we wil offer a small multi-size option which has 5 different sizes on an 8” x 10” print. This multi-size is best suited for those testing low-resolution systems at close distances. Contact if you are interested.

Transmissive Photographic Film

Our film is printed using high-precision LVT Technology. We have two different types of film available. Black and White and Color. These targets are transmissive and require a lightbox in order to be used properly. 

Black and White

The Black and White film is over twice the resolution of our inkjet targets, and can optionally include a color patch for customers needing to do color measurements. The size of the film is 12” x 20” or 16” x 20” (with ½” on each side as unprintable area). The minimum target size on this media is roughly 2” x 3”. We can print multiple targets on a single sheet of film depending on the size and resolution requirements to help make this option more cost-effective.

This media is suited for customers testing in a small area with low to medium resolution cameras.

For high-resolution systems, we can tile together multiple pieces of LVT film to fit the size of your lightbox. The maximum dimensions using this option would be approximately 19” x 32”. This option is best suited for customers testing high-resolution cameras such as DSLR’s. 


Our High-Precision Color film is printed on 8” x 10” film with a maximum printed area of 9.25” x 7.75”. The minimum target size on this media is approximately 0.5” x 1”. As with the Black and White film, we can print multiple targets to a single sheet of film to make this a more cost-effective option.

This media is suited for customers requiring a very compact testing system or those using conversion optics to simulate infinity within a very small space. The fine detail of the film allows us to test mid to high-resolution cameras at close distances and with a small field of view. Color film also has the highest dynamic range of all of the targets we offer. 

Chrome on Glass Photomask 

Chrome Photomasks are by far the absolute sharpest option we have available for resolution testing, though it is also our most expensive option. We use a lithographic photomasking process to print chrome directly onto glass. This process is single tone, so there is no gray-scale or tonal variance.

Chrome on Glass offers superior resolution at the cost of color and tonal measurements. Using chrome on glass, we can make targets as small as 2mm x 3mm for measuring devices such as endoscopes or microscopy equipment. When printing to glass, the chrome has an optical density of 1, which gives a contrast ratio of approximately 10:1, suitable for resolution measurement.

Our standard glass plates are 4” x 4” with a non-printable border of 1 cm. At maximum size on our 4” glass plates, we can measure imaging systems with a resolution above 25 Megapixels.

We can source plates up to 20” x 20” and as small as 1” x 1”. Any plates larger than 4” x 4” will require an extended lead time of 6-8 weeks. A 20” plate with our SFRplus pattern would be suitable for testing cameras over 100MP.

We can customize the size of various targets such as our own SFRplus or ISO-eSFR targets on request. We can also print most custom design requests to glass, though some may require an engineering fee depending on the complexity of the design.  Contact


Read More