![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
图像处理
xin_hen
这个作者很懒,什么都没留下…
展开
-
3种插值算法C++代码实现
最近邻插值算法//最近邻插值Vec3b INTER_NEAREST(double row, double col, const Mat& img) { int r = int(row + 0.5); int c = int(col + 0.5); Vec3b vec3b; if (r < 0 || r >= img.rows || c < 0 || c >= img.cols) vec3b[0] = vec3b[1] = v原创 2020-08-03 19:51:39 · 8094 阅读 · 1 评论 -
直方图计算C++代码实现
//计算直方图vector<vector<int>> CalHistgram(const Mat& img) { vector<vector<int>>histogram(256); for (int i = 0; i < histogram.size(); ++i) histogram[i].resize(3); for (int row = 0; row < img.rows; row++)原创 2020-08-03 19:40:08 · 2575 阅读 · 0 评论 -
直方图均衡化C++代码实现
//直方图均衡化void equHistogram(const Mat& src,Mat& dst) { assert(src.cols == dst.cols && src.rows == dst.rows); vector<int>histogram(255); //计算直方图 for (int row = 0; row < src.rows; ++row) { const unsigned char*原创 2020-08-01 17:56:50 · 1566 阅读 · 0 评论 -
直方图规格化C++代码实现
//直方图规格化void specifyHistogram(const Mat& src, const Mat& dst,Mat& out) { assert(src.cols == dst.cols && src.rows == dst.rows); assert(src.cols == dst.cols && out.rows == out.rows); vector<double>src_hist(255);原创 2020-08-01 17:56:13 · 714 阅读 · 0 评论