[英]find new coordinates after joining the images
I have 25 images with the coordinates (x,y) and images are of size 128*128
.我有 25 张坐标为 (x,y) 的图像,图像的大小为
128*128
。 SO I am joining the images and new the image size would be 640 * 640
.所以我加入了图像,新的图像大小为
640 * 640
。 I want to find out the new coordinates of (x,y)我想找出 (x,y) 的新坐标
I tried something like我试过类似的东西
#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)
Small image (i, j)
to large image:小图像
(i, j)
到大图像:
X = 128 i + x,
Y = 128 j + y
Large image to small:大图到小图:
i = X / 128,
j = Y / 128,
x = X mod 128,
y = Y mod 128
(with integer division). (带整数除法)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.