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?

Recommended Answers

All 3 Replies

Post what you have done up to now.

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?

I'm sorted - cannot find where to delete the thread though...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.