May 24, 2005
Copyright © 2005 by Matrox Electronic Systems Ltd. All rights reserved.
The Matrox Imaging ActiveX Controls (ActiveMIL) are a collection of ActiveX controls encapsulating an extensive set of optimized image processing operations (point-to-point, statistics, filtering, morphology and geometric transforms), blob analysis, code reading and writing, edge analysis, pattern matching, measurement, calibration, and character recognition.
The following tables outline the combinations of operating systems, development environments, and Matrox Imaging hardware supported by ActiveMIL.
Operating System / Development Environments
Windows XP | Windows 2000 | |
Microsoft Visual Studio .NET | Yes | Yes |
*Other development environments, and other
operating systems are not officially supported by Matrox.
Operating System / Matrox Imaging Hardware
Windows XP | Windows 2000 | |
Matrox Meteor-II/Standard | Yes | Yes |
Matrox Meteor-II/Multi-Channel | Yes | Yes |
Matrox Meteor-II/1394 | Yes | Yes |
Matrox Meteor-II/Digital | Yes | Yes |
Matrox Meteor-II/Camera Link | Yes | Yes |
Matrox Genesis | Yes | Yes |
Matrox Genesis-LC | Yes | Yes |
Matrox Orion | Yes | Yes |
Matrox Corona-II | Yes | Yes |
Matrox CronosPlus | Yes | Yes |
Matrox Helios New | Yes | Yes |
Matrox Morphis New | Yes | Yes |
Matrox Solios New | Yes | Yes |
Matrox Odyssey* New | Yes | Yes |
Matrox Iris New | No | No |
* Multiple processing is not supported on Matrox Odyssey with this
release.
Note that Matrox Cronos, Matrox Pulsar-LC, Matrox Pulsar, Matrox Meteor, Matrox
Corona-LC and Matrox Corona are no longer supported.
Some ActiveMIL-Lite controls have allocation properties that can now be set to amilDefault (ActiveMILDefaultConstants). By doing so, the property will be set to the value specified in MILConfig.
The new LoadStream method, SaveStream method, and StreamSize property, added to the controls listed below, support the writing of the stream to a single file.
Multiple results can be inquired with a single call to the Results.GetMultiple
method.
Look for Results.GetMultiple in the following controls:
The API of UserBits has been completely redesigned:
Added support for recursive Infinite Impulse Response (IIR) filtering as a predefined kernel:
Added support for drawing multiple items at once:
Added support for minimum and maximum LUT pixel values in the following controls:
Wrapper class support is being phased out. Native COM is the only way to use ActiveMIL with Visual C++. For information on how to convert your project to Native COM, refer to the 'Using ActiveMIL with Microsoft Visual C++ (Native COM)' chapter in the ActiveMIL User Guide.
The new properties available for the Application control are:
- AvailabelSystems.Item.SystemDescriptor property
- AvailabelSystems.Item.SystemName property
- NonPagedMemory property
- ResultsValidation property
- Timer.SynchronizationMode property
- Version property
SaveRunInformationEnabled returns or sets whether to save run information.
The Calibration control requires an OwnerSystem on which to allocate its resources. Use the OwnerSystem or the OwnerSystemName property to modify you current applications, otherwise they will not run.
- Results.Strings.Item.Length returns the length of the resulting string.
- The search angle range has been widened.
- Added support for the following code types:
- codeCompositeCode
- codeCode93
- codeEAN8
- codeMicroPDF417
- codePharmaCode
- codeQRCode
- codeRSSCode
- Added quality estimation:
Use the VerifyCode method to verify if the code quality meets your standards. The verification results are returned in the properties of the Results.VerificationGrade property.
- You can increase the decoding speed or the accuracy by modifying the following features:
- ScanlineHeight property
- ScanlineStep property
- SubType property
- Timeout property
- Added support for camera locking:
- CameraLock event
- CameraLockEvent property
- CameraLockSensitivity property
- CameraUnlockSensitivity property
- Added support for camera presence:
- CameraPresent event
- CameraPresentEvent property
- IsCameraPresent property
- Added support for exposure signals format:
- Exposure1Format property
- Exposure2Format property
- Added support for line events:
- GrabLine event
- GrabLineEvent property
- GrabLineEnd event
- GrabLineEndEvent property
- Added support for synchronization of two digitizers:
- SynchronizeOnGrabEnd property
- SynchronizeOnGrabStart property
- Added support for grabbing:
- GrabAbort method
- GrabContinuousEndTrigger property
- GrabPeriod property
- UseVoltageReference property
- Added support for multiple buffering:
- MultipleBuffering property
- ProcessModifiedImage event
- Other new properties:
- Bayer property
- InputFilter property
- TriggerFormat property
The new methods and properties available for the Display control are:
- ClearOverlay method
- CenterDisplay property
- FillDisplay property
- InterpolationMode property
- NoTearing property
- SelectedLUT property
- Added support for new extraction filters:
- ExtractionFilter.Kernel property
- ExtractionFilter.Mode property
- ExtractionFilter.OverscanType property
- ExtractionFilter.OverscanValue property
- ExtractionFilter.Power property
- ExtractionScale property
- Added support for timeout:
- Timeout property
- Results.TimeoutEnd property
- Added support for getting vertices’ corresponding edge or edgels, in a chain approximation:
- Results.Item.Vertices.Item.ChainIndex property
- Results.Item.Vertices.Item.EdgelIndex property
- Added support to get the width and height of the image from which the edges were extracted:
- Results.SizeX property
- Results.SizeY property
- Added support for new edge features:
- Circle
- FeatureList.CircleFit property
- Results.Item.CircleFitCenterX property
- Results.Item.CircleFitCenterY property
- Results.Item.CircleFitCoverage property
- Results.Item.CircleFitError property
- Results.Item.CircleFitRadius property
- Ellipse
- FeatureList.EllipseFit property
- Results.Item.EllipseFitCenterX property
- Results.Item.EllipseFitCenterY property
- Results.Item.EllipseFitMajorAxis property
- Results.Item.EllipseFitMinorAxis property
- Results.Item.EllipseFitAngle property
- Results.Item.EllipseFitError property
- Results.Item.EllipseFitCoverage property
- Line
- FeatureList.LineFit property
- Results.Item.LineFitA property
- Results.Item.LineFitB property
- Results.Item.LineFitC property
- Results.Item.LineFitError property
- Added support for moment elongation angle:
- FeatureList.MomentElongationAngle property
- FeatureList.GeneralFeret.RelativeToMomentElongationAngle property
- Results.Item.MomentElongationAngle property
- Other new methods and properties:
- FillGapParameters.Candidate property
- ModificationCount property
- NearestNeighbors property
- PutEdgeResults method
- Results.CalculateStat method
- Results.Put method
- The new properties available for the GraphicContext control are:
- LineSegments property
- Dots property
- Added support for overscaning:
- AllocationOverscanSize property
- FastOverscanEnabled property
- Added support for minimum and maximum pixel value:
- MinimumPixelValue property
- MaximumPixelValue property
- Added support for memory mapping and location:
- MappingToHostMemoryEnabled property
- OnBoardMemoryLocation property
- Other new methods and properties:
- ChildRegion.Move method
- GammaCorrectionExponents property
- Added support for statistics:
- CalculateStats method
- Results.Stats property
- The WaterShed method has changed to use a new improved and faster internal algorithm.
To apply the old algorithm, set the WaterShedAlgorithm property to impMethod2.
- impMethod1 (Default) : new watershed method; faster and highly recommended.
- impMethod2 : old watershed method.
Measurement Control
- The following search region box properties have been added to the Results.Item, Results.Item.Edge1, and Results.Item.Edge2 properties:
- Results.Item.BoxCornerBottomLeftX property
- Results.Item.BoxCornerBottomLeftY property
- Results.Item.BoxCornerBottomRightX property
- Results.Item.BoxCornerBottomRightY property
- Results.Item.BoxCornerTopLeftX property
- Results.Item.BoxCornerTopLeftY property
- Results.Item.BoxCornerTopRightX property
- Results.Item.BoxCornerTopRightY property
- * Also applies to Results.Item.Edge1 and Results.Item.Edge2 *
- Added support for filtering mode:
- FilterMode property
- KernelDepth property
- KernelWidth property
- Added support for new model types:
- Models.AddFromMerge method
- Models.AddFromResult method
- Models.AddDiamondModel method
- Models.AddTriangleModel method
- Models.Item.SyntheticDefinition.Diamond property
- Models.Item.SyntheticDefinition.Triangle property
- Added support for determining the parameters used when drawing a model:
- Models.Item.DrawingParameters property
- Results.DrawingParameters property
- Added support for returning the angle of the chained edgel:
- Models.Item.Chains.Item.Edgels.Item.Angle property
- Results.Item.ModelChains.Item.Edgels.Item.Angle property
- Results.TargetChains.Item.Edgels.Item.Angle property
- Results.Item.TargetChains.Item.Edgels.Item.Angle property
- Results.Item.ModelChains.Item.Edgels.Item.Angle property
- Added image definition settings:
- Models.Item.ImageDefinition.DataDepth
- Models.Item.ImageDefinition.DataType
- Models.Item.ImageDefinition.NumberOfBands
- Other new methods and properties:
- UndoPreprocessing method
- Models.ItemAtLabel property
- Models.LastLevel property
- Models.SearchPositionEnabled property
- Results.ModelAdditionCompatible property
- Results.TimeOutEnd property
- SearchMode property returns or sets the search mode when the MultipleModelMode property is set to true.
- The Results.Get method has a new ResultType: patModelIndex. This ResultType returns the indices of the occurrences.
- Added support for overscanning:
- AllocationOverscanSize property
- FastOverscanImage property
- Added support for serial ports:
- SerialPorts property
- SerialPortData event
- Added support for asynchronous function:
- AsynchronousCallSupport property
- Added support for multithreading
- MultithreadSupport property
- Other new properties:
- NumberofCRTControllers property
- SystemDescriptor property
- SystemName property
- WatchDog property
[Contents]The new threading control allows you to allocate ActiveMIL thread contexts and synchronization events.
Use the threading control to allocate a selectable thread on a specified multi-threaded ActiveMIL system.
This allows you to synchronize the execution of ActiveMIL calls on an on-board processor.
This section contains important information for users upgrading to ActiveMIL 8.0.
After the installation of ActiveMIL 8.0, open your project in your development environment and compile it.
The variant parameter of the following methods should be changed to a VARIANT* using the '&' operator. If you do not make this change and call one of the methods listed below, a compilation error will inform you that there is no conversion between VARIANT and VARIANT*. Affected methods are:
The new Threading control replaced the Application.ControlThread method. The Threading control allows you to allocate ActiveMIL thread contexts and events that help you synchronize the execution of ActiveMIL calls.
The CalibrationPoints.RemoveAll method is no longer supported. Instead, use the CalibrationPoints.Remove method with the Index set to calAll.
The following digitizer properties are not supported anymore:
The following properties are no longer a Long expression. They have been changed to a Double expression:
The following properties are no longer a Long expression. They have been changed to a Double expression:
The X and Y parameters of the Pan and Zoom methods have also been changed to a Double. Note that negative numbers are no longer supported. You should use decimal values to zoom out.
The following display properties are not supported anymore:
You can now use the method Results.Get with an index or a label value.
The Control method has the following modifications:
The Picture property is no longer supported since it cannot be used in Visual Basic.Net.
The new OverscanMode parameter, allowing you to enable or disable overscanning, has been added to the following methods:
The WarpParameters.WarpLUT.Get method has 2 new parameters:
The Watershed method has 2 new parameters:
The number of parameters of the method Models.AddEdgeModel has increased. Four "double" optional parameters (OffsetX, OffsetY, SizeX, SizeY) were added to specify a region of EdgeFinder Results to be used as a new model. Applications using this method in Visual Basic .NET 2003 or in Visual Basic 6.0 only need to be recompiled. For Visual C++ applications, these parameters need to be added in the code before recompilation since optional parameters are not supported.
The Models.Item.SearchRegion property has been replaced with Models.Item.Position properties. The old Models.Item.SearchRegion property was misleading in giving the impression that a child region was extracted, when in fact, it was defining a region in witch the model position was expected to be found. For this reason, it has been replaced.
FindOrientation method and patOrientation model type (Models.Item.ModelType
property) are no longer supported. Note that searching at an angle (with or
without patCircularOverscan) is still fully supported
This affects the following properties and functions:
Models.Item.ExportDontCareImage and Models.Item.ExportImage methods are no longer supported. Use the Models.Item.Draw method with patDrawDontCares or patDrawImage instead.
The properties GrabInDisplay.LiveGrabNoTearing and GrabInDisplay.LastGrabInTrueImage were moved to the digitizer.
The following properties are no longer a String expression:
The following properties are not supported anymore:
Refer to the 'Using ActiveMIL with Microsoft Visual C++ (Native COM)' chapter in the ActiveMIL User Guide for an explanation on how to convert an existing project using wrapper classes to use Native COM.
If you have no choice but to continue working in these environments, add the Wizard and AddIns to your IDE by doing the following (note that it is not officially supported):
Visual Studio 6.0
Visual Basic 6.0
The new Matrox imaging CronosPlus is now supported.
The Models.Item.Chains.Item.Pixels property has been renamed to the Models.Item.Chains.Item.Edgels property. Subsequently, a collection of edgels refers to a collection of ModelFinderEdgel objects. These changes were made to be more precise and to be consistent with the new EdgeFinder control. Programs that were build with the old names do not require a recompilation. However, if you modify your code, failure to make the name change will result in compilation errors.
Angular search is no longer supported on the Matrox Genesis.
The complete on-line documentation provided with ActiveMIL can be found under Start\All Programs\Matrox Imaging\ActiveMIL\Documentation\ActiveMIL Help. The documentation contains five majors sections:
Refer to the 'Distribution and licensing' chapter in the ActiveMIL User Guide.
Note for Visual Basic Users:
We do not provide dependency files (DEP files) for use with Visual Basic's setup wizard because this tool does not allow for the installation of Matrox frame grabber drivers.
The following sources should be checked for additional information when it is needed:
This section contains information specific to a given development environment. Although ActiveMIL strives to be environment-independent, each environment is implemented differently and this sometimes causes problems for ActiveMIL.
Note: You must have at least Visual Studio .NET 2003 with Microsoft .NET Framework 1.1 Service Pack 1 (SP1).The procedure for starting a new ActiveMIL C++ project under Visual Studio .NET is similar to the procedure for Visual C++ 6.0. For more information, please refer to the 'Using the MFC Application template to create an application (Visual C++)' section in the 'Introduction' chapter and to the 'Using the ActiveMIL MFC Application template to create an application (Visual C++)' chapter in the ActiveMIL User.
Known bugs
Using arrays more efficiently
The marshalling of arrays between the Microsoft .NET managed environment and the ActiveMIL controls can be time consuming. This is because arrays are not passed directly to the ActiveMIL controls. Instead, arrays are copied to unmanaged memory, a call to ActiveMIL is made, and then the arrays are copied back to managed memory. To avoid all this copying, ActiveMIL provides the MArrayRef class. Arrays wrapped in an object of this type are passed directly. The following table shows approximate timings*:
Normal | MArrayRef | Ratio | ||
---|---|---|---|---|
one band | Image.Get | 18 ms | 1 ms | 18 times better |
Image.Put | 13 ms | 1 ms | 13 times better | |
all bands | Image.Get | 168 ms | 2 ms | 84 times better |
Image.Put | 94 ms | 2 ms | 47 times better |
This class is included in the Matrox.ActiveMIL.Utility.dll assembly, found in the "Matrox Imaging\ActiveMil\Containers\VStudio.NET" directory of the Matrox Imaging installation CD.
Example of usage:
// Visual Basic .NET example ' Normal array declaration Dim Array(AxMImage1.SizeX, AxMImage1.SizeY) As Byte ' The array is wrapped in a MArrayRef class before passing. This pins ' the array memory so that the garbage collector does not move it. Dim ArrayRef As MArrayRef = New Matrox.ActiveMIL.Utility.MArrayRef(Array) ' When calling the ActiveMIL method, the MArrayRef.GetSafeArray method must be used AxMImage1.Get(ArrayRef.GetSafeArray(), ImFormatConstants.imFormatDefault, _ ImBandConstants.imAllBands, 0, 0, AxMImage1.SizeX, AxMImage1.SizeY) ' After the call is made, you can call the Dispose function to unpin the array memory. ' If Dispose is not called, the array will get unpinned when the MArrayRef object ' gets collected by the garbage collector. ArrayRef.Dispose()
Known bugs
An unhandled exception of type 'System.ExecutionEngineException' occurred in custommarshalers.dll
If you get this error, use a For...Next statement as a workaround.
This section describes any limitations, or problems that exist in the current ActiveMIL release. The tags [VB.NET] and [VC] implly that the note only applies to Visual Basic or Visual C++, respectively. If the tag is followed by a number, the note is specific to that version of the development environment. If there is no tag, the note applies to all development environments.
Models loaded from a file
1394 camera format 7
[VB.NET]
Const M_1394_BANDWIDTH_FLAG = &H800 Public Function M_1394_BANDWIDTH(ByVal percent As Integer) As Integer If (percent > 0) And (percent <= 100) Then Return (M_1394_BANDWIDTH_FLAG Or percent) Else Throw New System.Exception("invalid bandwidth value") End If End Function AxMDigitizer1.InitializationFlag = M_1394_BANDWIDTH(10)
[VC]
#define M_1394_BANDWIDTH_FLAG 0x00000800L #define M_1394_BANDWIDTH(percent) ( (((long) percent > 0) && ((long) percent <= 100)) ? (M_1394_BANDWIDTH_FLAG | ((long) percent)) : 0 ) m_Digitizer1->InitializationFlag = M_1394_BANDWIDTH(10);
Models.SearchPositionEnabled
[VB.NET] ActiveMIL controls dropped on a .NET form will be visible at runtime, unless you set the Visible property to false.
On certain systems, stopping your debugging process by pressing the Stop-Debugging button or by using the keyboard shortcut Shift-F5 while your Dialog or Form is open, causes the control to stay in an error state at design-time. To correct the situation, close the Dialog or Form and re-open it.
[VB.NET] For all properties that refer to another ActiveMIL control (for example, the Image property of the Digitizer control). you can use the Visual Basic Nothing statement to confirm that the property is not currently associated with a control.