- DNN模块
图像分类、图像检测、实时对象检测、图像分割、预测、视频对象跟踪
- 使用googlenet模型实现图像分类
Caffe模型:bvlc_googlenet.caffemodel
描述文件:vblc_googlener.prototxt
标签文件:synset_words.txt
- 加载Caffe模型、使用模型预测
#include <opencv2/opencv.hpp>
#include <opencv2/dnn.hpp>
#include <iostream>
using namespace std;
using namespace cv::dnn;
using namespace cv;
String Model_Caffe = "bvlc_googlenet.caffemodel";
String Model_Text = "vblc_googlener.prototxt";
String Label_Text = "synset_words.txt";
vector<string> readClassLabels();
int main(int argc, char** argv)
{
vector<string> labels = readClassLabels();
Mat src;
src = imread("../path.jpg");
if (src.empty<