当前位置: 首页>>代码示例>>C++>>正文


C++ DataStore::insertResultEntry方法代码示例

本文整理汇总了C++中DataStore::insertResultEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ DataStore::insertResultEntry方法的具体用法?C++ DataStore::insertResultEntry怎么用?C++ DataStore::insertResultEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataStore的用法示例。


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

示例1: main

int main(int argc, char **argv) {
    if(argc < 2) {
        std::cerr << "Usage: " << argv[0] << " [file_name]" << std::endl;
        return 0;
    }

    BiomarkerImageProcessor processor;

    cv::namedWindow("blur_win", CV_WINDOW_AUTOSIZE);
    cv::namedWindow("canny_win", CV_WINDOW_AUTOSIZE);
    cv::namedWindow("img_win", CV_WINDOW_AUTOSIZE);
    cv::VideoCapture cap(argv[1]);

    DataStore p = DataStore::open("jkk_store.sqlite3");
    p.createTables();

    ResultEntry entry(-1, "My Model", "Bob", "Some notes", "now", 66.6, "", "", "some stats");
    p.insertResultEntry(entry);

    // char *str = "SOMEDATA";
    // void *ptr = str;
    // ModelEntry mod("My Model", ptr, 7);
    // p.insertModelEntry(mod);

    // RegressionFactory factory;
    // factory.createNew("mymodel_ser", "mytest_ser");
    // factory.addNewComponent(ModelComponent::LINEAR, 0, 10, ModelComponent::RED);

    // ModelPtr myModel = factory.getCreatedModel();

    // const void *blob;
    // unsigned int len;
    // factory.serializeToDB(myModel, blob, len);

    // ModelEntry mod(myModel->getModelName(), blob, len);
    // p.insertModelEntry(mod);

    // std::vector<ModelEntry> entries = p.findAllModelEntries();
    // for(int i = 0; i < entries.size(); i++) {
    //   std::cout << entries[i].name << " (" << entries[i].length << " bytes)" << std::endl;
    //   std::vector<ResultEntry> results = p.findResultsForModelName(entries[i].name);
    //   ModelPtr deserModel = factory.deserializeFromDB(entries[i].data, entries[i].length);
    //   std::cout << "Deserialized -- name: " << deserModel->getModelName() << std::endl;
    //   std::cout << "  Entries: ";
    //   for(int j = 0; j < results.size(); j++) {
    //     std::cout << results[i].subjectName << ", ";
    //   }
    //   std::cout << std::endl;
    // }
    // p.close();

    cv::Mat frame;
    // skipNFrames(cap, 8730, &frame);

    std::vector<cv::Vec3f> circles;
    while(true) {
        bool got_frame = skipNFrames(cap, FRAME_SKIP, &frame);

        if(got_frame) {
            CircularSampleAreaDetector detector;
            circles = detector.detect(frame);

            // Just to draw the circle...
            processor.process(frame, circles);

            cv::imshow("img_win", frame);
        } else {
            break;
        }

        char key = cvWaitKey(0);
        if(key == 'y') {
            break;
        }
    }

    processor.reset();

    while(true) {
        bool got_frame = skipNFrames(cap, FRAME_SKIP, &frame);

        if(got_frame) {
            std::vector<cv::SerializableScalar> samples = processor.process(frame, circles);
            if(samples.size() > 0) {
                cv::SerializableScalar sample = samples[0];
                std::cout << sample[0] << "," << sample[1] << "," << sample[2] << "," << sample[3] << "," << processor.getAverageStdDev()[0] << std::endl;
            }

            cv::imshow("img_win", frame);
        } else {
            break;
        }

        char key = cvWaitKey(1);
        if(key == 27) {
            break;
        }
    }

    return 0;
//.........这里部分代码省略.........
开发者ID:RemchoResearchGroup,项目名称:OccuChrome-GitHub,代码行数:101,代码来源:imgtest.cpp


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