Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ GetFileInfo Calibration Issue

Colleagues,

 

I've got trouble with IMAQ GetCalibration Info. It seems to be that this function unable to get calibration info from Vision, and uses common resolution from png file (from pHYs chunk, I believe).

Feel differences:

 

Snippet.png

 

Image.png is calibrated with IMAQ Set Simple Calibration and saved from IMAQ Write Image with Vision Info.

Image2.png was saved in Photoshop.

 

I expect that calibrations obtained from IMAQ Get Calibration Info and IMAQ Get FileInfo should be the same, but its not true.

Fully understand, that we have here two different kinds of calibration info, but at least such behaviour should be clearly described in Help.


Be careful.

 

VDM 2011.

 

0 Kudos
Message 1 of 4
(3,835 Views)

Hey,

 

You should use Error Handling, and you should not expect anyhting Smiley Wink

The IMAQ Get Calibration Info VI you used for image2.png gives you the error -1074396113, which says: IMAQ Vision:  The source/input image has not been calibrated.

 

The IMAQ Calibration Info has nothing to do with the Calibration Output of the IMAQ Get File Info.

IMAQ Calibration Info is additional information to the image data, which can be created using IMAQ Learn Calibration Template or IMAQ Simple Calibration and which can be saved together with the image data as a standart file format like .png. Still this png contains additional information like the IMAQ calibration info. Just think about the VI Snippet you saved as .png, which can be interpreted as LabVIEW Code again.

 

The Calibration Output you get from the IMAQ Get File Info gives you information about the Print-Size of the image. E.g. 70pixels/inch or like in your image 100pixels/cm.

 

I don't think this is poor documented, but maybe we should change the name of the Output from "Calibration" to "Print Information" or something similar. You could create a product suggestion.

 

 

Thanks,

Christian

 

 

0 Kudos
Message 2 of 4
(3,804 Views)

Christian,

 

Thank you for the remark.

 

I guess, that I can expect not anything, but at least something from the product which cost more than € 3,500.00... Smiley Wink

 

Yes, you're fully correct - for image2.png we will get error -1074396113, which says that the image has not been calibrated. But at the same time IMAQ Get File Info returned to me 0.03 mm per pixel ratio in Calibration Cluster (which obviously means that the image is calibrated). Sure, I using error handling. But how error handling can help me to determinate that "The IMAQ Calibration Info has nothing to do with the Calibration Output of the IMAQ Get File Info"? The given snippet only illustrates, that we have two kinds of calibration info, which are completely different.

 

Lets explain my use case. I working with calibrated images, stored in PNG with Vision Info  (they are calibrated with IMAQ Simple Calibration VI). The images are pretty large - 14 MB per file. I was need to obtain the calibration info from already saved files. The only correct way - read image with vision info, then obtain calibration with IMAQ Get Calibration. But wait a moment -  here also IMAQ Get File Info available which immeaditely returned to me calibration info! Great! The advantages are clear - I don't need to read whole file into IMAQ Image, just header (hopefully IMAQ Get File Info does this exactly in that way)  - it should be fast and convenient without loading whole image... But I've got totally wrong calibration (lets say - not really wrong, but unexpected) information — because there are two kinds of calibration information stored in PNG file - one is "standard" png calibration which uses for printing, etc, and another one - internal NI calibration info into real world coordinates, which I needed. Take a note - both calibration info clusters looks mostly the same (well, to be honest - there are different typedefs). Usually physical pixel dimension — in our case obtained by IMAQ Get File Info from PNG's pHYs chunk — measured in dpi and internally cannot have Unit from the given list such as Angström or Nautical Miles, etc (and I don't remember which image format supported by IMAQ Get File Info except AIPD can store such info). Here we have mix of units (because during development of  IMAQ Get File Info software engineer have put units list from the IMAQ Calibration Info to this function), and as result, I was frustrated a little bit. Before using this finction I checked - IMAQ Get File Info can return to me the same units as IMAQ Get Calibration Info does - they should give me same calibration information, but they not the same!

 

Help says only the following for IMAQ Get File Info:

 

Calibration is a cluster containing the following elements:

 

X Step is the horizontal distance separating two adjacent pixels (in units specified by Unit).

 

Y Step is the vertical distance separating two adjacent pixels (in units specified by Unit).

 

Unit is the measuring unit associated with the image.

 

The help should say in clear words as you wrote "The IMAQ Calibration Info has nothing to do with the Calibration Output of the IMAQ Get File Info". This may save a little bit debugging time and prevent possible errors.

Except one small note:

 

Snippet2.png

As you can see, in some cases IMAQ Get File Info has something to do with IMAQ Calibration Smiley Happy

(and yes, I'm using error handling now)

 

 

Now about product suggestions. There are lot of points, which could be enhanced in VDM. Idea exchange is good place, sure, but these ideas aren't pure "LabVIEW - related". They are specific for particular toolkit. You have eight different sections already (CVI, DiaDem, etc), but not for VDM/VAS. My first suggestion was to add Vision Idea Exchange more than one year ago, but nothing happened. Vision Toolkit ideas, which posted into common LabVIEW Ideas exchange thread, are not really interesting for the people who not working with this toolkit, isn't?

 

Andrey.

 

Message 3 of 4
(3,797 Views)

Hi Andrey,

 

I understand your frustration about this point and I agree that it could be fixed with an additional note at the help or at leas with changing the name of the output.

Because of that I created CAR # 338750 and also linked to this discussion.

 

However, the idea exchange platform is one of several other platforms where we can gather information about what customers wants to have in future versions of our software products. Every single suggestion will be discussed and validated before we plan the feature set of a new release. However, I agree that there could be an own Vision Idea Exchange. I'll point some RnD guys to this thread.

 

 

Christian

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