Repository for OpenCV's extra modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

20 lines
494 B

#include <opencv2/viz2d/viz2d.hpp>
using namespace cv;
using namespace cv::viz;
constexpr int WIDTH = 1280;
constexpr int HEIGHT = 720;
int main() {
//Creates a Viz2D object for on screen rendering
Ptr<Viz2D> v2d = Viz2D::make(Size(WIDTH, HEIGHT), "Show image");
//An image
Mat image = imread(samples::findFile("lena.jpg"));
//Feeds the image to the video pipeline
v2d->feed(image);
//Display the framebuffer in the native window in an endless loop
v2d->run(v2d->display);
}