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.
Check this out (scroll down after [The Basics] 29):
http://xjaphx.wordpress.com/learning/tutorials/
Has some great tutorials like:
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 -
(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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With