示例#1
0
文件: detector.py 项目: prk3128/test
import cv2
import client
import morph
import hough
import distortion as dist

Trans = client.TrasnferClient()
Morph = morph.morph()
Hough = hough.hough(50,100)
Dist = dist.distortion()

#bright = cv2.imread("./bright.jpg")
#bright = cv2.cvtColor(bright,cv2.COLOR_BGR2GRAY)

#width, height = bright.shape[:2]

#for i in range(width):
#    for j in range(height):
#        bright[i, j] = 255-bright[i, j]

p=0
q=0

# construct camera object
cam = cv2.VideoCapture(0)

while(True) :
    ret, img = cam.read()

    #img = cv2.imread('001_crack.jpg')
#    q += 1
示例#2
0
文件: scanner.py 项目: prk3128/test
import cv2
import numpy as np
import distortion
import auto_canny as auto
import hough
import newlib
import client

count = 0
kernel = np.ones((3, 3), np.uint8)
Hough = hough.hough()
Dist = distortion.distortion()
Trans = client.TrasnferClient(ServerIP='192.168.0.6')

cam = cv2.VideoCapture(0)

while (cam.isOpened()):
    I1 = []
    I2 = []
    I3 = []

    ret, img = cam.read()

    img = Dist.Undistort(img)

    img = img[90:340, 175:425]

    h, w = img.shape[:2]

    img_h = auto.AutoCanny(img)
    #img_h = Hough.HoughDetect(img)