LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Threshold image to D array

Hello

I have included 2 Visa. The first one called 'scale image' introduces a picture and converts it to a resolution on 100x100. Is there a way I can export this picture into the second VI which includes IMAQ to threshold the image. 

 

I didn't create the second VI it is an example. But from what I Understand it produces the picture into binary. Is there a way I could produce an array with this information on it where the blacks are 1 and the white 0 or visa versa.

 

Thanks Craig

Download All
0 Kudos
Message 1 of 5
(2,489 Views)

Hello Craig

 

I am the applications engineer who will be supporting you with this question, as I understand you are looking for alternative methods for displaying image data once you have used the threshold function. Thank you for your thread and including your vi's, this allowed me to look at your code and come up with some ideas without asking you a number of tedious questions.

Firstly yes you can display your image as an array of binary data, either LED's or 0and1's I have created a project for you which includes your vi's and some additional examples, the additional examples show the new method which you will want to implement.

Secondly, I created a project so that you can easily pass data between vi's using shared variables, I have created one just to show you, to use the variable just select and drag from the project to your block diagram.

 

If you have any further questions or would like any additional examples regarding the conversion of images please get in touch and I will be happy to help. The attached files are in LabVIEW 2010 so if you cannot open them I can down convert them for you.

 

Thank you

Stephanie L
Applications Engineer
National Instruments UK and Ireland
Message 2 of 5
(2,458 Views)

Thank you,

 

This is really helpful. Is there a way I could just combine the 2 Vi's so the image with the resolution of 100x100 is the file inputted to the 'binary to image' vi. So all the files being converted to binary will have the same resolution. 

 

Also I have been doing this Vi at home, but I intend to take it to my University but I am not sure that the Uni has visual basic so I'm not sure to whether it can use the IMAQ's in the vi. Is there a way round this or could I do the same without the actual IMAQ stuff.

 

Greatly Appreciated

Craig

Download All
0 Kudos
Message 3 of 5
(2,450 Views)

From using the scaled image example and exporting a file i found that it wasn't changing the resolution of a picture. Would you have any ideas as to how i could change it so it would convert the resolution of a picture to my desired resolution.

 

Thanks again

Craig

0 Kudos
Message 4 of 5
(2,447 Views)

Hello Craig

 

I have spent some more time looking at the IMAQ functions and have looked at some articles as well to answer your queries and find some examples which will be useful to you.

1) You will need IMAQ and visual basic on the University machine to run your VI's, you will get errors otherwise, you can download evaluation versions of software from our website

2) I have added a new example to the project which converts images to arrays in a nicer way then the previous example.

3) I have added 3 functions to the binary vi, a get image size, get image info and set image size, you will be able to have the set image size function at the beginning of your execution just after the acquire IMAQ image vi

4) I would recommend working from the threshold and image to array vi's and adding the set image size functions, these functions are in the same palette as the other IMAQ functions within LabVIEW. If you would like any more help with combining the examples I will be happy to help.

 

Thank you

Stephanie L
Applications Engineer
National Instruments UK and Ireland
0 Kudos
Message 5 of 5
(2,411 Views)