acquire images and video from hardware -凯发k8网页登录
acquire images and video from hardware
since r2022a
description
the image acquisition explorer app provides a user interface to acquire images and video from cameras and frame grabbers.
using this app, you can:
preview live video data from your image acquisition hardware.
configure device-specific properties and acquisition settings such as video format, region of interest, and hardware trigger.
save image snapshot and video recording data to a file or to the matlab® workspace.
visualize and analyze saved data by launching image processing toolbox™ apps.
generate a matlab live script for app interactions that uses the
videoinput
interface.
open the image acquisition explorer app
matlab toolstrip: on the apps tab, under image processing and computer vision, click the app icon.
matlab command prompt: enter
imageacquisitionexplorer
.
examples
parameters
select camera file
— specify device configuration file
button
click this button to select a device configuration file, also known as a camera file or digitizer configuration format file, from your computer. some image acquisition devices use these files to store device configuration information. the app uses this file to determine the video format and other configuration information.
when you open the app, the rest of the app toolstrip is disabled until you select a camera file. you can change the camera file at any time.
note
the camera file is provided by the device manufacturer. see your device documentation for more information.
dependencies
this button is available only for devices that support camera files.
camera file
— name of camera file
selected camera file
this parameter is read-only.
this is the name of the camera file that you selected using the select camera file button. you can view the full file path by hovering your cursor over the file name.
dependencies
this parameter is available only for devices that support camera files.
video format
— video format
supported video formats
select the video format used by the device to capture images and video. the list of values for this parameter depends on the video formats supported by your device. the format selected when you open the app is the device's default format.
dependencies
this parameter is available only for devices that support video format.
color space
— color space used in matlab
grayscale
| rgb
| ycbcr
| bayer
select the color space that the app uses when it returns image data. the list of values for this parameter depends on the video format selected.
if you select grayscale
, you can set the
colormap and color limits parameters.
color limit — toggle this switch to manual to set the minimum and maximum values on the specified colormap. the default values are 0 and 255. all values in the preview that are less than or equal to the minimum value map to the lowest value of the colormap. all values in the preview that are greater than or equal to the maximum value map to the highest value of the colormap.
colormap — colormap applied to the preview. for a full list of options, see .
if you select bayer
, you can set the sensor
alignment parameter.
sensor alignment
— sensor alignment for bayer demosaicing
grbg
(default) | gbrg
| rggb
| bggr
select the 2-by-2 pixel bayer color filter array pattern of the bayer color filter array. the specified pattern is used to convert the bayer pattern image to rgb. there are four possible sensor alignments. for more information about which one to select, refer to your device documentation.
value | description |
---|---|
gbrg | the 2-by-2 sensor alignment is green blue red green |
grbg | the 2-by-2 sensor alignment is green red blue green |
bggr | the 2-by-2 sensor alignment is blue green green red |
rggb | the 2-by-2 sensor alignment is red green green blue |
dependencies
this parameter is enabled only if your device supports bayer sensor alignment and
color space is set to bayer
.
image
— specify image file or workspace variable name to log snapshot data
valid file name | valid variable name
edit the name of the image file or name of the workspace variable to save snapshot image data as.
if you select the file option, this parameter defines the image file name. you can click the configuration icon next to this parameter for additional settings, including the file location to save to and file format to save as.
if you select the workspace variable option, this parameter defines the workspace variable name.
when you click the capture button, the snapshot image data is saved as the specified file or workspace variable.
for more information, see log data in image acquisition explorer.
video
— specify video file or workspace variable name to log recorded data
valid file name | valid variable name
edit the name of the video file or name of the workspace variable to save recorded data as.
if you select the file option, this parameter defines the video file name. you can click the configuration icon next to this parameter for additional settings, including the file location to save to and file format to save as.
if you select the workspace variable option, this parameter defines the workspace variable name.
when you click the record button, the recorded data is saved as the specified file or workspace variable.
for more information, see log data in image acquisition explorer.
capture
— take image snapshot
button
click this button to immediately capture a single image frame and save it as an image file or as a workspace variable, depending on your selection of file or workspace variable in the logging section. for more information, see capture image snapshot.
finite
— select finite recording option
button
set the recording mode as finite and specify the number of frames or seconds to save when you click the record button. when you select this option, you have two options for finite recording.
specify the number of
frame(s)
to record. for more information, see record finite number of frames.specify the number of
second(s)
to record. for more information, see record for finite duration.
continuous
— select continuous recording option
button
set the recording mode as continuous to start saving frames when you click the record button. for more information, see record continuously.
hardware trigger
— select hardware triggered recording option
button
set the recording mode as hardware trigger. hardware triggered acquisition is supported for gige vision® and genicam™ gentl devices. when you select this option, the app opens a hardware trigger tab. you can define the following hardware trigger parameters.
number of triggers
frames per trigger
trigger source
trigger condition
if you are using this recording mode, make sure you
also enable hardware triggered acquisition in the device properties
by setting trigger mode to on
and
specifying other trigger selector parameters for your setup.
for more information, see and record with hardware trigger.
dependencies
this parameter is enabled only if your device supports hardware triggered acquisition.
record
— record video
button
click this button to acquire multiple frames and save them as a video file or as a workspace variable, depending on your selection of file or workspace variable in the logging section. this button becomes a stop button after you click it. end recording at any time and save the recorded data by clicking stop.
while you are recording, the app toolstrip and all property tabs are disabled. you can not change the value of any parameters during recording.
for more information, see record video.
image viewer
— view captured snapshot in image viewer app
button
click this button to launch the image viewer app and send it the most recent image data captured in this app session.
you must have image processing toolbox installed to use the image viewer app.
video viewer
— view recorded video in video viewer app
button
click this button to launch the video viewer app and send it the most recent video data recorded in this app session.
you must have image processing toolbox installed to use the video viewer app.
color thresholder
— view captured snapshot in color thresholder app
button
click this button to launch the color thresholder app and send it the most recent image data captured in this app session.
you must have image processing toolbox installed to use the color thresholder app.
export
— export matlab code
generate snapshot script
| generate record script
click this button to select an option to generate a matlab live script for capturing a snapshot or recording a video and open it in the live editor. the live script contains code for the current device configuration, as specified in the configure format section, and code for saving data as a file or workspace variable, as specified in the logging section.
for more information, see .
version history
introduced in r2022a
see also
functions
matlab 命令
您点击的链接对应于以下 matlab 命令:
请在 matlab 命令行窗口中直接输入以执行命令。web 浏览器不支持 matlab 命令。
select a web site
choose a web site to get translated content where available and see local events and offers. based on your location, we recommend that you select: .
you can also select a web site from the following list:
how to get best site performance
select the china site (in chinese or english) for best site performance. other mathworks country sites are not optimized for visits from your location.
americas
- (español)
- (english)
- (english)
europe
- (english)
- (english)
- (deutsch)
- (español)
- (english)
- (français)
- (english)
- (italiano)
- (english)
- (english)
- (english)
- (deutsch)
- (english)
- (english)
- switzerland
- (english)
asia pacific
- (english)
- (english)
- (english)
- 中国
- (日本語)
- (한국어)