如何在OpenCV中降低图像的分辨率? [英] How to Reduce the Resolution of an Image in OpenCV?

查看:167
本文介绍了如何在OpenCV中降低图像的分辨率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我有一个来自数字扫描仪的图像,其分辨率为26兆像素.我想将图像的分辨率降低到5兆像素.

So, I have an image from a digital scanner, its resolution is 26 Megapixel. I want to reduce the resolution of the image to 5 Megapixel.

是否可以在不损坏内容的情况下降低图像的分辨率?

Is it possible to reduce the resolution of an image without damaging the contents?

如果可以,如何在OpenCV实施中减少它?

If yes, how to reduce it in OpenCV implementation?

任何帮助将不胜感激.谢谢

Any help would be greatly appreciated. Thankyou

推荐答案

您可以使用在这里, interpolation 可以选择为 cv :: INTER_LANCZOS4 ,以获得最佳的插值结果.

here, interpolation can be selected as cv::INTER_LANCZOS4 to obtain best interpolation results.

factor 是采样率,为了从26mp转换到5mp,您可能需要将其设置为2.28

factor is the sampling ratio and in order to transform from 26mp to 5mp you may need it to be 2.28

下采样总是会带来一些信息和细节损失.

Downsampling always introduces some information and detail loss.

这篇关于如何在OpenCV中降低图像的分辨率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆