在OpenCV中更改图像的dpi [英] Change dpi of an image in OpenCV
本文介绍了在OpenCV中更改图像的dpi的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我在OpenCv中打开图像(可能为300 dpi,72 dpi等)时,图像的dpi自动更改为96 dpi.我想改变这个dpi.请帮忙.预先感谢...
When I open an image in OpenCv (which may be of 300 dpi, 72 dpi etc.), the dpi of the image is automatically changed to 96 dpi. I want to variate this dpi. Please help. Thanks in advance...
#include "stdafx.h"
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
IplImage *img1=cvLoadImage("input.jpg");
cvSaveImage("output.jpg",img1);
return(0);
}
推荐答案
您需要编辑图像元数据 libexif (c)或 exiv2 (c ++)
You need to edit the image meta data libexif(c) or exiv2 (c++)
这篇关于在OpenCV中更改图像的dpi的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文