LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing the brightness and contrast of an image displayed in a picture control

I am in the process of creating an image viewer that I can distribute to various users in the company. The image files are read and displayed in a picture control. Does anybody have functions built to be able to change the brightness/contrast of the displayed image. I do not what to use vision tools because of licensing requirements.
0 Kudos
Message 1 of 15
(6,643 Views)

This is no easy task!

The simpler of these two request would be the brightness.

To make a color brighter would involve shifting the color value in RGB space toward white (255,255,255). This shift in color values can not be a fixed amout for all three components (RGB) but should be scaled based on the original color and its distance in color space from white.

I believe brightness will be the easier part because it involves only comparing a single pixel color with white and adjusting.

Contrast is more complicated because it will involve shitfting some of the colors toward white and others toward black.

So...

The image Toolkit just may be worth it cost!

Ig you write this yourself, please share what you find. The world of images and color are both s
ubjects that interest me.

Trying to help,

Ben


Ben Rayner
Certified LabVIEW Developer
www.DSAutomation.com

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 15
(6,643 Views)
In all the image analysis packages I've seen, the basic brightness and contrast adjustment functions use a simple straight-line relationship between the old and the new intensity - basically z = a + b.z0 where z0 is the old intensity and z is the new intensity value. 0 < b < 1 would give reduced contrast, b > 1 would increase contrast; to change brightness but not contrast keep b = 1 and change a. For RGB images you just process R, G and B identically. A fairly easy task IMHO!
0 Kudos
Message 3 of 15
(6,643 Views)
I believe you have more experience in this area than I do!

I believe I agree with you re: brightness.

Before I get caried away, maybe you can help with what I understand as contrast.

TO simplify lets just talk grey-scale.

If I look at the video signal the brightness is my DC level.

Contrast is the amplitude.

Is this consistent with your understanding?

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 15
(6,643 Views)
Pretty much, yes.

If you want to play around with image analysis, have a look at the free ImageTool software from http://ddsdx.uthscsa.edu/dig/itdesc.html - the brightness & contrast adjustment tool in this program illustrates the idea very neatly.

(Mac users of course should get NIH Image from http://rsb.info.nih.gov/nih-image/ )
0 Kudos
Message 5 of 15
(6,644 Views)
THanks for the link I will chase it down.

I did mention that this topic interests me and did not claim to be an expert, didn't I?

Thank tmh!

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 15
(6,644 Views)
Thanks all for you comments and suggestions and as much as I would like to take on the challenge of programming these funtions myself, I am a true believer of not re-inventing the wheel. I have found a very inexpensive ActiveX control that will allow me to load and manipulate the images. Again thank you all for your suggestions.
0 Kudos
Message 7 of 15
(6,643 Views)
Would you mind sharing the name?

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 15
(6,642 Views)
The ActiveX component is called ImageX by Fath Software. I am also using their VideoCapX to capture images.
0 Kudos
Message 9 of 15
(6,642 Views)
Thank yu Terry!

I award you four stars ****

because you you have provided a faster and easier solution than I originally proposed.

Maybe next time we can help you.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 15
(6,642 Views)