本文整理汇总了Java中com.googlecode.javacv.CanvasFrame类的典型用法代码示例。如果您正苦于以下问题:Java CanvasFrame类的具体用法?Java CanvasFrame怎么用?Java CanvasFrame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CanvasFrame类属于com.googlecode.javacv包,在下文中一共展示了CanvasFrame类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: main
import com.googlecode.javacv.CanvasFrame; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
String cameraName = "Integrated Webcam";
String format = "dshow";
CanvasFrame frame = new CanvasFrame("Camera Test");
frame.setSize(640, 480);
frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
frame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
reading = false;
}
});
Camera camera = new Camera(cameraName, format);
camera.open(640, 480, 25);
while (reading && camera.isOpen()) {
frame.showImage(camera.getImage());
}
camera.close();
frame.dispose();
}
开发者ID:hoary,项目名称:JavaAV,代码行数:25,代码来源:CameraExample.java
示例2: run
import com.googlecode.javacv.CanvasFrame; //导入依赖的package包/类
public void run()
{
String arg[]=null;
so=new SparseO(dir,detected_face);
SparseO.main(arg);
String s=so.getRecognizedId();
if(!(s==null))
face_Ids.addElement(s);
System.out.println("Recognized:-"+s);
try
{
if(!(s==null)){
CanvasFrame cf=new CanvasFrame("RecognizedImage");
JLabel jl=new JLabel();
//BufferedImage b=ImageIO.read(new File(dir+"\\"+so.getRecognizedId()+"\\"+so.getRecognizedId()+"-0.jpg"));
jl.setIcon(new ImageIcon(dir+"\\"+so.getRecognizedId()));
cf.add(jl);
cf.setSize(250, 250);
cf.setVisible(true);
Thread.sleep(1000);
cf.dispose();
}
File f=new File("face_IDs.txt");
ObjectOutputStream oos=new ObjectOutputStream(new FileOutputStream(f));
oos.writeObject(face_Ids);
}
catch(Exception e)
{
e.printStackTrace();
System.out.println("Exception in Creating FaceId file"+e.getMessage());
}
}
开发者ID:devang29,项目名称:FACE-RECOGNITION-BASED-ATTENDANCE-MANAGEMENT-SYSTEM,代码行数:39,代码来源:FaceId_Thread.java
示例3: run
import com.googlecode.javacv.CanvasFrame; //导入依赖的package包/类
public void run()
{
String s=searchIm(dir,file);
System.out.println("Recognized:-"+s);
try
{
if(!(s==null)){
CanvasFrame cf=new CanvasFrame("RecognizedImage");
JLabel jl=new JLabel();
//BufferedImage b=ImageIO.read(new File(dir+"\\"+so.getRecognizedId()+"\\"+so.getRecognizedId()+"-0.jpg"));
jl.setIcon(new ImageIcon(s));
cf.add(jl);
cf.setSize(250, 250);
cf.setVisible(true);
Thread.sleep(1000);
cf.dispose();
}
// File f=new File("face_IDs.txt");
// ObjectOutputStream oos=new ObjectOutputStream(new FileOutputStream(f));
// oos.writeObject(face_Ids);
}
catch(Exception e)
{
e.printStackTrace();
System.out.println("Exception in Creating FaceId file"+e.getMessage());
}
}
开发者ID:devang29,项目名称:FACE-RECOGNITION-BASED-ATTENDANCE-MANAGEMENT-SYSTEM,代码行数:33,代码来源:New_FaceThread.java
示例4: ShowImage
import com.googlecode.javacv.CanvasFrame; //导入依赖的package包/类
public static void ShowImage(IplImage image, String caption, int width, int height)
{
CanvasFrame canvas = new CanvasFrame(caption, 1); // gamma=1
canvas.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
canvas.setCanvasSize(width, height);
canvas.showImage(image);
}
开发者ID:wordin0,项目名称:javacv,代码行数:8,代码来源:BlobDemo.java
示例5: main
import com.googlecode.javacv.CanvasFrame; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
String video = "src/examples/resources/bunny.mp4";
CanvasFrame frame = new CanvasFrame("Demuxer Test: " + video);
frame.setSize(640, 480);
frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
frame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
reading = false;
}
});
Demuxer demuxer = new Demuxer();
demuxer.open(video);
MediaFrame mediaFrame;
while (reading && (mediaFrame = demuxer.readFrame()) != null) {
if (mediaFrame.getType() == MediaFrame.Type.VIDEO) {
VideoFrame videoFrame = (VideoFrame) mediaFrame;
frame.showImage(Image.createImage(videoFrame, BufferedImage.TYPE_3BYTE_BGR));
//Thread.sleep((long) (1000 / (demuxer.getFrameRate())));
}
if (mediaFrame.getType() == MediaFrame.Type.AUDIO) {
//AudioFrame audioFrame = (AudioFrame) mediaFrame;
//Audio.getAudio16(audioFrame);
}
}
demuxer.close();
frame.dispose();
}
开发者ID:hoary,项目名称:JavaAV,代码行数:35,代码来源:DemuxerExample.java
注:本文中的com.googlecode.javacv.CanvasFrame类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论