LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Import an image to black&white into array

Hello there.

 

I'm making a type of cutter, that cuts stamps out of potatos. Currently, the pattern is an array of booleans of 25x25, where you have to click what you want to see and then the program cuts it out. We'd like to add more functionality though, perhaps by allowing images to be imported and these should then get put in the array, according to black/white-scale.

 

I have absolutly no idea how I'd start doing anything like this.

 

Thanks in advance!

0 Kudos
Message 1 of 6
(2,312 Views)

In graphics format there are functions for loading images (jpg, png) then a flatten to pixel map, you will get a 2d array you can decimate or resize the arrays with a little math, next threshold the image (easy in gray scale using a simple greater than, slightly harder if RGB), now you will have a 2d array of booleans.

 

This is much easire using IMAQ but I assumed that you do not have teh VDM installed.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 6
(2,311 Views)

Thanks for the fast reply.

 

Now, for the importing of the image, I'd like it to be possible for people to get prompted an image location, and that depending on what type the image is that image-open-thing is used. Is something lik that possible, or do you think it's too elaborate? Perhaps I should start with jpeg only, will be hard enough already.

 

And I have never heard of IMAQ or VDM, so I presume I don't have them no.

0 Kudos
Message 3 of 6
(2,308 Views)

Hi,

 

You should use the File Dialog VI. Provide it with a promt name (appears in the windows bar). pattern label (image type name), file patern (extention like *.bmp or *.jpg) and a start path (folder you would like to start in). You will now get a popup which starts in the folder you provided and limits to the extention you provided. Se VI attached (LV 2011) for an example.

 

Have a nice day

Rik Prins, CLA, CLED
Software Development Engineer
0 Kudos
Message 4 of 6
(2,288 Views)

Hi,

 

You should use the File Dialog VI. Provide it with a promt name (appears in the windows bar). pattern label (image type name), file patern (extention like *.bmp or *.jpg) and a start path (folder you would like to start in). You will now get a popup which starts in the folder you provided and limits to the extention you provided. Se VI attached (LV 2011) for an example.

What falkpl ment with VDM is Vision Development Module. This is an addon which you can install onto LabVIEW. It gives you a large library of VIsion functions to work on your images. For more info goto:

 

Vision Development Module

 

NI IMAQ is a driver for our Frame Grabbers to capture images from cameras.

 

Hope this helps. Have a nice day

Rik Prins, CLA, CLED
Software Development Engineer
0 Kudos
Message 5 of 6
(2,286 Views)

Okay I installed the VDM-module and I think it can be run. The VDM is version 12, however my current LabVIEW version is 10.0.

 

However, I still don't have a clue how I should start at this...

0 Kudos
Message 6 of 6
(2,275 Views)