Code Monkey home page Code Monkey logo

ocr-text-extraction's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ocr-text-extraction's Issues

ValueError: too many values to unpack in cv2.findContours

For whatever reason, cv2.findContours on line 211 returns three arguments instead of the expected 2. From playing with it, I found that by eliminating the first value would solve the problem.
I am not knowledgeable about cv2 so if this is something obvious someone please say so. (MacOS, cv2 '3.2.0').
Here is the fix that worked for me.
result = cv2.findContours(edges.copy(), cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE)
contours, hierarchy = result if len(result) == 2 else result[1:3]

ValueError: not enough values to unpack (expected 3, got 2)

in extract_bv(image)
22 ret,f6 = cv2.threshold(f5,15,255,cv2.THRESH_BINARY)
23 mask = np.ones(f5.shape[:2], dtype="uint8") * 255
---> 24 image, contours, hierarchy = cv2.findContours(f6.copy() ,cv2.RETR_LIST ,cv2.CHAIN_APPROX_SIMPLE)
25 for cnt in contours:
26 if cv2.contourArea(cnt) <= 200:

ValueError: not enough values to unpack (expected 3, got 2)

TypeError: flow() got an unexpected keyword argument 'class_mode'

Unable to resolve this error :

TypeError Traceback (most recent call last)
in
207 X,label=shuffle(X,label,random_state=2)
208 model=get_model()
--> 209 fit_model(model,X,label)

in fit_model(model, X, label)
189
190 datagen.fit(X_train)
--> 191 model.fit_generator(datagen.flow(X_train, y_train, batch_size=32, class_mode="categorical",target_size=(64, 64),color_mode="rgb",save_to_dir=r'/Users/Sanjeeth/Python work space/project1/testing/resnet/', save_prefix='fudus', save_format='jpeg'), steps_per_epoch=len(X_train) / 32, epochs=4)
192
193

Option to set threshold?

Is there any option to set a threshold on how we color the image? I have a file with white-on-black and black-on-white text. The script does a phenomenal job detecting the white-on-black text and converting it. However, it also erroneously inverts many of the black-on-white texts. Is that something that could potentially be tuned and fixed by giving us some parameter options?

extract_text.py texts are messed up?

This is a great effort and some tweaking it could be very useful for tesseract OCR.

the problem right now is that resulting text seems almost like it's from an withering ancient book. For example "O" looks almost like "U".

the best way I can put it is texts look almost dirty.

what variables or configs can I alter to retain the clean cut text like shown in the answer at

http://stackoverflow.com/questions/11678542/image-processing-for-ocr-with-leptonica-inverse-color-text

Draw a black bounding box on output image

Hi @jasonlfunk,
It's a great repo which done decent job on most of the images, I observed that for some color images , it will make black bounding box(inside this text is present), may happen due to size of contour , instead of ((img_x * img_y) / 5) this if I set it to fixed number i.e 10,000(250dpi img) above problem were solved but if text height(colour heading) exceed above threshold and it will not make correct thresholding of that portion
Please let me know is there any robust way to solve above issue.
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.