树莓派论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 3826|回复: 1
收起左侧

java 调用摄像头模块

[复制链接]
发表于 2014-11-25 00:45:47 | 显示全部楼层 |阅读模式
本帖最后由 skyding1212 于 2014-11-25 00:46 编辑

最近在国外看到了关于树莓派的java调用摄像头模块的例子
http://www.codeproject.com/Artic ... Raspberry-Pi-to-NET
RaspberryVideostreamingToNET.png
稍微有点开发经验的看这个应该就很熟悉了~
  1. // Captured video: 320x240 pixels, 24 frames/s                    
  2. // And it also inserts SPS and PPS inline headers (-ih) so that
  3. // later connected clients can synchronize to ongoing video frames.                    
  4. String aToExecute = "raspivid -n -vf -hf -ih -w 320 -h 240 -fps 24 -t 0 -o -";                    
  5. myRaspiVidProcess = Runtime.getRuntime().exec(aToExecute);                    
  6. myVideoStream = myRaspiVidProcess.getInputStream();
复制代码
具体安装过程(基本会点英语的应该看得懂,实在不行百度吧)
Raspberry Pi service application
  • Open Java project raspberry-camera-service in Eclipse and add reference to eneter-messaging.jarwhich you downloaded.
    (Right click on the project -> Properties -> Java Build Path -> Libraries -> Add External Jars -> eneter-messaging-6.0.1.jar)
  • Build the project and then export it to executable jar.
    (Right click on the project -> Export... -> Java -> Runable JAR file -> Launch configuration -> Export Destination -> Package required libraries into generated JAR -> Finish.)
  • Copy the generated jar to the Raspberry device.
  • Start the application
    java -jar raspberry-camera-service.jar
.NET Client Application
  • Open RaspberryCameraClient solution and add reference toEneter.Messaging.Framework.dll which you downloaded.
  • Check if the path VLC is correct in MainWindow.xaml.cs.
  • Provide correct IP address to your Raspberry Pi service in MainWindow.xaml.cs.
  • Compile and run.
  • Press 'Start Capturing'.

本来准备发代码的  系统有字数限制就算了吧


具体的 大家看附件吧



RaspberryCamera.rar

15.81 KB, 下载次数: 10

回复

使用道具 举报

发表于 2015-4-22 13:44:26 | 显示全部楼层
谢谢分享,学习中。。。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|树莓派论坛 ( 粤ICP备15075382号-1  

GMT+8, 2024-11-25 17:47 , Processed in 1.125000 second(s), 30 queries , Gzip On.

Powered by Shumeipai.net! X3.2

© 2001-2015 树莓派论坛安全联盟

快速回复 返回顶部 返回列表