| Article ID: | T35 |
| Date: | 6/3/99 |
| Product: | Vision Guide 2.x (all versions) |
| OS: | Windows NT 4.0 |
| Problem: | How to store images for later retrieval and analysis |
For some applications, you may need store
images for later retrieval and analysis.
For example, scan a part with a
mobile camera, taking pictures at various positions, then allow the part to
move on while analyzing the images with Vision Guide tools.
Here are the
basic steps:
Here are two examples, one using SPEL and
the other using VB Guide.
Using SPEL
imgFile$(1)="c:\temp\image1.mim"
imgFile$(2)="c:\temp\image2.mim"
imgFile$(3)="c:\temp\image3.mim"
' Store the images from a blank sequence called "SnapShot"
For i=1 To
3
Jump Pi
' Takes ~90
ms for the VRun and VSaveImage
VRun SnapShot
VSaveImage SnapShot, imgFile$(i)
Next i
' Search the images later using the sequence called "Search"
' by first
loading the images from disk
For i=1 To 3
'
Takes ~75 ms for VSet ImageFile
VSet
Search.ImageFile, imgFile$(i)
VRun Search
' Get results here
VGet
.....
Next i
Using VB Guide
imgFile$(1)="c:\temp\image1.mim"
imgFile$(2)="c:\temp\image2.mim"
imgFile$(3)="c:\temp\image3.mim"
'
Store the images ' from a blank sequence called "SnapShot"
With
SPELCom1
For i=1 To 3
.Jump i
' Takes ~67 ms for the VRun and
VSaveImage
.VRun
"SnapShot"
.VSaveImage
"SnapShot", imgFile$(i)
Next i
End With
Search the images later using the sequence called "Search"
' by
first loading the images from disk
With SPELCom1
For i=1 to 3
Takes ~33 ms for VSet ImageFile
.VSet "Search", "",
"ImageFile", imgFile$(i)
.VRun "Search"
' Get results here
.VGet .....
Next I
End With
