簡體   English   中英

加入圖像后找到新坐標

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM