‎04-21-2008 01:39 AM
‎04-21-2008 04:38 AM
‎04-21-2008 05:09 AM
Hi..
Thanks a lot. I actually want a 1 bit to represent each pixel in order to save as much space as possible. Can help suggest some VIs from IMAQ or any normal labview VIs?
Thanks In advance. ![]()
‎04-22-2008
11:36 AM
- last edited on
‎05-22-2026
06:04 PM
by
Content Cleaner
Hi Wan81,
If you are trying save disk space by writing your image out to a 1-bit file, I think the best way to do this would be to convert your image into an array of booleans, and then use the Flatten Pixmap VI to construct a pixmap of your image (with settings for no transparency, 1-bit depth, etc.) You could then use this pixmap with Write to BMP to write out a 1-bit image. See the LabVIEW help on the Graphics Formats VIs for more information.
To do the conversion into booleans, I would recommend thresholding your image into 0's and 1's, and then using two nested For Loops to build a corresponding 2-D boolean array based on whether the value at each pixel is 0 or 1.
If you are trying to save RAM by working with the image in memory as a 1-bit IMAQ image, then this unfortunately won't be possible. The normal IMAQ functions require at minimum an 8-bit image depth, such as Grayscale U8.
Message Edited by VGA CD-ROM on 04-22-2008 11:38 AM
‎04-23-2008 02:17 AM
‎04-23-2008 09:09 AM
‎04-25-2008 04:28 AM
Hi Vijay and GerardW,
Thanks for the tips. Really appreciate it. I will give it a try in my lab later.
Best Regards
Ridwan