Commit ad65110ebe2bb9fd745ec7f6630e3415c4064667

Authored by Scott Klum
1 parent 7e8fca15

More cleanup

openbr/plugins/classification/dlib.cpp
@@ -48,18 +48,20 @@ private: @@ -48,18 +48,20 @@ private:
48 48
49 void project(const Template &src, Template &dst) const 49 void project(const Template &src, Template &dst) const
50 { 50 {
51 - dst = src; 51 + dst = src;
52 52
53 if (!src.file.rects().isEmpty()) { 53 if (!src.file.rects().isEmpty()) {
54 shape_predictor *sp = shapeResource.acquire(); 54 shape_predictor *sp = shapeResource.acquire();
55 55
56 - cv_image<bgr_pixel> cimg(src.m().clone()); 56 + cv_image<unsigned char> cimg(src.m());
  57 + array2d<unsigned char> image;
  58 + assign_image(image,cimg);
57 59
58 for (int j=0; j<src.file.rects().size(); ++j) 60 for (int j=0; j<src.file.rects().size(); ++j)
59 { 61 {
60 QRectF rect = src.file.rects()[j]; 62 QRectF rect = src.file.rects()[j];
61 rectangle r(rect.left(),rect.top(),rect.right(),rect.bottom()); 63 rectangle r(rect.left(),rect.top(),rect.right(),rect.bottom());
62 - full_object_detection shape = (*sp)(cimg, r); 64 + full_object_detection shape = (*sp)(image, r);
63 for (size_t i=0; i<shape.num_parts(); i++) 65 for (size_t i=0; i<shape.num_parts(); i++)
64 dst.file.appendPoint(QPointF(shape.part(i)(0),shape.part(i)(1))); 66 dst.file.appendPoint(QPointF(shape.part(i)(0),shape.part(i)(1)));
65 } 67 }
@@ -99,7 +101,7 @@ private: @@ -99,7 +101,7 @@ private:
99 101
100 foreach (const Template &t, data) { 102 foreach (const Template &t, data) {
101 if (!t.file.rects().isEmpty()) { 103 if (!t.file.rects().isEmpty()) {
102 - cv_image<unsigned char> cimg(t.m().clone()); 104 + cv_image<unsigned char> cimg(t.m());
103 105
104 array2d<unsigned char> image; 106 array2d<unsigned char> image;
105 assign_image(image,cimg); 107 assign_image(image,cimg);
@@ -134,7 +136,7 @@ private: @@ -134,7 +136,7 @@ private:
134 void project(const Template &src, Template &dst) const 136 void project(const Template &src, Template &dst) const
135 { 137 {
136 dst = src; 138 dst = src;
137 - cv_image<unsigned char> cimg(src.m().clone()); 139 + cv_image<unsigned char> cimg(src.m());
138 array2d<unsigned char> image; 140 array2d<unsigned char> image;
139 assign_image(image,cimg); 141 assign_image(image,cimg);
140 142