Package de.swa.fuh.opencv
Class OpenCVObjectDetector
java.lang.Object
de.swa.fuh.opencv.OpenCVObjectDetector
public class OpenCVObjectDetector
extends java.lang.Object
Helper class to generate with OpenCV DNN Module results.
- Author:
- Tobias Lukoschek
-
Constructor Summary
Constructors Constructor Description OpenCVObjectDetector()
-
Method Summary
Modifier and Type Method Description void
addDetectionsToNode(MMFG fv, java.util.Vector<Node> detectedNodes, float confThreshold)
Generates the detections of the model.void
loadImageFromPath(java.lang.String path)
Loading the image in the working data class of OpenCV.void
loadModel()
Loads the model yolov3 as the neuronal network to use.static void
loadOpenCV()
Load OpenCV native library.void
loadResourceLocation()
Get the absolute path of the src/main/resources folder and save it in mAbsolutePath.
-
Constructor Details
-
OpenCVObjectDetector
public OpenCVObjectDetector()
-
-
Method Details
-
loadOpenCV
public static void loadOpenCV()Load OpenCV native library. -
loadResourceLocation
public void loadResourceLocation()Get the absolute path of the src/main/resources folder and save it in mAbsolutePath. -
loadModel
public void loadModel()Loads the model yolov3 as the neuronal network to use. -
loadImageFromPath
public void loadImageFromPath(java.lang.String path)Loading the image in the working data class of OpenCV.- Parameters:
path
- Path to the image file.
-
addDetectionsToNode
public void addDetectionsToNode(MMFG fv, java.util.Vector<Node> detectedNodes, float confThreshold)Generates the detections of the model. The nodes contains the classification name specified in cocoNames and the position in the TechnicalAttribute.- Parameters:
fv
- holds the node where to save the detections.detectedNodes
- also save the nodes in this vector to make it compatible with the interface ofGMAF_Plugin
.confThreshold
- sets the threshold which evaluates of a detection is enough sure.
-