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

Function copyMaker

core/lib/tengine_operations.cpp:503–523  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

501}
502
503image copyMaker(image im, int top, int bottom, int left, int right, float value)
504{
505 int width = im.w + left + right;
506 int height = im.h + top + bottom;
507 image resImg = make_image(width, height, im.c);
508 memset(resImg.data, value, sizeof(float) * width * height * im.c);
509 for(int c = 0; c < im.c; c++)
510 {
511 for(int i = top; i < height - bottom; i++)
512 {
513 for(int j = left; j < width - right; j++)
514 {
515 int resIndex = c * height * width + i * width + j;
516 int originIndex = c * im.w * im.h + (i - top) * im.w + (j - left);
517 resImg.data[resIndex] = im.data[originIndex];
518 }
519 }
520 }
521
522 return resImg;
523}
524
525void save_image(image im, const char* name)
526{

Callers 3

preprocess_yolov2Function · 0.85
preprocess_yolov2Function · 0.85
copy_one_patchFunction · 0.85

Calls 1

make_imageFunction · 0.85

Tested by 1

preprocess_yolov2Function · 0.68