// 郝老师修改视频,在darknet中嵌入识别本地视频的程序。
#ifdef OPENCV
image ipl_to_image(IplImage* src);
#include <stdio.h>
#include "image.h"
#include <cv.h>
#include "highgui.h"
#include "opencv2/highgui/highgui_c.h"
#include "opencv2/imgproc/imgproc_c.h"
void video_yolo(char *cfgfile, char *weightfile, float thresh)
{
network net = parse_network_cfg(cfgfile);
if(weightfile){
load_weights(&net, weightfile);
}
detection_layer l = net.layers[net.n-1];
//detection_layer l=detection_layer layer;
printf("the first!\n");
cvNamedWindow("edges",1);
CvCapture *cap = cvCreateFileCapture("/home/yjy/aa2.mp4");
clock_t time;
IplImage* frame;
set_batch_network(&net, 1);
srand(2222222);
int j;
float nms=.5;
box *boxes = calloc(l.side*l.side*l.n, sizeof(box));
float **probs = calloc(l.side*l.side*l.n, sizeof(float *));
for(j = 0; j < l
darknet网络中识别本地视频
最新推荐文章于 2025-02-21 20:17:55 发布