I am getting the following error when I call my method [given after the error].
error: /feedstock_root/build_artefacts/opencv_1496434080029/work/opencv-3.2.0/modules/core/src/arithm.cpp:1984: error: (-215) lb.type() == ub.type() in function inRange
The code that produces the code is right here. I don't see anything wrong with the code I feed to the function cv2.inRange
def red_filter(rgb_image):
hsv_image = cv2.cvtColor(rgb_image, cv2.COLOR_RGB2HSV)
avg_brightness = average_brightness(hsv_image)
avg_saturation = average_saturation(hsv_image)
# Define our color selection boundaries in HSV values
lower_red = np.array([0, avg_saturation, avg_brightness])
upper_red = np.array([20,255,255])
# Define the masked area
hsv_mask = cv2.inRange(hsv_image, lower_red, upper_red)
# Copy image
hsv_masked_image = np.copy(hsv_image)
# Mask the image to let the light show through
hsv_masked_image[hsv_mask != 0] = [0, 0, 0]
# Display it!
plt.imshow(hsv_masked_image)
Any idea what the issue may be? I couldn't find the solution in other related questions: Question 1 & Question 2