I'm developing a simple (or at least thought so) desktop application in Java for real-time image processing. I've chosen to access video frames using the Java Media Framework (JMF). I have a PAL camera and use EasyCAP video converter for digitizing. The device is visible on my Windows machine as a VFW device, allowing for YUV and 24-Bit RGB format acquisitions (32-Bit not available).
I already figured out the basics of the framework. I'm using a javax.media.Processor for media-data controlling and, for the beginning, wanted to add a grayscale-codec (implementing javax.media.Codec) for further rendering. In the codec I can access individual frames as javax.media.Buffer objects.
What is the fastest way to do the grayscale conversion in Java? I'd like to stick to some standard like JAI or so, as I'd like to be able to easily do further conversions using the same framework / methods.
I've been considering the following until now:
Adding a codec on the beginning of the codec chain to convert 24-Bit RGB to 32-Bit RGB. Than using java.nio.ByteBuffer to cast byte[] to int[] pixel-array for further processing with javax.awt.image filters. I've already tried to use com.sun.media.codec.video.colorspace.RGBConverter to achieve that, without success, though.
I'd be really grateful for any help, hope anyone has already done that.
I'd be grateful for any suggestions regarding overall application architecture as well. My general goal is to implement an Optical Flow algorithm in Java to be able to estimate camera attitude in real-time using visual input only.
Have a look at this library at JH Labs ( http://www.jhlabs.com/ip/filters/index.html ).
It is available with source code. You can check the implementation there... specifically GrayscaleFilter.. Also Check the license before use. If you like it then please give credit to the original author.. :)
Related
I'm starting a project for college that uses ImageJ and Micro Manager. I want to be able to access each pixel of the image taken from a snapshot of the camera feed. My goal is to be able to apply a custom built function to each pixel on the snapshot of the image. Is it possible to do this using ImageJ.
Yes you can, but at which level do you want to work: ImageJ macros or dive into the java code?
If you stay at the macros level, I don't think that you can access the pixel values.
However, if you want to do a little bit of programming, ImageJ uses the ImageProcessor class, which is extended according to the encoding type: ByteProcessor, ShortProcessor, BinaryProcessor, ColorProcessor. Then, you can access the pixel values using the methods getPixels(), getPixel(x,y), getPixelValue(x,y). But be careful to the encoding type, these methods are encoding specific.
I need to develop the simple skin disease diagnose system using image processing and neural network. To use images in neural network, image should be same standard and, To identify the skin disease we should apply some image processing technique as well.
But I don't know what image processing technique apply first and what are they?
As I read from references I think I need to apply image filtering technique, edge detection technique , etc...
Can someone who is expert in this please specify the image processing technique step by step. no need coding I just want to know image processing technique names and there order.
This is reference:
reference
I think when you say "images should be same standard" you mean that the images should represent similar patterns in similar form in order to train your neural network. However, I suppose you will not train your neural network using the image itself, in other words, the pixel values. You'll probably extract features from images for such purpose.
In the case you are dealing with patterns that can be recognized by its shape, in order to use "images in the same standard" you should apply morphological image operations in all images in your dataset and then extract shape features (area, width/height ratio, straight lines, angles, etc). These features could be the attributes input vector to your neural network and the pattern to be recognized could be the output.
The question is: what are the features necessary to properly identify the skin deseases? If you need to recognize spot in the skin, perhaps texture features. In order to extract texture features you will probably need to correct brightness variance in your dataset.
This is the just the tip of the iceberg. You could start choosing an image processing framework for such purpose:
ImageJ: I guess the most used framework for medical purposes.
Marvin Image Processing Framework (http://marvinproject.sourceforge.net/): easy to use Java image processing framework.
JMagick (http://www.jmagick.org/index.html): Java wrapper for ImageMagick.
The post below is a good start point:
"good resource for exploring image processing in java [closed]"
I'm attempting to make an app for Android and part of it includes the ability for me to convert an array of entries of x,y coordinates in to a character. e.g. if the coordinates form an L shape, it should return the character L.
I would assume that something like this exists already as I have seen similar things in other apps, although during my searching I wasn't able to find anything that did what I wanted (or I used the wrong search terms).
Does anyone know of any open-source systems that do this, or know of a good method for this?
Thanks for any help :)
For anyone who may want to do this in the future, I ended up using Gestures by Android - http://developer.android.com/reference/android/gesture/Gesture.html and used GesturePoints to input my x,y coordinate pair.
This functionality did exist previously (not sure if it still does, or if this project is open source) in the 'Eye's Free' product, which is designed to aid vision impaired users.
Your best bet is to use functionality from here is possible.
Source-code repo: https://code.google.com/p/eyes-free/
Blog: http://eyes-free.blogspot.com/
Search for TV Raman - he is\was the lead developer for this project
I think this is the specific project you are looking for (on Eye's Free source repo): https://code.google.com/p/eyes-free/downloads/detail?name=com.googlecode.eyesfree.inputmethod.latin-v1.1.6.apk&can=2&q=
You could use Android's built-in GestureDetector (http://developer.android.com/reference/android/view/GestureDetector.html). It will recognize shapes stored in a shape dictionary that you can ship with your app. You will have to seed the dictionary (although there may be some pre-defined alphabet dictionaries for free these days, this functionality has been around since API level 1). You can seed the dictionary by using your development environment and a utility to draw and save pre-defined shapes and map them to expected input.
The GestureDetector APIs will give you a probabilistic match between what the detector recognizes vs. what is in the dictionary and you can determine what to do with the input shape.
I have used this before in an old app and it works very well.
Here's another link to the old Android Dev docs for it: http://docs.huihoo.com/android/2.1/resources/articles/gestures.html
I'm new to adaptive bit rate streaming. Basically I'm trying to write an app that shows information about the quality of the connection on an Android device.
Since HoneyComb(3.0), Android supports adaptive bit rate streaming through HTTP Live Streaming (HLS). It seams like support for helping developers verify the quality of this connection device side is very limited.
What I would like to know is some low level information about the stream. Such as: the number of segments, the segment duration, number of requests to change bit rate, the bit rate the media player sees (to facilitate the change), etc.
I've been able to get some information about stream quality from the MediaPlayer, MediaController, MediaMetaDataRetriever, CamcorderProfile, MediaFormat, MediaExtractor classes. However, the stuff I'm looking for is even lower level. If possible I'd like to be able to actually see how the player is communicating with the server.
I just started looking at the MediaCodec class, however I can't figure out how to get the MediaCodec from a mediaplayer. Or Maybe I just don't know how to use this properly as I cannot find any good documentation and examples.
Does anyone know if it is possible to access the low level information on the Android that I'm looking for? Is the MediaCodec the way to go? If so, does anyone have any working examples of how I could get the currently used MediaCodec and extract the information I'm looking for out of it? (Or at least point me in the right direction)
Really appreciate any help on this one.
Cheers
I'm trying to make a program that roughly does the following:
produceBeepSound(double loudness);
can I do such a thing in Java? I need it to be very precise. What about matlab? Which language would be best for this task. The language must have a GUI component.
You can use Java Media Framework to produce sound but it is not necessary because you can work with javax.sound.sampled package and integrate it with Java Swing.
In python take a look at pyaudio library and also take a look at PythonInMusic it has a whole lot of collection of various A/V module.
Also, take a look at Beeper.
It is a GUI program, using only J2SE classes, that can produce a sound
of configurable tone & duration, and (with a bit of tweaking) at
different raw volumes
Thanks to #Andrew for once again correcting me.
In MATLAB, just use the SOUND function:
http://www.mathworks.com/help/techdoc/ref/sound.html
You can specify a vector which represents your signal, and the amplitude on that vector will determine loudness, so its a matter of simple scaling.
you can try Csound. There is API for java.
You should also check this wiki page: http://en.wikipedia.org/wiki/Comparison_of_audio_synthesis_environments.
But if you need somthing simple you can try:
java.awt.Toolkit.beep();
or
System.out.println((char)7);
But you won't have volume control.
Probably my favourite approach would be HTML 5 audio api - https://wiki.mozilla.org/Audio_Data_API#Writing_Audio
on windows actually any language can emit a sound just outputting ascii character "\007". Here is a nice article about how to do it in java.