How to create a new camera source in Java? - java

I am trying to create a new camera source or driver in java. There is a similar question based on python. What am trying to do is that I want a new camera source shown in windows so that all apps can connect to it. And the output will be many images showing in a loop instead of live camera. Can I achieve this with java? If yes How? In stackoverflow there are many questions based on c++. But not about Java. I am trying to achieve this in Java. I think for this I need to use something like directX.
I know how to create the loop of images. But How to create a camera source?

May be you could divide your problem in two parts:
Using a tool for creating virtual webcam video source rather than trying to create a driver from scratch. As discussed in many questions, for example this, you can use the following tool to create a virtual Direct Show source:
DirectShow Video Source Filter for JPEG and M-JPEG IP Cameras
Using another tool like ffmpeg to generate a real time mpegts udp stream from your images (as shown in this question). That stream is the one that the virtual camera source will read from.
You could even use Java to create the stream on point 2, using some library like this (not tested by me).

Related

Recording over existing audio file in android

I am currently building an app in android, and I am trying to record my audio over an existing audio file (without changing the length of the file), does anyone know how is it possible to do that? Everything I tried just puts the audio files one after another in one file.
A. You should use GGmpeg for Android, for example. Here you have some questions like yours.
question with code
more detailed tutorial
Google Group
another question
B. Another approach, although limited, is Android SoundPool. Check documentation here.
The sound pool requires you to manage multiple files rather than doing
mixdowns and playback of a single file. It would be cool if the
soundpool let you grap the output as a IOStream but, alas, the SDK
doesn't seem to allow it. Further, it would be nice if the
AudioRecorder allowed you to grab a stream from the music layer...but
that doesn't look possible either. List of audio inputs:
http://developer.android.com/reference/android/media/MediaRecorder.AudioSource.html
SOURCE: https://stackoverflow.com/a/2254086/9415337
C. Others suggest also doing it in a backend server.
D. This might also help you.

Get frame from video in Java

I need to extract a single frame from a video file to use as a thumbnail. I would like to be able to generate thumbnails from most common video formats and would also like to be cross platform, so a pure Java solution is preferential.
It would be also useful to be able to get additional information about the video such as frame rate and total length so I can get a frame from a specific place in the file.
I have looked at Xuggler but it appears to be depreciated.
Assuming you want to do this server side, then it may be easiest to leverage ffmpeg as it is commonly used for this type of video manipulation and it also has a large user community.
As ffmpeg is C based, using it with Java requires some sort of wrapper or JNI approach so it is not strictly speaking pure Java, but it is common to use it this way in Java programs. An example wrapper library, which seems to be regularly maintained, is:
https://github.com/bramp/ffmpeg-cli-wrapper

video Image processing , how can i?

So Here is the situation.
I have a video that contain some objects that moves (contract to be more accurate),
I'm trying to write a code to calculate these movements in matter of
Frequency of movements (how many contractions per minute)
How far does the contraction goes in mm.
How can this be done ?? :D!
I use Matlab now to to blot amplitude difference between each frame but its not giving very nice results so far.. (very buggy)
Any tips ? language i should use best, or is there already something exist that can compare different images and plot difference ?
Thanks
You should try Processing using one of these libraries.
Keywords to search for: Blob detection, Computer Vision
The best library for tracking moving objects is OpenCV, which can be used from within Processing, too. Tracking faces for example works like a charm there, but for more abstract shapes you should try another library like BlobDetection!
OpenCV is a great library if you plan to write into C/C++ (or wrapped into JavaCV if you prefer Java). Matlab is a great tool too, especially if you are working on a proof of concept you may want to work with something more friendly and "lighthearted" than C.
If you plan to measure positions or distances I suggest you to use some calibration toolbox to consider intrinsic/extrinsic parameters and eventually camera defects, it will give you more precise results. It is builtin into OpenCV, or take a look here if you plan to use Matlab.
so i'm not expert on this but if you want write something in php you probably would use gd library or imagemagick library also imagemagick utility on linux contains some comparing tool according this http://www.imagemagick.org/script/compare.php

1-D barcode scanner(using images from a capturing device) implementation in java

I am a student and as a project i have to implement a barcode(1-D) based attendance marking system.While surfing across the web i came to know that barcode readers are a bit costly toys to purchase,so now what I want to do is I want to capture images of barcodes through a capturing device(mostly a webcam) and then process them to get the content stored in it.
I found a few projects on the internet that do the same but they use .NET f/w and I am not so familiar with .NET technology. The only project that uses java is http://sourceforge.net/projects/javabarcoderead/ but somehow i am not able to run the jar file they are providing.
SO, I would like to know about the algorithms or methods that can be used for the same or even any project from where i can get some insight on how to move further with this...
Happy Coding...
You're right, it would be very difficult to use a library with no documentation and no source code.
I'd suggest using ZXing. It's a well-documented library with lots of examples.

JavaNNS - Parsing the created Neural Network

I'm currently working on a Neural Network for creating a "better" PNG Predictor (Prefilter).
I already created the network (with JavaNNS) which has a quite good learning rate on 8-Bit grayscale images.
Now my next step would be to include this created network in my prepared PNG Encoder/Decoder which is written in Java. But to do that I need to parse the created .net file from JavaNNS.
I don't want to invent the wheel again so is there any chance that another one of you has already written a simple parser for the .net files of the JavaNNS which would read all the layers with the neurons, the connections and the weights on the connections and store it in any usable Java data structure?
I know it isn't that hard to create a parser, but it would be awesome to save time and skip this "boring" task.. :)
Thanks!
JavaNNS's predecessor, SNNS (alternative link), had an export function which exported the trained network as C code (essentially a header and source file pair). These files could then be used in custom code.
In Java you could use JNI or JNA to call C code and I am sure there are threads here on SO how to accomplish this.
I do not know the current version of JavaNNS, but maybe they already provide an export function exporting the network as Java code instead of C? Or you could open your trained network in the old SNNS and export it?
I just wanna add that I've created my own .net (JavaNNS) File Parser in Java. It is possible to parse single hidden layer networks. If anyone needs the code who run into the same problem I had before I am happy to share my code.
You can contact me on my blog. Here is the post about the Neural Network Project I've done. Just let a comment there and I will provide you the JavaNNS Parser and the corresponding NeuralNetwork Class.
http://prineblog.wordpress.com/2011/06/21/neural-network-as-predictor-for-image-coding-png/
I just updated the Version of Nen to Beta - It is a lightweight 3-layer neural network implementation in Java for regression and classification. A little performance comparison against support vector machines (LibSVM) demonstrates its capabilities. It can be used via command line or Java.

Categories

Resources