如何使用java找出图像中心及其x,y坐标? [英] How to find out the image center and its x,y co-ordinate using java ?

查看:887
本文介绍了如何使用java找出图像中心及其x,y坐标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用java语言旋转图像矩阵45,90,180,270和360

所以我将在下一个链接应用方程式来旋转矩阵



http://主页。 inf.ed.ac.uk/rbf/HIPR2/rotate.htm [ ^ ]



但我认为(x0,y0)是图像中心的坐标

i需要计算这个中心

如果有人能帮忙那就太棒了!



问候!

I'm trying to rotate image matrix 45,90,180,270 and 360 using java language
so i will apply the equations in next link to rotate matrix

http://homepages.inf.ed.ac.uk/rbf/HIPR2/rotate.htm[^]

but i think (x0,y0)are the co-ordinate of the center of image
i need to calculate this center
If anyone could help that would be great!

Regards!

推荐答案

中心很简单:

Center is easy:
X Center: X(Top Left) + (Width / 2)
Y Center: Y(Top Left) + (Height / 2)


在SO上看一下类似的问题:http://stackoverflow.co m / questions / 14300520 / rotate-image-in-overriden-paintcomponent-method [ ^ ]。在那里你会找到完整的代码;)
Have a look at similar question at SO: http://stackoverflow.com/questions/14300520/rotate-image-in-overriden-paintcomponent-method[^]. There you'll find complete code ;)


这篇关于如何使用java找出图像中心及其x,y坐标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆