public void setFeatureExtraction(ShowExtractedFeatureFormat setFeatureExtractionMode){
            ShowExtractedFeatureMode = setFeatureExtractionMode;
            // Setup FeatureExtraction Class
            //Default direcotry: "..\\..\\..\\Data";
            // To setup the mode, see README in the library

            // User dependent. Notice that this is important
            //FeatureExtraction.ModeFormat MyMode = FeatureExtraction.ModeFormat.F1000; 
            if (processor_mode_ == Manager.ProcessorModeFormat.Michael)
            {
                //FeatureExtraction.ModeFormat MyMode = FeatureExtraction.ModeFormat.Blue;
                //FeatureExtraction.ModeFormat MyMode = FeatureExtraction.ModeFormat.Demo1000;
                FeatureExtraction.ModeFormat MyMode = FeatureExtraction.ModeFormat.Demo3Trees1000FeaturesWithWall;
                Feature = new FeatureExtractionLib.FeatureExtraction(MyMode);
            }
            else
            {
                FeatureExtraction.ModeFormat MyMode = FeatureExtraction.ModeFormat.BlueDefault;
                Feature = new FeatureExtractionLib.FeatureExtraction(MyMode, "D:\\gr\\training\\blue");
            }


            // The following code is deprecated even it is commented. Look at the above! 
            //FeatureExtraction.ModeFormat MyMode = FeatureExtraction.ModeFormat.Blue;
            //FeatureExtraction.ModeFormat MyMode = FeatureExtraction.ModeFormat.BlueDefault;
            //Feature = new FeatureExtractionLib.FeatureExtraction(MyMode, "D:\\gr\\training\\blue");			
            //Feature = new FeatureExtractionLib.FeatureExtraction(FeatureExtraction.ModeFormat.F2000, "C:\\Users\\Michael Zhang\\Desktop\\HandGestureRecognition\\Experiments\\alglib");
            // Michael's code here
            //Feature = new FeatureExtractionLib.FeatureExtraction(FeatureExtraction.ModeFormat.Blue);            
            // end of deprecated
            label_colors = Util.GiveMeNColors(Feature.num_classes_);
            Feature.ReadOffsetPairsFromStorage();
            predict_output_ = new float[width * height * Feature.num_classes_];
            predict_labels_ = new int[width * height];
            pool_ = new int[width * height];
            Console.WriteLine("Allocate memory for predict_output");
            
            //Feature.GenerateOffsetPairs(); // use this to test the offset pairs parameters setting
        }
 private void CreateThreadFunction(FeatureExtraction.ModeFormat mode, string dir = "..\\..\\..\\Data")
 {
     feature_lib_obj_ = new FeatureExtraction(mode, dir);
 }
 public void SetupFeatureExtraction(FeatureExtraction.ModeFormat mode, string dir = "..\\..\\..\\Data")
 {
     //Default direcotry: "..\\..\\..\\Data";
     // To setup the mode, see README in the library
     FeatureExtraction.ModeFormat MyMode = mode;
     //dir = "D:\\gr\\training\\blue\\";
     
     //feature_lib_obj_ = new FeatureExtraction(MyMode, dir);
   /* 
     const int kMaxStackSize = 1000000;
     //Thread oThread = new Thread(new ThreadStart(this.IAmFoo), kMaxStackSize);
     Thread oThread = new Thread(delegate()
         {
          this.CreateThreadFunction(MyMode, dir);
         }, kMaxStackSize);
     oThread.Start();
     // Start the thread            
     oThread.Join();
    */
    feature_lib_obj_ = new FeatureExtraction(MyMode, dir);
    Debug.WriteLine("Sucessfully read model");
 }
        public ProcessorState(
            Ref<System.Drawing.Rectangle> crop, Ref<System.Drawing.Rectangle> crop_values, 
            Ref<int> upper, Ref<int> lower,
            KinectData data_, short[] depth, byte[] depth_label_, byte[] rgb, byte[] bitmap_bits,
            Dictionary<Tuple<byte, byte, byte>, byte> nearest_cache_, Dictionary<byte, byte[]> label_color_,
            byte kBackgroundLabel, List<byte[]> centroid_colors_, List<byte> centroid_labels,
            Ref<bool> predict_on_enable_, Ref<bool>feature_extract_on_enable_,
            Ref<bool> overlay_start_, int kNoOverlay, int[] overlay_bitmap_bits_, int[] kEmptyOverlay,
            FeatureExtractionLib.FeatureExtraction feature, float[] predict_output_, int[] predict_labels_,
            List<IWebSocketConnection> all_sockets_,
            Filter.Step[] pipeline,
            HandGestureFormat hand_gesture_value_, RangeModeFormat range_mode_value_, int[] pool, byte[] bitmap_bits_copy, int radius, double density, int cluster_threshold_count)
        {
            this.crop = crop;
            this.crop_values = crop_values;
            this.upper = upper;
            this.lower = lower;
            this.data_ = data_;
            this.depth = depth;
            this.rgb = rgb;
            this.bitmap_bits_ = bitmap_bits;
            this.depth_label_ = depth_label_;
            this.bitmap_bits_copy_ = bitmap_bits_copy;
            
            this.nearest_cache_ = nearest_cache_;
            this.label_color_ = label_color_;
            this.kBackgroundLabel = kBackgroundLabel;
            this.centroid_colors_ = centroid_colors_;
            this.centroid_labels_ = centroid_labels;

            this.predict_on_enable_ = predict_on_enable_;
            this.feature_extract_on_enable_ = feature_extract_on_enable_;

            this.overlay_start_ = overlay_start_;
            this.kNoOverlay = kNoOverlay;
            this.overlay_bitmap_bits_ = overlay_bitmap_bits_;
            this.kEmptyOverlay = kEmptyOverlay;

            this.feature = feature;
            this.predict_output_ = predict_output_;
            this.predict_labels_ = predict_labels_;

            this.all_sockets_ = all_sockets_;
            this.pipeline = pipeline;

            this.hand_gesture_value_ = hand_gesture_value_;
            this.range_mode_value_ = range_mode_value_;

            this.pool_ = pool;
            this.radius_ = radius;
            this.density_ = density;
            this.cluster_threshold_count_ = cluster_threshold_count;

        }