Image processing in android with stretch scale and Twist effect - android

Now a day i am doing a project related to image processing with the fallowing feature
1)Stretch 2)Scale 3)Twist
I am not understand how to achieve it in android.
Here i am putting some screen shot related to this project for makeing more clarity in my question.
The above image is the real image i want to apply image processing over this image for making it like
blow image.
Please me any suggestion,help url ,tutorial and other thinks for achieve this task.

You need to find a function which, when applied to pixel coordinates, outputs new pixel coordinates producing the twist effect you're looking for.
It may help to take a look at some of the functions listed at http://reference.wolfram.com/mathematica/ref/ImageTransformation.html (esp. the section "Neat examples").
Once you have defined the function, you'd need to implement in Android the equivalent of the ImageTransformation command. Basically, for each pixel in the output image, call the function to know where to sample in the input image; use windowing when sampling the input image so that you limit artifacts and get a smoother result.

Related

Android: Animated gif image resize in kmagick

I am using kmagick for resizing gif images in android. It works fine for static but gives incorretc output for gif or animated webp files.
Magick.initialize().use {
val wand = MagickWand()
// getting image
wand.readImage(src)
// resizing image
wand.resizeImage(512,512,FilterType.UndefinedFilter)
// Saving image
wand.writeImage(dst)
promise.resolve("Done at ${dst}")
}
Input: (animated gif having multiple frames)
Output: I think its single frame and that also messed up but resizes according to input for height width.
Whats happening here. How to fix it?
Just want to reference for future, this was already answered in
https://github.com/cherryleafroad/kmagick/issues/3#issuecomment-1068044815
Anyways, to sum up what's going on,
Gifs are able to save the difference between frames to save space.
It's due to the way gif images work. Because the cli uses the api in a certain way, and kmagick bindings are only direct bindings to the c api, if you want to achieve the same results that the cli does, you have to use the api in the same way. (kmagick isn't doing anything to the image, it's imagemagick that's doing it; so it's more relevant to check imagemagick api docs / ask them so you can do it in the same way and get the same results).
I'm not sure what imagemagick api they're using off the top of my head however to achieve those results, but I think that doing something like extracting each frame individually then resizing them one by one would solve it.

Can we add a invisible image watermark to another image in Android? If yes then how?

I need the code to add invisible watermark to another image in Android
As the comments mentioned, Stackoverflow isn't a free coding service. I will provide you with a high level design advice from which you can implement your own code.
Invisible watermark could just be metadata. The point is to make your particular photo unique and identifiable, right? I would recommend you looking into image metadata manipulation for a simple solution.
That being said, if you are looking for some high tech stealthy watermarking, then you might be looking for pixel manipulation. You can change a few of the pixel colors so if it's compared with the original image with the naked eye, it looks identical but if compared with their base64 encoding you can see a difference. Simply create your own pattern as some sort of signature to attach to images to identify them.
Both method allows you to determine if an image is yours due to the "watermark" you leave on it.

Why Tesseract Tool for Android does not work in many cases

I am trying to implement Tesseract library to get text from the image, it works in some cases but in mostly it fails.
I am using this library in my Android project: https://github.com/rmtheis/tess-two
I am trying with this image
Actual Result
Expected Result
Wikipedia
The free Encyclopedia
Any suggestions as to why it's not working?
It's not working because of:
The uneven illumination in the image
The presence of part of the globe graphic at the top of the captured image.
By taking a picture of the screen, you're introducing some darker areas on the image that's captured. To fix it, you could use the image directly instead of taking a picture, or you could add code to your app to adjust for the uneven illumination.
With different illumination, and cropping around the text area, I get a better result:

Manipulate bitmap for best ocr detection

I'm using Tesseract ORC library to extract text from images taken on screens. Problem is that most modern cameras also captures the pixel on a display while taking a photo.
Is there anyway to apply like a filter or threasholding to the bitmap to "extract" the text to a clearer one for better results with tesseract?
Se example, before processing:
After processing (threshold effect in photoshop):
Tesseract has a built-in threshold method, TessBaseAPI#ThresholdRect. Have you tried that? If so, what problems did you have with it?
If it didn't work so well on some pictures, you may want to try looking up some "mean" or "adaptive" threshold algorithms, since it looks like Tesseract's is a straight threshold, so it may not adapt well to darker/lighter images without some tweaking.

Adjust Image properties (Like change contrast, brightness etc) using NDK

How to perform image manipulations using NDK?
I have already set up the NDK and have done a lot of research on the topic but did not get any result.
Thanking you in advance
For a quick start I would recommend Craig Lindley's book (Practical image processing in C). The image (bitmap) is nothing more than a 2D array of bytes (actually represented as an 1D-array). You may manipulate individual pixels to achieve brightness/contrast adjustment.
Build the histogram, recalculate new values for the image (to adjust constract).
If you don't want to read any book, look for tutorials like this: http://homepages.inf.ed.ac.uk/rbf/HIPR2/histgram.htm and read about it on Wikipedia

Categories

Resources