代码之家  ›  专栏  ›  技术社区  ›  antecessor

获取图像中某一点的坐标

  •  0
  • antecessor  · 技术社区  · 6 年前

    让我们用 imager .

    library(imager)
    
    
    file <- system.file('extdata/parrots.png',package='imager')
    #system.file gives the full path for a file that ships with a R package
    #if you already have the full path to the file you want to load just run:
    #im <- load.image("/somedirectory/myfile.png")
    im <- load.image(file)
    
    plot(im) #Parrots!
    

    enter image description here

    我想得到这张照片中两点的坐标:眼睛,如下所示:

    enter image description here

    如何获得两个点的XY坐标的数值?

    0 回复  |  直到 6 年前
        1
  •  2
  •   antecessor    6 年前

    我找到了一个非常简单的解决方案:跑步 locator() 你可以点击绘图中的任何地方,在跳过后,我们得到R壳中的XY坐标。

    推荐文章