Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Look up table

Solved!
Go to solution

Hi,

   How to create Lookup table for each R,G and B planes in IMAQ ColorUserLookup VI?

 

Regards

Madhubalan

 

0 Kudos
Message 1 of 13
(5,983 Views)

Hello,

 

depends on what you want to do. A cLUT (color lookup table) can be used to quickly alter the value of the pixel values based on your preference (the values are indexing the cLUT array).

Please see the attached code, where the 255 value on the red plane is replaced with 0 first using a cLUT and secondly with pixel by pixel access. The general basic idea of the lookup tables is reducing the calculation time.

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 2 of 13
(5,964 Views)

Hi Klemen,

               Suppose if i want to quantize the color in an image,i.e  reduces the number of distinct colors used in an image.

 

If have attached the example of an image defore and after quantization.

 

Thank you

0 Kudos
Message 3 of 13
(5,958 Views)

Hi Madhubalan,

 


as fas as I know, there is no specialized function in NI Vision Module, that does exactly as you specified. You have to do it manually. It can be done on a by-pixel basis: get the color of each pixel, split into red, green, blue and replace their values as desired. In LabVIEW it is possible to define ranges in numeric case structures such as "0..32", "33..64" and so on. In the example below, all values between 0 and 32 will be replaced with the value 16.

 

Regards, Topper

 

manipulate pixel values.png

0 Kudos
Message 4 of 13
(5,945 Views)

Hi Harley,

             can just convert it into 2011 and post it here.

 

Thank you

0 Kudos
Message 5 of 13
(5,893 Views)

Hi,

   In the attached Vi file ,i could able to get the color of each pixel,in this how can i reduce the distinct color of the pixel and how can represent it in the ouput image.

 

Thank you

Download All
0 Kudos
Message 6 of 13
(5,872 Views)
Solution
Accepted by topic author Madhubalan

Please see this thread, maybe it will help you:

 

http://forums.ni.com/t5/Machine-Vision/color-image-quantization/td-p/2545923

 

And here is your image reduced to 64 colors:

 

image_quantization_octree_dotNET_FP.png

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
Message 7 of 13
(5,855 Views)

Hi Klemen,

               It is working fine.

 

Thank you

 

0 Kudos
Message 8 of 13
(5,849 Views)

Hi Klemen,

               In above picture you have mentioned, it has reduced to 64 color,how can i find it in the code whether it is reduced to 64 color or not?

 

Thank you

0 Kudos
Message 9 of 13
(5,804 Views)

Hello,

 

Just count the number of instances of each element in the RGB vector (after the quantization). You can use the following vi: https://decibel.ni.com/content/docs/DOC-9801. Using the linked code, just check the size of the "count" output in the end.

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 10 of 13
(5,785 Views)