tur*_*boy 24 android image image-processing
有谁知道Android的任何好的图像处理教程?我是android的新手,我正在编写一个对位图产生影响的应用程序.我可以在java中找到很多教程,但android不支持awt.我想使用android sdk操作位图中的像素,例如变形,鱼眼等.我可以访问像素并改变它们的颜色,但我对变换不太好,并且不确定从哪里开始.
Ode*_*ner 18
检查一下(在[基础知识] 29之后向下滚动):
http://xjaphx.wordpress.com/learning/tutorials/
有一些很棒的教程,如:
小智 8
您还可以签出JavaCV,它为您提供绑定到opencv lib的Java对象.这样您就不需要进行任何c/c ++编码,您可以直接在Java中完成所有操作并从opencv访问函数.
回答你的后续问题:
例如,采用圆柱投影:看一下图像 -
(对不起,我不允许发布图片)这是从Szeliskis的书(http://szeliski.org/Book/)中获取的.你最终在这里的关系是
x'=s*tan?¹(x/f)
Run Code Online (Sandbox Code Playgroud)
和
y'=s*(y/sqrt(x²+f²))
Run Code Online (Sandbox Code Playgroud)
其中f是摄像机的焦距和圆柱的半径,你可以使用f = s.现在将其转换为循环,这里有一些伪代码:
%% 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
Run Code Online (Sandbox Code Playgroud)
BildNeu是新图片,这个数组与BildAlt(原始图片)大小相同.
内循环结束时BildNeu和BildAlt的行可能如下:
/** 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);
Run Code Online (Sandbox Code Playgroud)