Image processing question [message #30771] |
Thu, 16 May 2002 08:41  |
rkj
Messages: 66 Registered: February 1996
|
Member |
|
|
How do I convert a color image(.jpg) to grayscale?
I am using PV-Wave's Image_Read function to read the image,
which stores all the image info in an associative array.
Do I simply take the maximum RGB intensity value at each
pixel in the 'pixels' array (xdim,ydim,3)? This gives me
a grayscale image, but I'm not sure this is the "correct"
one.
Kyle J.
|
|
|
Re: Image processing question [message #30864 is a reply to message #30771] |
Sat, 18 May 2002 08:51  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
rkj@dukebar.crml.uab.edu (R. Kyle Justice) writes:
> How do I convert a color image(.jpg) to grayscale?
>
> I am using PV-Wave's Image_Read function to read the image,
> which stores all the image info in an associative array.
> Do I simply take the maximum RGB intensity value at each
> pixel in the 'pixels' array (xdim,ydim,3)? This gives me
> a grayscale image, but I'm not sure this is the "correct"
> one.
There is no one "correct" conversion from RGB to grayscale, since it
depends on the sensitivity response curve of your detector to light as
a function of wavelength. A common one in use is:
Y = 0.3*R + 0.59*G + 0.11*B
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|