简体   繁体   中英

Detecting text blocks in images using opencv c#

Hello I want to extract text-blocks from images and pass it to ocr for better accuracy. I have been searching on internet but not able to find suitable example for this. I am very new to this concept can anyone please help me out on the same?

在此处输入图片说明

在此处输入图片说明

This is what I want to achieve. Note I am using EMGUCV for opencv and ocr. I want to scan receipt mostly. If you can help with that it would be great.

Is your text always in the same location? If yes, you will have the location of the region of interest.

//Create the rectangle
cv::Rect roi(0, 0, 500, 500);
//Create the cv::Mat with the ROI you need
cv::Mat imageRoi = image(roi)

Then you can send to the ocr this images

You can threshold your image into a binary image. After that you can use the morphologic operation "DILATE" (repeatedly) do join the letters. When the letters are joined us the "findContours()" function to extract the contour and the bounding boy of it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM