Hi all

I have been tasked to implement a median filter on an image - this involves creating a window that will traverse the entire image.

When the window goes out of bounds of the image, the guilty indices are supposed to be set to zero.

My problem is that I have no idea how to do this since the type of data in the matrix is JSAMPLE. I tried using NULL but its not working.

Can anyone help?

Edited by bakwanyana: n/a

7 Years
Discussion Span
Last Post by bakwanyana

oh ok. well i have tried to create a zero pixel value by doing the following:

JSAMPLE zero[from->num_components];
    for (i = 0; i < from->num_components; i++)
      zero[i] = 0;

and have tried testing it by assigning the output image's values to zero. However the output image is grey - does this mean its working?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.