MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / DetectObjects

Method DetectObjects

src/CVObjectDetection.cpp:97–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97void CVObjectDetection::DetectObjects(const cv::Mat &frame, size_t frameId){
98 // Get frame as OpenCV Mat
99 cv::Mat blob;
100
101 // Create a 4D blob from the frame.
102 int inpWidth, inpHeight;
103 inpWidth = inpHeight = 416;
104
105 cv::dnn::blobFromImage(frame, blob, 1/255.0, cv::Size(inpWidth, inpHeight), cv::Scalar(0,0,0), true, false);
106
107 //Sets the input to the network
108 net.setInput(blob);
109
110 // Runs the forward pass to get output of the output layers
111 std::vector<cv::Mat> outs;
112 net.forward(outs, getOutputsNames(net));
113
114 // Remove the bounding boxes with low confidence
115 postprocess(frame.size(), outs, frameId);
116
117}
118
119
120// Remove the bounding boxes with low confidence using non-maxima suppression

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected