 |
HALCON 6.1 Virtual Frame Grabber Interface |
This page provides the documentation of the HALCON
virtual frame grabber interface which allows reading images from file(s)
by using the regular operators of the HALCON frame grabber interface.
Registered
customers can download the
latest
revision of this interface from the
MVTec WWW server.
Revision: 2.7
Introduction
The HALCON virtual frame grabber interface
allows you to load images and image sequences from files by using
the regular frame grabber operators open_framegrabber,
grab_image, grab_image_async and
close_framegrabber.
Thus, you are able to test and debug your frame grabber application
without having installed a real frame grabber board in your computer.
All you have to do is to choose "File" in the parameter
Name of open_framegrabber and to give the proper
file name of the image(s) to be loaded in the parameter CameraType.
The CameraType parameter can be either the name of a
-
Single image: In this case every subsequent call of the operator
grab_image or grab_image_async will load this image
file. Note that the image name can either be given absolutely
(e.g., "C:\\MyImages\\MyPicture") or relatively to your
environment setting %HALCONIMAGES% (e.g., "MyPicture").
Furthermore, you can also choose to specify the full image name
(e.g., "MyPicture.tif") or you can omit the file extension
(e.g., "MyPicture"). In the latter case HALCON automatically
appends the usual file extensions of the supported image formats
(tiff, tif, jpg, jpeg, png, pbm, pnm, pgm, ppm, gif, bmp, pcx,
ras, ima, xwd).
-
Sequence file: A sequence file is a file which contains
in each line the name of a single image file. In this case the first
call of the operator grab_image or grab_image_async,
respectively, will load the first image file, the second call will load
the second one etc. In case of a failure loading an image an error
will be returned and the next call will load the succeeding file.
After the last entry in the sequence file has been reached
the next grab will start with the first image file again (looping).
Both the name of the sequence file as the image file names
within the sequence file can either be given absolutely
(e.g., "C:\\MyImages\\MySequence") or relatively to your
environment setting %HALCONIMAGES%. Usually, the sequence file has
the extension ".seq" (you can also omit to specify this file
extension). Note that you can query the actual file name of the
next image by calling get_framegrabber_param(...,'device',...).
-
Directory name: If you specify a valid directory name
in the parameter CameraType all files in this directory
with one of the supported image file extensions (tiff, tif, jpg,
jpeg, png, pbm, pnm, pgm, ppm, gif, bmp, pcx, ras, ima, xwd) are
used one after the other in the following calls of grab_image
or grab_image_async. In case of a failure loading an image an
error will be returned and the next grab will load the succeeding file.
After the grabbing of all available images the next grab
will start with the first image file again (looping). Note that
you can query the actual file name of the next image by calling
get_framegrabber_param(...,'device',...).
-
AVI file: Under Windows the virtual frame grabber interface
also provides reading video streams in AVI file format. In this case
the first call of the operator grab_image or
grab_image_async respectively, will load the first image
file, the second call will load the second one etc. After the last
frame of the AVI file has been reached the next grab will start with
the first frame again (looping).
The name of the AVI file can either be given absolutely
(e.g., "C:\\MyImages\\MyAVIFile") or relatively to your
environment setting %HALCONIMAGES%. The AVI file has
the extension ".avi" (you can also omit to specify this file
extension).
Examples for using the HALCON virtual frame grabber interface
can be found in the directories examples\hdevelop\Image\Framegrabber
and examples\hdevelop\Applications\FA. An example for a sequence file
can be found in %HALCONROOT%\images\pendulum\.
System Requirements
-
HALCON 6.1.1 or higher (note that this interface will
not work with HALCON 6.1.0!).
-
HALCON virtual frame grabber interface HFGFile.dll for
Windows systems (or parHFGFile.dll for use with Parallel HALCON)
or HFGFile.so for most UNIX systems, respectively.
Depending on your system architecture, this file should
reside either in bin\%ARCHITECTURE% (Windows) or in
lib/$ARCHITECTURE (UNIX systems) within the HALCON base directory
%HALCONROOT% you have chosen during the installation of HALCON.
Description
Parameters for
open_framegrabber():
|
Name
|
'File'
|
The name of the HALCON frame grabber interface.
|
|
HorizontalResolution
|
---
|
Ignored.
|
|
VerticalResolution
|
---
|
Ignored.
|
|
ImageWidth
|
---
|
Ignored.
|
|
ImageHeight
|
---
|
Ignored.
|
|
StartRow
|
---
|
Ignored.
|
|
StartColumn
|
---
|
Ignored.
|
|
Field
|
---
|
Ignored.
|
|
BitsPerChannel
|
---
|
Ignored.
|
|
ColorSpace
|
---
|
Ignored.
|
|
Gain
|
---
|
Ignored.
|
|
ExternalTrigger
|
---
|
Ignored.
|
|
CameraType
|
'filename'
|
The camera type parameter is used to specify the name of either a
single image file, an AVI file (Windows only!), a sequence file
containing the file names of a whole image sequence, or
a directory (see introduction above).
Default: 'fabrik'.
|
|
Device
|
---
|
Ignored.
|
|
Port
|
---
|
Ignored.
|
|
LineIn
|
---
|
Ignored.
|
|
Parameters for
set_framegrabber_param():
|
'frame_number'
|
|
number
|
|
AVI format only. The parameter sets the number of the next frame
to be grabbed by grab_image or grab_image_async.
|
|