[英]find new coordinates after joining the images
我有 25 张坐标为 (x,y) 的图像,图像的大小为128*128
。 所以我加入了图像,新的图像大小为640 * 640
。 我想找出 (x,y) 的新坐标
我试过类似的东西
#w,h of the new image i.e 640 , 640
#imw,imh of the old image i.e 128*128
#x,y old coordinates
newx = int(( w * x )/ imw)
newy = int(( h * y )/ imh)
小图像(i, j)
到大图像:
X = 128 i + x,
Y = 128 j + y
大图到小图:
i = X / 128,
j = Y / 128,
x = X mod 128,
y = Y mod 128
(带整数除法)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.