LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read image and convert to unsigned 8 bit 2D array(but show size 0 X 0 )

Solved!
Go to solution

Hello, I am a rookie to the labview.

 

        What I want is to read file and do the edge detection.

        I have using the example: edge detection with 2d convolution, and try to modify it.

        I have using about three different methods but all of them jump to the error: not an image.

 

        1.using imaq to read file and using the imaq edge detection.

 

        2.using imaq to read file and using the built-in 2d convolution vi.

        (using imaq cast image amd imaq image to array to convert to unsigned 8 bit grey image)

 

        3.using read jpeq to read file and using the built-in 2d convolution vi.

        (using imaq cast image amd imaq image to array to convert to unsigned 8 bit grey image)

 

        I have fight with it and try to fix it but in vain. And I don't know the reason what cause the error.

        How do I fix all of the version?

 

Thanks for you reading my question.

 

        The attachment is the vi I have tried and the test image.

 

Download All
0 Kudos
Message 1 of 4
(3,254 Views)
Solution
Accepted by XXZERO12

@XXZERO12 wrote:
[...]  3.using read jpeq to read file and using the built-in 2d convolution vi.

[...]

       


hi,

 

1# your input picture has a depth of 24 bits, so you have to wire the 24-bit output of "unflatten pixmap.vi";

if you don't wire the correct output, the resulting image will be empty.

 

2# you need only 8 bits for the "convolution.vi", so you have to convert from [0;1;2;...;(2^24)-1] to [0;1;2;...; (2^8)-1]  for example like this:

1.PNG

 

 

Regards,
Alex

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

Thx, it helps me a lot and give me the reason what I make mistakes so that I won't make mistakes again. 

I really appreciate your help!Smiley Happy

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

alternatively, you could use "scale by power of two" to convert from 24 to 8 bits:

 

 

x2n.png

 

 

 

Regards,
Alex

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