Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android image processing tutorial? [closed]

Tags:

Does anyone know of any good image processing tutorials for android? I'm new to android, and I'm coding an app that places an effect on a bitmap. I can find plenty of tutorials in java, but android does not support awt. I'd like to manipulate the pixels in the bitmap just using the android sdk, e.g. warping, fisheye etc. I can access the pixels and change their colour but I'm not too good with transformations, and not sure where to start.

like image 547
turtleboy Avatar asked May 21 '11 00:05

turtleboy


2 Answers

Check this out (scroll down after [The Basics] 29):

http://xjaphx.wordpress.com/learning/tutorials/

Has some great tutorials like:

  • Mean Removal effect
  • Smooth effect
  • Emboss effect
  • Engraving effect
  • Boost up color intensity
  • Rounded Corner Image
  • Watermarking on the fly
  • Image Flipping / Mirroring
  • Pixel Color Replacement
  • Tint Color
  • Flea / Noise Effect
  • Black Filter (Increasing the Darkness)
  • Snow Effect
  • Shading Filter
  • Saturation Filter
  • Hue Filter
  • Image Reflection Effect
  • Draw Text on a Curve
like image 103
Oded Breiner Avatar answered Oct 04 '22 19:10

Oded Breiner


You can also checkout JavaCV that give you Java Objects with bindings to opencv lib. This way you wouldn't need to do any c/c++ coding, you can do all directly in Java and access functions from opencv.

Google code Project

Answer to your followup question:

For example, take a cylindrical projection: Take a look at the image -

image

(sorry I'm not allowed to post pictures) this is taken from Szeliskis book (http://szeliski.org/Book/). The relation you have here in the end is

x'=s*tan⁻¹(x/f)  

and

y'=s*(y/sqrt(x²+f²))  

where f is the focal lenght of a camera and s the radius of the cylinder, you can use f=s. Now to get this into loops, here is some pseudocode:

%% xMitte , yMitte are the coordinates for the point in the middle for yNeu =1: height    for xNeu =1: width       dx = xNeu - xMitte ; %% X relativ to origin       dy = yNeu - yMitte ; %% Y relativ to origin       theta = atan(dx / f);       h = dy / sqrt(dx ^2+f^2);       x = (f * theta) + xMitte ;       y = (f * h) + yMitte ;       BildNeu (xNeu ,yNeu) = BildAlt (x, y);    end end 

BildNeu is the new picture, this array has the same size as BildAlt (the original picture).

The Line with BildNeu and BildAlt at the end of the inner loop could be like:

/** returns the color value of that pixel **/ CvScalar pixel = cvGet2D(originalImage, i, j); /** writes the new color value of that pixel **/ cvSet2D(destinationImage, y, x, pixel); 
like image 22
rac2030 Avatar answered Oct 04 '22 18:10

rac2030