Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

imaqReadCustomData(..) failed

Solved!
Go to solution

I am trying to read data matrix, by using the sample code in CVI2012. Instead of runing the source code, I created a new project, loaded one sample image (data matrix) , tried to get data matrix setting, but failed.

 

I don't know why the source code can successfully get this setting, but I cannot. The only difference is that I read just one image, instead of all the sample images one time. Cat Frustrated

 

Checked the help file, found the description for function (imaqReadCustomData) is very poor noted.

 

Left is the error message shown. Capture.PNG

 

Can someone show me what is the problem?

 

Thank you very much. 

0 Kudos
Message 1 of 4
(4,536 Views)

Supplement Info:

 

1) Had an image, 1.png, for example, I can read data matrix in NI Vision Assistant 2012;

2) Using imaqWiteFile(..) to save 1.png to 1.bmp, try 1.bmp in NI Vision Assistant, I can read the data matrix also;

3) Use imaqReadFile(..) to load file 1.bmp in my code, When it runs to imaqReadCustomerData(..) it will failed;

4) Use imaqReadVisionFile(..) to load 1.png, it works well.

 

Don't know why, does it any limit in read data matrix, for example, only support *.png image file?

 

Please help.

0 Kudos
Message 2 of 4
(4,526 Views)
Solution
Accepted by yuzaihuan

Hi,

 

Based on your findings you are facing issues with using imaqReadCustomData and not with imaqReadDataMatrixBarcode API.

 

imaqReadCustomData is used for reading custom data (ROI, cluster of parameters or anything) from NI Vision image. Only png files are supported for writing and reading the custom data to/from disk.

 

If you need to read custom data from an image file (in this case it is data matrix parameters), the file should have been loaded with imaqReadVisionFile so that it reads image data and custom data while loading from disk.

 

imaqReadCustomData is not related to reading data matrix barcodes. It was just used to read the parametes stored in the example images. You could also provide another set of parameters instead of using stored parameters. Please use Vision Assistant to come up with parameter set.

 

Hope this helps.

 

Antony

0 Kudos
Message 3 of 4
(4,498 Views)

You are right: Only png files are supported for writing and reading the custom data to/from disk.

 

I will try to use other set of parameters, instead of from the image file.

 

Thank you very much.

0 Kudos
Message 4 of 4
(4,485 Views)