Пример #1
0
def captcha_regonize(im):
    """
    Run captcha regonization.
    """
    cleanup()
    img = rmnoise(preprocess(im))
    edges = find_edges(img)
    cutcaptcha(img, edges)
    captcha = matchcapthca()
    return captcha
Пример #2
0
def captcha_regonize(im):
    """
    Run captcha regonization.
    """
    cleanup()
    img = rmnoise(preprocess(im))
    edges = find_edges(img)
    cutcaptcha(img, edges)
    captcha = matchcapthca()
    return captcha
from skimage import feature
from skimage.morphology import disk
from skimage.morphology import erosion, dilation

import edge_detection as ed

parser = argparse.ArgumentParser(
    description='Shows additional sampling points for the given picture')
parser.add_argument('filename',
                    help='file with image',
                    default='pic1.jpg',
                    nargs='?')
args = parser.parse_args()

print(args.filename)
im = ndi.imread(args.filename)
img = rgb2gray(im)
img_dark = ed.find_dark_regions(img)
img_edges = ed.find_edges(img)
img = img_dark + img_edges

# display results
fig = plt.figure()
ax0 = fig.add_subplot(111)
ax0.imshow(img, cmap=plt.cm.gray)
ax0.axis('off')
ax0.set_title('Sobel filter', fontsize=12)

plt.tight_layout()
plt.show()
import argparse
import numpy as np
import matplotlib.pyplot as plt
from scipy import ndimage as ndi
from skimage.color import rgb2gray

import edge_detection as ed

parser = argparse.ArgumentParser(description='Shows edges from the given picture')
parser.add_argument('filename', help='file with image', default='pic1.jpg', nargs='?')
#parser.add_argument('sigma', help='Sigma value for Canny algorithm', default='4', nargs='?')
args = parser.parse_args()

im = ndi.imread(args.filename)
img = rgb2gray(im)
img = ed.find_edges(img)

# display results
fig = plt.figure()
ax0 = fig.add_subplot(111)
ax0.imshow(img, cmap=plt.cm.gray)
ax0.axis('off')
ax0.set_title('Sobel filter', fontsize=12)

plt.tight_layout()
plt.show()
import argparse
import numpy as np
import matplotlib.pyplot as plt
from scipy import ndimage as ndi
from skimage.color import rgb2gray

import edge_detection as ed

parser = argparse.ArgumentParser(
    description='Shows edges from the given picture')
parser.add_argument('filename',
                    help='file with image',
                    default='pic1.jpg',
                    nargs='?')
#parser.add_argument('sigma', help='Sigma value for Canny algorithm', default='4', nargs='?')
args = parser.parse_args()

im = ndi.imread(args.filename)
img = rgb2gray(im)
img = ed.find_edges(img)

# display results
fig = plt.figure()
ax0 = fig.add_subplot(111)
ax0.imshow(img, cmap=plt.cm.gray)
ax0.axis('off')
ax0.set_title('Sobel filter', fontsize=12)

plt.tight_layout()
plt.show()
import matplotlib.pyplot as plt
from scipy import ndimage as ndi
from skimage.color import rgb2gray

from skimage import feature
from skimage.morphology import disk
from skimage.morphology import erosion, dilation

import edge_detection as ed

parser = argparse.ArgumentParser(description='Shows additional sampling points for the given picture')
parser.add_argument('filename', help='file with image', default='pic1.jpg', nargs='?')
args = parser.parse_args()

print(args.filename)
im = ndi.imread(args.filename)
img = rgb2gray(im)
img_dark = ed.find_dark_regions(img)
img_edges = ed.find_edges(img)
img = img_dark + img_edges

# display results
fig = plt.figure()
ax0 = fig.add_subplot(111)
ax0.imshow(img, cmap=plt.cm.gray)
ax0.axis('off')
ax0.set_title('Sobel filter', fontsize=12)

plt.tight_layout()
plt.show()