How do I use a JAI USB3 Vision camera with Matlab?

Solution

This is a guide on how to interface with JAI cameras in Matlab.

Make sure to use the JAI SDK, not the eBUS SDK with this guide.
For USB cameras, see also Issue: Matlab does not find any JAI USB devices.

Related Article: 

Mathworks have an article about interfacing on their home page: http://www.mathworks.com/help/imaq/genicam-gentl-hardware.html

Requirements:

  • Matlab 2018a or higher. (Lower may not work for all customers)
    • Extension for matlab
      Image Acquisition Toolbox
      Image Acquisition Toolbox Support package for GenICam Interface
      Image Acquisition Toolbox Support package for GigE Vision Hardware
  • JAI SDK https://www.jai.com/support-software/jai-software

Step by step guide: 

  1. Install the requirements
  2. Add environment variable GENICAM_GENTL32_PATH or GENICAM_GENTL64_PATH depending if your system is 32 or 64 bit, and set its value to "C:\Program Files\JAI\SDK\bin" (assuming JAI SDK is installed in "C:\Program Files"). The path can be added like this:

    • From Start -> Run (or "Windows key"+"R"), execute "sysdm.cpl". This will open the System Properties dialog.
    • From the "advanced" tab, click the "Environment Variables" button. This will open the dialog, where you can enter the system variable.
  3. Restart Matlab if open.

  4. Verify that the adaptors are loaded, Both Gentl and GigE is load in this example
    imaqhwinfo

    ans =
    struct with fields:
    InstalledAdaptors: {'gentl' 'gige'}
    MATLABVersion: '23.2 (R2023b)'
    ToolboxName: 'Image Acquisition Toolbox'
    ToolboxVersion: '23.2 (R2023b)'
  5. Add "C:\Program Files\JAI\SDK\bin" to Matlab path.
    path(path, 'C:\Program Files\JAI\SDK\bin')
  6. Check if the cameras are able to connect
    imaqsupport
    Generating diagnostic information ...

    In the File: imaqsupport.txt you should see something like this

    ...
    ----------GENTL ADAPTOR----------
    Adaptor Name: gentl
    Adaptor DLL: C:\ProgramData\MATLAB\SupportPackages\R2023b\toolbox\imaq\supportpackages\gentl\adaptor\win64\mwgentlimaq.dll

    IMAQHWINFO:
    AdaptorDllName: 'C:\ProgramData\MATLAB\SupportPackages\R2023b\toolbox\imaq\supportpackages\gentl\adaptor\win64\mwgentlimaq.dll'
    AdaptorDllVersion: '23.2 (R2023b)'
    AdaptorName: 'gentl'
    DeviceIDs: {[1] [2]}
    DeviceInfo: [1×2 struct]

    Available Devices:

    Device Name: GOX-24505C-PGE
    Device ID: 1
    Device File Supported: 0
    Default Format: BayerRG8
    Supported Formats:
    {'BayerRG10' }
    {'BayerRG12' }
    {'BayerRG8' }
    {'RGB10V1Packed'}
    {'RGB10p32' }
    {'RGB8' }

    Device Name: JAI Ltd., Japan GO-5000M-USB (14FB00A7A25A)
    Device ID: 2
    Device File Supported: 0
    Default Format: Mono8
    Supported Formats:
    {'Mono10'}
    {'Mono12'}
    {'Mono8' }
    ...
  7.  Now you should be able to open Image Acquisition Explorer and connect to the a JAI camera

 

Issue: Matlab does not find any JAI USB devices

If eBUS SDK is installed, the driver used is most likely a USB3 Vision, this driver doesn't work with Matlab.

Solution:

Uninstall the eBUS SDK and restart the computer. Verify that the camera has the correct driver using the JAI Control Tool. If you see a "USB" and not a "USB <Full name of the camera>", the please install the driver with the control tool

  Once the driver is install and you can start Acquisition from the JAI Control Tool, then Matlab should be able to find it. Now you should be able to follow step 4 to 7 in the Step by Step Guide above

 

Revision note:

Date Comment
17/03/2018 Some customer didn't success in Matlab 2012b by above setting, but it worked after update Matlab to 2018a.
01/06/2023

Added Package requirements for Matlab needed to interface with GigE and GenICam

25/10/2023

eBUS SDK USB3 vision driver cannot be open with Matlab. Uninstalling is recommended.

 

 

 

Have more questions? Submit a request

3 Comments

  • 0
    Avatar
    Koko Den

    Information update: Some customer didn't success in Matlab 2012b by above setting, but it worked after update Matlab to 2018a.

  • 0
    Avatar
    Phuong Luong

    Could you please tell me how to connect Jai USB 3 Vision interface and Matlab? I followed instructions written above but no success. Matlab always display " no devices were detected " although i have installed "Gentl " and "Gige" adaptors and Jai DSK. I am using Matlab 2019a  and a Jai USV 3 Vision (model GO-5000M-USB serial 502062).

    Thank you for your help!

  • 0
    Avatar
    Roger Lin

    Was able to get it working with Go-5000c-usb and SP-20000C-USB for version R2023a. After performing the steps outlined above will also need to click on don't see your device on the top left of Image Acquisition Explorer. Select the add on to add support packages for Genicam Interface. 

    Edited by Roger Lin
Please sign in to leave a comment.