1

I have a RGB image. I want to compute the Optical Density of a region of that image.

I have converted the Image to grayscale and I know the formula for Optical Density is log(1/illumination).

My procedure is to use roiploy to specify the ROI. But however this is not working and I never get a uniform answer.

What is the best way to do this? Should I use a mask? Will correlation be of any help between the mask and the original image?

Sista
  • 887
  • 2
  • 15
  • 19

1 Answers1

0

What you get from roipoly is a mask - you need to apply that to your image with:

masked_image = image .* mask

Then each pixel of the masked image has a value corresponding to its illumination, assuming it came from a CCD camera.

As an aside, I'm a bit dubious about that formula for optical density - what happens when the illumination is zero?

Optimal Cynic
  • 797
  • 3
  • 6
  • Thanks a lot for this. I will try this out. Regarding the illumination, I guess I could replace that with the average pixel alue. I will look that up. But thats for pointing that out. – Sista Jul 05 '11 at 20:31