LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problème valeurs retour CLUT

Bonjour,

Je veux récupérer les trois valeurs rgb de mes couleurs (index des couleurs que je donne en entrée à ma fonction)

mais quand j'utilise la fonction labview "color to RGB.vi", cela me retourne uniquement les valeurs de B et que des valeurs nulles pour R et G....Je ne comprends pas comment c'est possible que ma fonction soit ok que pour B?!

Est-ce que quelqu'un saurait identifier mon problème?

 

(J'ai mis des valeur d'exemple en entrée pour faire des tests)Capture d’écran du 2024-12-14 15-22-08.pngCapture d’écran du 2024-12-14 15-23-46.png

0 Kudos
Message 1 of 6
(201 Views)

@Ginette wrote:

Translated by google:

Good morning,

I want to retrieve the three rgb values ​​of my colors (index of the colors that I give as input to my function)

but when I use the labview function "color to RGB.vi", it only returns the values ​​of B and only zero values ​​for R and G....I don't understand how it is possible that my function is ok only for B?!

Can anyone identify my problem?

 

(I put example values ​​as input to do tests)

 

 

(J'ai mis des valeur d'exemple en entrée pour faire des tests)


This is a very simple operation that can fit on a postage stamp. It looks like your "traces" are only in the range of x00..xFF, i.e. they only contain blue. If you have full color RGB values, they should be in the range x00000-xFFFFFF. IF your entries are actually indices into a colormap, you need to have the colormap.

 

We cannot debug blurry pictures. I can't even tell the division you are doing. Please attach your VI containing typical data in the controls.

0 Kudos
Message 2 of 6
(190 Views)

@altenbach wrote:
This is a very simple operation that can fit on a postage stamp.

As an example, here's some simple code that can replace the entire while loop.

 

altenbach_0-1734189861219.png

 

Also,

 

  • do not get the size and wire N if you are autoidexing.
  • You only need one 255 diagram constant, not three. Branch the wire!
  • Could it be you only have two points and three consecutive colors are the RGB components?
  • etc.

 

 

0 Kudos
Message 3 of 6
(182 Views)

If each three U8 values are the RGB components, here's all you need:

 

altenbach_0-1734191028110.png

 

I am sure you need to make modifications according to your exact requirements...

 

0 Kudos
Message 4 of 6
(173 Views)

Thanks for your answer,

 

I need RGB values between 0 and 1, that's why i'm dividing by 255

But I initially only have indices (what I called traces) of my colors, so I'm using the "color to RGB.vi" from Labview, in order to get the value of each R,G and B. Which works but only for the B value....and no I do not have only blue colors, I have tried with many different indices, always returns 0 for my R and G.

I'm really confuse because the issue seems to come from the color vi, as my traces (the input) is correct, but not my output rgb values.

0 Kudos
Message 5 of 6
(147 Views)

A color is a U32 value where 24 bits are used, 8 each for R, G, and B. If the values are less than 255, it is obvious that R and G are zero and no voodoo or "tricks" can generate them out of thin air. Obviously, the output is NOT correct!

 

As I said, maybe you have a colormap. In that case there are only 256 RGB colors and the value is an index into that array. Can you explain where the original data comes from? What is upstream? If you unflatten from a image that has a colormap, you get an array of colors out, then just index into it using your "traces" as index. (These are "indices", not sure why you call them "traces")

 

altenbach_0-1734287672403.png

 

 

(Again, your 255 was blurry and barely recognizable without zooming in. It would be much easier to attach VIs instead. We canny debug images)

0 Kudos
Message 6 of 6
(135 Views)