MCPcopy Create free account
hub / github.com/Xilinx/CHaiDNN / inputImageRead

Function inputImageRead

software/imageread/xi_input_image.cpp:645–690  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

643//loadDatafromBuffptr
644
645void inputImageRead(const char *img_path, xChangeLayer *xChangeHostInpLayer)
646//void inputImageRead(FILE **file_list, xChangeLayer *xChangeHostInpLayer)
647{
648
649#if EN_IO_PRINT
650 cout<< "inputImageRead : " <<endl;
651#endif
652
653 //char img_path[500];
654 //fscanf(*file_list, "%s", img_path);
655
656 int num_mean_values; //read from params
657 int status;
658
659 //xChangeLayer *xChangeHostInpLayer = &lay_obj[imgId][layerId];// = &xChangeHostLayers[0];
660
661 //xChangeHostInpLayer.in_ptrs[0] = (char*)create_sdsalloc_mem(mem_size);
662 //xChangeHostInpLayer.params = (char*)create_sdsalloc_mem(params_mem_size);
663
664 int *scalar_conv_args = (int *)xChangeHostInpLayer->params;
665
666 int mean_sub_flag = scalar_conv_args[26];
667
668 cv::Mat in_frame, out_frame;
669
670 out_frame = imread(img_path, 1);
671 if(!out_frame.data)
672 {
673 std :: cout << "[ERROR] Image read failed - " << img_path << std :: endl;
674 //fprintf(stderr,"image read failed\n");
675 //return -1;
676 }
677
678 if(mean_sub_flag)
679 {
680 status = loadImage(out_frame, xChangeHostInpLayer);
681 }
682 else
683 {
684 status = loadAndPrepareImage(out_frame, xChangeHostInpLayer);
685 }
686
687#if EN_IO_PRINT
688 cout<< "inputImageRead done: " <<endl;
689#endif
690}

Callers 1

imageReadRoutineFunction · 0.85

Calls 2

loadImageFunction · 0.85
loadAndPrepareImageFunction · 0.85

Tested by

no test coverage detected