GithubHelp home page GithubHelp logo

pwntcha 测试 about awesome-ocr HOT 6 CLOSED

wanghaisheng avatar wanghaisheng commented on June 2, 2024
pwntcha 测试

from awesome-ocr.

Comments (6)

wanghaisheng avatar wanghaisheng commented on June 2, 2024
➜  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.

wanghaisheng avatar wanghaisheng commented on June 2, 2024
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.

wanghaisheng avatar wanghaisheng commented on June 2, 2024

https://github.com/TonyLyu/project

from awesome-ocr.

wanghaisheng avatar wanghaisheng commented on June 2, 2024

https://raw.githubusercontent.com/dingtiansong/infoEx/cb858fef0fefd3f5a4397d79c0fffc57b49f0d2a/picReg/wumiiTrainImage/inputImage.py

from awesome-ocr.

wanghaisheng avatar wanghaisheng commented on June 2, 2024

https://github.com/goncalopp/simple-ocr-opencv
(py2.7) ➜ OCR git clone https://github.com/TonyLyu/Final.git

from awesome-ocr.

wanghaisheng avatar wanghaisheng commented on June 2, 2024

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)

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.