• C++(CMake)视觉OpenCV-Raspberry Pi图像处理-3D图像重建-面部界标检测-卷积神经网络车牌自动识别-深度神经网络面部检测和识别


    演示如何为桌面和小型嵌入式系统(如 Raspberry Pi)编写一些图像处理过滤器;使用 SfM 模块将场景重建为稀疏点云,包括相机位姿,以及如何使用多视图立体获取密集点云;使用人脸模块进行人脸界标(也称为人脸标记)检测的过程;图像分割和特征提取、模式识别基础知识和两种重要的模式识别算法,支持向量机 (SVM) 和深度神经网络 (DNN);在图像上检测人脸的不同技术,从使用具有 Haar 特征的级联分类器的更经典算法到采用深度学习的新技术;使用 OpenCV.js 为 Web 开发计算机视觉算法的新方法,OpenCV.js 是用于 JavaScript 的 OpenCV 的编译版本;使用 OpenCV 的 ArUco 模块、Android 的 Camera2 API 和 JMonkeyEngine 3D 游戏引擎在 Android 生态系统中实现增强现实 (AR) 应用程序;使用 OpenCV 的 iOS 预编译库在 iPhone 上构建全景图像拼接应用程序。

    Raspberry Pi图像处理

    演示如何为桌面和小型嵌入式系统(如 Raspberry Pi)编写一些图像处理过滤器;

    3D图像重建

    使用 SfM 模块将场景重建为稀疏点云,包括相机位姿,以及如何使用多视图立体获取密集点云

    #include <algorithm>
    #include <iostream>
    #include <numeric>
    #include <string>
    
    #define CERES_FOUND true
    
    #include <opencv2/core/utils/filesystem.hpp>
    #include <opencv2/core/utils/logger.hpp>
    #include <opencv2/opencv.hpp>
    #include <opencv2/sfm.hpp>
    #include <opencv2/viz.hpp>
    #include <opencv2/xfeatures2d.hpp>
    
    #include <boost/filesystem.hpp>
    #include <boost/graph/adjacency_list.hpp>
    #include <boost/graph/connected_components.hpp>
    #include <boost/graph/graph_traits.hpp>
    #include <boost/graph/graphviz.hpp>
    
    #define _USE_OPENCV true
    #include <libs/MVS/Interface.h>
    
    using namespace cv;
    using namespace std;
    namespace fs = boost::filesystem;
    
    class StructureFromMotion {
    
    public:
        StructureFromMotion(const string& dir, const float matchSurvivalRate = 0.5f,
            const bool viz = false, const string mvs = "", const string cloud = "",
            const bool saveDebug = false)
            : PAIR_MATCH_SURVIVAL_RATE(matchSurvivalRate)
            , visualize(viz)
            , saveMVS(mvs)
            , saveCloud(cloud)
            , saveDebugVisualizations(saveDebug)
    
        {
            findImagesInDiretcory(dir);
        }
    
        void runSfM()
        {
            extractFeatures();
            matchFeatures();
            buildTracks();
            reconstructFromTracks();
            if (visualize) {
                visualize3D();
            }
            if (saveMVS != "") {
                saveToMVSFile();
            }
            if (saveCloud != "") {
                CV_LOG_INFO(TAG, "Save point cloud to: " + saveCloud);
                viz::writeCloud(saveCloud, pointCloud, pointCloudColor);
            }
        }
    
    private:
        void findImagesInDiretcory(const string& dir)
        {
            CV_LOG_INFO(TAG, "Finding images in " + dir);
    
            utils::fs::glob(dir, "*.jpg", imagesFilenames);
            utils::fs::glob(dir, "*.JPG", imagesFilenames);
            utils::fs::glob(dir, "*.png", imagesFilenames);
            utils::fs::glob(dir, "*.PNG", imagesFilenames);
    
            std::sort(imagesFilenames.begin(), imagesFilenames.end());
    
            CV_LOG_INFO(TAG, "Found " + std::to_string(imagesFilenames.size()) + " images");
    
            CV_LOG_INFO(TAG, "Reading images...");
            for (const auto& i : imagesFilenames) {
                CV_LOG_INFO(TAG, i);
                images[i] = imread(i);
                imageIDs[i] = images.size() - 1;
            }
        }
    
        void extractFeatures()
        {
            CV_LOG_INFO(TAG, "Extract Features");
    
            auto detector = AKAZE::create();
            auto extractor = AKAZE::create();
    
            for (const auto& i : imagesFilenames) {
                Mat grayscale;
                cvtColor(images[i], grayscale, COLOR_BGR2GRAY);
                detector->detect(grayscale, keypoints[i]);
                extractor->compute(grayscale, keypoints[i], descriptors[i]);
    
                CV_LOG_INFO(TAG, "Found " + to_string(keypoints[i].size()) + " keypoints in " + i);
    
                if (saveDebugVisualizations) {
                    Mat out;
                    drawKeypoints(images[i], keypoints[i], out, Scalar(0, 0, 255));
                    imwrite(fs::basename(fs::path(i)) + "_features.jpg", out);
                }
            }
        }
    
        vector<DMatch> matchWithRatioTest(
            const DescriptorMatcher& matcher, const Mat& desc1, const Mat& desc2)
        {
            // Raw match
            vector<vector<DMatch>> nnMatch;
            matcher.knnMatch(desc1, desc2, nnMatch, 2);
    
            // Ratio test filter
            vector<DMatch> ratioMatched;
            for (size_t i = 0; i < nnMatch.size(); i++) {
                DMatch first = nnMatch[i][0];
                float dist1 = nnMatch[i][0].distance;
                float dist2 = nnMatch[i][1].distance;
    
                if (dist1 < MATCH_RATIO_THRESHOLD * dist2) {
                    ratioMatched.push_back(first);
                }
            }
    
            return ratioMatched;
        }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127

    面部界标检测

    使用人脸模块进行人脸界标(也称为人脸标记)检测的过程

    卷积神经网络车牌自动识别

    图像分割和特征提取、模式识别基础知识和两种重要的模式识别算法,支持向量机 (SVM) 和深度神经网络 (DNN)

    深度神经网络面部检测和识别

    在图像上检测人脸的不同技术,从使用具有 Haar 特征的级联分类器的更经典算法到采用深度学习的新技术

    网络视觉

    使用 OpenCV.js 为 Web 开发计算机视觉算法的新方法,OpenCV.js 是用于 JavaScript 的 OpenCV 的编译版本

    ArUco增强现实应用程序

    使用 OpenCV 的 ArUco 模块、Android 的 Camera2 API 和 JMonkeyEngine 3D 游戏引擎在 Android 生态系统中实现增强现实 (AR) 应用程序

    iOS中全景图

    使用 OpenCV 的 iOS 预编译库在 iPhone 上构建全景图像拼接应用程序。

    参阅 - 亚图跨际

  • 相关阅读:
    【进程复制】
    SQL Server多实例之间触发器同步数据
    (vue)h5 通过百度地图(原生) 获取当前位置
    一起Talk Android吧(第三百八十八回:lifecycle)
    Pytorch笔记之回归
    ElasticSearch基础入门
    B. 01 Game【模拟】
    Docker实战-使用NGINX实现4层的负载均衡
    5.Vue-在Vue框架中实现Vue的增删改查
    李宏毅-机器学习-笔记-P1
  • 原文地址:https://blog.csdn.net/jiyotin/article/details/125473974