Question

I'm confused. I tried writing a 'red-eye reduction' program to remove the red-eye from my pictures....

I'm confused. I tried writing a 'red-eye reduction' program to remove the red-eye from my pictures. The algorithm is pretty simple:
For each Pixel within the Picture, check if the color matches java.awt.Color.red.
   If it matches, set the new red, green, and blue all to zero (i.e. black)

And yet, when I try running it and displaying the result, the final Picture looks identical to what I started with!

What's the most likely problem? In plain English, briefly describe what my process should be for fixing it!

Homework Answers

Answer #1

Solution:

You are checking with 100% red color i.e (red = 255 green = 0 blue = 0)

such colours wont happen very frequently in real pictures.

try something like this

if(red > 150 && green <50 && blue <50)

{

red = 0;

green = 0;

blue = 0;

}

if you want to allow higher green and blue values if red is very high like around 200.

//second if statement

if(red > 230 && green <90 && blue <90)

{

red = 0;

green = 0;

blue = 0;

}

#please consider my effort and give me a like...thank u...

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions