Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Does anyone know how to change the resolution of a bitmap in LabVIEW?

I need to do a LabVIEW program that changes the resolution of a bitmap to different values (i.e. 640x480, 320x240, etc.). If there is a way to perform this task, please let me know.
0 Kudos
Message 1 of 8
(4,216 Views)
Sure there is a way. You just need to decide how to do it.

If you are using the Vision toolkit, there is a handy resample vi. You can also use the Extract vi to only keep every 2nd, 3rd, etc. line of the image.

If you aren't using Vision, you can use the picture controls. Load an image as a bitmap and pull out the array. Use a loop to remove the lines you don't need, then put the resulting bitmap back into the picture.

If you are talking about something more detailed, you will need to give some more examples of what you are looking for.

Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 8
(4,213 Views)
I do not have the Vision toolkit, but this is what I need to do:

I need to convert an 800x600, 8-bit, greyscale bitmap picture to a 768x489, 8-bit, greyscale bitmap picture. Since I do not have the Vision toolkit, I will have to write all the code by myself. However, I am not familiar with your suggestion of removing the unnecessary lines of the picture's array. Please let me know where I can find information about this topic or if you have a VI that does something similar. Thanks for everything.
0 Kudos
Message 3 of 8
(4,203 Views)
Are you going to change the aspect ratio of the image? Your original image is a 3x4 ratio, where your new image is not. If you resample the entire image, it will look squished.

Would it work to just take a subset of the original image? In this case, just extract the image array and take a subset of it.

Never mind on removing the lines you don't need. This only works when you want every 2nd, 3rd, etc. line of the image.

If you only need to do this once, use a paint program to do it well.

If you are going to resample the entire image, it will be messy programming to write. There isn't a real simple way to do resampling that will look good.

Bruce
Bruce Ammons
Ammons Engineering
Message 4 of 8
(4,202 Views)
I do not need to take a subset of the original image. I need to resample the whole thing and I understand that it will look squished. Adobe Photoshop does exactly what I need, but unfortunately, I am required to do the whole conversion simply by pressing a button in the front panel of LabVIEW. I was trying to write a code that would call Photoshop to perform the job I need, but I did not find anything.

Thanks for your help.
0 Kudos
Message 5 of 8
(4,198 Views)
If you have 7.1, check the Example Finder with it connected to the 'net.

Yesterday I found a third party .vi that opens any image with Irfanview. Irfanview is a great little application that can take a number of arguments on the command line. (I needed to convert, save, then print an IMAQ image)

Once I'm back on a Windows box, I can post the .vi here if you can't find it.
---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 6 of 8
(4,189 Views)
Here is a VI from my collection that I modified for your needs. It calls PhotoShop, opens a file, resizes the image and saves it. Check the preferences->Ruler and set it for pixels if that is the desired units that you want to specify.
Michael Munroe, CLD, CTD, MCP
Automate 1M+ VI Search, Sort and Edit operations with Property Inspector 5.0, now with a new Interactive Window Manager!
Now supports full project automation using one-click custom macros or CLI.
Message 7 of 8
(4,173 Views)
Thank you EVERYBODY for your help. Your support really helped me with my project.
0 Kudos
Message 8 of 8
(4,167 Views)