nearest.raster.point(spatstat)
nearest.raster.point()所属R语言包:spatstat
Find Pixel Nearest to a Given Point
像素最近一个给定的点
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Given cartesian coordinates, find the nearest pixel.
在直角坐标系中,找到最近的像素。
用法----------Usage----------
nearest.raster.point(x,y,w, indices=TRUE)
参数----------Arguments----------
参数:x
Numeric vector of x coordinates of any points
数字矢量x的任意点坐标
参数:y
Numeric vector of y coordinates of any points
数字矢量y的任意点坐标
参数:w
A window (an object of class "owin") of type "mask" representing a binary pixel image.
一个窗口(对象类"owin")类型"mask"代表一个二进制像素的图像。
参数:indices
Logical flag indicating whether to return the row and column indices, or the actual x,y coordinates.
逻辑标志指示是否返回的行和列指数,或实际的x,y坐标。
Details
详细信息----------Details----------
The argument w should be a window (an object of class "owin", see owin.object for details) of type "mask". This represents a binary pixel image.
参数w应该是一个窗口类的一个对象"owin",看到owin.object的详细信息,的类型"mask"。这表示一个二进制的像素的图像。
The arguments x and y should be numeric vectors of equal length. They are interpreted as the coordinates of points in space. For each point (x[i], y[i]), the function finds the nearest pixel in the grid of pixels for w.
的参数x和y应该是数字向量的长度相等。它们被解释为在空间中的点的坐标。对于每一个点(x[i], y[i]),功能找到最近的像素在网格中的像素w。
If indices=TRUE, this function returns a list containing two vectors rr and cc giving row and column positions (in the image matrix). For the location (x[i],y[i]) the nearest pixel is at row rr[i] and column cc[i] of the image.
如果indices=TRUE,这个函数返回一个列表,其中包含两个向量rr和cc让行和列的位置(在图像矩阵)。的位置(x[i],y[i])最近的像素是于行rr[i]和列cc[i]的图像。
If indices=FALSE, the function returns a list containing two vectors x and y giving the actual coordinates of the pixels.
如果indices=FALSE,该函数返回一个列表,其中包含两个向量x和y的实际坐标的像素。
值----------Value----------
If indices=TRUE, a list containing two vectors rr and cc giving row and column positions (in the image matrix). If indices=FALSE, a list containing vectors x and y giving actual coordinates of the pixels.
如果indices=TRUE,一个列表,其中包含两个向量rr和cc让行和列的位置(在图像矩阵)。如果indices=FALSE,一个列表,其中包含向量x和y给予实际的像素坐标。
(作者)----------Author(s)----------
Adrian Baddeley
<a href="mailto:Adrian.Baddeley@csiro.au">Adrian.Baddeley@csiro.au</a>
<a href="http://www.maths.uwa.edu.au/~adrian/">http://www.maths.uwa.edu.au/~adrian/</a>
and Rolf Turner
<a href="mailto:r.turner@auckland.ac.nz">r.turner@auckland.ac.nz</a>
参见----------See Also----------
owin.object, as.mask
owin.object,as.mask
实例----------Examples----------
w <- owin(c(0,1), c(0,1), mask=matrix(TRUE, 100,100)) # 100 x 100 grid[100×100格]
nearest.raster.point(0.5, 0.3, w)
nearest.raster.point(0.5, 0.3, w, indices=FALSE)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|