Which kind of interpolation best for resizing image?

后端 未结 3 1937
故里飘歌
故里飘歌 2021-02-02 10:14

I have a numpy array that I wish to resize using opencv. Its values range from 0 to 255. If I opt to use cv2.INTER_CUBIC, I may get values outside this range. This is undesirabl

3条回答
  •  心在旅途
    2021-02-02 10:43

    If you are enlarging the image, you should prefer to use INTER_LINEAR or INTER_CUBIC interpolation. If you are shrinking the image, you should prefer to use INTER_AREA interpolation.

    Cubic interpolation is computationally more complex, and hence slower than linear interpolation. However, the quality of the resulting image will be higher.

提交回复
热议问题