Comments (6)
➜ pwntcha-testsuite git:(master) pwntcha -s /usr/local/src/pwntcha/src passport/passport_000.jpeg
pwntcha: image size 250x50, 256 colours
pwntcha: could not guess captcha type
from awesome-ocr.
import cv2
import preprocess as pre
import platedetect as pld
import DetectChars as DC
import PossiblePlate
import PossibleChar
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
from PIL import Image
import sys
import pyocr
import pyocr.builders
#import pillowfight
import PIL.Image
import sys
import pyocr
import pyocr.builders
SCALAR_BLACK = (0.0, 0.0, 0.0)
SCALAR_WHITE = (255.0, 255.0, 255.0)
SCALAR_YELLOW = (0.0, 255.0, 255.0)
SCALAR_GREEN = (0.0, 255.0, 0.0)
SCALAR_RED = (0.0, 0.0, 255.0)
showSteps = False
def main():
blnKNNTrainingSuccessful = DC.loadKNNDataAndTrainKNN()
if blnKNNTrainingSuccessful == False: # if KNN training was not successful
print "\nerror: KNN traning was not successful\n" # show error message
return # and exit program
# end if
original_image = cv2.imread("Temp-new.jpeg", 1)
imgGrayScale, imgThresh = pre.preprocess(original_image)
cv2.imshow('gray', imgGrayScale)
cv2.imshow('thresh', imgThresh)
# ROI detection filter by roi size
listOfPossibleRois = pld.detectPlates(imgThresh, original_image)
listOfPossibleRois = DC.detectCharsInPlates(listOfPossibleRois)
if len(listOfPossibleRois) == 0:
print "no candidates roi"
else:
listOfPossibleRois.sort(key = lambda possiblePlate: len(possiblePlate.strChars), reverse=True)
for index in range(len(listOfPossibleRois)):
# cv2.imshow('imgPlate'+str(index), listOfPossibleRois[index].imgPlate)
cv2.imwrite('imgRoi'+str(index)+'.png', listOfPossibleRois[index].imgPlate)
# Stroke Width Transformation
# img_in = PIL.Image.open('imgRoi'+str(index)+'.png')
# # step01 ace
# ace_out_img = pillowfight.ace(img_in,
# slope=10,
# limit=1000,
# samples=100,
# seed=None)
# # step 02
# sobel_out_img = pillowfight.sobel(img_in)
# # step 03
# blackfilter_out = pillowfight.unpaper_blackfilter(sobel_out_img)
# # step 04
# out_img = pillowfight.unpaper_noisefilter(sobel_out_img)
# # step 05
# out_img = pillowfight.unpaper_blurfilter(out_img)
# # step 06
# out_img = out_img.resize((out_img.size[0] * 4, out_img.size[1] * 4), PIL.Image.RASTERIZE) # bigger is better
ocr = pyocr.get_available_tools()
if len(ocr) == 0:
print("No OCR tool found")
sys.exit(1)
# The tools are returned in the recommended order of usage
tool = ocr[0]
print("Will use tool '%s'" % (tool.get_name()))
# Ex: Will use tool 'libtesseract'
langs = tool.get_available_languages()
print("Available languages: %s" % ", ".join(langs))
lang = langs[0]
print("Will use lang '%s'" % (lang))
txt = ocr.image_to_string(out_img, lang='eng')
print('candidates roi'+str(index)+'ocr result:'+txt)
if __name__ == "__main__":
main()
from awesome-ocr.
https://github.com/TonyLyu/project
from awesome-ocr.
from awesome-ocr.
https://github.com/goncalopp/simple-ocr-opencv
(py2.7) ➜ OCR git clone https://github.com/TonyLyu/Final.git
from awesome-ocr.
How to compile on Linux
Install Depedencies (Debian)
sudo apt-get install libsdl1.2debian
sudo apt-get install libsdl1.2-dev
sudo apt-get install libsdl-image1.2
sudo apt-get install libsdl-image1.2-dev
sudo apt-get install libsdl-mixer1.2-dev
sudo apt-get install libsdl-ttf2.0-dev
sudo apt-get install libsdl-gfx1.2-dev
Compile
./bootstrap
./configure
make
from awesome-ocr.
Related Issues (20)
- OCR basics HOT 1
- EAST:An Efficient and Accurate Scene Text Detector HOT 1
- Robust, Simple Page Segmentation using Hybrid Convolutional MDLSTM Networks
- PixelLink: Detecting Scene Text via Instance Segmentation
- Table-to-Text: Describing Table Region with Natural Language
- lable tools
- how to modify the connectionist Temporal Classification (CTC) layer of the network to also give us a confidence score? HOT 2
- Confidence Prediction for Lexicon-Free OCR HOT 1
- 工业制造——Workplace of automated control of vibration output circular trays HOT 3
- Tesseract for R HOT 1
- Cut, Paste and Learn: Surprisingly Easy Synthesis for Instance Detection
- 【Rosetta:大规模图像文字检测识别系统】《Rosetta: Large scale system for text detection and recognition in images》[Facebook] (2018) O HOT 4
- Radical analysis network for zero-shot learning in printed Chinese character recognition HOT 3
- DenseRAN for Offline Handwritten Chinese Character Recognition HOT 3
- Deep TextSpotter: An End-to-End Trainable Scene Text Localization and Recognition Framework
- in marmot data set the table BBOX are not matching with original images
- dhSegment: A generic deep-learning approach for document segmentation
- null
- 2018年末撸串计划 HOT 5
- 希望可以增加PaddleOCR、AgentOCR HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from awesome-ocr.