Revision: 41416
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41416
Author:   nazgul
Date:     2011-10-31 14:27:32 +0000 (Mon, 31 Oct 2011)
Log Message:
-----------
Camera tracking integration
===========================

Remove moravec detector. It doesn't work really fine and it's times slower than 
fast detector.

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/blenkernel/BKE_tracking.h
    branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c
    branches/soc-2011-tomato/source/blender/editors/space_clip/tracking_ops.c

Modified: branches/soc-2011-tomato/source/blender/blenkernel/BKE_tracking.h
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/BKE_tracking.h   
2011-10-31 14:08:14 UTC (rev 41415)
+++ branches/soc-2011-tomato/source/blender/blenkernel/BKE_tracking.h   
2011-10-31 14:27:32 UTC (rev 41416)
@@ -90,10 +90,6 @@
                        int framenr, int margin, int min_trackness, int 
min_distance, struct bGPDlayer *layer,
                        int place_outside_layer);
 
-void BKE_tracking_detect_moravec(struct MovieTracking *tracking, struct ImBuf 
*imbuf,
-                       int framenr, int margin, int count, int min_distance, 
struct bGPDlayer *layer,
-                       int place_outside_layer);
-
 struct MovieTrackingTrack *BKE_tracking_indexed_bundle(struct MovieTracking 
*tracking, int bundlenr);
 
 void BKE_tracking_stabilization_data(struct MovieTracking *tracking, int 
framenr, int width, int height, float loc[2], float *scale, float *angle);

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c        
2011-10-31 14:08:14 UTC (rev 41415)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c        
2011-10-31 14:27:32 UTC (rev 41416)
@@ -1657,23 +1657,6 @@
 #endif
 }
 
-void BKE_tracking_detect_moravec(MovieTracking *tracking, ImBuf *ibuf,
-                       int framenr, int margin, int count, int min_distance, 
bGPDlayer *layer, int place_outside_layer)
-{
-#ifdef WITH_LIBMV
-       struct libmv_Features *features;
-       unsigned char *pixels= get_ucharbuf(ibuf);
-
-       features= libmv_detectFeaturesMORAVEC(pixels, ibuf->x, ibuf->y, 
ibuf->x, margin, count, min_distance);
-
-       MEM_freeN(pixels);
-
-       retrieve_libmv_features(tracking, features, framenr, ibuf->x, ibuf->y, 
layer, place_outside_layer);
-
-       libmv_destroyFeatures(features);
-#endif
-}
-
 MovieTrackingTrack *BKE_tracking_indexed_bundle(MovieTracking *tracking, int 
bundlenr)
 {
        MovieTrackingTrack *track= tracking->tracks.first;

Modified: 
branches/soc-2011-tomato/source/blender/editors/space_clip/tracking_ops.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_clip/tracking_ops.c   
2011-10-31 14:08:14 UTC (rev 41415)
+++ branches/soc-2011-tomato/source/blender/editors/space_clip/tracking_ops.c   
2011-10-31 14:27:32 UTC (rev 41416)
@@ -2244,11 +2244,9 @@
        MovieClip *clip= ED_space_clip(sc);
        ImBuf *ibuf= BKE_movieclip_get_ibuf_flag(clip, &sc->user, 0);
        MovieTrackingTrack *track= clip->tracking.tracks.first;
-       int detector= RNA_enum_get(op->ptr, "detector");
        int placement= RNA_enum_get(op->ptr, "placement");
        int margin= RNA_int_get(op->ptr, "margin");
        int min_trackness= RNA_int_get(op->ptr, "min_trackness");
-       int count= RNA_int_get(op->ptr, "count");
        int min_distance= RNA_int_get(op->ptr, "min_distance");
        int place_outside_layer= 0;
        bGPDlayer *layer= NULL;
@@ -2267,10 +2265,7 @@
                track= track->next;
        }
 
-       if(detector==0)
-               BKE_tracking_detect_fast(&clip->tracking, ibuf, 
sc->user.framenr, margin, min_trackness, min_distance, layer, 
place_outside_layer);
-       else
-               BKE_tracking_detect_moravec(&clip->tracking, ibuf, 
sc->user.framenr, margin, count, min_distance, layer, place_outside_layer);
+       BKE_tracking_detect_fast(&clip->tracking, ibuf, sc->user.framenr, 
margin, min_trackness, min_distance, layer, place_outside_layer);
 
        IMB_freeImBuf(ibuf);
 
@@ -2279,40 +2274,8 @@
        return OPERATOR_FINISHED;
 }
 
-static void detect_features_draw(bContext *C, wmOperator *op)
-{
-       uiLayout *layout = op->layout;
-       wmWindowManager *wm= CTX_wm_manager(C);
-       PointerRNA ptr;
-       int detector= RNA_enum_get(op->ptr, "detector");
-       PropertyRNA *prop_min_trackness;
-       PropertyRNA *prop_count;
-
-       prop_min_trackness= RNA_struct_find_property(op->ptr, "min_trackness");
-       prop_count= RNA_struct_find_property(op->ptr, "count");
-
-       if(detector==0) {
-               RNA_def_property_clear_flag(prop_min_trackness, PROP_HIDDEN);
-               RNA_def_property_flag(prop_count, PROP_HIDDEN);
-       } else {
-               RNA_def_property_flag(prop_min_trackness, PROP_HIDDEN);
-               RNA_def_property_clear_flag(prop_count, PROP_HIDDEN);
-       }
-
-       RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr);
-
-       /* main draw call */
-       uiDefAutoButsRNA(layout, &ptr, NULL, 'V');
-}
-
 void CLIP_OT_detect_features(wmOperatorType *ot)
 {
-       static EnumPropertyItem detector_items[] = {
-                       {0, "FAST",             0, "FAST",              "FAST 
corner detector"},
-                       {1, "MORAVEC",  0, "Moravec",   "Moravec corner 
detector"},
-                       {0, NULL, 0, NULL, NULL}
-       };
-
        static EnumPropertyItem placement_items[] = {
                        {0, "FRAME",                    0, "Whole Frame",       
                "Place markers across the whole frame"},
                        {1, "INSIDE_GPENCIL",   0, "Inside grease pencil",      
"Place markers only inside areas oulined with grease pencil"},
@@ -2328,17 +2291,14 @@
        /* api callbacks */
        ot->exec= detect_features_exec;
        ot->poll= space_clip_frame_poll;
-       ot->ui= detect_features_draw;
 
        /* flags */
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 
        /* properties */
-       RNA_def_enum(ot->srna, "detector", detector_items, 0, "Detector", 
"Detector using for detecting features");
        RNA_def_enum(ot->srna, "placement", placement_items, 0, "Placement", 
"Placement for detected features");
        RNA_def_int(ot->srna, "margin", 16, 0, INT_MAX, "Margin", "Only corners 
further than margin pixels from the image edges are considered", 0, 300);
        RNA_def_int(ot->srna, "min_trackness", 16, 0, INT_MAX, "Trackness", 
"Minimum score to add a corner", 0, 300);
-       RNA_def_int(ot->srna, "count", 50, 1, INT_MAX, "Count", "Count of 
corners to detect", 0, 300);
        RNA_def_int(ot->srna, "min_distance", 120, 0, INT_MAX, "Distance", 
"Minimal distance accepted between two corners", 0, 300);
 }
 

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to