Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot Open u16 RAW (binary) Image in Vision

Solved!
Go to solution

Have another U16 Image question.  Trying to open a U16 raw image.  Opens fine in ImageJ with the following options:

 

ImageJ.PNG

 

I duplicated these settings using this simple code

 

ReadU16Raw-Vision.png

 

But I get the error: "Error -1074396074 occurred at IMAQ ReadFile

Possible reason(s):

IMAQ Vision:  Incompatible image size."

 

Image should look like:

 

Martha 1849-02-001-6-view0000_raw_grey_16bit.png

 

I am posting the file "Martha 1849-02-001-6-view0000_raw_grey_32bit.raw" at ftp://ftp.ni.com/incoming if you would like to try.

 

Thanks,

 

Don

0 Kudos
Message 1 of 6
(4,914 Views)
Solution
Accepted by topic author DonRoth

The help says "If you are reading a nonstandard file format, you must set the size of Image to match the contents of the file before using IMAQ ReadFile".

Use IMAQ SetImageSize to set the size to 3888 x 3072 and it works.

 

-Christophe

Message 2 of 6
(4,908 Views)

Thanks.  This makes perfect sense. I missed this when reading the help on the function.  And it works.

 

 

ReadU16Raw-Vision.png

 

What I would suggest to the NI Vision team is that they add X and Y size (resolution) parameters to the 'File Options' cluster IMAQ ReadFile VI.  Then a complete specification would be available in just this one function.

 

Thanks again.

 

Sincerely,

 

Don

0 Kudos
Message 3 of 6
(4,898 Views)

One question  related to this - anyway to open raw binary file in Vision Assistant?  Doesn't seem to be.  This should certainly be added as an option and have a dialog spawned with File Options control.

 

Don

0 Kudos
Message 4 of 6
(4,803 Views)

Unfortunately, there is no way currently to open a RAW file in Vision Assistant. I filed feature CAR 326887 to address it in a future version.

I can't give you a timeline, as features are prioritized for each version, but we have a trace of that request now.

 

Thanks,

 

-Christophe

0 Kudos
Message 5 of 6
(4,799 Views)

Thanks. This one should be simple to implement for a future version since you already have the underlying code to do it in Vision.  I would think a lot of folks would be interested in this.

 

Don

0 Kudos
Message 6 of 6
(4,795 Views)