A method and apparatus for processing gastrointestinal (GI) images are disclosed. According to this method, a regular image is received, where the regular image is captured using an imaging apparatus by projecting non-structured light onto a body lumen when the imaging apparatus is in the body lumen. One or more structured-light images captured using the imaging apparatus by projecting the body lumen with structured light are received. A target distance for a target region in the regular image is derived based on said one or more structured-light images. A filter is determined based on the target distance and camera parameters associated with the imaging apparatus. A first processed target region is generated by applying the filter to the target region to improve sharpness of the target region. A first processed regular image comprising the first processed target region is provided.