我想得到图像的宽度和高度,我怎么能在OpenCV中做到这一点?
例如:
Mat src = imread("path_to_image");
cout << src.width;
Run Code Online (Sandbox Code Playgroud)
是对的吗?
我想计算累积直方图,我已经完成了直方图计算,下面是它的代码。
我已将 iamge 转换为 ycbcr 通道,并为 Y 通道应用直方图
感谢帮助
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "iostream"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
#include <stdio.h>
using namespace cv;
using namespace std;
void histogramcalculation(const Mat &Image, Mat &histoImage)
{
int histSize = 255;
// Set the ranges ( for B,G,R) )
float range[] = { 0, 256 } ;
const float* histRange = { range };
bool uniform = true; bool accumulate = false;
Mat b_hist, g_hist, r_hist;
vector<Mat> bgr_planes;
split(Image, …Run Code Online (Sandbox Code Playgroud)