私のコードを通して、画像の寸法をインチで知りたいです。OpenCVを介して、次のコードを使用して、画像のピクセルの配列の高さと幅を見つけることができます。
#include "stdafx.h"
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
IplImage *img = cvLoadImage("photo.jpg");
if (!img) {
printf("Error: Couldn't open the image file.\n");
return 1;
}
cout<<"Number of pixels in width = "<<img->width<<endl<<"Number of pixels in height = "<<img->height;
return(0);
}
画像のサイズをインチで見つけるのを手伝ってください。前もって感謝します...