MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / normalize_image

Function normalize_image

yolo_detector/darknet_opt/src/image.c:434–452  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

432}
433
434void normalize_image(image p)
435{
436 int i;
437 float min = 9999999;
438 float max = -999999;
439
440 for(i = 0; i < p.h*p.w*p.c; ++i){
441 float v = p.data[i];
442 if(v < min) min = v;
443 if(v > max) max = v;
444 }
445 if(max - min < .000000001){
446 min = 0;
447 max = 1;
448 }
449 for(i = 0; i < p.c*p.w*p.h; ++i){
450 p.data[i] = (p.data[i] - min)/(max-min);
451 }
452}
453
454void normalize_image2(image p)
455{

Callers 4

show_image_normalizedFunction · 0.85
show_imagesFunction · 0.85
get_weightsFunction · 0.85
test_dcganFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_dcganFunction · 0.68