gpt4 book ai didi

opencv - OPENCV 2.4.9调整大小会更改像素值吗?

转载 作者:行者123 更新时间:2023-12-02 16:56:28 25 4
gpt4 key购买 nike

我正在处理TIFF图像的分类问题。我正在处理整个图像。但是在最后阶段,我将图像调整为较小的尺寸以快速显示。预计将获得二进制图像,但是调整大小会引入中间值的像素,因此,在预期纯为0或255像素的像素值中会出现几个灰点?

最佳答案

在进行re-sizing时,请使用INTER_NEAREST插值类型来避免这种情况:

interpolation – 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

关于opencv - OPENCV 2.4.9调整大小会更改像素值吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28081995/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com