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

C++ show_image函数代码示例

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

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



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

示例1: onDraw

    void onDraw(SkCanvas* canvas) override {
        sk_sp<SkImage> image0(make_image(canvas));

        const ImageFilterFactory factories[] = {
            IFCCast([]{ return SkBlurImageFilter::Make(8, 8, nullptr); }),
            IFCCast([]{ return SkDilateImageFilter::Make(8, 8, nullptr); }),
            IFCCast([]{ return SkErodeImageFilter::Make(8, 8, nullptr); }),
            IFCCast([]{ return SkOffsetImageFilter::Make(8, 8, nullptr); }),
        };

        const SkMatrix matrices[] = {
            SkMatrix::MakeScale(SK_ScalarHalf, SK_ScalarHalf),
            SkMatrix::MakeScale(2, 2),
            SkMatrix::MakeTrans(10, 10)
        };

        const SkScalar spacer = image0->width() * 3.0f / 2;

        canvas->translate(40, 40);
        for (auto&& factory : factories) {
            sk_sp<SkImageFilter> filter(factory());

            canvas->save();
            show_image(canvas, image0.get(), filter);
            for (const auto& matrix : matrices) {
                sk_sp<SkImageFilter> localFilter(filter->makeWithLocalMatrix(matrix));
                canvas->translate(spacer, 0);
                show_image(canvas, image0.get(), std::move(localFilter));
            }
            canvas->restore();
            canvas->translate(0, spacer);
        }
    }
开发者ID:03050903,项目名称:skia,代码行数:33,代码来源:localmatriximagefilter.cpp


示例2: test_lsd

void test_lsd(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;
    int i, imlayer = 0;

    for (i = 0; i < net.n; ++i) {
        if (net.layers[i].out_c == 3) {
            imlayer = i;
            printf("%d\n", i);
            break;
        }
    }

    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 resized = resize_min(im, net.w);
        image crop = crop_image(resized, (resized.w - net.w)/2, (resized.h - net.h)/2, net.w, net.h);
        //grayscale_image_3c(crop);

        float *X = crop.data;
        time=clock();
        network_predict(net, X);
        image out = get_network_image_layer(net, imlayer);
        //yuv_to_rgb(out);
        constrain_image(out);
        printf("%s: Predicted in %f seconds.\n", input, sec(clock()-time));
        show_image(out, "out");
        show_image(crop, "crop");
        save_image(out, "out");
#ifdef OPENCV
        cvWaitKey(0);
#endif

        free_image(im);
        free_image(resized);
        free_image(crop);
        if (filename) break;
    }
}
开发者ID:vaiv,项目名称:OpenANPR,代码行数:57,代码来源:lsd.c


示例3: 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


示例4: 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


示例5: decode_captcha

void decode_captcha(char *cfgfile, char *weightfile)
{
    setbuf(stdout, NULL);
    srand(time(0));
    network net = parse_network_cfg(cfgfile);
    set_batch_network(&net, 1);
    if(weightfile){
        load_weights(&net, weightfile);
    }
    char filename[256];
    while(1){
        printf("Enter filename: ");
        fgets(filename, 256, stdin);
        strtok(filename, "\n");
        image im = load_image_color(filename, 300, 57);
        scale_image(im, 1./255.);
        float *X = im.data;
        float *predictions = network_predict(net, X);
        image out  = float_to_image(300, 57, 1, predictions);
        show_image(out, "decoded");
        #ifdef OPENCV
        cvWaitKey(0);
        #endif
        free_image(im);
    }
}
开发者ID:Nerei,项目名称:darknet,代码行数:26,代码来源:captcha.c


示例6: show_images

void show_images(image *ims, int n, char *window)
{
    image m = collapse_images_vert(ims, n);
    save_image(m, window);
    show_image(m, window);
    free_image(m);
}
开发者ID:Nerei,项目名称:darknet,代码行数:7,代码来源:image.c


示例7: gtk_image_menu_item_set_image

/**
 * gtk_image_menu_item_set_image:
 * @image_menu_item: a #GtkImageMenuItem.
 * @image: (allow-none): a widget to set as the image for the menu item.
 *
 * Sets the image of @image_menu_item to the given widget.
 * Note that it depends on the show-menu-images setting whether
 * the image will be displayed or not.
 *
 * Deprecated: 3.10
 */
void
gtk_image_menu_item_set_image (GtkImageMenuItem *image_menu_item,
                               GtkWidget        *image)
{
    GtkImageMenuItemPrivate *priv;

    g_return_if_fail (GTK_IS_IMAGE_MENU_ITEM (image_menu_item));

    priv = image_menu_item->priv;

    if (image == priv->image)
        return;

    if (priv->image)
        gtk_container_remove (GTK_CONTAINER (image_menu_item),
                              priv->image);

    priv->image = image;

    if (image == NULL)
        return;

    gtk_widget_set_parent (image, GTK_WIDGET (image_menu_item));
    g_object_set (image,
                  "visible", show_image (image_menu_item),
                  "no-show-all", TRUE,
                  NULL);
    gtk_image_set_pixel_size (GTK_IMAGE (image), 16);

    g_object_notify (G_OBJECT (image_menu_item), "image");
}
开发者ID:raja651,项目名称:gtk,代码行数:42,代码来源:gtkimagemenuitem.c


示例8: stack_imgs

IplImage *cmp_two_image(IplImage *src1, IplImage *src2) {
    float **des1, **des2;
    int npts1, npts2;
    int ndes;
    t_point *pts1, *pts2;

//  IplImage *img1 = harris(src1, 0.01, &des1, &npts1, &ndes, &pts1);
//  IplImage *img2 = harris(src2, 0.01, &des2, &npts2, &ndes, &pts2);
    IplImage *print = stack_imgs(src1, src2);
    harris_center(src1, 0.01);
    harris_center(src2, 0.01);

    return NULL;

    /*print des of img1 and img2*/
#ifdef PRINT
    for (int i = 0; i < npts1; i++) {
        for (int j = 0; j < ndes; j++) {
            cout << des1[i][j] << " ";
        }
        cout << endl;
    }
    cout << "\n";
    for (int i = 0; i < npts2; i++) {
        for (int j = 0; j < ndes; j++) {
            cout << des2[i][j] << " ";
        }
        cout << endl;
    }
    cout << "\n";
#endif

    int mark = 0;
    float mdist = 10000;
    for (int i = 0; i < npts1; i++) {
        mdist = 10000;
        for (int j = 0; j < npts2; j++) {
            float dist = 0;

            for (int k = 0; k < ndes; k++) {
                dist += ABS(des1[i][k] - des2[j][k]);
            }
#ifdef PRINT
            cout << dist << " " << i << " " << j << endl;
#endif
            if (dist < mdist) {
                mdist = dist;
                mark = j;
            }
        }
        if (mdist < 0.02) {
            cvLine(print,
                   cvPoint(pts1[i].x, pts1[i].y),
                   cvPoint(pts2[mark].x + src1->width, pts2[mark].y),
                   cvScalar(0, 255, 0), 1);
        }
    }

    show_image(print, "match");
}
开发者ID:cherip,项目名称:Harris,代码行数:60,代码来源:harris.cpp


示例9: main

int main(int argc, char **argv) {
    if(wiringPiSetup() == -1) {
        printf("wiringPiSetup() failed\n");
        return EXIT_FAILURE;
    }

    // 540kHz speed - recomended by ST7920 spec
    //if ((lcd_fd = wiringPiSPISetupMode(0, 540000, 0x07)) < 0) {
    if ((lcd_fd = wiringPiSPISetup(0, 540000)) < 0) {
        printf("Can't open the SPI bus\n");
        return EXIT_FAILURE;
    }
    
    char mode = 0x07;
    ioctl(lcd_fd, SPI_IOC_WR_MODE, &mode);

    init_gpio();
    reset_lcd();
    init_lcd();
    
    set_extended_mode(0, 0, 0);
    set_extended_mode(0, 1, 1);

    clear_lcd();

    show_image(raspberry_pix);

    return EXIT_SUCCESS;
}
开发者ID:banec,项目名称:st9720_spi_test,代码行数:29,代码来源:st7920_spi_test.c


示例10: get_center

CvPoint get_center(IplImage *img) {
    int origW = img->width;
    int origH = img->height;

    ellipseW = origW / factor; 
    ellipseH = origH / factor;
    mask = new unsigned char[ellipseH * ellipseW];
    init_mask(ellipseW, ellipseH);
    //num = ellipseH * ellipseW;

    int half_w = ellipseW / 2;
    int half_h = ellipseH / 2;
    int ctrX, ctrY;
    float maxComplax;

    for (int y = half_h; y < origH - half_h; y++) {
        for (int x = half_w; x < origW - half_w; x++) {
//          cvSetImageROI(img, cvEllipse(
            float complaxVal = get_complax(img, x, y, ellipseW, ellipseH);
//          printf("%f %d %d\n", complaxVal, x, y);
            if (complaxVal > maxComplax) {
                maxComplax = complaxVal;
                ctrX = x;
                ctrY = y;
            }
        }
    }

    cvCircle(img, cvPoint(ctrX, ctrY), half_h, cvScalar(0, 255, 9));
    printf("%d %d\n", ctrX, ctrY);
    show_image(img, "center");

    return cvPoint(ctrX, ctrY);
}
开发者ID:cherip,项目名称:dct,代码行数:34,代码来源:ellipse.cpp


示例11: show_images_and_delay

/**
 * need comment here
 */
static int show_images_and_delay(BmpBlockHeader *bmph, int local, int index)
{
	int i;
	ScreenLayout *screen;
	ImageInfo *image;

	screen = (ScreenLayout *)(bmph + 1);
	screen += local * bmph->number_of_screenlayouts;
	screen += index;

	for (i = 0;
	     i < MAX_IMAGE_IN_LAYOUT && screen->images[i].image_info_offset;
	     i++) {
		image = (ImageInfo *)((uint8_t *)bmph +
				screen->images[i].image_info_offset);
		if (show_image(image, screen->images[i].x,
				screen->images[i].y))
			goto bad;
	}

	VbExSleepMs(1000);
	return 0;

bad:
	VbExDebug("Failed to display image, screen=%lu, image=%d!\n", index, i);
	return 1;
}
开发者ID:ArthySundaram,项目名称:u-boot-chromebook,代码行数:30,代码来源:cmd_vbexport_test.c


示例12: draw_coco

void draw_coco(image im, float *pred, int side, char *label)
{
    int classes = 1;
    int elems = 4+classes;
    int j;
    int r, c;

    for(r = 0; r < side; ++r){
        for(c = 0; c < side; ++c){
            j = (r*side + c) * elems;
            int class = max_index(pred+j, classes);
            if (pred[j+class] > 0.2){
                int width = pred[j+class]*5 + 1;
                printf("%f %s\n", pred[j+class], "object"); //coco_classes[class-1]);
                float red = get_color(0,class,classes);
                float green = get_color(1,class,classes);
                float blue = get_color(2,class,classes);

                j += classes;

                box predict = {pred[j+0], pred[j+1], pred[j+2], pred[j+3]};
                predict.x = (predict.x+c)/side;
                predict.y = (predict.y+r)/side;
                
                draw_bbox(im, predict, width, red, green, blue);
            }
        }
    }
    show_image(im, label);
}
开发者ID:crystalphi,项目名称:darknet,代码行数:30,代码来源:coco.c


示例13: run

        // the main device method
        virtual void run() {

            if(!opened) {

                scene->addItem(item);

                // lock the image viewer
                img_view_mutex.lock();

                // update the pixmap and unlock the image viewer
                show_image();

                // open a window to show the QGraphicsScene
                view->show();

                // set the flag to true
                opened = true;

            } else {

                if (img_view_mutex.try_lock())  {

                    // a new thread!
                    std::thread show_image_thread(&ImageViewerDevice::show_image, this);

                    // leave it alone
                    show_image_thread.detach();

                }

            }

        }
开发者ID:josiasalexandre,项目名称:smoothPursuit,代码行数:34,代码来源:ImageViewerDevice.hpp


示例14: gtk_image_menu_item_set_always_show_image

/**
 * gtk_image_menu_item_set_always_show_image:
 * @image_menu_item: a #GtkImageMenuItem
 * @always_show: %TRUE if the menuitem should always show the image
 *
 * If %TRUE, the menu item will ignore the #GtkSettings:gtk-menu-images
 * setting and always show the image, if available.
 *
 * Use this property if the menuitem would be useless or hard to use
 * without the image.
 *
 * Since: 2.16
 *
 * Deprecated: 3.10
 */
void
gtk_image_menu_item_set_always_show_image (GtkImageMenuItem *image_menu_item,
        gboolean          always_show)
{
    GtkImageMenuItemPrivate *priv;

    g_return_if_fail (GTK_IS_IMAGE_MENU_ITEM (image_menu_item));

    priv = image_menu_item->priv;

    if (priv->always_show_image != always_show)
    {
        priv->always_show_image = always_show;

        if (priv->image)
        {
            if (show_image (image_menu_item))
                gtk_widget_show (priv->image);
            else
                gtk_widget_hide (priv->image);
        }

        g_object_notify (G_OBJECT (image_menu_item), "always-show-image");
    }
}
开发者ID:raja651,项目名称:gtk,代码行数:40,代码来源:gtkimagemenuitem.c


示例15: QLabel

MainWindow::MainWindow()
{
    img_label = new QLabel("",0);
    setCentralWidget(img_label);

    createActions();
    createMenus();
    createToolBar();

    powertfDlg = 0;
    edgedetectDlg = 0;
    houghDlg = 0;
    morphDlg = 0;
    blurDlg = 0;
    histeqDlg = 0;
    facedetectDlg = 0;

    cam_on = false;
    cam_save = false;
    capture = 0;

    setWindowIcon(QIcon(":/images/title.png"));

    img = imread("images/Home.png", 1);
    img.copyTo(cur_img);
    show_image();
}
开发者ID:fei-GitHub,项目名称:opencv_study,代码行数:27,代码来源:main_window.cpp


示例16: toDarkImage

void Darknet::yoloImage(const QString &filename, float thresh)
{
	const Mat ori = OpenCV::loadImage(getAbs(filename), -1);
	Mat img;
	cv::resize(ori, img, cv::Size(priv->net.w, priv->net.h));
	image im = toDarkImage(img);
	//image im = load_image_color((char *)qPrintable(getAbs(filename)), 0, 0);

	//image sized = resize_image(im, priv->net.w, priv->net.h);
	//float *X = sized.data;
	float *X = im.data;
	float *predictions = network_predict(priv->net, X);

	float nms=.5;
	const detection_layer l = priv->l;
	convert_yolo_detections(predictions, l.classes, l.n, l.sqrt, l.side, 1, 1, thresh, priv->probs, priv->boxes, 0);
	if (nms) do_nms_sort(priv->boxes, priv->probs, l.side*l.side*l.n, l.classes, nms);
	draw_detections(im, l.side*l.side*l.n, thresh, priv->boxes, priv->probs, voc_names, 0, 20);
	show_image(im, "predictions");
	save_image(im, "predictions");

	//show_image(sized, "resized");
	free_image(im);
	//free_image(sized);
}
开发者ID:yca,项目名称:VideoAI,代码行数:25,代码来源:darknet.cpp


示例17: 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


示例18: loadFile

void MainWindow::open()
{
    QString filename = QFileDialog::getOpenFileName(0, "Open File", "", "*.jpg *.png *.bmp", 0);
    if (!filename.isEmpty()) {
        loadFile(filename);
        show_image();
    }
}
开发者ID:fei-GitHub,项目名称:opencv_study,代码行数:8,代码来源:main_window.cpp


示例19: show_text

void sceneShow::show_scene(int n)
{
    if (n < 0) {
        return;
    }
    if (scene_list.size() <= n) {
        std::cout << "ERROR: Scene List[" << n << "] invalid. List size is " << image_scenes.size() << "." << std::endl;
        return;
    }
    CURRENT_FILE_FORMAT::file_scene_list scene = scene_list.at(n);
    input.clean();

    for (int i=0; i<SCENE_OBJECTS_N; i++) {
        input.read_input();
        int scene_seek_n = scene.objects[i].seek_n;
        //std::cout << ">> sceneShow::show_scene - i: " << i << ", scene_seek_n: " << scene_seek_n << std::endl;

        if (_interrupt_scene == true || input.p1_input[BTN_START] == 1) {
            scene_seek_n = -1;
            break;
        }

        if (scene_seek_n != -1) {
            int scene_type = scene.objects[i].type;
            //std::cout << "### scene_type[" << scene_type << "]" << std::endl;
            if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_SHOW_TEXT) {
                show_text(scene_seek_n);
            } else if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_CLEAR_AREA) {
                clear_area(scene_seek_n);
            } else if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_CLEAR_SCREEN) {
                graphLib.clear_area(0 ,0, RES_W, RES_H, 0, 0, 0);
            } else if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_MOVE_IMAGE) {
                show_image(scene_seek_n);
            } else if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_MOVE_VIEWPOINT) {
                show_viewpoint(scene_seek_n);
            } else if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_PLAY_MUSIC) {
                play_music(scene_seek_n);
            } else if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_PLAY_SFX) {
                play_sfx(scene_seek_n);
            } else if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_SHOW_ANIMATION) {
                show_animation(scene_seek_n, scene.objects[i].repeat_value, scene.objects[i].repeat_type);
            } else if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_STOP_MUSIC) {
                soundManager.stop_music();
            } else if (scene_type == CURRENT_FILE_FORMAT::SCENETYPE_SUBSCENE) {
                show_scene(scene_seek_n);
            } else {
                std::cout << ">> sceneShow::show_scene - unknown scene_type[" << scene_type << "]" << std::endl;
            }
            std::cout << "show_scene::DELAY[" << i << "][" << scene.objects[i].delay_after << "]" << std::endl;
            if (input.waitScapeTime(scene.objects[i].delay_after) == 1) {
                _interrupt_scene = true;
            }
        } else {
            break;
        }
    }
    std::cout << "show_scene::DONE" << std::endl;
}
开发者ID:protoman,项目名称:rockbot,代码行数:58,代码来源:sceneshow.cpp


示例20: inter_dcgan

void inter_dcgan(char *cfgfile, char *weightfile)
{
    network *net = load_network(cfgfile, weightfile, 0);
    set_batch_network(net, 1);
    srand(2222222);

    clock_t time;
    char buff[256];
    char *input = buff;
    int i, imlayer = 0;

    for (i = 0; i < net->n; ++i) {
        if (net->layers[i].out_c == 3) {
            imlayer = i;
            printf("%d\n", i);
            break;
        }
    }
    image start = random_unit_vector_image(net->w, net->h, net->c);
    image end = random_unit_vector_image(net->w, net->h, net->c);
        image im = make_image(net->w, net->h, net->c);
        image orig = copy_image(start);

    int c = 0;
    int count = 0;
    int max_count = 15;
    while(1){
        ++c;

        if(count == max_count){
            count = 0;
            free_image(start);
            start = end;
            end = random_unit_vector_image(net->w, net->h, net->c);
            if(c > 300){
                end = orig;
            }
            if(c>300 + max_count) return;
        }
        ++count;

        slerp(start.data, end.data, (float)count / max_count, im.w*im.h*im.c, im.data);

        float *X = im.data;
        time=clock();
        network_predict(net, X);
        image out = get_network_image_layer(net, imlayer);
        //yuv_to_rgb(out);
        normalize_image(out);
        printf("%s: Predicted in %f seconds.\n", input, sec(clock()-time));
        //char buff[256];
        sprintf(buff, "out%05d", c);
        save_image(out, "out");
        save_image(out, buff);
        show_image(out, "out", 0);
    }
}
开发者ID:kunle12,项目名称:darknet,代码行数:57,代码来源:lsd.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ show_invalid_param_message函数代码示例发布时间:2022-05-30
下一篇:
C++ show_helptext函数代码示例发布时间: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