Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

detailsEnchance giving error: (-215) (scn == 3 || scn == 4) && (depth == CV_8U || depth == CV_32F) in function cvtColor

I saw this link which helps enhance details in the image This is my code

img = cv2.imread('p_45.png',0)
#Enhance the contrast
clahe = cv2.createCLAHE(clipLimit=2.0, tileGridSize=(8,8))
cl1 = clahe.apply(img)

abs_lp1 = np.absolute(cl1)
i_8U = np.uint8(abs_lp1)

dst = cv2.detailEnhance(i_8U,sigma_s=10, sigma_r=0.15)

This is the error I'm getting

dst = cv2.detailEnhance(img,sigma_s=10, sigma_r=0.15)
cv2.error: /tmp/opencv3-20170817-33981-15wdezm/opencv-3.3.0/modules/imgproc/src/color.cpp:10724: error: (-215) (scn == 3 || scn == 4) && (depth == CV_8U || depth == CV_32F) in function cvtColor

What went wrong?

detailsEnchance giving error: (-215) (scn == 3 || scn == 4) && (depth == CV_8U || depth == CV_32F) in function cvtColor

I saw this link which helps enhance details in the image image

This is my code

img = cv2.imread('p_45.png',0)
#Enhance the contrast
clahe = cv2.createCLAHE(clipLimit=2.0, tileGridSize=(8,8))
cl1 = clahe.apply(img)

abs_lp1 = np.absolute(cl1)
i_8U = np.uint8(abs_lp1)

dst = cv2.detailEnhance(i_8U,sigma_s=10, sigma_r=0.15)

This is the error I'm getting

dst = cv2.detailEnhance(img,sigma_s=10, sigma_r=0.15)
cv2.error: /tmp/opencv3-20170817-33981-15wdezm/opencv-3.3.0/modules/imgproc/src/color.cpp:10724: error: (-215) (scn == 3 || scn == 4) && (depth == CV_8U || depth == CV_32F) in function cvtColor

What went wrong?