From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting Camera Attributes in MATLAB using the PCI-1428 Frame Grabber

Hi,
 
I am trying to acquire an image through MATLAB's Image Acquisition Toolbox using a PULNIX camera connected to a National Instruments PCI-1428 Frame Grabber Board.  I have been successfull in obtaining an image; however I would like to also set some specific camera attributes for taking the image (exposure time, gain, etc) which I am unable to do.  I can view and set camera attributes through the National Instruments Measurement and Automation Software; however, when trying to set any 'device specific properties' within MATLAB's Image Acquisition Toolbox I am only getting what I believe are settings for the Frame Grabber board.
 
The specifications of my hardware, software and drivers are as follows:
 
Frame Grabber Board: National Instruments PCI-1428
Camera: PULNIX 1400CL
MATLAB Version: 2008a
MATLAB Image Acquisition Toolbox Version: 3.1
NI-IMAQ version: 4.0
 
The 'device specific properties' I obtain when using the 'get(getselectedsource(object))' command in MATLAB are as follows:
 
General Settings:
    Parent = [1x1 videoinput]
    Selected = on
    SourceName = Channel 0
    Tag =
    Type = videosource
  Device Specific Properties:
    AcquisitionDoneDriveLine = none
    AcquisitionDoneDrivePolarity = activeHigh
    AcquisitionInProgressDriveLine = none
    AcquisitionInProgressDrivePolarity = activeHigh
    FrameDoneDriveLine = none
    FrameDoneDrivePolarity = activeHigh
    FrameStartDriveLine = none
    FrameStartDrivePolarity = activeHigh
    HSyncDriveLine = none
    HSyncDrivePolarity = activeHigh
    VSyncDriveLine = none
    VSyncDrivePolarity = activeHigh
 
Can I somehow set camera attributes from MATLAB? (Specifically exposure time and gain)
 
Or, is there a way to setup my configuration within the National Instruments Measurement & Automation Software and then export this configuration to MATLAB?
 
I know this may not be a National Instruments issue but any help or redirection would be appreciated.
 
Many thanks,
 
Tom
 

 
 
 
0 Kudos
Message 1 of 2
(4,315 Views)
Dear Tom,

I cannot speak personally to using MATLAB's Image Acquisition Toolbox to return camera attributes, and MathWorks would be better equipped to help you with setting camera attributes using their toolbox. There are alternatives, on being the use of IMAQ library C function calls. See this post: Matlab can't see my NI-IMAQ PCI/PXI - 1428

If you can make C function calls in MATLAB, then you can refer to the NI IMAQ Function Reference help file to find the functions to get and set camera attributes using the IMAQ driver.

The IMAQ driver looks to a camera file (.icd) specific to your camera and usually supplied by your camera manufacturer to determine available camera attributes, ranges, and valid values for those attributes. Though it would be a rather brute force method, you could always parse this file to find specific values and then programatically replace them using text file read/write and string functions before starting your acquisition.

See this KnowledgeBase for more information:

Setting My Camera Attributes Programmatically Does Not Permanently Change the Attributes
http://digital.ni.com/public.nsf/allkb/09794AF61D4CE35286256DBA0075150A?OpenDocument


Best Regards,

Nate
0 Kudos
Message 2 of 2
(4,291 Views)