@uraqtlee You can do like this,
#include "opencv2/imgproc/imgproc.hpp"
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main()
{
VideoCapture cam(0); //change index accordingly
if(!cam.isOpened())
{
cout<<"error camera failed to open ! "<< endl;
return -1;
}
while(1)
{
Mat img, img_roi, mask;
bool success = cam.read(img);
if(!success)
{
cout<<"error cannot read image ! "<<endl;
return -1;
}
img.copyTo(mask);
int width = img.cols;
int height = img.rows;
Rect roi(width/2 - 100, height/2 - 100, 200, 200); // set roi for rectangle according to your choice
rectangle(img, roi, Scalar(255,0,0), 2, 8, 0); // draw rectangle using above roi
img_roi = mask(roi);
imshow("img", img); // showing orignal image with rectangle
imshow("img_roi", img_roi); // showing image in the rectangle
//now process img_roi image for further text detection processing.
if (waitKey(3) == 27)
break;
}
}
please rather attach an image, than a useless link to a external video.
also: what have you tried, so far ? do you have any code ? show us !
its just a simple text recognition program where it reads words through a video, but since it is detecting the entire screen capture it won't be as accurate, so what I'm trying to do is make the program just read a specific part of the video similarly to the video I linked.
again, your video is useless here. and we can only help, if you show us something apart from that.
ill try to reply asap im trying something currently