AttributeError: 'numpy.ndarray' object has no attribute 'asType'
topHat = cv2.morphologyEx(gray, cv2.MORPH_TOPHAT, rectKernel)
gradX = cv2.Sobel(topHat, ddepth=cv2.CV_32F, dx=1, dy=0,ksize=-1)
gradX = np.absolute(gradX)
(minVal, maxVal) = (np.min(gradX), np.max(gradX))
gradX = (255*((gradX - minVal) / (maxVal - minVal)))
gradX = gradX.asType("uint8")