Examples of CascadeClassifier


Examples of org.opencv.objdetect.CascadeClassifier

        OpenCVObjectDetectorPropertyWorker objectDetector = new OpenCVObjectDetectorPropertyWorker();
        objectDetector.loadNativeLibrary();
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        BufferedImage bImage = ImageIO.read(cl.getResourceAsStream(TEST_IMAGE));

        CascadeClassifier objectClassifier = new CascadeClassifier(cl.getResource(CLASSIFIER).getPath());
        objectDetector.addObjectClassifier("face", objectClassifier, "http://test.lumify.io/#face");
        List<ArtifactDetectedObject> detectedObjectList = objectDetector.detectObjects(bImage);
        assertTrue("Incorrect number of objects found", detectedObjectList.size() == 1);

        ArtifactDetectedObject detectedObject = detectedObjectList.get(0);
View Full Code Here

Examples of org.opencv.objdetect.CascadeClassifier

        String[] classifierConcepts = conceptListString.split(",");
        for (String classifierConcept : classifierConcepts) {
            String classifierFilePath = (String) workerPrepareData.getStormConf().get(OPENCV_CLASSIFIER_PATH_PREFIX + classifierConcept + OPENCV_CLASSIFIER_PATH_SUFFIX);

            File localFile = createLocalFile(classifierFilePath, workerPrepareData.getHdfsFileSystem());
            CascadeClassifier objectClassifier = new CascadeClassifier(localFile.getPath());
            String iriConfigurationKey = Configuration.ONTOLOGY_IRI_PREFIX + classifierConcept;
            String conceptIRI = (String) workerPrepareData.getStormConf().get(iriConfigurationKey);
            if (conceptIRI == null) {
                throw new LumifyException("Could not find concept IRI for " + iriConfigurationKey);
            }
View Full Code Here

Examples of org.opencv.objdetect.CascadeClassifier

    String cascadePath = getLibPath();
    cascadePath += relativePath;
       
    PApplet.println("Load cascade from: " + cascadePath);

    classifier = new CascadeClassifier(cascadePath);  
       
        if(classifier.empty()){
          PApplet.println("Cascade failed to load"); // raise exception here?
        } else {
          PApplet.println("Cascade loaded: " + cascadeFileName);
View Full Code Here

Examples of org.opencv.objdetect.CascadeClassifier

   * @param absolute
   *     Whether or not the cascadeFilePath is an absolute path to an XML file.   
   */
  public void loadCascade(String cascadeFilePath, boolean absolute){
    if(absolute){
      classifier = new CascadeClassifier(cascadeFilePath);  
         
          if(classifier.empty()){
            PApplet.println("Cascade failed to load"); // raise exception here?
          } else {
            PApplet.println("Cascade loaded from absolute path: " + cascadeFilePath);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.