diff --git a/src/alg_sec.cpp b/src/alg_sec.cpp index b25eabd9..30a174c9 100644 --- a/src/alg_sec.cpp +++ b/src/alg_sec.cpp @@ -592,35 +592,4 @@ void algsec_detect(ctx_cam *cam){ } -void algsec_primary(ctx_cam *cam){ - /*This function runs on the camera thread */ - #ifdef HAVE_OPENCV - Mat mat_dst, mat_out, mat_fgmsk; - int imgsize; - - mythreadname_set("pcv",cam->threadnr,cam->conf->camera_name.c_str()); - - imgsize = (cam->imgs.height * cam->imgs.width * 3) / 2; - cam->current_image->diffs=2000; - - Ptr pBackSub; - pBackSub = createBackgroundSubtractorMOG2(); - - Mat mat_src = Mat(cam->imgs.height*3/2, cam->imgs.width - , CV_8UC1, (void*)cam->current_image->image_norm); - cvtColor(mat_src, mat_dst, COLOR_YUV2RGB_YV12); - - pBackSub->apply(mat_dst, mat_fgmsk,0); - - cvtColor(mat_fgmsk, mat_out, COLOR_BGR2YUV_I420); - memcpy(cam->imgs.image_motion.image_norm,(unsigned char*)mat_out.data,imgsize); - - mythreadname_set("ml",cam->threadnr,cam->conf->camera_name.c_str()); - - #else - (void)cam; - #endif - -} - diff --git a/src/alg_sec.hpp b/src/alg_sec.hpp index 594e4192..6053c419 100644 --- a/src/alg_sec.hpp +++ b/src/alg_sec.hpp @@ -54,6 +54,5 @@ struct ctx_algsec { void algsec_detect(ctx_cam *cam); void algsec_init(ctx_cam *cam); void algsec_deinit(ctx_cam *cam); -void algsec_primary(ctx_cam *cam); #endif \ No newline at end of file diff --git a/src/motion_loop.cpp b/src/motion_loop.cpp index 59e5056c..7af8caa2 100644 --- a/src/motion_loop.cpp +++ b/src/motion_loop.cpp @@ -899,18 +899,15 @@ static void mlp_detection(struct ctx_cam *cam){ } if ( !cam->pause ) { - if (cam->conf->primary_method == 0){ + if (cam->conf->primary_method == 1) { + alg_new_diff(cam); + } else if (cam->conf->primary_method == 0){ alg_diff(cam); alg_lightswitch(cam); alg_switchfilter(cam); alg_despeckle(cam); alg_tune_smartmask(cam); - } else if (cam->conf->primary_method == 1) { - alg_new_diff(cam); - } else if (cam->conf->primary_method == 2) { - algsec_primary(cam); } - } else { cam->current_image->diffs = 0; } @@ -938,8 +935,6 @@ static void mlp_tuning(struct ctx_cam *cam){ if (cam->conf->primary_method == 0){ alg_update_reference_frame(cam, UPDATE_REF_FRAME); - } else { - alg_new_update_frame(cam); } cam->previous_diffs = cam->current_image->diffs;