Getting RGB values
Hello all:
I have a question about getting RGB values from an image (TImage
component).
I'm working on a program that takes streaming data from a thermal camera,
displays that image in a TImage component as a bitmap. The image is a
display in colors of different temperatures on the object being viewed. The
purpose of the program is to display the image, allow the user to assign
different temperature values to specific colors, and allow the user to
choose different areas to inspect (by drawing a rectangle, cross or dot)
and receive temperature values (based on the color of the pixels at that
area and the temperatures assigned by the user to colors) for those
inspection areas.
To set the temperature/color relationship, here's what they do: At the top
of this image, there is a 'calibration strip' of the colors that are
present in the image. The user can then click on the color they want to
represent 'cold' and assign a temperature to it. The program will get the
RGB values of the 'cold' color, write those values into an array, along
with the user defined temp. The user then does the same for the 'hot'
color. Then, to make matters even more fun, the user can specify a number
of iteration between the cold and hot colors/temperatures. For instance,
the user can assign blue a 'cold' value of 10 degrees and red a 'hot' value
of 25 degrees, with 5 iterations between those two temps. That would give
the program the following temperatures to identify RGB values for: 13, 16,
19, 22. Each of these will obviously have a specific RGB value, with 10
degrees (blue) being (0, 0, 255) and 25 degrees (red) being (255, 0, 0),
with the points in between having various combinations of RGB values.
Now, for the questions: 1) How do I get the RGB values and assign them to
variables that I can write to an array? 2) How would I go about setting
the RGB values for the iterations between the two user defined
colors/temps? 3) How would I account for RGB values that fall between two
colors/temps? (i.e.., if I have a RGB value that falls between the RGB
values for 10 degrees and 13 degrees, do I have any way to account for
this?) 4) Am I trying to do this the hard way? Is there an easier way to
do this?
All help will be greatly appreciated since I know nothing about graphics
programming.
Thanks kindly.
Brett Messimer
PS: If I have not explained this sufficiently, please e-mail me with your
questions and I'll answer them.