Imatest IT – imatest https://www.imatest.com Image Quality Testing Software & Test Charts Tue, 07 Apr 2020 19:33:21 -0600 en-US hourly 1 https://wordpress.org/?v=5.3 New Documentation Available for Imatest IT https://www.imatest.com/2017/06/new-documentation-available-imatest/ https://www.imatest.com/2017/06/new-documentation-available-imatest/#respond Tue, 27 Jun 2017 19:51:44 +0000 http://www.imatest.com/?p=19197 Imatest is pleased to unveil updated documentation for Imatest IT. The documentation has been updated to include the latest software release (Imatest 4.5), including details for new features, filtering options for preferred languages, and several new Troubleshooting articles.

Users can now filter Imatest IT instructions for their preferred languages and interfaces including C, C++, Python, .NET (C# and Visual Basic), and EXE. In addition, there are now more detailed installation and setup instructions for both Windows and Linux versions.

Imatest IT ships with several example projects in C++, Python, C#, and Visual Basic. You can find them in the samples folder of your IT installation, along with example images of Imatest test charts that can be used for each of IT’s analysis modules.

Related Content

Automating Lab and Manufacturing Processes – [Webinar]

 

]]>
https://www.imatest.com/2017/06/new-documentation-available-imatest/feed/ 0
Error Message: “Input must be a row vector of characters.” https://www.imatest.com/2017/03/error-message-input-must-be-a-row-vector-of-characters/ https://www.imatest.com/2017/03/error-message-input-must-be-a-row-vector-of-characters/#respond Thu, 16 Mar 2017 16:39:53 +0000 http://www.imatest.com/?p=18433 Error Message: Input must be a row vector of characters.

Solution: This can happen when you pass a directory path into Imatest IT EXE with a trailing slash, and can be fixed by removing the slash:

May cause errors:

sfr.exe "-1" "C:\ImatestSamples\sfr_example.jpg" "C:\Program Files\Imatest\v4.5\IT\bin\" "C:\ImatestSamples\imatest-v2.ini" "C:\ImatestSamples\Results\"

Fixed:

sfr.exe "-1" "C:\ImatestSamples\sfr_example.jpg" "C:\Program Files\Imatest\v4.5\IT\bin" "C:\ImatestSamples\imatest-v2.ini" "C:\ImatestSamples\Results"
]]>
https://www.imatest.com/2017/03/error-message-input-must-be-a-row-vector-of-characters/feed/ 0
Python Idle Error: Error writing to output stream. https://www.imatest.com/2017/03/python-idle-error-error-writing-to-output-stream/ https://www.imatest.com/2017/03/python-idle-error-error-writing-to-output-stream/#respond Mon, 13 Mar 2017 20:36:00 +0000 http://www.imatest.com/?p=18385 Error Message: Error writing to output stream. (when using Idle Python GUI)

Solution: Imatest IT writes output to your computer’s standard output. This error occurs when Idle is launched as a standalone GUI app without a connected terminal (i.e., launching from the Start Menu in Windows, or using the “idle &” command in Linux).

To fix this error, you need to launch Idle from the command line.

Windows:   cd “C:\Program Files\Imatest\v4.5\IT\samples\python\”
C:\Python27\Lib\idlelib\idle.py colorcheck_example.py
Linux:   cd /usr/local/Imatest/v4.5/IT/samples/python/colorcheck
idle colorcheck_example.py

Once Idle is opened with the example script, you should now be able to run the module (F5).

]]>
https://www.imatest.com/2017/03/python-idle-error-error-writing-to-output-stream/feed/ 0
Error Messsage: “Import Error: No module named imatest.it” https://www.imatest.com/2017/03/error-messsage-import-error-no-module-named-imatest-it/ https://www.imatest.com/2017/03/error-messsage-import-error-no-module-named-imatest-it/#respond Mon, 13 Mar 2017 20:34:23 +0000 http://www.imatest.com/?p=18383 Error Messsage: Import Error: No module named imatest.it

Solution: The Imatest IT/Python package has not been installed. Follow the instructions under Other Additional Installation Steps on the Imatest IT Instructions page.

]]>
https://www.imatest.com/2017/03/error-messsage-import-error-no-module-named-imatest-it/feed/ 0
Error Message: “Exception caught during initialization of Python interface” https://www.imatest.com/2017/03/error-message-exception-caught-during-initialization-of-python-interface/ https://www.imatest.com/2017/03/error-message-exception-caught-during-initialization-of-python-interface/#respond Mon, 13 Mar 2017 20:31:58 +0000 http://www.imatest.com/?p=18381 Error Message: Exception caught during initialization of Python interface. Details: To call deployed MATLAB code on a win64 machine, you must run a win64 version of Python. Details: C:\Program Files\MATLAB\MATLAB Runtime\v90\runtime\win64

Solution: This is caused by trying to run a 64-bit Imatest IT installation using a 32-bit version of Python. You must install a 64-bit version of Python, and be sure the installation directory is in your PATH variable ahead of the 32-bit version.

]]>
https://www.imatest.com/2017/03/error-message-exception-caught-during-initialization-of-python-interface/feed/ 0
Error Message: “RuntimeError: On Linux, you must set the environment variable “LD_LIBRARY_PATH” to a non-empty string” https://www.imatest.com/2017/03/error-message-runtimeerror-on-linux-you-must-set-the-environment-variable-ld_library_path-to-a-non-empty-string/ https://www.imatest.com/2017/03/error-message-runtimeerror-on-linux-you-must-set-the-environment-variable-ld_library_path-to-a-non-empty-string/#respond Mon, 13 Mar 2017 20:30:05 +0000 http://www.imatest.com/?p=18376 Error Message: RuntimeError: On Linux, you must set the environment variable “LD_LIBRARY_PATH” to a non-empty string. For more details, see the package documentation.

Solution: Be sure that your LD_LIBRARY_PATH environment variable is set correctly. See Linux Only: Setting the LD_LIBRARY_PATH” on the Imatest IT Instructions page.

]]>
https://www.imatest.com/2017/03/error-message-runtimeerror-on-linux-you-must-set-the-environment-variable-ld_library_path-to-a-non-empty-string/feed/ 0
Error Message: “An unhandled exception of type ‘System.BadImageFormatException'” https://www.imatest.com/2017/03/error-message-an-unhandled-exception-of-type-system-badimageformatexception/ https://www.imatest.com/2017/03/error-message-an-unhandled-exception-of-type-system-badimageformatexception/#respond Mon, 13 Mar 2017 20:24:59 +0000 http://www.imatest.com/?p=18374 Error Message: An unhandled exception of type ‘System.BadImageFormatException’ occurred in mscorlib.dll  Additional information: Could not load file or assembly ‘Imatest.IT, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. An attempt was made to load a program with an incorrect format.

Solution: This is caused by trying to run a 64-bit Imatest IT installation using a an x86 configuration in Visual Studio. Be sure the configuration is set correctly for the version of Imatest you have installed.  Note, because Matlab DLLs are compiled for a specific architecture, the “Any CPU” option may not work properly. It is best to use the configuration specific to your Imatest version (“x64” for 64-bit and “x86” for 32-bit).

Note: As of Imatest 4.5, only 64-bit architectures are supported.

]]>
https://www.imatest.com/2017/03/error-message-an-unhandled-exception-of-type-system-badimageformatexception/feed/ 0
Error Message: “[module] not registered – Run the License Manager to activate your license or trial” https://www.imatest.com/2017/03/error-message-module-not-registered-run-the-license-manager-to-activate-your-license-or-trial/ https://www.imatest.com/2017/03/error-message-module-not-registered-run-the-license-manager-to-activate-your-license-or-trial/#respond Mon, 13 Mar 2017 20:20:57 +0000 http://www.imatest.com/?p=18372 Error Message: [module] not registered – Run the License Manager to activate your license or trial

Solution: Your copy of Imatest IT is not activated. Follow the activation instructions here, then try again.

Note: You need an activation code for Imatest IT, even for trial usage. If you do not have one, please contact support@imatest.com.

]]>
https://www.imatest.com/2017/03/error-message-module-not-registered-run-the-license-manager-to-activate-your-license-or-trial/feed/ 0
Automating CPIQ analysis Using Imatest IT and Python https://www.imatest.com/2017/02/automating-cpiq-analysis-using-imatest-it-and-python/ https://www.imatest.com/2017/02/automating-cpiq-analysis-using-imatest-it-and-python/#respond Thu, 16 Feb 2017 10:18:43 +0000 http://www.imatest.com/?p=17982 The Python interface to Imatest IT provides a simple means of invoking Imatest’s tests. This post will show how Imatest runs can be automated, then the results of those tests can be collected and easily processed. For this example, we will run five Imatest modules across three light levels, then extract CPIQ quality loss metrics.

Development Setup

Image Collection

For each device, we capture the following set of images of different test charts at different light levels:   (Note: full details will be available with the publication of the standard in March of 2017)

  • DeviceX_eSFR_5000KLED_1000lux.JPG
  • DeviceX_eSFR_TL84_100lux.JPG
  • DeviceX_eSFR_Tung_10lux.JPG
  • DeviceX_Dot_5000KLED_1000lux.JPG
  • DeviceX_Dot_TL84_100lux.JPG
  • DeviceX_Dot_Tung_10lux.JPG
  • DeviceX_SG_5000KLED_1000lux.JPG
  • DeviceX_SG_TL84_100lux.JPG
  • DeviceX_SG_Tung_10lux.JPG
  • DeviceX_Coins_5000KLED_1000lux.JPG
  • DeviceX_Coins_TL84_100lux.JPG
  • DeviceX_Coins_Tung_10lux.JPG
  • DeviceX_Unif_100lux.JPG

Running All The Tests

Once we have these images collected in a folder named “DeviceX”, we define our lighting conditions, initialize the Imatest IT library and run our processing function on this and a number of other devices:

led5k = "5000KLED_1000lux"               # Light Levels
tl84 = "TL84_100lux"
tung = "Tung_10lux"
light_conditions = [led5k, tl84, tung]
imatest = ImatestLibrary()
phones = ['DeviceX',                     # Just for example...
          'DeviceY',
          'DeviceZ']
for phone in phones:
    calc_phone(phone)

imatest.terminate_library()

The main processing script invokes the five modules, collects their data outputs and saves them to a JSON file:

def calc_phone(phone):
    print('Calculating Metrics for '+phone+ ' *****************************')
    uniformity_results = uniformity(phone) # Uniformity
    multitest_results  = multitest(phone) # Multitest
    dotpattern_results = dotpattern(phone) # Dot Pattern
    esfriso_results    = esfriso(phone) # eSFR ISO
    random_results     = random(phone) # Random

    # Output data to disk
    file_name = os.path.join(images_dir, phone, phone + '.json')
    with open(file_name, 'w') as outfile:
        full_data = {'multitest'  : multitest_results,
                     'dotpattern' : dotpattern_results,
                     'esfriso' : esfriso_results,
                     'random' : random_results,
                     'uniformity' : uniformity_results}
        json.dump(full_data, outfile, indent=4, separators=(',',': '))

    return full_data

We call the Imatest eSFR ISO module for each specified lighting condition:

# eSFR ISO (ISO 12233:2014) is used to test Visual Noise (VN) 
# and Spatial Frequency Response (SFR)
def esfriso(base):
    global images_dir, ini_file, light_conditions, op_mode
    output = {}
    for light_source in light_conditions:
        print('Testing ' + base + ' eSFR ISO at ' + light_source)
        input_file = os.path.join(images_dir, base, base+'_eSFR_'+light_source+'.jpg')
        if os.path.exists(input_file) != True:
            raise Exception('File ' + input_file + 'not found!')
        print('opening ' + input_file)
        result = imatest.esfriso_json(input_file=input_file, root_dir=root_dir, 
                                      op_mode=op_mode, ini_file=ini_file)
        data = json.loads(result)
        output[light_source] = data['esfrisoResults'];

return output

On the fly INI file changes

The most difficult part of this processing is to manually update region selections for the calls to Multitest, which does not yet have automatic region detection for the Colorchecker SG target (coming soon…).

In this case, we are we replacing the [sg] roi, nwid_save, and nht_save keys with the values stored in this multicharts-rois.json file:

{
"DeviceX_SG_5000KLED_1000lux.JPG": "468 417 2122 1578 468 1588 2102 397",
"DeviceX_SG_TL84_100lux.JPG":"482 376 2142 1571 482 1561 2157 376",
"DeviceX_SG_Tung_10lux.JPG":"386 336 2016 1492 401 1497 2021 321",
"width":"2592",
"height":"1936"
}

We use this script to modify INI files to dynamically insert different settings:

import ConfigParser

def get_config(path): # Used make ConfigParser case sensitive
    config = ConfigParser.ConfigParser()
    config.optionxform=str
    try:
        config.read(os.path.expanduser(path))
        return config
     except Exception, e:
        log.error(e)

def setROI(roi,width,height):
    global ini_file
    imatestini = get_config(ini_file)

    imatestini.set('ccsg', 'roi', roi)
    imatestini.set('ccsg', 'nwid_save', width)
    imatestini.set('ccsg', 'nht_save', height)
    with open(tempINI, 'w') as outfile:
        imatestini.write(outfile)
    return

These functions are then called using the values loaded from the JSON file inside of our multicharts function call:

    roi_overrides = {}
    roi_overrides_lower = {}
    roi_override_file = os.path.join(images_dir,base,'multicharts-rois.json')
    if os.path.exists(roi_override_file):
        with open(roi_override_file,'r') as fh: # read ROI override file
            roi_overrides = json.load(fh)
        for override, rois in roi_overrides.iteritems(): # convert to lowercase
            roi_overrides_lower[override.lower()] = rois
    else:
        raise Exception('ROI override file ' + roi_override_file + ' not found.')
 
    if image_file.lower() in roi_overrides_lower:
         setROI(roi_overrides_lower[image_file.lower()], roi_overrides['width'], roi_overrides['height'])
         selectedINI = tempINI
    else:
         raise Exception('Missing ROI override for ' + image_file)

Extracting Scores

Finally, we extract Key Performance Indicators (KPI), which are all in perceptual quality loss (QL) in units of just noticeable differences (JND).  This script is a bit long for this post, so view the source on Github if you are interested./

Here is the resulting set of calculated metrics in JSON format:

{ 'DeviceX': 
    { 'CL_QL': { '5000KLED_1000lux': 0.9142,
                 'TL84_100lux': 0.1803,
                 'Tung_10lux': 2.565},
      'CU_QL': 0.07498,
      'LCD_QL': 0,
      'LGD_QL': 0,
      'SFR_QL': { '5000KLED_1000lux': 0.0,
                  'TL84_100lux': 0.1969,
                  'Tung_10lux': 0.3946},
      'TB_QL': { '5000KLED_1000lux': 1.2,
                 'TL84_100lux': 6.25,
                 'Tung_10lux': 9.1},
      'VN_QL': { '5000KLED_1000lux': 1.113,
                 'TL84_100lux': 2.409,
                 'Tung_10lux': 8.531}},
      'Combined_QL': 11.0245
}

Once test procedures and combined score calculations are finalized by the IEEE Conformity Assessment Program, these outputs will be combined into a simple camera phone rating score.

The full python source code for this example is posted on GitHub.

To add these automation capabilities to your existing Imatest Master license, upgrade to Imatest Ultimate. You can also request a free 30-day trial of Imatest IT to see how this works for you before you purchase.

 

Related Webinars

Join us March 1 for Automating Lab and Manufacturing Processes: Defining image quality parameters on automated test equipment. Register now

]]>
https://www.imatest.com/2017/02/automating-cpiq-analysis-using-imatest-it-and-python/feed/ 0
Visual C++ Runtime Library: “The Application has requested the Runtime to terminate in an unusual way. “ https://www.imatest.com/2015/10/visual-c-runtime-library-the-application-has-requested-the-runtime-to-terminate-in-an-unusual-way/ https://www.imatest.com/2015/10/visual-c-runtime-library-the-application-has-requested-the-runtime-to-terminate-in-an-unusual-way/#comments Wed, 07 Oct 2015 16:27:21 +0000 http://www.imatest.com/?p=13808 Symptoms of problem:

Running the library leads to this error:

UnusualRuntime

 

Root cause of problem:

This error is typically the result of a conflict between the Microsoft Visual C++ Redistributables libraries supplied with MATLAB, and those that are supplied by some third party applications.

 

Solution to problem:

To revert to a previous version of the C++ Redistributable libraries, you should uninstall all versions of your current 2005 and 2008 C++ Redistributable libraries through your Windows Control Panel, and reboot you machine. You can then re-install them by running the MATLAB-provided installers which can be found in the following locations:

For 32-bit Imatest:

 C:\Program Files (x86)\MATLAB\MATLAB Compiler Runtime\v81\bin\win32\vc90\vcredist_x86.exe

For 64-bit Imatest:

C:\Program Files\MATLAB\MATLAB Compiler Runtime\v81\bin\win64\vc90\vcredist_x64.exe

Note: for older releaseses, a different matlab folder will be used, for example, v714 for releases 3.10 and below.

See Also:

]]>
https://www.imatest.com/2015/10/visual-c-runtime-library-the-application-has-requested-the-runtime-to-terminate-in-an-unusual-way/feed/ 2