Esempio n. 1
0
def updateImage():
    destDepth = cv2.CV_32F; # should be higher than source depth to avoid overflow
    imgCopy = cv2.Sobel(img, ddepth=destDepth, dx=cvparam_dict['dx'].value, dy=cvparam_dict['dy'].value, ksize=cvparam_dict['kernelSize'].value,
                      scale=cvparam_dict['scale'].value, delta=cvparam_dict['delta'].value)

    cvparams.annotateImageWithParams(cvparam_dict, imgCopy)
    cv2.imshow('results', imgCopy)
Esempio n. 2
0
def updateImage():
    imgCopy = cv2.GaussianBlur(img, (cvparam_dict['kernelWidth'].value,
                                     cvparam_dict['kernelHeight'].value),
                               cvparam_dict['sigmaY'].value)

    cvparams.annotateImageWithParams(cvparam_dict, imgCopy)
    cv2.imshow('results', imgCopy)
Esempio n. 3
0
def updateImage():
    d = cvparam_dict['filterSize'].value
    sigmaColor = cvparam_dict['colorKernelSize'].value
    sigmaSpace = cvparam_dict['spaceKernelSize'].value
    imgCopy = cv2.bilateralFilter(img, d=d, sigmaColor=sigmaColor, sigmaSpace=sigmaSpace)

    cvparams.annotateImageWithParams(cvparam_dict, imgCopy)
    cv2.imshow('results', imgCopy)
Esempio n. 4
0
def updateImage():
    copy = img.copy()
    squares = find_contours(copy)
    cv2.drawContours(copy, squares, -1, (0, 255, 0), 1 )

    cvparams.annotateImageWithParams(cvparam_dict, copy)

    cv2.imshow('results', copy)
Esempio n. 5
0
def updateImage():
    copy = img.copy()
    squares = find_contours(copy)
    cv2.drawContours(copy, squares, -1, (0, 255, 0), 1)

    cvparams.annotateImageWithParams(cvparam_dict, copy)

    cv2.imshow('results', copy)
Esempio n. 6
0
def updateImage():
    edges = cv2.Canny(gray, cvparam_dict['threshold1'].value, cvparam_dict['threshold2'].value, apertureSize=cvparam_dict['aperture'].value)

    imag = img.copy()
    imag /= 2
    imag[edges != 0] = (0, 255, 0)

    cvparams.annotateImageWithParams(cvparam_dict, imag)
    cv2.imshow('results', imag)
Esempio n. 7
0
def updateImage():
    d = cvparam_dict['filterSize'].value
    sigmaColor = cvparam_dict['colorKernelSize'].value
    sigmaSpace = cvparam_dict['spaceKernelSize'].value
    imgCopy = cv2.bilateralFilter(img,
                                  d=d,
                                  sigmaColor=sigmaColor,
                                  sigmaSpace=sigmaSpace)

    cvparams.annotateImageWithParams(cvparam_dict, imgCopy)
    cv2.imshow('results', imgCopy)
Esempio n. 8
0
def updateImage():
    edges = cv2.Canny(gray,
                      cvparam_dict['threshold1'].value,
                      cvparam_dict['threshold2'].value,
                      apertureSize=cvparam_dict['aperture'].value)

    imag = img.copy()
    imag /= 2
    imag[edges != 0] = (0, 255, 0)

    cvparams.annotateImageWithParams(cvparam_dict, imag)
    cv2.imshow('results', imag)
Esempio n. 9
0
def updateImage():
    theta = np.pi / 180
    rho = 1
    threshold = cvparam_dict["threshold"].value
    minLength = cvparam_dict["minLength"].value
    maxGapLength = cvparam_dict["maxGapLength"].value
    lines = cv2.HoughLinesP(edges, rho, theta, threshold=threshold, minLineLength=minLength, maxLineGap=maxGapLength)

    imag = img.copy()
    for x1, y1, x2, y2 in lines[0]:
        cv2.line(imag, (x1, y1), (x2, y2), (0, 255, 0), 2)
    cvparams.annotateImageWithParams(cvparam_dict, imag)
    cv2.imshow("results", imag)
Esempio n. 10
0
def updateImage():
    theta = np.pi/180
    rho = 1
    threshold = cvparam_dict['threshold'].value
    minLength =  cvparam_dict['minLength'].value
    maxGapLength = cvparam_dict['maxGapLength'].value
    lines = cv2.HoughLinesP(edges, rho, theta, threshold=threshold, minLineLength=minLength, maxLineGap=maxGapLength)

    imag = img.copy()
    for x1,y1,x2,y2 in lines[0]:
        cv2.line(imag,(x1,y1),(x2,y2),(0,255,0),2)
    cvparams.annotateImageWithParams(cvparam_dict, imag)
    cv2.imshow('results', imag)
Esempio n. 11
0
def updateImage():
    destDepth = cv2.CV_32F
    # should be higher than source depth to avoid overflow
    imgCopy = cv2.Sobel(img,
                        ddepth=destDepth,
                        dx=cvparam_dict['dx'].value,
                        dy=cvparam_dict['dy'].value,
                        ksize=cvparam_dict['kernelSize'].value,
                        scale=cvparam_dict['scale'].value,
                        delta=cvparam_dict['delta'].value)

    cvparams.annotateImageWithParams(cvparam_dict, imgCopy)
    cv2.imshow('results', imgCopy)
Esempio n. 12
0
def updateImage():
    w = cvparam_dict['kernelSize'].value
    imgCopy = cv2.medianBlur(img, w)

    cvparams.annotateImageWithParams(cvparam_dict, imgCopy)
    cv2.imshow('results', imgCopy)