|
@@ -19,7 +19,7 @@ extern CRITICAL_SECTION g_cs;
|
|
|
namespace graft_cv
|
|
|
{
|
|
|
|
|
|
- char *g_version_str = "0.6.16";
|
|
|
+ char *g_version_str = "0.7.0";
|
|
|
|
|
|
//configure
|
|
|
string g_conf_file = "./gcv_conf.yml";
|
|
@@ -44,12 +44,13 @@ namespace graft_cv
|
|
|
CRootStockCutPointReid g_rs_cp_reid = CRootStockCutPointReid(g_cp,&g_logger);
|
|
|
CScionCutPoint g_sc_cp = CScionCutPoint(g_cp,&g_logger);
|
|
|
|
|
|
- CRootStockGrabPoint g_rs_gp(g_cp, &g_logger);
|
|
|
+ CRootStockGrabPoint g_sola_grab_rs(g_cp, &g_logger);
|
|
|
+ CRootStockGrabPoint g_sola_grab_sc(g_cp, &g_logger);
|
|
|
|
|
|
- CSolaCutPointReid g_sola_rs = CSolaCutPointReid(g_cp, 1, &g_logger);
|
|
|
- CSolaCutPointReid g_sola_sc = CSolaCutPointReid(g_cp, 0, &g_logger);
|
|
|
+ CSolaCutPointReid g_sola_reid_rs = CSolaCutPointReid(g_cp, 1, &g_logger);
|
|
|
+ CSolaCutPointReid g_sola_reid_sc = CSolaCutPointReid(g_cp, 0, &g_logger);
|
|
|
|
|
|
- //
|
|
|
+ //??¶àÏß³ÌÓÐÎÊÌâ
|
|
|
map<string, cv::Mat> g_img_cache;
|
|
|
|
|
|
|
|
@@ -140,9 +141,10 @@ namespace graft_cv
|
|
|
g_oa.set_image_saver(&g_pImStore);
|
|
|
g_rs_cp.set_image_saver(&g_pImStore);
|
|
|
g_sc_cp.set_image_saver(&g_pImStore);
|
|
|
- g_rs_gp.set_image_saver(&g_pImStore);
|
|
|
- g_sola_rs.set_image_saver(&g_pImStore);
|
|
|
- g_sola_rs.set_image_saver(&g_pImStore);
|
|
|
+ g_sola_grab_rs.set_image_saver(&g_pImStore);
|
|
|
+ g_sola_grab_sc.set_image_saver(&g_pImStore);
|
|
|
+ g_sola_reid_rs.set_image_saver(&g_pImStore);
|
|
|
+ g_sola_reid_sc.set_image_saver(&g_pImStore);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
@@ -296,23 +298,23 @@ namespace graft_cv
|
|
|
return 0;
|
|
|
};*/
|
|
|
//
|
|
|
- int sola_grab_point(
|
|
|
+ int sola_grab_point_rs(
|
|
|
float* points,
|
|
|
int pixel_size,
|
|
|
- int pt_size,
|
|
|
- int dtype,
|
|
|
+ int pt_size,
|
|
|
PositionInfo& posinfo,
|
|
|
const char* fn/*=0*/
|
|
|
)
|
|
|
{
|
|
|
memset(&posinfo, 0, sizeof(PositionInfo));
|
|
|
+ int dtype = 1;
|
|
|
try {
|
|
|
- int rst = g_rs_gp.load_data(points, pixel_size, pt_size, fn);
|
|
|
+ int rst = g_sola_grab_rs.load_data(points, pixel_size, pt_size, fn);
|
|
|
if (rst <= 0) {
|
|
|
g_logger.ERRORINFO("invalid points");
|
|
|
return 1;
|
|
|
}
|
|
|
- int oa = g_rs_gp.grab_point_detect(dtype, posinfo);
|
|
|
+ int oa = g_sola_grab_rs.grab_point_detect(dtype, posinfo);
|
|
|
if (oa != 0) {
|
|
|
g_logger.ERRORINFO("no points");
|
|
|
return 1;
|
|
@@ -334,6 +336,43 @@ namespace graft_cv
|
|
|
|
|
|
}
|
|
|
|
|
|
+ int sola_grab_point_sc(
|
|
|
+ float* points,
|
|
|
+ int pixel_size,
|
|
|
+ int pt_size,
|
|
|
+ PositionInfo& posinfo,
|
|
|
+ const char* fn/*=0*/
|
|
|
+ )
|
|
|
+ {
|
|
|
+ memset(&posinfo, 0, sizeof(PositionInfo));
|
|
|
+ int dtype = 0;
|
|
|
+ try {
|
|
|
+ int rst = g_sola_grab_sc.load_data(points, pixel_size, pt_size, fn);
|
|
|
+ if (rst <= 0) {
|
|
|
+ g_logger.ERRORINFO("invalid points");
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ int oa = g_sola_grab_sc.grab_point_detect(dtype, posinfo);
|
|
|
+ if (oa != 0) {
|
|
|
+ g_logger.ERRORINFO("no points");
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (std::exception &err) {
|
|
|
+ g_logger.ERRORINFO(err.what());
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ catch (string& msg) {
|
|
|
+ g_logger.ERRORINFO(msg);
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ catch (...) {
|
|
|
+ g_logger.ERRORINFO("unknown error");
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
//9
|
|
|
int rs_oa_get_result(
|
|
@@ -422,16 +461,34 @@ namespace graft_cv
|
|
|
}
|
|
|
|
|
|
//
|
|
|
- int sola_cut_point_reid(ImgInfo*imginfo, int sola_type, PositionInfo& posinfo)
|
|
|
+ int sola_cut_point_reid_rs(ImgInfo*imginfo, PositionInfo& posinfo)
|
|
|
{
|
|
|
memset(&posinfo, 0, sizeof(PositionInfo));
|
|
|
+ int sola_type = 1;
|
|
|
try {
|
|
|
- if (sola_type == 0) {
|
|
|
- g_sola_sc.cut_point_reid(imginfo, cv::Mat(), posinfo);
|
|
|
- }
|
|
|
- else {
|
|
|
- g_sola_rs.cut_point_reid(imginfo, cv::Mat(), posinfo);
|
|
|
- }
|
|
|
+ g_sola_reid_rs.cut_point_reid(imginfo, cv::Mat(), posinfo);
|
|
|
+ }
|
|
|
+ catch (std::exception &err) {
|
|
|
+ g_logger.ERRORINFO(err.what());
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ catch (string& msg) {
|
|
|
+ g_logger.ERRORINFO(msg);
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ catch (...) {
|
|
|
+ g_logger.ERRORINFO("unknown error");
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ int sola_cut_point_reid_sc(ImgInfo*imginfo, PositionInfo& posinfo)
|
|
|
+ {
|
|
|
+ memset(&posinfo, 0, sizeof(PositionInfo));
|
|
|
+ int sola_type = 0;
|
|
|
+ try {
|
|
|
+ g_sola_reid_sc.cut_point_reid(imginfo, cv::Mat(), posinfo);
|
|
|
}
|
|
|
catch (std::exception &err) {
|
|
|
g_logger.ERRORINFO(err.what());
|