MCPcopy Create free account
hub / github.com/OAID/Tengine / square_boxes

Function square_boxes

examples/caffe_wrapper/mtcnn/caffe_mtcnn_utils.cpp:119–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119void square_boxes(std::vector<face_box>& rects)
120{
121 for(unsigned int i = 0; i < rects.size(); i++)
122 {
123 float h = rects[i].y1 - rects[i].y0 + 1;
124 float w = rects[i].x1 - rects[i].x0 + 1;
125
126 float l = std::max(h, w);
127
128 rects[i].x0 = rects[i].x0 + (w - l) * 0.5;
129 rects[i].y0 = rects[i].y0 + (h - l) * 0.5;
130 rects[i].x1 = rects[i].x0 + l - 1;
131 rects[i].y1 = rects[i].y0 + l - 1;
132 }
133}
134
135void padding(int img_h, int img_w, std::vector<face_box>& rects)
136{

Callers 1

process_boxesFunction · 0.70

Calls 2

maxFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected