|
@@ -47,7 +47,7 @@ struct stitch_data
|
|
|
{
|
|
|
Mat scaled_gray_frame;
|
|
|
float work_scale;
|
|
|
- vector<KeyPoint> keypoints;
|
|
|
+ vector<Point2f> good_keypoints;
|
|
|
Mat descriptors;
|
|
|
Mat homo = (Mat_<double>(3, 3) << 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0); // store homography matrix to base image
|
|
|
Mat base_homo = (Mat_<double>(3, 3) << 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0); // store homography matrix to last base image
|
|
@@ -70,6 +70,7 @@ public:
|
|
|
|
|
|
int failed_count = 0; // 当前连续失败的帧数
|
|
|
int failed_thresh = 10; // 连续5帧失败才返回失败
|
|
|
+ vector<float> last_move_distances; // 记录存下来的最近10帧的移动距离,算均值,大于阈值的时候提示速度过快
|
|
|
|
|
|
float iou_thresh = 0.7; // iou低于该阈值的时候把这张图片存下来
|
|
|
float area_thresh = 0.5; // area threshold for green box
|
|
@@ -87,6 +88,7 @@ public:
|
|
|
Mat last_stitch_image = Mat(); // 最后一张拼接缩略图
|
|
|
int last_direction = 0; // 上一帧的手机移动方向
|
|
|
vector<float> last_angles = vector<float>{90, 90, 90, 90};
|
|
|
+ vector<float> last_scales = vector<float>{1, 1, 1, 1};
|
|
|
string last_stitch_image_path = ""; // 拼接缩略图的本地路径
|
|
|
stitch_data last_check_data; // 上一帧的数据
|
|
|
string big_stitch_image_path = ""; // 拼接大图的本地路径
|
|
@@ -118,6 +120,7 @@ void optimizeSeam(Mat &last_img, Mat &stitched_image, vector<Point2f> &corners);
|
|
|
void getLinePara(float x1, float y1, float x2, float y2, LinePara &LP);
|
|
|
float point_2_line(float k, float b, float k2, float x, float y);
|
|
|
int get_direction(vector<Point2f> &frame_corners, vector<Point2f> &transpose_corners);
|
|
|
+float get_move_distance(vector<Point2f> &frame_center, vector<Point2f> &transpose_center);
|
|
|
int dcmp(float x);
|
|
|
float cross(Point2f a, Point2f b, Point2f c);
|
|
|
float CPIA(vector<Point2f> a, vector<Point2f> b, int na, int nb);
|
|
@@ -126,13 +129,13 @@ Point2f get_intersection_point(Point2f a, Point2f b, Point2f c, Point2f d);
|
|
|
float PolygonArea(vector<Point2f> p, int n);
|
|
|
float single_quadrangle_iou(vector<Point2f> pts1, vector<Point2f> pts2);
|
|
|
float single_box_iou(vector<Point2f> pts1, vector<Point2f> pts2);
|
|
|
-void stitch_big_image(Mat frame, vector<float> angles, int direction, int big_frame_index);
|
|
|
+void stitch_big_image(Mat frame, vector<float> angles, vector<float> scales, int direction, int big_frame_index);
|
|
|
void cylindrical_projection(Mat &img, Mat &output, float angle);
|
|
|
+void SphericalProjection(Mat& imgMat, Mat& output, float angle);
|
|
|
void fill_contours(vector<vector<Point>> contours, Mat &source_image, Mat &target_image);
|
|
|
float angle_of_two_vector(Point2f &pt1, Point2f &pt2, Point2f &c);
|
|
|
void calc_angles(vector<Point2f> &conners);
|
|
|
|
|
|
-
|
|
|
#endif
|
|
|
|
|
|
#endif
|