如何使用 OpenCV 确定图像(Mat 格式)的分辨率(宽 x 高)?
我有一个线程接收很 multimap 像..一次一个。我想确定图像的分辨率,当线程接收到它时(以获得以像素为单位的宽度和高度尺寸)。
最佳答案
像这样:
cv::Mat someMat;
int width;
int height;
width = someMat.cols;
height = someMat.rows;
或:
width = someMat.size().width;
height = someMat.size().height;
关于c++ - 如何计算图像的分辨率?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21859164/