Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving Pattern matching information to an array

I am using imaqLearnPattern function to create a template image. According the IMAQ documentation, the pattern matching information is "appended" to the image. But when I try to call the imaqImageToArray function on this template image, it does not give me any pattern matching information. Is there any way, that I can save the template data into an array? I do not want to use the imaqWriteVisionFile function because I want the data in an array format and not saved in a file.
Thanks.
0 Kudos
Message 1 of 3
(3,161 Views)
I don't think there is any way to store the pattern matching information without using the imaqWriteVisionFile command.

Your options are to use this command, or regenerate the information each time you load the bitmap.

Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 3
(3,161 Views)
Normally you cannot save this information without this function. This information saved in *.png file. This format have a possibilities for saving "user data", and this fact used by IMAQ Vision. Theoretically you can extract this information from *.png into array (format of png is a well known format), but what can you do with this information afterwards? You cannot load this information separately without IMAQ Read Image and Vision Info.vi, because (pretty sure) this function allocated memory for Vision Info before loading, but you not able to do this. You can make this only if you know internal representation of IMAQ image in memory. How organized common parameters, such as width, height, pixel pointer, resolution, linewidth - not very complicated (IMAQ Image -
a cluster of string and pointer to appropriate structure), but where placed vision info - not very easy.
Better, fastest and easyest way - to use IMAQ Write Image and Vision Info.vi.

with best regards
0 Kudos
Message 3 of 3
(3,161 Views)