• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java CanvasFrame类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EfficientStreamingTransformer类代码示例发布时间:2022-05-22
下一篇:
Java KuduTable类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap