初始化接口 img:第一帧图像 width,height:输入图像分辨率
output_img:输出图像 w_out,h_out:拼接后输出图像分辨率
outh_off:输出图像行移动的像素数
Max_corner_count:角点最大数量,通常取128或64
Fast_corner_mode:0和1两种模式,通常取1 Fast_th:角点阈值,通常取80左右
Match_th:匹配阈值,通常取2560或2560*4/3
offset_th:预匹配的阈值,通常取5
nms_windon_size:非极大值抑制的窗口,一般取7
Max_filter_th_x,Max_filter_th_y:最大值滤波的x,y方向的阈值,一般取5,3
Frame_stride:拼接时帧的步长,一定程度上减缓拼接后的缝隙
Adjustment_enable:处理放大问题的使能
max_off:行偏移的最大数,提高匹配的速度。 void
mg_stitch_reinit(uint8_t*img, int width, int height, uint8_t
*output_img, int w_out, int h_out, int outh_off, int Max_corner_count,
int Fast_corner_mode, uint32_t Fast_th, uint32_t Match_th, int
Adjustment_enable); 重新初始化接口 void img_stitch_deinit();
结束时调用该接口,释放内存 int img_stitch_process(uint8_t*src_img,
uint8_t dst_img, uint8_toutput_img, uint8_t flag_force_stitch,
uint8_t flag_force_exit); src_img:第一帧图像 dst_img:第二帧图像
output_img:拼接后输出图像
flag_force_stitch:是否强制拼接(当拼接失败后,可以返回,也可以将该值设置为1,则会按照上一帧拼接的结果来拼接)
flag_force_exit:1代表强制推出。
返回值:返回1代表拼接成功,否则拼接失败。若为6,说明拼接后的输出图像达到了给定的最大buf,再继续拼接,会出现内存泄露。
int post_process(uint8_t src, uint8_tdst, int width, int height, int
center_x, int center_y); 后处理接口:对图像进行旋转矫正 src:输入图像
dst:输出图像 width, height:输入和输出图像的分辨率
center_x,center_y:中心点(拼接图像的中心点,行需要加上outh_off)
返回值为1代表进行了矫正,为0代表没有进行矫正 enum img_stitch_status {
success = 1, corner_count_err, match_count_err, mapping_err,
direction_err, out_w_err, force_exit_err, };