In computational ghost imaging the object is illuminated with a sequence of known patterns, and the scattered light is collected using a detector that has no spatial resolution. Using those patterns and the total intensity measurement from the detector, one can reconstruct the desired image. Here we study how the reconstructed image is modified if the patterns used for the reconstruction are not the same as the illumination patterns, and show that one can choose how to illuminate the object, such that the reconstruction process behaves like a spatial filtering operation on the image. The ability to measure directly a processed image, allows one to bypass the post-processing steps, and thus avoid any noise amplification they imply. As a simple example we show the case of an edge-detection filter.