OpenCV access elements by dynamic address
来源:互联网 发布:淘宝天猫店是如何申请 编辑:程序博客网 时间:2024/06/04 18:54
OpenCV access elements by dynamic address
#include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <iostream> using namespace std;using namespace cv;void colorReduce(Mat& inputImage, Mat& outputImage, int div);int main() {Mat srcImage = imread("1.JPG");imshow("原始图像", srcImage);Mat dstImage;dstImage.create(srcImage.rows, srcImage.cols, srcImage.type());double time0 = static_cast<double>(getTickCount());colorReduce(srcImage, dstImage, 32);time0 = ((double)getTickCount() - time0) / getTickFrequency();cout << "此方法的时间为" << time0 << "秒" << endl; imshow("效果图", dstImage);waitKey(0);}void colorReduce(Mat& inputImage, Mat& outputImage, int div) {outputImage = inputImage.clone();int rowNumber = outputImage.rows;int colNumber = outputImage.cols;for (int i = 0; i < rowNumber; i++) {for (int j = 0; j < colNumber; j++) {outputImage.at<Vec3b>(i, j)[0] = outputImage.at<Vec3b>(i, j)[0] / div * div + div / 2;outputImage.at<Vec3b>(i, j)[1] = outputImage.at<Vec3b>(i, j)[1] / div * div + div / 2;outputImage.at<Vec3b>(i, j)[2] = outputImage.at<Vec3b>(i, j)[2] / div * div + div / 2;}}}
0 0
- OpenCV access elements by dynamic address
- OpenCV access elements by pointer
- OpenCV access elements by iterator
- OpenCV for Android - Access elements of Mat
- Access the Address Book
- access violation at address
- Dynamic Sql Order by
- Sorting array elements by date
- Sorting array elements by date
- Address of My access website
- access violation at address delphi
- Access MAC address from sk_buff
- Windows Vista – Dynamic Address Space
- Deny visitors by IP address
- COBOL dynamic SQL access Oracle
- access violation at address 00000000.read of address 00000000
- Access Violation at address 00000000.Read of address 00000000 解决办法
- access violation at address in module Read of address
- JAVA获取CLASSPATH路径
- Unity VR游戏开发干货教程:VR中的交互方式
- img 标签加载失败监听事件
- 跳槽前不想好这些,99%会被淘汰!
- 开门人和关门人_1013
- OpenCV access elements by dynamic address
- centos下nginx的启动、关闭、重启操作
- Gym 101102D 单调栈
- 斗牛
- vbox虚拟机网络开机有时有 有时没有问题的解决
- 高效的字符串Hash公式
- sublime 正则表达式查找并替换
- Radix-Sorting(线性阶 多关键字排序算法 基数排序)
- AbstractFactory_Level5