Best way to access web camera in Java - image

I need to access web camera using Java. This is what I want to do
Access web cam
Now the user can see web cam working because his face is visible on screen
(have heard some libs are there which doesn't show the video output of webcam)
when user click save button, take a snapshot and save it
I have tried number of ways to do this, from a long time.
JMF - Now it is dead
FMJ - Now it is dead too
VLCJ - too much because I am not creating a music/video player and it expect VLC to be installed
Xuggler - too much and hard work
JMyron - didn't work
JavaFX - I thought it could do it, but seems like it can't
I am even satisfied if the library is just ONLY doing the above mentioned, because that's enough for me. But I expect it to be simple too. Really great if it is not using DLLs, because it is not platform independent if it does. Really appreciate if it can DETECT the camera, without manually passing the camera name and other info as have do in VLCJ (because there might be thousands of camera brands, so I can't create a list of thousand elements in it). And, I am creating a desktop application, not web app.
If you know a library like this, please be kind enough to let me know. Other libraries (which might not suit to all of my requirements, but suits to the basic requirement) also welcome. Please help

I think the project you are looking for is: https://github.com/sarxos/webcam-capture (I'm the author)
There is an example working exactly as you've described - after it's run, the window appear where, after you press "Start" button, you can see live image from webcam device and save it to file after you click on "Snapshot" (source code available, please note that FPS counter in the corner can be disabled):
The project is portable (WinXP, Win7, Win8, Linux, Mac, Raspberry Pi) and does not require any additional software to be installed on the PC.
API is really nice and easy to learn. Example how to capture single image and save it to PNG file:
Webcam webcam = Webcam.getDefault();
webcam.open();
ImageIO.write(webcam.getImage(), "PNG", new File("test.png"));

Related

How to detect location/place type from the image?

I have a web application where user uploads the images of their locations. I want to write a program to detect the type of location and list of objects from the image. I write a program in C# using alturos YOLO to detect objects in the image. The result is fine for me but the problem is i want to detect the place type from the image. Like, if you upload some image that has snow then it should detect the "Snow" keyword. If you upload the "Lake" image then it should show keywords like "Lake, water, river etc". I am a web developer and never done any Machine Learning or image processing thing. But i am keen to learn this. Is there any way to do this or anyone can tell me the right path to do this.
I found this "https://www.clarifai.com/" but i want to write my own code because i have large number of images.
All in all, I'm pretty sure that there's no single correct answer to this. You could implement image recognition in a hundred different equally correct ways using different tools. So here's my opinionated perspective. Anyone and everyone is free to agree/disagree with what I'm saying.
I've worked a bit with Open CV (Python) in the past. There are a great number of libraries available based on it, so you can probably find a working base to build off of. I think that it should be capable of doing the task you specify, although I'm not quite sure how it would be done.
The other framework for machine learning and object recognition that I have seen is Apple's Create ML/ Core ML system (Swift or Objective-C). My experience with that one is as limited as cloning a git repo and poking around inside, but it looks pretty powerful.

interactive Augmented Reality 3D drawer

I'm planning on doing an interactive AR application that will use a laser sensor (for distances), GPS technology to get a location, and then use compass/gyroscope for tracking 6DOF viewfinder
movements. The user can choose from a number of ready-made 3D-models, and should be able to place them by selecting the desired location on the screen.
My target platform will be a 8"-handheld-device, running on windows8.
Any hints what would be the best AR-SDK or 3D-viewer to work with?
thanks in advance!
There are quite a few 3D viewers that are working in the browsers. But most recently and most notably: va3C viewer
It is webgl based app and doesnt require a server, so if your handheld device supports webgl, then you are good to go, however, whether it works on IE or not is questionable ;).
Although based on my experience and your usecase, I believe client side JS libraries do not provide enough access to the device's hardware. So you might have to serve the information like GPS, Gyroscope, from the server side, then gather this on the client using something like socket.io and then mash it up alongside the geometry.
I am trying to do something similar, although havent quite done it yet. Will keep you posted.
Another approach I am exploring is X3DOM, which gives the ability to write 3D data like XML alongside HTML, which is quite declarative and simple to pickup. X3DOM derives from X3D.
Tell me if you need more info.
Also, worth exploring for its motion abilities, is Robot Studio, which is a desktop app with SDK.

Media players that can be programmatically controlled? (Ruby)

I already know that iTunes has an interface that I can control, but the API is a bit opaque and I can't find it documented anywhere. Does anyone know of any good open-source or at least well-working media players that can be programmatically controlled?
In particular, I would like to be able to search a media library for a song by title or artist, and play, pause, resume, stop the song.
Ruby would be nice, because I'm working in it, but C would work too. I could write a wrapper.
Edit: My solution has to work on Windows, as that is the environment I am developing in.
XMMS works on a server / client basis. This means that it is relatively easy to control the playback, and the song queue. I'm not sure how easy is to handle file metadata (song info), but maybe that part can be handled independently.
Check this guide to get an overview of functions you can use.
Back in the day, I used MPD.

Converter from IP based cameras to Flash player

I would like to know the file formats that IP based surveillance cameras produces. I would then need to build or use available codec/ source code to convert to a format Flash player 10 can support. These are formats other than the usual .FLV for my website which is run on JBoss with Flex 3. I would like to support as many file formats as possible.
I do not want to introduce a streaming server (FMS or RED5 Open source) because of various reasons.
Have anyone any idea about this? Any help would be amazing to get because I have not done anything like this before.
Thanks in advance,
Ranjith
There's no reason to expect these to be standard or consistent; they can do anything they want as long as the camera and the base station agree.
You would have to acquire the target surveillance system and read its documentation, or sniff its network traffic and see what it does. If the first brand seems too difficult, move on to another brand.

Which Windows (C++) screen capture libraries fit my requirements?

I'm ready to outsource the screen capture functionality of our application, because it's not our core business and I've spent too much time trying to get our code to do all the things I need. Time for a specialist, I think. My requirements, in decreasing order of importance, are below. Does anyone have experience with any commercial or free libraries that meet most or all of these requirements?
Has to work in Windows XP and higher. (But not Win95/98/Me.)
Visual C++ 2005 compatible, where screenshot can be triggered from my code. Preferably a static library, but a DLL or COM object is OK. I'd prefer not to shell out to a standalone EXE because there are some users that will try to tamper with our application and I think having an obvious separate screenshot EXE makes that too easy.
Must be able to take full screenshots of multiple monitor systems. (Preferably the way the "Print Screen" key does in Windows, by making a bitmap of the displays stitched together, but if I have to take the pictures separately and combine them myself that's acceptable.)
Must be able to capture screen correctly when Remote Desktop Client (or any RDP client or VM) is in full screen mode. (Of course, it should also work when RDP is in windowed mode, but that shouldn't be a problem as long as it doesn't operate by simulating a key press that might get transmitted to the remote OS instead of being handled locally.)
Must be able to capture screen correctly when Windows Media Player (or any other media player) is in full screen mode.
Must be able to capture screen correctly when game (e.g. World of Warcraft) is in full screen mode.
Would be nice to be able to capture a few seconds of user activity as a video.
I don't know of a library that would do what you want.
If I had to code your requirements, I would probably use the source code of the TightVNC server as my starting point. I think it has the technology to do everything on your list EXCEPT....
I'm not sure that technically there's ANYTHING that can do a screen capture of somebody's Remote Desktop session. Think about it: There can be multiple remote desktop sessions (the csrss.exe process) occuring using the same physical remote desktop server. If you were sitting in front of the machine looking at the video monitor, you wouldn't see anything happening at all. So what woould you expect to capture. VNC is only going to capture what's happening with the "real" video (the non-remote csrss.exe).
I dont know if this really helps, but the best imaging libraries available are available from
www.accusoft.com and
www.leadtools.com
Both support creatting screenshots, though i don't know, if hey will properly capture movie player output that displays through graphics acceleration or the recording of movies from screen.
If I were you I would investigate WindowsClippings, a pretty mature and extensible application written in C++ that does precisely what you need. It has an API you can extend to your requirements and is pretty cheap at 18$
Some people in our office are using Magick++ (an ImageMagick library) to make screenshots. I don't know all the specs, but you could take a look at it and see if it matches your requirements.

Resources