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

C/C++ | CMake | OpenCV | Raspberry Pi | 图像处理 | 图像重建 | 面部界标检测 | 卷积神经网络 | 车牌识别 | 深度神经网络 | 面部检测和识别

演示如何为桌面和小型嵌入式系统(如 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);
        }
    }

    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;
    }

面部界标检测

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

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

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

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

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

网络视觉

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

ArUco增强现实应用程序

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

iOS中全景图

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

源代码

🏈page指点迷津 | Brief

Last updated