Esempio n. 1
0
 public static extern ErrorType draw_fhog_object_detector_scan_fhog_pyramid(PyramidType pyramid_type,
                                                                            uint pyramid_rate,
                                                                            FHogFeatureExtractorType extractor_type,
                                                                            IntPtr obj,
                                                                            uint weightIndex,
                                                                            int cellDrawSize,
                                                                            out IntPtr out_matrix);
Esempio n. 2
0
 public static extern ErrorType object_detector_scan_fhog_pyramid_serialize(byte[] fileName,
                                                                            int filepathLength,
                                                                            PyramidType pyramidType,
                                                                            uint pyramidRate,
                                                                            FHogFeatureExtractorType featureExtractorType,
                                                                            IntPtr obj,
                                                                            out IntPtr errorMessage);
Esempio n. 3
0
 public static extern ErrorType object_detector_scan_fhog_pyramid_operator(PyramidType pyramidType,
                                                                           uint pyramidRate,
                                                                           FHogFeatureExtractorType featureExtractorType,
                                                                           IntPtr detector,
                                                                           MatrixElementType elementType,
                                                                           IntPtr matrix,
                                                                           out IntPtr dets);
Esempio n. 4
0
 public void CreatePyramid(Player p, byte type, PyramidType pyramidType, ushort radius, ushort verticalExpansion)
 {
     List<Pos> buffer = new List<Pos>();
     Level level = p.level;
     ushort cx = (ushort)(p.pos[0] / 32), cy = (ushort)((p.pos[1] / 32) - 1), cz = (ushort)(p.pos[2] / 32);
     ushort sx = (ushort)(cx - radius - 1), sy = cy, sz = (ushort)(cz - radius - 1), ex = (ushort)(cx + radius + 1), ey = (ushort)(cy + (radius * verticalExpansion)), ez = (ushort)(cz + radius + 1);
     Pos pos = new Pos(); pos.x = cx; pos.y = ey; pos.z = cz;
     for (ushort iy = 0; iy < verticalExpansion; iy++)
         for (ushort ix = cx; ix > (ushort)(cx - 2); ix--)
             for (ushort iz = cz; iz > (ushort)(cz - 2); iz--)
                 if (level.GetTile(ix, (ushort)(ey + iy), iz) != type)
                 {
                     pos.x = ix; pos.y = (ushort)(ey + iy); pos.z = iz;
                     buffer.Add(pos);
                 }
     int temp = 0;
     if (pyramidType == PyramidType.Hollow)
     {
         for (ushort y = sy; y < ey; y++)
         {
             for (ushort x = sx; x < ex; x++)
                 for (ushort z = sz; z < ez; z++)
                     if (x == sx || x == (ushort)(ex - 1) || z == sz || z == (ushort)(ez - 1))
                         if (level.GetTile(x, y, z) != type)
                         {
                             pos.x = x; pos.y = y; pos.z = z;
                             buffer.Add(pos);
                         }
             temp++;
             if (temp == verticalExpansion)
             {
                 temp = 0;
                 sx += 1; ex -= 1;
                 sz += 1; ez -= 1;
             }
         }
     }
     else if (pyramidType == PyramidType.Solid)
     {
         for (ushort y = sy; y < ey; y++)
         {
             for (ushort x = sx; x < ex; x++)
                 for (ushort z = sz; z < ez; z++)
                     if (level.GetTile(x, y, z) != type)
                     {
                         pos.x = x; pos.y = y; pos.z = z;
                         buffer.Add(pos);
                     }
             temp++;
             if (temp == verticalExpansion)
             {
                 temp = 0;
                 sx += 1; ex -= 1;
                 sz += 1; ez -= 1;
             }
         }
     }
     Execute(p, buffer, type);
 }
 public static extern ErrorType create_tiled_pyramid(MatrixElementType img_type,
                                                     IntPtr img,
                                                     PyramidType pyramidType,
                                                     uint pyramidRate,
                                                     uint padding,
                                                     uint outer_padding,
                                                     out IntPtr out_img,
                                                     out IntPtr rects);
Esempio n. 6
0
 public static extern ErrorType input_rgb_image_pyramid_to_tensor(IntPtr input,
                                                                  PyramidType pyramidType,
                                                                  uint pyramidRate,
                                                                  MatrixElementType elementType,
                                                                  IntPtr matrix,
                                                                  int templateRows,
                                                                  int templateColumns,
                                                                  uint iteratorCount,
                                                                  IntPtr tensor);
Esempio n. 7
0
 public static extern ErrorType scan_fhog_pyramid_evaluate_detectors(PyramidType pyramid_type,
                                                                     uint pyramid_rate,
                                                                     FHogFeatureExtractorType extractor_type,
                                                                     IntPtr[] objects,
                                                                     int objects_num,
                                                                     MatrixElementType elementType,
                                                                     IntPtr image,
                                                                     double adjust_threshold,
                                                                     out IntPtr ret);
Esempio n. 8
0
 public static extern ErrorType structural_object_detection_trainer_scan_fhog_pyramid_be_verbose(PyramidType pyramid_type,
                                                                                                 uint pyramid_rate,
                                                                                                 FHogFeatureExtractorType extractor_type,
                                                                                                 IntPtr obj);
Esempio n. 9
0
 public static extern void object_detector_scan_fhog_pyramid_delete(PyramidType pyramidType,
                                                                    uint pyramidRate,
                                                                    FHogFeatureExtractorType featureExtractorType,
                                                                    IntPtr detector);
Esempio n. 10
0
 public static extern ErrorType object_detector_scan_fhog_pyramid_new(PyramidType pyramidType,
                                                                      uint pyramidRate,
                                                                      FHogFeatureExtractorType featureExtractorType,
                                                                      out IntPtr detector);
 public static extern ErrorType cross_validate_object_detection_trainer_scan_fhog_pyramid_test_object_detection_function_rectangle(PyramidType pyramid_type,
                                                                                                                                   uint pyramid_rate,
                                                                                                                                   FHogFeatureExtractorType extractor_type,
                                                                                                                                   IntPtr obj,
                                                                                                                                   MatrixElementType elementType,
                                                                                                                                   IntPtr images,
                                                                                                                                   IntPtr objects,
                                                                                                                                   out IntPtr matrix);
Esempio n. 12
0
 public Pyramid(PyramidType type, int firstVertex)
 {
     this.type = type;
     Top       = firstVertex;
     Count     = 1;
 }
Esempio n. 13
0
 public static extern ErrorType scan_fhog_pyramid_set_nuclear_norm_regularization_strength(PyramidType pyramid_type,
                                                                                           uint pyramid_rate,
                                                                                           FHogFeatureExtractorType extractor_type,
                                                                                           IntPtr obj,
                                                                                           double strength);
Esempio n. 14
0
 public static extern ErrorType input_rgb_image_pyramid_image_space_to_tensor_space(IntPtr input,
                                                                                    PyramidType pyramidType,
                                                                                    uint pyramidRate,
                                                                                    IntPtr data,
                                                                                    double scale,
                                                                                    IntPtr r,
                                                                                    out IntPtr rect);
Esempio n. 15
0
 public static extern ErrorType input_rgb_image_pyramid_new(PyramidType pyramidType,
                                                            uint pyramidRate,
                                                            out IntPtr ret);
Esempio n. 16
0
 public static extern void structural_object_detection_trainer_scan_fhog_pyramid_delete(PyramidType pyramidType,
                                                                                        uint pyramidRate,
                                                                                        FHogFeatureExtractorType featureExtractorType,
                                                                                        IntPtr pyramid);
Esempio n. 17
0
 public static extern ErrorType scan_fhog_pyramid_num_separable_filters(PyramidType pyramid_type,
                                                                        uint pyramid_rate,
                                                                        FHogFeatureExtractorType extractor_type,
                                                                        IntPtr obj,
                                                                        uint weight_index,
                                                                        out uint ret);
Esempio n. 18
0
 public static extern ErrorType scan_fhog_pyramid_threshold_filter_singular_values(PyramidType pyramid_type,
                                                                                   uint pyramid_rate,
                                                                                   FHogFeatureExtractorType extractor_type,
                                                                                   IntPtr obj,
                                                                                   double thresh,
                                                                                   uint weight_index,
                                                                                   out IntPtr ret);
Esempio n. 19
0
        public void CreatePyramid(Player p, byte type, PyramidType pyramidType, ushort radius, ushort verticalExpansion)
        {
            List <Pos> buffer = new List <Pos>();
            Level      level = p.level;
            ushort     cx = (ushort)(p.pos[0] / 32), cy = (ushort)((p.pos[1] / 32) - 1), cz = (ushort)(p.pos[2] / 32);
            ushort     sx = (ushort)(cx - radius - 1), sy = cy, sz = (ushort)(cz - radius - 1), ex = (ushort)(cx + radius + 1), ey = (ushort)(cy + (radius * verticalExpansion)), ez = (ushort)(cz + radius + 1);
            Pos        pos = new Pos(); pos.x = cx; pos.y = ey; pos.z = cz;

            for (ushort iy = 0; iy < verticalExpansion; iy++)
            {
                for (ushort ix = cx; ix > (ushort)(cx - 2); ix--)
                {
                    for (ushort iz = cz; iz > (ushort)(cz - 2); iz--)
                    {
                        if (level.GetTile(ix, (ushort)(ey + iy), iz) != type)
                        {
                            pos.x = ix; pos.y = (ushort)(ey + iy); pos.z = iz;
                            buffer.Add(pos);
                        }
                    }
                }
            }
            int temp = 0;

            if (pyramidType == PyramidType.Hollow)
            {
                for (ushort y = sy; y < ey; y++)
                {
                    for (ushort x = sx; x < ex; x++)
                    {
                        for (ushort z = sz; z < ez; z++)
                        {
                            if (x == sx || x == (ushort)(ex - 1) || z == sz || z == (ushort)(ez - 1))
                            {
                                if (level.GetTile(x, y, z) != type)
                                {
                                    pos.x = x; pos.y = y; pos.z = z;
                                    buffer.Add(pos);
                                }
                            }
                        }
                    }
                    temp++;
                    if (temp == verticalExpansion)
                    {
                        temp = 0;
                        sx  += 1; ex -= 1;
                        sz  += 1; ez -= 1;
                    }
                }
            }
            else if (pyramidType == PyramidType.Solid)
            {
                for (ushort y = sy; y < ey; y++)
                {
                    for (ushort x = sx; x < ex; x++)
                    {
                        for (ushort z = sz; z < ez; z++)
                        {
                            if (level.GetTile(x, y, z) != type)
                            {
                                pos.x = x; pos.y = y; pos.z = z;
                                buffer.Add(pos);
                            }
                        }
                    }
                    temp++;
                    if (temp == verticalExpansion)
                    {
                        temp = 0;
                        sx  += 1; ex -= 1;
                        sz  += 1; ez -= 1;
                    }
                }
            }
            Execute(p, buffer, type);
        }
Esempio n. 20
0
 public static extern ErrorType scan_fhog_pyramid_new(PyramidType pyramidType,
                                                      uint pyramidRate,
                                                      FHogFeatureExtractorType featureExtractorType,
                                                      out IntPtr pyramid);
Esempio n. 21
0
 public static extern ErrorType structural_object_detection_trainer_scan_fhog_pyramid_set_epsilon(PyramidType pyramid_type,
                                                                                                  uint pyramid_rate,
                                                                                                  FHogFeatureExtractorType extractor_type,
                                                                                                  IntPtr obj,
                                                                                                  double epsilon);
Esempio n. 22
0
 public static extern ErrorType structural_object_detection_trainer_scan_fhog_pyramid_set_num_threads(PyramidType pyramid_type,
                                                                                                      uint pyramid_rate,
                                                                                                      FHogFeatureExtractorType extractor_type,
                                                                                                      IntPtr obj,
                                                                                                      uint thread);
Esempio n. 23
0
 public static extern void input_rgb_image_pyramid_delete(IntPtr input,
                                                          PyramidType pyramidType,
                                                          uint pyramidRate);
Esempio n. 24
0
 public static extern ErrorType structural_object_detection_trainer_scan_fhog_pyramid_train_rectangle(PyramidType pyramid_type,
                                                                                                      uint pyramid_rate,
                                                                                                      FHogFeatureExtractorType extractor_type,
                                                                                                      IntPtr obj,
                                                                                                      MatrixElementType elementType,
                                                                                                      IntPtr images,
                                                                                                      IntPtr objects,
                                                                                                      out IntPtr detector);
Esempio n. 25
0
 public static extern ErrorType input_rgb_image_pyramid_get_pyramid_outer_padding(IntPtr input,
                                                                                  PyramidType pyramidType,
                                                                                  uint pyramidRate,
                                                                                  out uint pyramidOuterPadding);
Esempio n. 26
0
 public static extern ErrorType structural_object_detection_trainer_scan_fhog_pyramid_new(PyramidType pyramidType,
                                                                                          uint pyramidRate,
                                                                                          FHogFeatureExtractorType featureExtractorType,
                                                                                          IntPtr scanner,
                                                                                          out IntPtr pyramid);
Esempio n. 27
0
 public static extern ErrorType pyramid_up_pyramid_matrix(PyramidType pyramid_type,
                                                          uint pyramid_rate,
                                                          MatrixElementType elementType,
                                                          IntPtr image);
Esempio n. 28
0
 public static extern ErrorType scan_fhog_pyramid_set_detection_window_size(PyramidType pyramid_type,
                                                                            uint pyramid_rate,
                                                                            FHogFeatureExtractorType extractor_type,
                                                                            IntPtr obj,
                                                                            uint width,
                                                                            uint height);