Ask Your Question

joshua101's profile - activity

2020-11-08 10:51:30 -0600 received badge  Popular Question (source)
2017-05-20 08:29:30 -0600 commented answer How to increase contrast of a image with text

Thank you but as you can see that the thresholded image is quite different from what imagemagick provides. Therefore, tesseract can not seem to OCR the one thresholded from opencv but can OCR the one from imagemagick. Perhaps I should add some gaussian blur after the threshold. What values did you use for the threshold OTSU?

2017-05-20 07:54:09 -0600 commented question How to increase contrast of a image with text

Well I don't want to use imagemagick because that is not part of my automated pipeline. I would rather have the results replicated in opencv....maybe not exactly like imagemagick but close to it. I agree the LUT formula in the referenced blog post seems very aggressive. Instead, I am looking for something that makes the black pixels blacker and white pixels whiter.

2017-05-20 06:57:53 -0600 commented question How to increase contrast of a image with text

I tried using LUT as mentioned in this post http://www.pyimagesearch.com/2015/10/... however, the results were not same as imagemagick at all

2017-05-20 06:36:30 -0600 commented answer How to re-train the classifiers for opencv_contrib text module

Thanks, I see the PR. I'll try it out. Thanks!

2017-05-20 06:34:48 -0600 received badge  Editor (source)
2017-05-20 06:34:10 -0600 asked a question How to increase contrast of a image with text

I have an image that contains text. Before sending it to OCR, I would like to increase the contrast of it.

The original image is like this:

image description

I can increase the contrast of the text using imagemagick: convert orig.jpg -level 60%x85% contrast.jpg. This turns the image into

image description

The imagemagick code is basically doing this http://www.imagemagick.org/script/com...

In normal usage (-level) the image values are stretched so that the given 'black_point' value in the original image is set to zero (or black), while the given 'white_point' value is set to QuantumRange (or white). This provides you with direct contrast adjustments to the image. The 'gamma' of the resulting image will then be adjusted.

Question

How can I do the same thing in OpenCV? I tried the threshold functions with cv2.THRESH_BINARY but it doesn't produce the same result.

2017-05-20 05:43:56 -0600 commented answer How to re-train the classifiers for opencv_contrib text module

Thank you. I believe I came across that, however, it provides no instructions and the README is not that much of a help either. Thats why I was looking for some help on how to get started with it

2017-05-19 15:20:53 -0600 asked a question How to re-train the classifiers for opencv_contrib text module

The opencv_contrib has a text module that provides a sample classifier. It is found here https://github.com/opencv/opencv_cont...

I am trying to find a way for me to re-train the classifier for my particular purposes. How can I generate the two XML files and provide them to the functions cv2.text.loadClassifierNM1 and cv2.text.loadClassifierNM2 ?