【发布时间】:2020-07-06 13:20:00
【问题描述】:
我在 98 宽 x 81 高的 *jpg 图像 (sample_7958) 中有一些以像素为单位的对象位置 (left_x,top_y,width,height):
im.name<-rep("sample_7958",3)
obj<-c(1,2,3)
left_x<-c(2,56,61)
top_y<-c(-0,23,37)
width<-c(9,15,32)
height<-c(8,14,23)
total_im_width<-c(98,98,98)
total_im_height<-c(81,81,81)
im.ds<-data.frame(cbind(im.name,obj,left_x,top_y,width,height,total_im_width,total_im_height))
im.ds
im.name obj left_x top_y width height total_width total_height
1 sample_7958 1 2 0 9 8 98 81
2 sample_7958 2 56 23 15 14 98 81
3 sample_7958 3 61 37 32 23 98 81
我知道在 *tiff 的原始图像中,图像的中心具有X,Y(803958,7674280) 坐标和0.05686330017443669976,-0.05686329721392673064 像素大小,那么我想找到任何方法来转换并在im.ds 中创建新列每个对象(1 到 3)的 X、Y 边界地理坐标(Xmin, Xmax, Ymin, Ymax)。这可能吗?
【问题讨论】:
标签: r coordinates raster r-raster coordinate-systems