Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I run an applet for accessing the PC camera

 
Daniel Georgescu
Greenhorn
Posts: 5
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm working on my master thesis. I have as subject -face recognition. The subjects should be identified in a webcam/PC camera, locally installed. I mean an USB camera. The application that I developed so far is a web application and I have all the necessary code accessing the camera in Swing, in a JFrame.
Even so I'm not able to port this code to a working applet inside my web app.
I've dug into this for few weeks. The best result I had was a blank applet frame.
The others reported different exceptions, either missing classes under JMF framework, or ( my best friend ) the applet class is not found.
The applet code I have is



and works fine if I run it in Eclipse ->Run as Java applet.

The question is:
Could you point me to a good tutorial or show me something working?
I'll really appreciate if you can give something for dummies or no-brain webcam Java applet programmer.
Thank you
 
Mavaj Sun Co
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I saw your code and I have tried to run it , but I go the error



I am wondering if you could solve the problem and willing to share with me how did you solve it . I have kind of similar requirement for my application but I can not access to any webcam local ( USB webcam ) via applet , but swing version work fine .

Thanks
MavajSunCo
 
Tim Moores
Bartender
Posts: 2803
41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At the very least, the applet needs to be signed: http://www.coderanch.com/how-to/java/HowCanAnAppletReadFilesOnTheLocalFileSystem
 
Daniel Georgescu
Greenhorn
Posts: 5
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I could solve it, doing undesired things. Not all are necessary. I don't know if here's allowed to cross post, but I posted on Oracle site, too. There is a long but detailed discussion. You will find every problem I met and how I solved it.
https://forums.oracle.com/forums/thread.jspa?threadID=2215540
I can say 3 things :
- basically it is a problem related to signing the applet
- begin with little steps : creating a file on your system, writing in that file, etc...
- keep an eye all the time in your Java Console in your browser.
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Daniel Georgescu wrote:
- begin with little steps : creating a file on your system, writing in that file, etc...


As designed, applets can't access files on the browser's system. They are the wrong tool for what you are trying to do. With enough signature stuff, perhaps on some operating systems, with some browsers you can make it work. But it will always be against the spirit, since a camera is by definition a device that will vary wildly in capabilities. Its hard to write
device independent code when you start out having to deal with device specifics.

I would look for javascript libraries that can access the camera, and skip applets completely.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64858
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaScript has less access to the client system than applets do.
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:JavaScript has less access to the client system than applets do.


Didn't know that. Still, Applets seem to me to be a poor match to the OP's requirements.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic