如何从多维数组中筛选出一些值,然后计算平均选定值?
因此,当我单击某个图像时,它应该显示深度数据(来自Microsoft Kinect),不仅在鼠标指针所在的位置,而且还应该计算环境中的值(这是多维数组).
这是我的代码:
protected void imageIR_MouseClick(object sender, System.Windows.Input.MouseEventArgs e)
{
// Get the x and y coordinates of the mouse pointer.
System.Windows.Point mousePoint = e.GetPosition(imageIR);
double xpos_IR = mousePoint.X;
double ypos_IR = mousePoint.Y;
int x = (int)xpos_IR;
int y = (int)ypos_IR;
lbCoord.Content = "x- & y- Koordinate [pixel]: " + x + " ; " + y;
int d = (ushort)pixelData[x + y * this.depthFrame.Width];
d = d >> 3;
int xpos_Content = (int)((x - 320) * 0.03501 / …Run Code Online (Sandbox Code Playgroud)