> hi
> i was wondering would anyone know how to implement this formula for
[quoted text clipped - 6 lines]
> If anyone knows how to do this or has done it in the past could you
> please let me know. thanks
Insert asterisks `*' to indicate multiplications,
and end each statement with a semicolon `;'.

Signature
Eric.Sosman@sun.com
> Y = 0.299 R + 0.587 G + 0.114 B
>Cb = - 0.169 R - 0.331 G + 0.500 B
>Cr = 0.500 R - 0.419 G - 0.081 B
I am puzzled by your question since the answer requires only the most
rudimentary knowledge of Java. If you could not do this, you could
not do the many more difficult things that need to go around it. So
perhaps I misinterpreted your question.
double y = 0.299 * r + 0.587 * g + 0.114 * b;
double cb = - 0.169 * r - 0.331 * g + 0.500 * b;
double cr = 0.500 * r - 0.419 * g - 0.081 * b;
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Maverick - 13 Apr 2004 11:45 GMT
> > Y = 0.299 R + 0.587 G + 0.114 B
> >Cb = - 0.169 R - 0.331 G + 0.500 B
[quoted text clipped - 8 lines]
> double cb = - 0.169 * r - 0.331 * g + 0.500 * b;
> double cr = 0.500 * r - 0.419 * g - 0.081 * b;
Thanks for that i am trying to convert to YCrCb using that fornula and
using 2-arrays and then be able to display the Cb part of the image.
from there i want to be able to change some of the pixels within the
cb . thats what im trying to do sorry i didnt specify the question
correctly if you have any input to how you would code this i would be
very grateful.
Roedy Green - 14 Apr 2004 05:01 GMT
>Thanks for that i am trying to convert to YCrCb using that fornula and
>using 2-arrays and then be able to display the Cb part of the image.
>from there i want to be able to change some of the pixels within the
>cb . thats what im trying to do sorry i didnt specify the question
>correctly if you have any input to how you would code this i would be
>very grateful.
Write a java.awt.image.ColorModel. Look at the source for some
examples. Once you have that, the methods of Image will do what you
need.
see http://mindprod.com/jgloss/image.html
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.