• 从左上角到右下角的像素积分图


    像素积分图计算:

     

     1 #include <opencv2/opencv.hpp>
     2 #include <iostream>
     3 
     4 using namespace cv;
     5 
     6 int main(int argc, char** argv) {
     7     Mat src = imread("L:/5.jpg", IMREAD_GRAYSCALE);
     8     if (src.empty()) {
     9         printf("could not load image...
    ");
    10         return -1;
    11     }
    12     namedWindow("input image", CV_WINDOW_AUTOSIZE);
    13     imshow("input image", src);
    14 
    15     Mat sumii = Mat::zeros(src.rows + 1, src.cols + 1, CV_32FC1); //参数1.左上角像素和
    16     Mat sqsumii = Mat::zeros(src.rows + 1, src.cols + 1, CV_64FC1);//参数2.左上角像素平方和
    17     integral(src, sumii, sqsumii);  //积分算法API
    18 
    19     Mat iiResult;
    20     normalize(sumii, iiResult, 0, 255, NORM_MINMAX, CV_8UC1, Mat());// 归一化
    21     imshow("Integral Image", iiResult);
    22 
    23     waitKey(0);
    24     return 0;
    25 }

  • 相关阅读:
    iOS网络开发之AFNetworking
    TCP/IP、Http、Socket的区别
    iOS开发
    iOS 10相关技术
    HTTP协议详解
    HTTPS和HTTP的区别
    CocoaPods
    关于 iOS 10 中 ATS 的问题
    Run Loop详解
    iOS开发项目之MVC与MVVM
  • 原文地址:https://www.cnblogs.com/Jack-Elvis/p/11944706.html
Copyright © 2020-2023  润新知