#include <iostream>
 
 
 
int testMatcher_1x1(const std::string& path0, const std::string& path1)
{
    try {
 
        std::shared_ptr<Diametrix::Template> template0;
        {
            std::cout << path0.c_str() << std::endl;
 
            auto image = decoder->read(path0);
            if(image->empty()) {
                std::cout << "The image is empty" << std::endl;
                return -3;
            }
                      
            std::vector<std::shared_ptr<Diametrix::Detection>> detections;
            detector->detect(image, 500, 0.1, detections);
 
            if(detections.size()) {
                extractor->extract(detections[0], template0);
            } else {
                fingerprintCenter.
x = image->width() / 2;
 
                fingerprintCenter.
y = image->height() / 2;
 
 
                extractor->extract(detections[0], template0);
            }
        }
 
        std::shared_ptr<Diametrix::Template> template1;
        {
            std::cout << path1.c_str() << std::endl;
 
            auto image = decoder->read(path1);
            if(image->empty()) {
                std::cout << "The image is empty" << std::endl;
                return -3;
            }
                      
            std::vector<std::shared_ptr<Diametrix::Detection>> detections;
            detector->detect(image, 500, 0.1, detections);
 
            if(detections.size()) {
                extractor->extract(detections[0], template1);
            } else {
                fingerprintCenter.x = image->width() / 2;
                fingerprintCenter.y = image->height() / 2;
 
                extractor->extract(detections[0], template1);
            }
        }
 
        std::cout << "Similarity score: " << matcher->match(template0, template1) << std::endl;
 
        return 0;
    }
        std::cout << 
"Exception:\t" << exp.
what() << std::endl;
 
        return -2;
    }
    catch (...) {
        std::cout << "Something happened" << std::endl;
        return -1;
    }
 
    return 0;
}
Класс Исключение Все исключения в Diametrix SDK являются Diametrix::Exception.
Definition: exception.h:21
 
const char * what() const noexcept
Definition: exception.h:30
 
Заголовочный файл с описанием декодера изображений
 
Заголовочный файл с описание детектора отпечатков пальцев и отпечатков
 
Заголовочный файл с описанием класса Diametrix::Exception.
 
std::unique_ptr< Diametrix::Detector > DMXSDK_API createDetector(const std::shared_ptr< Diametrix::Config > &cfg)
 
std::shared_ptr< Diametrix::Detection > DMXSDK_API constructDetection(const std::shared_ptr< Diametrix::Image > &image, int dpi, Diametrix::Point ¢er, float angle)
 
std::unique_ptr< Diametrix::Decoder > DMXSDK_API createDecoder(const std::shared_ptr< Diametrix::Config > &cfg)
 
std::unique_ptr< Diametrix::Matcher > DMXSDK_API createMatcher(const std::shared_ptr< Diametrix::Config > &cfg)
 
Заголовочный файл с описанием Галереи Шаблонов и Матчера
 
std::shared_ptr< Diametrix::Config > DMXSDK_API makeConfig(const std::string &path)
 
Точка
Definition: detector.h:26