opencv减色算法
来源:互联网 发布:linux怎么建站 编辑:程序博客网 时间:2024/05/21 17:09
#include "mainwindow.h"#include <QApplication>#include <iostream>#include <string>#include <stdio.h>#include <opencv2/core/core.hpp>#include <opencv2/highgui/highgui.hpp>#include <opencv2/opencv.hpp>using namespace cv;void colorReduce(cv::Mat image, int div=64) { int nl= image.rows; // 行数 // 每行的元素数量 int nc= image.cols * image.channels(); for (int j=0; j<nl; j++) { // 取得行j的地址 uchar* data= image.ptr<uchar>(j); for (int i=0; i<nc; i++) { // 处理每个像素 --------------------- data[i]= data[i]/div*div + div/2; // 像素处理结束 ---------------- } // 一行结束 }}int main(int argc, char *argv[]){ Mat image; // image= imread("C:\\Users\\Administrator\\Desktop\\QTsucai\\result.jpg"); // 读取输入图像 if(image.empty()){ return 0; } colorReduce(image,64); namedWindow("Original Image"); imshow("Original Image", image); waitKey(20); getchar(); return 0;}
阅读全文
0 0
- opencv减色算法
- opencv 图像减色
- 有关opencv的学习(3)—图像的减色算法
- 【学习 OpenCV】—— 图像减色(color reduced)
- JavaScript图像处理(6) - 减色算法(Color Reduction)
- OpenCV学习——Kmean均值聚类对图片进行减色处理
- 【OpenCV学习】Kmean均值聚类对图片进行减色处理
- 加色模式与减色模式
- 加色法和减色法
- OpenCV 常用算法
- OpenCV 常用算法
- CamShift算法,OpenCV实现
- Bresenham算法opencv实现
- CamShift算法,OpenCV实现
- OpenCV:SURF算法浅析
- OpenCV:SURF算法浅析
- opencv实现分水岭算法
- OpenCV 常用算法
- python调用chrome ie等浏览器
- 云服务器中安装wordpress,却不能使用公网IP进行访问
- 手机拍摄实时互联网直播解决方案
- vue中this.$el 和 this.$ref
- react router4.0的一些变化
- opencv减色算法
- ESXi 6.x 强制识别 ssd 硬盘
- Spring4实战记录
- 我的收藏
- 机器学习--k均值聚类
- SVM和LSSVM
- C 字符串处理函数
- Android studio JNI的使用
- NOI国家集训队论文集