当前位置: 首页>>代码示例>>Java>>正文


Java Loader.load方法代码示例

本文整理汇总了Java中org.bytedeco.javacpp.Loader.load方法的典型用法代码示例。如果您正苦于以下问题:Java Loader.load方法的具体用法?Java Loader.load怎么用?Java Loader.load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bytedeco.javacpp.Loader的用法示例。


在下文中一共展示了Loader.load方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: tryLoad

import org.bytedeco.javacpp.Loader; //导入方法依赖的package包/类
public static void tryLoad() throws Exception {
    if (loadingException != null) {
        throw loadingException;
    } else {
        try {
            Loader.load(org.bytedeco.javacpp.avutil.class);
            Loader.load(org.bytedeco.javacpp.avcodec.class);
            Loader.load(org.bytedeco.javacpp.avformat.class);
            Loader.load(org.bytedeco.javacpp.postproc.class);
            Loader.load(org.bytedeco.javacpp.swresample.class);
            Loader.load(org.bytedeco.javacpp.swscale.class);
            Loader.load(org.bytedeco.javacpp.avfilter.class);

            av_register_all();
            avfilter_register_all();
        } catch (Throwable t) {
            if (t instanceof Exception) {
                throw loadingException = (Exception)t;
            } else {
                throw loadingException = new Exception("Failed to load " + FFmpegFrameRecorder.class, t);
            }
        }
    }
}
 
开发者ID:a3349384,项目名称:AndroidVideoRecordEx,代码行数:25,代码来源:FFmpegFrameFilter.java

示例2: tryLoad

import org.bytedeco.javacpp.Loader; //导入方法依赖的package包/类
public static void tryLoad() throws Exception {
    if (loadingException != null) {
        throw loadingException;
    } else {
        try {
            Loader.load(org.bytedeco.javacpp.avutil.class);
            Loader.load(org.bytedeco.javacpp.swresample.class);
            Loader.load(org.bytedeco.javacpp.avcodec.class);
            Loader.load(org.bytedeco.javacpp.avformat.class);
            Loader.load(org.bytedeco.javacpp.swscale.class);

            /* initialize libavcodec, and register all codecs and formats */
            av_register_all();
            avformat_network_init();
        } catch (Throwable t) {
            if (t instanceof Exception) {
                throw loadingException = (Exception)t;
            } else {
                throw loadingException = new Exception("Failed to load " + FFmpegFrameRecorder.class, t);
            }
        }
    }
}
 
开发者ID:a3349384,项目名称:AndroidVideoRecordEx,代码行数:24,代码来源:FFmpegFrameRecorder.java

示例3: imageChanged

import org.bytedeco.javacpp.Loader; //导入方法依赖的package包/类
@Override
public void imageChanged(IplImage image) {
	// Allocate the memory storage TODO make this globalData
	if (storage == null) {
		storage = cvCreateMemStorage(0);
	}

	if (cascade == null) {
		// Preload the opencv_objdetect module to work around a known bug.
		Loader.load(opencv_objdetect.class);

		cascade = new CvHaarClassifierCascade(cvLoad(String.format("%s/%s", cascadeDir, cascadeFile)));
		// cascade = new
		// CvHaarClassifierCascade(cvLoad("haarcascades/haarcascade_eye.xml"));

		if (cascade == null) {
			log.error("Could not load classifier cascade");
		}
	}

}
 
开发者ID:glaudiston,项目名称:project-bianca,代码行数:22,代码来源:OpenCVFilterFaceDetect.java

示例4: FaceDetectorAlpha

import org.bytedeco.javacpp.Loader; //导入方法依赖的package包/类
public FaceDetectorAlpha() {
    this.file = new File (System.getProperty("user.home")+"/.webcamstudio/faces/haarcascade_frontalface_alt2.xml");
    this.maskImg = (System.getProperty("user.home")+"/.webcamstudio/faces/Alien.png");
    File sImg = new File(maskImg);
    try {
        sourceMask = ImageIO.read(sImg);
    } catch (IOException ex) {
        Logger.getLogger(FaceDetectorAlpha.class.getName()).log(Level.SEVERE, null, ex);
    }
    classifierName = file.getAbsolutePath();
    Loader.load(opencv_objdetect.class);
    this.classifier = new opencv_objdetect.CvHaarClassifierCascade(cvLoad(classifierName));
    if (classifier.isNull()) {
        System.err.println("Error loading classifier file \"" + classifierName + "\".");
        System.exit(1);
    }
}
 
开发者ID:WebcamStudio,项目名称:webcamstudio,代码行数:18,代码来源:FaceDetectorAlpha.java

示例5: imageChanged

import org.bytedeco.javacpp.Loader; //导入方法依赖的package包/类
@Override
public void imageChanged(IplImage image) {
  // Allocate the memory storage TODO make this globalData
  if (storage == null) {
    storage = cvCreateMemStorage(0);
  }

  if (cascade == null) {
    // Preload the opencv_objdetect module to work around a known bug.
    Loader.load(opencv_objdetect.class);

    cascade = new CvHaarClassifierCascade(cvLoad(String.format("%s/%s", cascadeDir, cascadeFile)));
    // cascade = new
    // CvHaarClassifierCascade(cvLoad("haarcascades/haarcascade_eye.xml"));

    if (cascade == null) {
      log.error("Could not load classifier cascade");
    }
  }

}
 
开发者ID:MyRobotLab,项目名称:myrobotlab,代码行数:22,代码来源:OpenCVFilterFaceDetect.java

示例6: imageChanged

import org.bytedeco.javacpp.Loader; //导入方法依赖的package包/类
@Override
public void imageChanged(IplImage image) {
  // Allocate the memory storage TODO make this globalData
  if (storage == null) {
    storage = cvCreateMemStorage(0);
  }

  if (cascade == null) {
    // Preload the opencv_objdetect module to work around a known bug.
    Loader.load(opencv_objdetect.class);

    log.info("Starting new classifier {}", cascadeFile);
    cascade = new CvHaarClassifierCascade(cvLoad(String.format("%s/%s", cascadeDir, cascadeFile)));
    // cascade = new
    // CvHaarClassifierCascade(cvLoad("haarcascades/haarcascade_eye.xml"));

    if (cascade == null) {
      log.error("Could not load classifier cascade");
    }
  }

}
 
开发者ID:MyRobotLab,项目名称:myrobotlab,代码行数:23,代码来源:OpenCVFilterFaceDetect.java

示例7: tryLoad

import org.bytedeco.javacpp.Loader; //导入方法依赖的package包/类
public static void tryLoad() throws Exception {
    if (loadingException != null) {
        throw loadingException;
    } else {
        try {
            Loader.load(org.bytedeco.javacpp.avutil.class);
            Loader.load(org.bytedeco.javacpp.avcodec.class);
            Loader.load(org.bytedeco.javacpp.avformat.class);
            Loader.load(org.bytedeco.javacpp.swscale.class);
        } catch (Throwable t) {
            if (t instanceof Exception) {
                throw loadingException = (Exception)t;
            } else {
                throw loadingException = new Exception("Failed to load " + FFmpegFrameRecorder.class, t);
            }
        }
    }
}
 
开发者ID:duodecimo,项目名称:jmcv,代码行数:19,代码来源:FFmpegFrameRecorder.java

示例8: tryLoad

import org.bytedeco.javacpp.Loader; //导入方法依赖的package包/类
public static void tryLoad() throws Exception {
    if (loadingException != null) {
        throw loadingException;
    } else {
        try {
            Loader.load(org.bytedeco.javacpp.avutil.class);
            Loader.load(org.bytedeco.javacpp.avcodec.class);
            Loader.load(org.bytedeco.javacpp.avformat.class);
            Loader.load(org.bytedeco.javacpp.avdevice.class);
            Loader.load(org.bytedeco.javacpp.swscale.class);
        } catch (Throwable t) {
            if (t instanceof Exception) {
                throw loadingException = (Exception)t;
            } else {
                throw loadingException = new Exception("Failed to load " + FFmpegFrameGrabber.class, t);
            }
        }
    }
}
 
开发者ID:duodecimo,项目名称:jmcv,代码行数:20,代码来源:FFmpegFrameGrabber.java

示例9: FaceView

import org.bytedeco.javacpp.Loader; //导入方法依赖的package包/类
public FaceView(FacePreview context) throws IOException {
    super(context);

    // Load the classifier file from Java resources.
    File classifierFile = Loader.extractResource(getClass(),
        "/org/bytedeco/javacv/facepreview/haarcascade_frontalface_alt.xml",
        context.getCacheDir(), "classifier", ".xml");
    if (classifierFile == null || classifierFile.length() <= 0) {
        throw new IOException("Could not extract the classifier file from Java resource.");
    }

    // Preload the opencv_objdetect module to work around a known bug.
    Loader.load(opencv_objdetect.class);
    classifier = new CvHaarClassifierCascade(cvLoad(classifierFile.getAbsolutePath()));
    classifierFile.delete();
    if (classifier.isNull()) {
        throw new IOException("Could not load the classifier file.");
    }
    storage = CvMemStorage.create();
}
 
开发者ID:duodecimo,项目名称:jmcv,代码行数:21,代码来源:FacePreview.java

示例10: init

import org.bytedeco.javacpp.Loader; //导入方法依赖的package包/类
@Override public void init() {
    try {
        // Load the classifier file from Java resources.
        String classiferName = "haarcascade_frontalface_alt.xml";
        File classifierFile = Loader.extractResource(classiferName, null, "classifier", ".xml");
        if (classifierFile == null || classifierFile.length() <= 0) {
            throw new IOException("Could not extract \"" + classiferName + "\" from Java resources.");
        }

        // Preload the opencv_objdetect module to work around a known bug.
        Loader.load(opencv_objdetect.class);
        classifier = new CvHaarClassifierCascade(cvLoad(classifierFile.getAbsolutePath()));
        classifierFile.delete();
        if (classifier.isNull()) {
            throw new IOException("Could not load the classifier file.");
        }

        storage = CvMemStorage.create();
    } catch (Exception e) {
        if (exception == null) {
            exception = e;
            repaint();
        }
    }
}
 
开发者ID:duodecimo,项目名称:jmcv,代码行数:26,代码来源:FaceApplet.java

示例11: setClassifier

import org.bytedeco.javacpp.Loader; //导入方法依赖的package包/类
public void setClassifier(String name) {

		try {

			setClassiferName(name);
			classifierFile = Loader.extractResource(classiferName, null, "classifier", ".xml");

			if (classifierFile == null || classifierFile.length() <= 0) {
				throw new IOException("Could not extract \"" + classiferName + "\" from Java resources.");
			}

			// Preload the opencv_objdetect module to work around a known bug.
			Loader.load(opencv_objdetect.class);
			classifier = new CvHaarClassifierCascade(cvLoad(classifierFile.getAbsolutePath()));
			classifierFile.delete();
			if (classifier.isNull()) {
				throw new IOException("Could not load the classifier file.");
			}

		} catch (Exception e) {
			if (exception == null) {
				exception = e;

			}
		}

	}
 
开发者ID:MeAnupSarkar,项目名称:ExoVisix,代码行数:28,代码来源:FaceDetector.java

示例12: setClassifierEye

import org.bytedeco.javacpp.Loader; //导入方法依赖的package包/类
public void setClassifierEye(String name) {

		try {

			classiferName = name;
			classifierFile = Loader.extractResource(classiferName, null, "classifier", ".xml");

			if (classifierFile == null || classifierFile.length() <= 0) {
				throw new IOException("Could not extract \"" + classiferName + "\" from Java resources.");
			}

			// Preload the opencv_objdetect module to work around a known bug.
			Loader.load(opencv_objdetect.class);
			classifierEye = new CvHaarClassifierCascade(cvLoad(classifierFile.getAbsolutePath()));
			classifierFile.delete();
			if (classifier.isNull()) {
				throw new IOException("Could not load the classifier file.");
			}

		} catch (Exception e) {
			if (exception == null) {
				exception = e;

			}
		}

	}
 
开发者ID:MeAnupSarkar,项目名称:ExoVisix,代码行数:28,代码来源:FaceDetector.java

示例13: setClassifierSmile

import org.bytedeco.javacpp.Loader; //导入方法依赖的package包/类
public void setClassifierSmile(String name) {

		try {

			setClassiferName(name);
			classifierFile = Loader.extractResource(classiferName, null, "classifier", ".xml");

			if (classifierFile == null || classifierFile.length() <= 0) {
				throw new IOException("Could not extract \"" + classiferName + "\" from Java resources.");
			}

			// Preload the opencv_objdetect module to work around a known bug.
			Loader.load(opencv_objdetect.class);
			classifierSmile = new CvHaarClassifierCascade(cvLoad(classifierFile.getAbsolutePath()));
			classifierFile.delete();
			if (classifier.isNull()) {
				throw new IOException("Could not load the classifier file.");
			}

		} catch (Exception e) {
			if (exception == null) {
				exception = e;

			}
		}

	}
 
开发者ID:MeAnupSarkar,项目名称:ExoVisix,代码行数:28,代码来源:FaceDetector.java

示例14: setClassifierSideFace

import org.bytedeco.javacpp.Loader; //导入方法依赖的package包/类
public void setClassifierSideFace(String name) {

		try {

			classiferName = name;
			classifierFile = Loader.extractResource(classiferName, null, "classifier", ".xml");

			if (classifierFile == null || classifierFile.length() <= 0) {
				throw new IOException("Could not extract \"" + classiferName + "\" from Java resources.");
			}

			// Preload the opencv_objdetect module to work around a known bug.
			Loader.load(opencv_objdetect.class);
			classifierSideFace = new CvHaarClassifierCascade(cvLoad(classifierFile.getAbsolutePath()));
			classifierFile.delete();
			if (classifier.isNull()) {
				throw new IOException("Could not load the classifier file.");
			}

		} catch (Exception e) {
			if (exception == null) {
				exception = e;

			}
		}

	}
 
开发者ID:MeAnupSarkar,项目名称:ExoVisix,代码行数:28,代码来源:FaceDetector.java

示例15: setClassifierFullBody

import org.bytedeco.javacpp.Loader; //导入方法依赖的package包/类
public void setClassifierFullBody(String name) {

		try {

			setClassiferName(name);
			classifierFile = Loader.extractResource(classiferName, null, "classifier", ".xml");

			if (classifierFile == null || classifierFile.length() <= 0) {
				throw new IOException("Could not extract \"" + classiferName + "\" from Java resources.");
			}

			// Preload the opencv_objdetect module to work around a known bug.
			Loader.load(opencv_objdetect.class);
			classifierFullBody = new CvHaarClassifierCascade(cvLoad(classifierFile.getAbsolutePath()));
			classifierFile.delete();
			if (classifier.isNull()) {
				throw new IOException("Could not load the classifier file.");
			}

		} catch (Exception e) {
			if (exception == null) {
				exception = e;

			}
		}

	}
 
开发者ID:MeAnupSarkar,项目名称:ExoVisix,代码行数:28,代码来源:FaceDetector.java


注:本文中的org.bytedeco.javacpp.Loader.load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。