0

I have a gray image on which I have applied homomorphic filtering. The result of this filtering gives me an image which has some complex numbers as it's pixel values. When I viewed imaginary image and real image separately, then I realized I need only imaginary image for further processing. But I am unable to use it as I am unable to binarize the imaginary image for further processing. If anyone has any solution or suggestion regarding this then kindly let me know.

Here is the whole process image:enter image description here

complex image: enter image description here

real image: enter image description here

original gray image: enter image description here

Prachi
  • 141
  • 2
  • 2
  • 13
  • 1
    Take the imaginary part and apply a threshold? – m7913d Sep 05 '17 at 11:46
  • I tried using imbinarize in MATLAB but it is saying that cannot binarize and image having imaginary values. I tried selecting min value out of imaginary values but could not find as it is giving error. – Prachi Sep 07 '17 at 05:43
  • How where you able to plot the imaginary part? You probably used `imag`. Use the output, which is real, as argument for `imbinarize`. You can also apply a threshold manually by using an equality comparision, i.e. `image > thresholdValue`. – m7913d Sep 07 '17 at 06:05

1 Answers1

0

Like m7913d says, you can take the imaginary part of each pixel by using imag:

Ex:

imaginary_img = imag(complex_img);

Besides that, a good technique to binarize is set the threshold using the mean of image.

threshold = mean(mean(imaginary_img));
binarized_img = imbinarize(imaginary_img,threshold);