1

My teacher has assigned me to work combine RGB channels and create a GR image, whose results are like a negative image as shown here:

GRimage

I have tried the following code:

GR1=(double(100*green_channel/1+red_channel+blue_channel));
GR2=(double(256/1+red_channel+blue_channel+green_channel));
GR=(double(GR1.*GR2));

But this does not produce the desired results.

Jack Deeth
  • 3,062
  • 3
  • 24
  • 39

1 Answers1

1

I assume the main issue is the lack of parentheses in the denominator of your GR1 and GR2 equations. For example, I assume you want something like GR2=double(256/(1+red_channel+blue_channel+green_channel));

Secondarily, how did you display the image? Look at the min and max values of GR and verify that they are compatible with the function you are using. The min and max could also likely have tipped you off to the parentheses issue.

Jim Quirk
  • 606
  • 5
  • 18