Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

how to feed the vision assistant a grayscale u8 image?

I got an image that is in grayscale u8 

 

I've tried to make it into a purple line but it failed

 

can anyone help me?

 

(vi below)

0 Kudos
Message 1 of 18
(5,773 Views)

Hello,

 

you are passing only image size, but no image data to the IMAQ reference.Why are you using 2D picture control?

Is the 8-bit grayscale image located on your disk? Then use "IMAQ read file" to load an image directly as a "purple line" reference.

 

If you already have a 2D picture, you can pass this data to the IMAQ reference as is shown here:

 

http://forums.ni.com/t5/Machine-Vision/How-to-display-a-purple-line-image/m-p/2536974#M39736

 

Best regards,

K

 

 


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 2 of 18
(5,753 Views)

Is there any vi can transform a U16 array image into an IMAQ image ?(purple)

0 Kudos
Message 3 of 18
(5,749 Views)

That would be "IMAQ ArrayToImage".

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 4 of 18
(5,747 Views)

I made a new vi (first file) that should transform U16 into imaq image

 

but error says it's not an image

 

(the second file is the camera's example which transform U16 into picture)

Download All
0 Kudos
Message 5 of 18
(5,743 Views)

I do not get any errors when running both attached codes. Only the image will be empty, since the input array is also empty. The second attached code only converts 16-bit to 8-bit so that the 16-bit maximum value has an 8-bit value of 255.

 

What are you trying to do?

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 6 of 18
(5,733 Views)

I want to send the image into vision assistant so that I can analyze it

0 Kudos
Message 7 of 18
(5,726 Views)

If I understand correctly, your camera returns an image with U16 datatype? Also, you then convert it to U8 datatype right? Be aware that some functions accept only U8 datatypes. Try the following.

 

Example_VI_BD.png

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 8 of 18
(5,716 Views)

vision assistant still output an error "not an image" 

here's the code I modified

0 Kudos
Message 9 of 18
(5,710 Views)

Like i said, i get no error here. You need to attach the Vision Assistant code also in order to reproduce the error. And also the input U16 image. You can use "make current values default" after populating the 2D array.

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 10 of 18
(5,708 Views)