Android Image Problem and threshold - android

Long time reader never posted until now.
Im having some trouble with Android, im implementing a library called JJIL its an open source imaging library.
My problem is this i need to run some analysis on an image and to do
so i need to have it in jjil.core.image format and once those
processes are complete i need to convert the changed image from
jjil.core.image to java.awt.image.
I cant seem to find a method of doing this does anyone have any ideas
or have any experience with this?
I would be grateful of any help.
Danny

You should let others know what you found... probably you found that android.graphics.Bitmap has a getPixel(x,y) method that returns an int representing the ARGB value?
http://developer.android.com/reference/android/graphics/Bitmap.html

I have done some serious research into this and i have found that i can extract the rgb values of a bitmap image with a similar method.
But the threshold that i was using the previous library for is now not possible because i have had to abandon the use of this library.
Is there a way to use colour matrix's to threshold the image? Or better still is there an inbuilt method that would do this automatically?
Thank you for any help.
Danny

Related

Speed Comparison decodeResource vs createBitmap

For a current project I need to know which method is faster:
Bitmap.createBitmap(width,height,config)
or
BitmapFactory.decodeResource(getResources(),id)
thanks for your support
I usually ask questions on sites like this because I hope there are some people who may have experienced the same situation or asked themselves the same question as I do. But more and more i recognised that simple questions like the above one,are obviously not wanted here.
The answer for my question is:
Loading Bitmaps is not as fast( and thus efficient) as creating a new one
Thanks for the great help and suggestions
I upvoted your answer but it's important to note that these methods are not interchangeable, as some people may assume from the question.
AFAIK, BitmapFactory.decodeResource() is used to instantiate a Bitmap from a resource (e.g. a .png or .xml in the drawable directory),
While Bitmap.createBitmap() is used to instantiate a brand enter code herenew Bitmap (basically from primitives such as float etc), so i don't see how they could be interchangeably used, and hope i saved future readers from scratching their heads a little.

Better option to handle JPEG byte array decoding

Given a JPEG Encoded byte array taken from a camera, I need to decode it and display its image (bitmap) in my application. From searching around, I've found that there are two primary ways to go about this: use NDK Jpeg Decoding library or use BitmapFactory.decodeByteArray. This is for an experimental embedded device being developed that runs on Android with a built-in camera.
I would greatly prefer to develop the application in SDK not NDK if possible at all, but many people seemed to handle this problem by going straight to NDK, which bugged me a bit.
Is there some sort of inherent limitation in BitmapFactory.decodeByteArray that forces you to handle this problem by using libjpeg in NDK (Perhaps speed? Incompatibility?)
Performance isn't a big consideration unless if it takes say more than 45 seconds to decode the image and display it.
This is an important decision I need to make upfront, so I'd appreciate any thoughtful answers. Thank you so much.
Here is a really good example / explanation how you can decode images on device efficiently without using NDK : Displaying Bitmap Efficiently. You have an option to decode bitmap from stream or file so it depends on your needs. But in most of my applications I am using the same method and it's working great. So I suggest you to take a look at the SDK example.
Hope it will helps you.

Android Image Processiing

In my application I want to capture an image and compare it with a stored image to know if they are similar.
What API/technology/third party application can I use to make this happen?
You can use the OpenCV library:
http://sourceforge.net/projects/opencvlibrary/
Take a look at this answer for ideas how to solve your problem:
Simple and fast method to compare images for similarity

How to generate a PDF using android drawing commands?

I have an android program which draws lines and text to a canvas. (These are all vector drawing operations.) Does anyone have any advice for exporting that canvas to a PDF? I've looked into changing the Bitmap.CompressFormat that the canvas is based upon, hoping there'd be a PDF (or some sort of vector) format, but no luck there.
My goal is to output some sort of Vector file suitable for printing.
I'd appreciate any advice. Thanks!
There is nothing in Android for this. You can take a shot at seeing if somebody has a PDF library for Java (e.g., iText) working on Android, but these libraries may be large.
A better solution may be for you to save in something simpler (e.g., SVG, an XML format) and have your server convert that to PDF or anything else desired.
That was very long ago. If anybody happens to find this question nowadays, Android has it since KitKat: PrintedPdfDocument.

android decoding video frame not displayed properly - interlacing problem?

I am beginner in android. I am working on porting ffmpeg to android and i am able to display the picture, which looks really odd. I am providiing the links to pictures please advice me what really went wrong in my case.
In the native code I call sws_scale function to convert image from native format to rgb 565 and I use this rgb565 frame to be displayed using canvas and bitmap in java code.
I am guessing this is interlacing problem, but not sure. Need suggestions . Please help.
How are you calling ffmpeg? I definitely agree that its an interlacing issue. Can you just pass deinterlace to it?

Categories

Resources