Exemplo n.º 1
0
void PatternManager::thresholdImageFinished() {
    QFutureWatcher<cv::Mat*>* watcher = static_cast<QFutureWatcher<cv::Mat*>*>(QObject::sender());
    this->m_thresholdedPatterns.push_back(watcher->result());
    qDebug() << "Image thresholded " << watcher->result()->depth();
    delete watcher;
    emit imgThresholded(this->m_thresholdedPatterns.size());
    if(this->m_thresholdedPatterns.size() == patternSetSize) {
        emit originalPatternsThresholded();
        qDebug("All images thresholded");
    }
}
Exemplo n.º 2
0
int main (int argc, char* argv[]) {
    unsigned char threshold;
    image = imgLoadJPG("images/atlas5.jpg");

    if (image) {
        glutInit(&argc, argv);

        glutInitDisplayMode(GLUT_DEPTH | GLUT_RGBA | GLUT_DOUBLE);
        glutInitWindowSize(imgGetWidth(image), imgGetHeight(image));

        threshold = imgGetOtsuThreshold(image);

        imgThresholded(image, threshold);

        glutCreateWindow("Image view");
        glutDisplayFunc(main_display);

        init();
        glutMainLoop();
    } else printf("Error opening the image!\n");

    return 0;
}