• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ resize_image函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中resize_image函数的典型用法代码示例。如果您正苦于以下问题:C++ resize_image函数的具体用法?C++ resize_image怎么用?C++ resize_image使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了resize_image函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: retrieve_name

void WadImageCache::cache_image(WadImageDescriptor& desc, int width, int height, SDL_Surface *image)
{
	std::string name = retrieve_name(desc, width, height, true);
	if (!name.empty())
	{
		autosave_cache();
		return;
	}
	
	SDL_Surface *resized_image = NULL;
	if (image)
	{
		resized_image = resize_image(image, width, height);
	}
	else
	{
		image = image_from_desc(desc);
		if (image)
		{
			resized_image = resize_image(image, width, height);
			SDL_FreeSurface(image);
		}
	}
	if (!resized_image)
		return;
	
	name = add_to_cache(cache_key_t(desc, width, height), resized_image);
	SDL_FreeSurface(resized_image);
}
开发者ID:blezek,项目名称:marathon-ios,代码行数:29,代码来源:WadImageCache.cpp


示例2: draw_label

void draw_label(image a, int r, int c, image label, image prob_label, const float *rgb)
{
    float ratio = (float) label.w / label.h;
    int h = label.h;
    int w = ratio * h;
    image rl = resize_image(label, w, h);
    if (r - h >= 0) r = r - h;
    float ratiop = (float) prob_label.w / prob_label.h;
    int hp = prob_label.h;
    int wp = ratiop * hp;
    image rpl = resize_image(prob_label, wp, hp);

    int i, j, k;
    for(j = 0; j < h && j + r < a.h; ++j){
        for(i = 0; i < w && i + c < a.w; ++i){
            for(k = 0; k < label.c; ++k){
                float val = get_pixel(rl, i, j, k);
                set_pixel(a, i+c+50, j+r, k, rgb[k] * val);
            }
        }
    }
    for(j = 0; j < hp && j + r < a.h; ++j){
        for(i = 0; i < wp && i + c < a.w; ++i){
            for(k = 0; k < prob_label.c; ++k){
                float val = get_pixel(rpl, i, j, k);
                set_pixel(a, i+c, j+r, k, rgb[k] * val);
            }
        }
    }
    free_image(rl);
    free_image(rpl);
}
开发者ID:jjmata,项目名称:cvjena-darknet,代码行数:32,代码来源:image.c


示例3: retrieve_image

SDL_Surface *WadImageCache::get_image(WadImageDescriptor& desc, int width, int height, SDL_Surface *image)
{
	SDL_Surface *surface = retrieve_image(desc, width, height);
	if (surface)
		return surface;

	if (image)
	{
		surface = resize_image(image, width, height);
	}
	else
	{
		image = image_from_desc(desc);
		if (image)
		{
			surface = resize_image(image, width, height);
			SDL_FreeSurface(image);
		}
	}

	if (surface)
	{
		add_to_cache(cache_key_t(desc, width, height), surface);
	}
	return surface;
}
开发者ID:blezek,项目名称:marathon-ios,代码行数:26,代码来源:WadImageCache.cpp


示例4: create_ios_launch_images

static bool create_ios_launch_images(const char *dir, export_config *conf) {
    size_t len;
    stbi_uc *img_data;
    int width, height;
    if (conf->launch_image == NULL) {
        width = 1024;
        height = 1024;
        len = width * height * 4;
        img_data = (stbi_uc*)malloc(len);
        memset(img_data, 255, len);
    } else {
        void *data = am_read_file(conf->launch_image, &len);
        int components = 4;
        stbi_set_flip_vertically_on_load(0);
        img_data =
            stbi_load_from_memory((stbi_uc const *)data, len, &width, &height, &components, 4);
        free(data);
        if (img_data == NULL) return false;
    }
    if (!resize_image(img_data, width, height, dir,    "Default.png", 320, 480)
        || !resize_image(img_data, width, height, dir, "[email protected]", 640, 960)
        || !resize_image(img_data, width, height, dir, "[email protected]", 640, 1136)
        || !resize_image(img_data, width, height, dir, "[email protected]", 750, 1334)
        || !resize_image(img_data, width, height, dir, "[email protected]", 1242, 2208)
        || !resize_image(img_data, width, height, dir, "[email protected]~ipad.png", 2048, 1536)
        || !resize_image(img_data, width, height, dir, "Default-Landscape~ipad.png", 1024, 768)
        || !resize_image(img_data, width, height, dir, "[email protected]~ipad.png", 1536, 2048)
        || !resize_image(img_data, width, height, dir, "Default-Portrait~ipad.png", 768, 1024)
        ) return false;
    free(img_data);
    return true;
}
开发者ID:AntonioModer,项目名称:amulet,代码行数:32,代码来源:am_export.cpp


示例5: yoloPredict

/*
 * do prediction
  *@param[in]: yoloctx, context
  *@param[in]: filename, input picture
  *@param[in]: thresh, threshold for probability x confidence level
  *@param[out]: predictions, store detected objects
*/
void yoloPredict(context_param_yolo_t *yoloctx, char *filename, float thresh, yoloPredictions *predictions)
{
	printf("YOLO predict\n");
	int	nwidth	= yoloctx->_nwidth;
	int nheight = yoloctx->_nheight;
	int side	= yoloctx->_grid.grids;
	int classes = yoloctx->_grid.classes;
	int bbs		= yoloctx->_grid.bbs;
	int sqrt	= yoloctx->_sqrt;
	float nms		= yoloctx->_nms;

	image im	= load_image_color(filename, 0, 0);
	image sized = resize_image(im, nwidth, nheight);
	
	resetData(yoloctx);

	float *x = sized.data;
	float *fpredictions = network_predict(yoloctx->_net, x);

	float	**probs = yoloctx->_grid.probs;
	box		*boxes = yoloctx->_grid.boxes;

	convertDetections(fpredictions, classes, bbs, sqrt, side, 1, 1, thresh, probs, boxes, 0); 
	if (nms) do_nms_sort(boxes, probs, side*side*bbs, classes, nms);
	convertResults(im.w, im.h, side*side*bbs, thresh, boxes, probs, class_names, 20, predictions);
	
	//free(predictions);
	free_image(sized);
	free_image(im);
}
开发者ID:lxgyChen,项目名称:darknet,代码行数:37,代码来源:yolo_.c


示例6: yolo_net_predict

void yolo_net_predict(network *pNet, char *imgfilename, char * resfile, float thresh){
  detection_layer l = pNet->layers[pNet->n-1];
  clock_t time;
  char buff[256];
  //    char *input = buff;
  int j;
  float nms=.5;
  box *boxes = calloc(l.side*l.side*l.n, sizeof(box));
  float **probs = calloc(l.side*l.side*l.n, sizeof(float *));
  for(j = 0; j < l.side*l.side*l.n; ++j) probs[j] = calloc(l.classes, sizeof(float *));

  image im = load_image_color(imgfilename,0,0);
  image resized = resize_image(im, pNet->w, pNet->h);
  float *X = resized.data;
  time=clock();
  float *predictions = network_predict(*pNet, X);
  free_image(im);
  printf("%s: Predicted in %f seconds.\n", imgfilename, sec(clock()-time));

  FILE *ofp = fopen(resfile, "w");
  if (ofp == NULL) {fprintf(stderr, "Can't open output file %s!\n",resfile); exit(1);}

  //convert_yolo_detections(predictions, l.classes, l.n, l.sqrt, l.side, 1, 1, demo_thresh, probs, boxes, 0);

  convert_print_yolo_detections(ofp, predictions, l.classes, l.n, l.sqrt, l.side, 1, 1, thresh, probs, boxes, 0);
  //if (nms) do_nms_sort(boxes, probs, l.side*l.side*l.n, l.classes, nms);

  fclose(ofp);

}
开发者ID:forest-jiang,项目名称:Real-time-image-classification,代码行数:30,代码来源:yolo.c


示例7: cvCreateImage

void CAntimonyDlg::showImage(IplImage *image, UINT ID)    // ID 是Picture Control控件的ID号
{
	CvSize ImgSize;
	IplImage *theimg;
	ImgSize.width = picrect.Width();
	ImgSize.height = picrect.Height();
	theimg = cvCreateImage(ImgSize, IPL_DEPTH_8U, 3);
	IplImage *image2 = image;
	resize_image(image2, theimg);

	CDC *pDC = GetDlgItem(ID)->GetDC();
	HDC hDC = pDC->GetSafeHdc();

	int rw = picrect.right - picrect.left;
	int rh = picrect.bottom - picrect.top;
	int iw = theimg->width;
	int ih = theimg->height;
	int tx = (int)(rw - iw) / 2;
	int ty = (int)(rh - ih) / 2;
	SetRect(picrect, tx, ty, tx + iw, ty + ih);
	CvvImage cimg;
	cimg.CopyOf(theimg); // 复制图片
	cimg.DrawToHDC(hDC, &picrect); // 将图片绘制到显示控件的指定区域内
	ReleaseDC(pDC);
}
开发者ID:Spritutu,项目名称:MonitorSYS,代码行数:25,代码来源:AntimonyDlg.cpp


示例8: test_detector

void test_detector(char *datacfg, char *cfgfile, char *weightfile, char *filename, float thresh, float hier_thresh)
{
	int show_flag = 1;
    list *options = read_data_cfg(datacfg);
    char *name_list = option_find_str(options, "names", "data/names.list");
    char **names = get_labels(name_list);

    image **alphabet = load_alphabet();
    network net = parse_network_cfg(cfgfile);
    if(weightfile){
        load_weights(&net, weightfile);
    }
    set_batch_network(&net, 1);
    srand(2222222);
    clock_t time;
    char buff[256];
    char *input = buff;
    int j;
    float nms=.4;
    while(1){
        if(filename){
            strncpy(input, filename, 256);
        } else {
            printf("Enter Image Path: ");
            fflush(stdout);
            input = fgets(input, 256, stdin);
            if(!input) return;
            strtok(input, "\n");
        }
        image im = load_image_color(input,0,0);
        image sized = resize_image(im, net.w, net.h);
        layer l = net.layers[net.n-1];

        box *boxes = calloc(l.w*l.h*l.n, sizeof(box));
        float **probs = calloc(l.w*l.h*l.n, sizeof(float *));
        for(j = 0; j < l.w*l.h*l.n; ++j) probs[j] = calloc(l.classes + 1, sizeof(float *));

        float *X = sized.data;
        time=clock();
        network_predict(net, X);
        printf("%s: Predicted in %f seconds.\n", input, sec(clock()-time));
        get_region_boxes(l, 1, 1, thresh, probs, boxes, 0, 0, hier_thresh);
        if (l.softmax_tree && nms) do_nms_obj(boxes, probs, l.w*l.h*l.n, l.classes, nms);
        else if (nms) do_nms_sort(boxes, probs, l.w*l.h*l.n, l.classes, nms);
        draw_detections(im, l.w*l.h*l.n, thresh, boxes, probs, names, alphabet, l.classes, show_flag);
        save_image(im, "predictions");
        show_image(im, "predictions");

        free_image(im);
        free_image(sized);
        free(boxes);
        free_ptrs((void **)probs, l.w*l.h*l.n);
#ifdef OPENCV
        cvWaitKey(0);
        cvDestroyAllWindows();
#endif
        if (filename) break;
    }
}
开发者ID:apollos,项目名称:eyes,代码行数:59,代码来源:detector.c


示例9: get_image_from_stream

void *fetch_in_thread(void *ptr)
{
    in = get_image_from_stream(cap);
    if(!in.data){
        error("Stream closed.");
    }
    in_s = resize_image(in, net.w, net.h);
    return 0;
}
开发者ID:isuker,项目名称:darknet,代码行数:9,代码来源:demo.c


示例10: resize_image

float *network_predict_image(network *net, image im)
{
    //image imr = letterbox_image(im, net->w, net->h);
    image imr = resize_image(im, net->w, net->h);
    set_batch_network(net, 1);
    float *p = network_predict(*net, imr.data);
    free_image(imr);
    return p;
}
开发者ID:Nuzhny007,项目名称:Multitarget-tracker,代码行数:9,代码来源:network.c


示例11: test_yolo

void test_yolo(char *cfgfile, char *weightfile, char *filename, float thresh)
{

    network net = parse_network_cfg(cfgfile);
    if(weightfile){
        load_weights(&net, weightfile);
    }
    detection_layer l = net.layers[net.n-1];
    set_batch_network(&net, 1);
    srand(2222222);
    clock_t time;
    char buff[256];
    char *input = buff;
    int j;
    float nms=.5;
    box *boxes = calloc(l.side*l.side*l.n, sizeof(box));
    float **probs = calloc(l.side*l.side*l.n, sizeof(float *));
    for(j = 0; j < l.side*l.side*l.n; ++j) probs[j] = calloc(l.classes, sizeof(float *));
    while(1){
        if(filename){
            strncpy(input, filename, 256);
        } else {
            printf("Enter Image Path: ");
            fflush(stdout);
            input = fgets(input, 256, stdin);
            if(!input) return;
            strtok(input, "\n");
        }
        image im = load_image_color(input,0,0);
        image sized = resize_image(im, net.w, net.h);
        float *X = sized.data;
        time=clock();
        float *predictions = network_predict(net, X);
        printf("%s: Predicted in %f seconds.\n", input, sec(clock()-time));
        convert_yolo_detections(predictions, l.classes, l.n, l.sqrt, l.side, 1, 1, thresh, probs, boxes, 0);
        if (nms) do_nms_sort(boxes, probs, l.side*l.side*l.n, l.classes, nms);
        //draw_detections(im, l.side*l.side*l.n, thresh, boxes, probs, voc_names, voc_labels, 20);
        draw_detections(im, l.side*l.side*l.n, thresh, boxes, probs, voc_names, 0, 20);
        show_image(im, "predictions");
        save_image(im, "predictions");

        show_image(sized, "resized");
        free_image(im);
        free_image(sized);
#ifdef OPENCV
        cvWaitKey(0);
        cvDestroyAllWindows();
#endif
        if (filename) break;
    }
}
开发者ID:simonfojtu,项目名称:darknet,代码行数:51,代码来源:yolo.c


示例12: load_image

image load_image(char *filename, int w, int h, int c)
{
#ifdef OPENCV
    image out = load_image_cv(filename, c);
#else
    image out = load_image_stb(filename, c);
#endif

    if((h && w) && (h != out.h || w != out.w)){
        image resized = resize_image(out, w, h);
        free_image(out);
        out = resized;
    }
    return out;
}
开发者ID:renmengye,项目名称:darknet,代码行数:15,代码来源:image.c


示例13: test_writing

void test_writing(char *cfgfile, char *weightfile, char *filename)
{
    network * net = parse_network_cfg(cfgfile);
    if(weightfile){
        load_weights(net, weightfile);
    }
    set_batch_network(net, 1);
    srand(2222222);
    clock_t time;
    char buff[256];
    char *input = buff;
    while(1){
        if(filename){
            strncpy(input, filename, 256);
        }else{
            printf("Enter Image Path: ");
            fflush(stdout);
            input = fgets(input, 256, stdin);
            if(!input) return;
            strtok(input, "\n");
        }

        image im = load_image_color(input, 0, 0);
        resize_network(net, im.w, im.h);
        printf("%d %d %d\n", im.h, im.w, im.c);
        float *X = im.data;
        time=clock();
        network_predict(net, X);
        printf("%s: Predicted in %f seconds.\n", input, sec(clock()-time));
        image pred = get_network_image(net);

        image upsampled = resize_image(pred, im.w, im.h);
        image thresh = threshold_image(upsampled, .5);
        pred = thresh;

        show_image(pred, "prediction");
        show_image(im, "orig");
#ifdef OPENCV
        cvWaitKey(0);
        cvDestroyAllWindows();
#endif

        free_image(upsampled);
        free_image(thresh);
        free_image(im);
        if (filename) break;
    }
}
开发者ID:kunle12,项目名称:darknet,代码行数:48,代码来源:writing.c


示例14: test_resize

void test_resize(char *filename)
{
    image im = load_image(filename, 0,0, 3);
    float mag = mag_array(im.data, im.w*im.h*im.c);
    printf("L2 Norm: %f\n", mag);
    image gray = grayscale_image(im);

    image sat2 = copy_image(im);
    saturate_image(sat2, 2);

    image sat5 = copy_image(im);
    saturate_image(sat5, .5);

    image exp2 = copy_image(im);
    exposure_image(exp2, 2);

    image exp5 = copy_image(im);
    exposure_image(exp5, .5);

    #ifdef GPU
    image r = resize_image(im, im.w, im.h);
    image black = make_image(im.w*2 + 3, im.h*2 + 3, 9);
    image black2 = make_image(im.w, im.h, 3);

    float *r_gpu = cuda_make_array(r.data, r.w*r.h*r.c);
    float *black_gpu = cuda_make_array(black.data, black.w*black.h*black.c);
    float *black2_gpu = cuda_make_array(black2.data, black2.w*black2.h*black2.c);
    shortcut_gpu(3, r.w, r.h, 1, r_gpu, black.w, black.h, 3, black_gpu);
    //flip_image(r);
    //shortcut_gpu(3, r.w, r.h, 1, r.data, black.w, black.h, 3, black.data);

    shortcut_gpu(3, black.w, black.h, 3, black_gpu, black2.w, black2.h, 1, black2_gpu);
    cuda_pull_array(black_gpu, black.data, black.w*black.h*black.c);
    cuda_pull_array(black2_gpu, black2.data, black2.w*black2.h*black2.c);
    show_image_layers(black, "Black");
    show_image(black2, "Recreate");
    #endif

    show_image(im, "Original");
    show_image(gray, "Gray");
    show_image(sat2, "Saturation-2");
    show_image(sat5, "Saturation-.5");
    show_image(exp2, "Exposure-2");
    show_image(exp5, "Exposure-.5");
#ifdef OPENCV
    cvWaitKey(0);
#endif
}
开发者ID:jjmata,项目名称:cvjena-darknet,代码行数:48,代码来源:image.c


示例15: get_gray

float *get_image_dct( const IplImage *src, const int nSub, int &featLen ) {
    IplImage *img = get_gray( src ); 
    IplImage *subImage = resize_image( img, nSub ); 
    IplImage *dctImage = cvCloneImage( subImage );

    cvDCT( subImage, dctImage, CV_DXT_FORWARD );
//  print_32f_image( dctImage );

//  float *data = ( float * )( dctImage->imageData );
//  qsort( data + 1, nSub * nSub - 1, sizeof( float ), cmp );
//  print_32f_image( dctImage );
    
    int subDct = 6;
    featLen = subDct * subDct - 1;
    int index = 0;
    float *feature = new float[ featLen ];
    /*copy only 35 points of dcts*/
    for ( int y = 0; y < subDct; y++ ) {
        for ( int x = 0; x < subDct; x++ ) {
            if ( x == 0 && y == 0 ) 
                continue;
            feature[ index++ ] = pixval32f( dctImage, x, y );
        }
    }

    /*print the feature without sort*/
//  print_dct_feature( feature, subDct );

    qsort( feature, featLen, sizeof( float ), cmp );
    //sort( feature, feature + featLen );
    /*print the feature after sort*/
    //print_dct_feature( feature, subDct );
    for ( int i = 0; i < featLen; i++ ) {
        printf( "%.3f\t", feature[ i ] );
    }
    std::cout << endl;

    show_image( img, "gray" );

    cvReleaseImage( &img );
    cvReleaseImage( &subImage );
    cvReleaseImage( &dctImage );

    return feature;
}
开发者ID:cherip,项目名称:dct,代码行数:45,代码来源:dct.cpp


示例16: test_coco

void test_coco(char *cfgfile, char *weightfile, char *filename, float thresh)
{
    image **alphabet = load_alphabet();
    network *net = load_network(cfgfile, weightfile, 0);
    layer l = net->layers[net->n-1];
    set_batch_network(net, 1);
    srand(2222222);
    float nms = .4;
    clock_t time;
    char buff[256];
    char *input = buff;
    while(1){
        if(filename){
            strncpy(input, filename, 256);
        } else {
            printf("Enter Image Path: ");
            fflush(stdout);
            input = fgets(input, 256, stdin);
            if(!input) return;
            strtok(input, "\n");
        }
        image im = load_image_color(input,0,0);
        image sized = resize_image(im, net->w, net->h);
        float *X = sized.data;
        time=clock();
        network_predict(net, X);
        printf("%s: Predicted in %f seconds.\n", input, sec(clock()-time));

        int nboxes = 0;
        detection *dets = get_network_boxes(net, 1, 1, thresh, 0, 0, 0, &nboxes);
        if (nms) do_nms_sort(dets, l.side*l.side*l.n, l.classes, nms);

        draw_detections(im, dets, l.side*l.side*l.n, thresh, coco_classes, alphabet, 80);
        save_image(im, "prediction");
        show_image(im, "predictions");
        free_detections(dets, nboxes);
        free_image(im);
        free_image(sized);
#ifdef OPENCV
        cvWaitKey(0);
        cvDestroyAllWindows();
#endif
        if (filename) break;
    }
}
开发者ID:AnissaSchirock,项目名称:darknet,代码行数:45,代码来源:coco.c


示例17: demo_art

void demo_art(char *cfgfile, char *weightfile, int cam_index)
{
#ifdef OPENCV
    network *net = load_network(cfgfile, weightfile, 0);
    set_batch_network(net, 1);

    srand(2222222);

    void * cap = open_video_stream(0, cam_index, 0,0,0);

    char *window = "ArtJudgementBot9000!!!";
    if(!cap) error("Couldn't connect to webcam.\n");
    int i;
    int idx[] = {37, 401, 434};
    int n = sizeof(idx)/sizeof(idx[0]);

    while(1){
        image in = get_image_from_stream(cap);
        image in_s = resize_image(in, net->w, net->h);

        float *p = network_predict(net, in_s.data);

        printf("\033[2J");
        printf("\033[1;1H");

        float score = 0;
        for(i = 0; i < n; ++i){
            float s = p[idx[i]];
            if (s > score) score = s;
        }
        score = score;
        printf("I APPRECIATE THIS ARTWORK: %10.7f%%\n", score*100);
        printf("[");
	int upper = 30;
        for(i = 0; i < upper; ++i){
            printf("%c", ((i+.5) < score*upper) ? 219 : ' ');
        }
        printf("]\n");

        show_image(in, window, 1);
        free_image(in_s);
        free_image(in);
    }
#endif
}
开发者ID:iscaswcm,项目名称:darknet,代码行数:45,代码来源:art.c


示例18: show_images

void show_images(image *ims, int n, char *window)
{
    image m = collapse_images_vert(ims, n);
    /*
       int w = 448;
       int h = ((float)m.h/m.w) * 448;
       if(h > 896){
       h = 896;
       w = ((float)m.w/m.h) * 896;
       }
       image sized = resize_image(m, w, h);
     */
    normalize_image(m);
    image sized = resize_image(m, m.w, m.h);
    save_image(sized, window);
    show_image(sized, window);
    free_image(sized);
    free_image(m);
}
开发者ID:renmengye,项目名称:darknet,代码行数:19,代码来源:image.c


示例19: MLT_FRAME_PROPERTIES

static uint8_t *frame_resize_image( mlt_frame frame, int owidth, int oheight, int bpp )
{
	// Get properties
	mlt_properties properties = MLT_FRAME_PROPERTIES( frame );

	// Get the input image, width and height
	uint8_t *input = mlt_properties_get_data( properties, "image", NULL );
	uint8_t *alpha = mlt_frame_get_alpha( frame );
	int alpha_size = 0;
	mlt_properties_get_data( properties, "alpha", &alpha_size );

	int iwidth = mlt_properties_get_int( properties, "width" );
	int iheight = mlt_properties_get_int( properties, "height" );

	// If width and height are correct, don't do anything
	if ( iwidth < owidth || iheight < oheight )
	{
		uint8_t alpha_value = mlt_properties_get_int( properties, "resize_alpha" );

		// Create the output image
		uint8_t *output = mlt_pool_alloc( owidth * ( oheight + 1 ) * bpp );

		// Call the generic resize
		resize_image( output, owidth, oheight, input, iwidth, iheight, bpp );

		// Now update the frame
		mlt_frame_set_image( frame, output, owidth * ( oheight + 1 ) * bpp, mlt_pool_release );

		// We should resize the alpha too
		if ( alpha && alpha_size >= iwidth * iheight )
		{
			alpha = resize_alpha( alpha, owidth, oheight, iwidth, iheight, alpha_value );
			if ( alpha )
				mlt_frame_set_alpha( frame, alpha, owidth * oheight, mlt_pool_release );
		}

		// Return the output
		return output;
	}
	// No change, return input
	return input;
}
开发者ID:aib,项目名称:mlt,代码行数:42,代码来源:filter_resize.c


示例20: test_coco

void test_coco(char *cfgfile, char *weightfile, char *filename)
{

    network net = parse_network_cfg(cfgfile);
    if(weightfile) {
        load_weights(&net, weightfile);
    }
    set_batch_network(&net, 1);
    srand(2222222);
    clock_t time;
    char buff[256];
    char *input = buff;
    while(1) {
        if(filename) {
            strncpy(input, filename, 256);
        } else {
            printf("Enter Image Path: ");
            fflush(stdout);
            input = fgets(input, 256, stdin);
            if(!input) return;
            strtok(input, "\n");
        }
        image im = load_image_color(input,0,0);
        image sized = resize_image(im, net.w, net.h);
        float *X = sized.data;
        time=clock();
        float *predictions = network_predict(net, X);
        printf("%s: Predicted in %f seconds.\n", input, sec(clock()-time));
        draw_coco(im, predictions, 7, "predictions");
        free_image(im);
        free_image(sized);
#ifdef OPENCV
        cvWaitKey(0);
        cvDestroyAllWindows();
#endif
        if (filename) break;
    }
}
开发者ID:renmengye,项目名称:darknet,代码行数:38,代码来源:coco.c



注:本文中的resize_image函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ resized函数代码示例发布时间:2022-05-30
下一篇:
C++ resizeWindow函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap