Ask Your Question

Revision history [back]

Hi all,

I've figured out why the contours decrease when the image resolution is reduced. The reason is due to image interpolation.

If cv2.resize was used, there is a argument for the type of interpolation to be used:

interpolation method:

  • INTER_NEAREST - a nearest-neighbor interpolation
  • INTER_LINEAR - a bilinear interpolation (used by default)
  • INTER_AREA - resampling using pixel area relation. It may be a preferred method for image decimation, as it gives moire’-free results. But when the image is zoomed, it is similar to the INTER_NEAREST method.
  • INTER_CUBIC - a bicubic interpolation over 4x4 pixel neighborhood
  • INTER_LANCZOS4 - a Lanczos interpolation over 8x8 pixel neighborhood