Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
8 ratings:
 4.37 out of 5     Rate this Document

How Do I Convert 32-bit Color Images to 8-bit Grayscale Images in Vision Assistant?

Primary Software: Vision Assistant
Primary Software Version: 7.1
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
I want to use some IMAQ Vision processing functions on a color image, but they require a grayscale image. How do I convert the color image to an 8-bit grayscale image in Vision Assistant?

Solution:
A 32-bit color image is encoded in memory as either an RGB (red-green-blue) or an HSL (hue-saturation-luminance) image.  RGB images store color information using 8 bits each for the red, green, and blue planes. HSL images store color information using 8 bits each for hue, saturation, and luminance.  In both cases, the alpha plane is not used.

To convert the color image to a grayscale image, you can simply extract the desired 8-bit plane from the color image.

To extract a color plane from an image in Vision Assistant, follow these steps:
  1. Add the Color Plane Extraction step from the list of Color Processing Functions.
  2. In the Setup window, choose the desired color plane.  The Processing Window will display a preview of the resulting grayscale image.
  3. Click OK.


Related Links:
Developer Zone Example: Convert Image to 8-bits

Product Manuals: NI Vision Assistant Tutorial (8.2.1)

Attachments:





Report Date: 01/30/2001
Last Updated: 04/18/2008
Document ID: 25TBKAOA

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit