11-21-2012 09:13 AM
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!
11-21-2012 09:22 AM
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.
11-21-2012 09:37 AM - edited 11-21-2012 09:41 AM
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.
11-23-2012 02:04 AM
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
11-23-2012
02:11 AM
- last edited on
03-24-2025
05:12 PM
by
Content Cleaner
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:
NI IMAQ is a driver for our Frame Grabbers to capture images from cameras.
Hope this helps. Have a nice day
11-23-2012 02:45 PM
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...