123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- // Grafting is the process of joining two plants together
- //(an upper portion and a lower portion) to grow as one.
- //The upper portion of the plant is known as the scion,
- //which is attached to the lower portion known as the rootstock.
- //rs -- rootstock, sc -- scion
- #pragma once
- #include "data_def_api.h"
- using namespace std;
- //定义GCV_DEBUG,每一步图像处理都会输出中间结果图片显示(opencv),回车后继续执行,用于测试
- // #define GCV_DEBUG
- // export
- #define GCV_EXPORTS
- #ifdef GCV_EXPORTS
- #define GCV_API __declspec(dllexport)
- #else
- #define GCV_API __declspec(dllimport)
- #endif
- #ifdef __cplusplus
- extern "C"
- {
- #endif
- namespace graft_cv
- {
- //1 设置log路径
- GCV_API int cv_set_logpath(char*lpath);
- //2 设置log等级
- GCV_API int cv_set_loglevel(int lev);// 0-debug, 1-info, 2-warning, 3-error
- //3 设置是否存储图片(存储路径在configure文件中),true--保存,false--不保存
- GCV_API int cv_init_image_saver();
- //4 初始化:本地配置文件初始化(yml)
- // 返回: 0- 正常; 1- 配置文件不存在
- GCV_API int cv_init(char*conf_file);
- //5 初始化:通过ConfigParam结构体对象直接赋值配置参数(内存)
- GCV_API void cv_set_param(ConfigParam&);
- GCV_API int cv_set_param_from_file(char*conf_file);
- //6 接口退出前的释放
- GCV_API int cv_release();
- //7 获取当前配置文件路径,输入char*要空间足够,内部没有检测是否越界
- GCV_API void cv_get_conf_file(char*);
- //8 保存到本地配置文件中(覆盖)
- GCV_API void cv_save_param(char* conf_file/*=0*/);
- //9 获取当前的配置参数
- GCV_API void cv_get_param(ConfigParam&);
- //10 获取当前版本号,char*要空间足够,内部没有检测是否越界
- GCV_API void get_version(char* buf);
- //11 茄科上苗,基于3d点云,找到抓取位置, 砧木
- //
- // 输入: points --- 输入, 指向点云的指针,点云为3值一组,结构:[pt0.x, pt0.y, pt0.z, pt1.x, pt1.y,pt1.z], 有时是4值一组(视采集设备数据情况)
- // pixel_size --- 输入,一个点云的维度(一般3或4)
- // pt_size-------- 输入, 点云数量,上例中数量为2
- // posinfo ------- 输出
- // double rs_grab_x; //砧木上苗抓取位置x,毫米
- // double rs_grab_y; //砧木上苗抓取位置y,毫米
- // double rs_grab_z; //砧木上苗抓取位置z,毫米
- // double rs_fork_x; //砧木上苗茎节位置x,毫米
- // double rs_fork_y; //砧木上苗茎节位置y,毫米
- // double rs_fork_z; //砧木上苗茎节位置z,毫米
- // double rs_width; //茎的宽度(直径),毫米
- // double rs_tortuosity; //弯曲度,离茎中心轴线最大距离,毫米
- // double rs_count; //当前第一排共有多少株
- // ImgInfo* pp_images[5]; //返回的处理结果图片
- //
- // fn ------------ 输入, points指向0,且fn可用时,读取文件中的数据(用于测试),仅支持ply格式
- //
- // 返回: 0- 正常; 其他- 失败
- GCV_API int sola_grab_point_rs(float* points, int pixel_size, int pt_size, PositionInfo& posinfo, const char* fn = 0);
- //12 茄科上苗,基于3d点云,找到抓取位置, 穗苗
- //
- // 输入: points --- 输入, 指向点云的指针,点云为3值一组,结构:[pt0.x, pt0.y, pt0.z, pt1.x, pt1.y,pt1.z], 有时是4值一组(视采集设备数据情况)
- // pixel_size --- 输入,一个点云的维度(一般3或4)
- // pt_size-------- 输入, 点云数量,上例中数量为2
- // posinfo ------- 输出
- // double sc_grab_x; //穗苗上苗抓取位置x,毫米
- // double sc_grab_y; //穗苗上苗抓取位置y,毫米
- // double sc_grab_z; //穗苗上苗抓取位置z,毫米
- // double sc_width; //茎的宽度(直径),毫米
- // double sc_tortuosity; //弯曲度,离茎中心轴线最大距离,毫米
- // double sc_count; //当前第一排共有多少株
- // ImgInfo* pp_images[5]; //返回的处理结果图片
- //
- // fn ------------ 输入, points指向0,且fn可用时,读取文件中的数据(用于测试),仅支持ply格式
- //
- // 返回: 0- 正常; 其他- 失败
- GCV_API int sola_grab_point_sc(float* points, int pixel_size, int pt_size, PositionInfo& posinfo, const char* fn = 0);
- //13 3d点云棋盘格标定功能,通过输入的点云(棋盘格点云),识别点云上的交叉点,并输出交叉点坐标
- GCV_API int chessboard_calibration(float* points, int pixel_size, int pt_size, PositionInfo& posinfo, const char* fn = 0);
- };//namespace graft_cv
- #ifdef __cplusplus
- }
- #endif
|