C ++ web project using OpenCV with Wt

What is a good platform for a web project that implements image processing using the OpenCV library ? I found Wt ( http://www.webtoolkit.eu/wt ).

Can I use OpenCV with Wt? Are there any better alternatives to Wt?

Requirements:

Graphical interface of the login page to upload documents, select areas on the image, handwriting word / line recognition using OpenCV

+8
c ++ opencv wt
source share
3 answers

I used Wt in the past, it is very useful, albeit bulky. This bloat is due to the need to support a wide range of web browsers, so in some cases this is a feature.

If you are more like a programmer, I would recommend PION and implement your GUI using some of your website building skills:

http://www.pion.org/projects/pion-network-library

You can use OpenCV in almost any network library. A good overview of your options is available here at StackOverflow:

https://stackoverflow.com/questions/175507/cc-web-server-library

+4
source share

I think you are asking with Wt. I cannot anticipate OpenCV connectivity issues in Wt, and the system is certainly interactive enough to provide the functionality you describe. First, execute it using server-side actions, and if necessary, you can optimize the details with small bits of client JS.

+1
source share

FWIW, this is a simple code for displaying an OpenCV image (possibly changing the image while the application is running):

Wt::WMemoryResource* cvMat2res(const cv::Mat& img){ std::vector<uchar> buf; cv::imencode(".png",img,buf); // by default, the fastest compression auto ret=new Wt::WMemoryResource(this); ret->setMimeType("mime/png"); ret->setData(buf); // data is copied here return ret; } /* ... */ auto img=new Wt::Image(); root()->addWidget(img); Wt::WMemoryResource* imgRes=nullptr; /* set image data; this can be done also in event handler and the image updates itself automatically from the new resource */ if(imgRes) delete imgRes; imgRes=cvMat2res(cvImage); img->setImageLink(imgRes); 
0
source share

Source: https://habr.com/ru/post/650051/


All Articles