lane/threshold.py
def abs_sobel_thresh(img, orient='x', thresh=(20, 100)):
    """
    #--------------------- 
    # This function applies Sobel x or y, and then 
    # takes an absolute value and applies a threshold.
    #
    """
    # Take the derivative in x or y given orient = 'x' or 'y'
    if orient == 'x':
        abs_sobel = np.absolute(cv2.Sobel(img, cv2.CV_64F, 1, 0))
    if orient == 'y':
        abs_sobel = np.absolute(cv2.Sobel(img, cv2.CV_64F, 0, 1))

    # Scale to 8-bit (0 - 255) then convert to type = np.uint8    
    scaled_sobel = np.uint8(255*abs_sobel/np.max(abs_sobel))
   
    # Create a binary mask where mag thresholds are met  
    binary_output = np.zeros_like(scaled_sobel)
    binary_output[(scaled_sobel >= thresh[0]) & (scaled_sobel <= thresh[1])] = 255

    # Return the result
    return binary_output

    #--------------------- 
    # This function applies Sobel x or y, and then 
    # takes an absolute value and applies a threshold.
    #
    
This function applies Sobel x or y, and then
takes an absolute value and applies a threshold.
This function applies Sobel x or y and then takes an absolute value and applies a threshold .
def abs_sobel_thresh(img, orient='x', thresh=(20, 100)):
    if orient == 'x':
        abs_sobel = np.absolute(cv2.Sobel(img, cv2.CV_64F, 1, 0))
    if orient == 'y':
        abs_sobel = np.absolute(cv2.Sobel(img, cv2.CV_64F, 0, 1))
    scaled_sobel = np.uint8(255*abs_sobel/np.max(abs_sobel))
    binary_output = np.zeros_like(scaled_sobel)
    binary_output[(scaled_sobel >= thresh[0]) & (scaled_sobel <= thresh[1])] = 255
    return binary_output
def abs_sobel_thresh ( img , orient = 'x' , thresh = ( 20 , 100 ) ) : if orient == 'x' : abs_sobel = np . absolute ( cv2 . Sobel ( img , cv2 . CV_64F , 1 , 0 ) ) if orient == 'y' : abs_sobel = np . absolute ( cv2 . Sobel ( img , cv2 . CV_64F , 0 , 1 ) ) scaled_sobel = np . uint8 ( 255 * abs_sobel / np . max ( abs_sobel ) ) binary_output = np . zeros_like ( scaled_sobel ) binary_output [ ( scaled_sobel >= thresh [ 0 ] ) & ( scaled_sobel <= thresh [ 1 ] ) ] = 255 return binary_output
This function applies Sobel x or y, and then
 takes an absolute value and applies a threshold.
This function applies Sobel x or y and then takes an absolute value and applies a threshold .
"""
    #--------------------- 
    # This function applies Sobel x or y, and then 
    # takes an absolute value and applies a threshold.
    #
    """ # Take the derivative in x or y given orient = 'x' or 'y' # Scale to 8-bit (0 - 255) then convert to type = np.uint8     # Create a binary mask where mag thresholds are met   # Return the result
img
orient
thresh