/**
         * 点1と点2の間に線分を定義して、その線分上のベクトルを得ます。点は、画像の内側でなければなりません。 320*240の場合、(x>=0 &&
         * x<320 x+w>0 && x+w<320),(y>0 && y<240 y+h>=0 && y+h<=319)となります。
         *
         * @param i_pos1
         *            点1の座標です。
         * @param i_pos2
         *            点2の座標です。
         * @param i_area
         *            ベクトルを検出するカーネルサイズです。1の場合(n*2-1)^2のカーネルになります。 点2の座標です。
         * @param o_coord
         *            結果を受け取るオブジェクトです。
         * @return
         * @throws NyARException
         */
        public bool traceLine(NyARIntPoint2d i_pos1, NyARIntPoint2d i_pos2, int i_edge, VecLinearCoordinates o_coord)
        {
            NyARIntCoordinates coord  = this._coord_buf;
            NyARIntSize        base_s = this._ref_base_raster.getSize();
            // (i_area*2)の矩形が範囲内に収まるように線を引く
            // 移動量

            // 点間距離を計算
            int dist = (int)Math.Sqrt(i_pos1.sqDist(i_pos2));

            // 最低AREA*2以上の大きさが無いなら、ラインのトレースは不可能。
            if (dist < 4)
            {
                return(false);
            }
            // dist最大数の決定
            if (dist > 12)
            {
                dist = 12;
            }
            // サンプリングサイズを決定(移動速度とサイズから)
            int s  = i_edge * 2 + 1;
            int dx = (i_pos2.x - i_pos1.x);
            int dy = (i_pos2.y - i_pos1.y);
            int r  = base_s.w - s;
            int b  = base_s.h - s;

            // 最大14点を定義して、そのうち両端を除いた点を使用する。
            for (int i = 1; i < dist - 1; i++)
            {
                int x = i * dx / dist + i_pos1.x - i_edge;
                int y = i * dy / dist + i_pos1.y - i_edge;
                // limit
                coord.items[i - 1].x = x < 0 ? 0 : (x >= r ? r : x);
                coord.items[i - 1].y = y < 0 ? 0 : (y >= b ? b : y);
            }

            coord.length = dist - 2;
            // 点数は20点程度を得る。
            return(traceConture(coord, 1, s, o_coord));
        }