Skip to content

damiles/OpenCVGUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
David Millan Escriva
Jul 17, 2024
082a3e4 · Jul 17, 2024
Jan 4, 2017
Jan 8, 2019
Jul 2, 2016
Jul 17, 2024
Jun 15, 2017
Jul 17, 2024
Feb 7, 2017
Dec 16, 2016
May 8, 2024
Jun 8, 2017
Jan 31, 2017
Sep 23, 2016
Oct 25, 2016

Repository files navigation

OpenCVGUI

Do you like OpenCV Highui but it's not enough and don't want waste your time in a new UI SDK? This is your solution! OpenCVGUI is a new graphical user inteface for OpenCV with different widgets and tools to provide developers a new and more powerful user interface with 3D and 2D plotting support, advanced forms, with small dependencies and OpenGL based.

Why OpenCVGUI: more Powerful and exactly so simple than OpenCV Highui.

screenshot

Dependencies

  • GLEW
  • xorg-dev

Build

  1. git submodule update --init --recursive
  2. mkdir build
  3. cd build
  4. cmake ..
  5. make
  6. sudo make install

Features

  • No complex sdk framework like others.
  • It's like OpenCV Highui calls, simple and clean.
  • Computer vision in different Thread than UI
  • Image render
  • Forms
  • Input Text
  • Buttons
  • Radio buttons
  • Checkboxs
  • Sliders and progress bars
  • File Management (in progress)
  • 2D plot
  • 2D multiplot
  • 3D Plot

screenshot screenshot

Short snippets

Init the GUI

    OpenCVGUI::init();

Create a new window

    OGUICVWindow* window= OpenCVGUI::namedWindow("Wellcome to OpenCVGUI Example 2");

Show image in window

    Mat image= imread("./lena.jpg");
    window->imshow("image title key like highui imshow", &image);

Basic Example

#include "OGUI.h"
#include "OGUISlider.h"
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>

using namespace OpenCVGUI;
using namespace cv;

VideoCapture cap;
Mat frame, gray;
double thr=125;
OGUICVWindow *window;

void cv_process() {
    while(app_is_running) {
        cap >> frame;
        window->imshow("camera", &frame);
        Mat output;
        cvtColor( frame, gray, COLOR_RGB2GRAY );
        threshold( gray, output, (int)thr, 255, CV_THRESH_BINARY);
        window->imshow("threshold", &output);
    }
}

void on_change_slider_threshold(double value){
    thr= value;
}

int main( int argc, const char* argv[] )
{
    // Init GUI
    OpenCVGUI::init();

    // Create our window
    window= OpenCVGUI::namedWindow("Wellcome to OpenCVGUI Example 2");

    // Create the Forms we need and add to window
    OGUISlider slider("Threshold", 0, 255, 125);
    slider.setCallBack(on_change_slider_threshold);
    window->addFormWidget(&slider);

    // Start video capture
    cap.open(0);
    if(cap.isOpened()){
        cap >> frame;
        // show image
        window->imshow("camera", &frame);
    }else{
        return 0;
    }

    // Convert frame, threshodl and show
    cvtColor( frame, gray, COLOR_RGB2GRAY );
    Mat output;
    threshold( gray, output, 125, 255, CV_THRESH_BINARY);
    window->imshow("threshold", &output);

    // Start the Comptuer vision process
    OpenCVGUI::app_run(cv_process);

}    

screenshot

About

OpenCVGUI. More Powerful and exactly so simple than OpenCV Highui

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages