How do I choose an image interpolation method? (Emgu/OpenCV)

The algorithms are: (descriptions are from the OpenCV documentation)

  • 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

If you want more speed use Nearest Neighbor method.

If you want to preserve quality of Image after downsampling, you can consider using INTER_AREA based interpolation, but again it depends on image content.

You can find detailed analysis of speed comparison here

Below is the speed comparison on 400*400 px image taken from the above link

Speed comparison


Nearest neighbor will be as fast as possible, but you will lose substantial information when resizing.

Linear interpolation is less fast, but will not result in information loss unless you're shrinking the image (which you are).

Cubic interpolation (probably actually "Bicubic") uses one of many possible formulas that incorporate multiple neighbor pixels. This is much better for shrinking images, but you are still limited as to how much shrinking you can do without information loss. Depending on the algorithm, you can probably reduce your images by 50% or 75%. The primary con of this approach is that it is much slower.

Not sure what "area" is - it may actually be "Bicubic". In all likelihood, this setting will give your best result (in terms of information loss / appearance), but at the cost of the longest processing time.

Update: this link gives more details (including a fifth type not included in your list):

http://docs.opencv.org/modules/imgproc/doc/geometric_transformations.html?highlight=resize#resize