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
- Extension for matlab
- JAI SDK https://www.jai.com/support-software/jai-software
Step by step guide:
- Install the requirements
-
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.
-
Restart Matlab if open.
- 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)' - Add "C:\Program Files\JAI\SDK\bin" to Matlab path.
path(path, 'C:\Program Files\JAI\SDK\bin')
- 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' }
... - 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. |
|
3 Comments