Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

let me guess, above is a binary (8bit grayscale) image, -- you cannot draw something in color on that. only the 1st channel of your drawingcolor will be used, and that is 0, so you draw a black circle on black background.

solution1:

## draw a grey circle, so you have some contrast to both line & bg:
cv2.circle(ske, (centroid_x,centroid_y), 5, (127,0,0), -1)

solution2:

## convert to 3 channels, then draw your red circle into that:
bgr = cvtColor(ske, cv2.COLORGRAY2BGR)
cv2.circle(bgr, (centroid_x,centroid_y), 5, (0,0,255), -1)

let me guess, above is a binary (8bit grayscale) image, -- you cannot draw something in color on that. only the 1st channel of your drawingcolor will be used, and that is 0, so you draw a black circle on black background.

solution1:

## draw a grey circle, so you have some contrast to both line & bg:
cv2.circle(ske, (centroid_x,centroid_y), 5, (127,0,0), -1)

solution2:

## convert to 3 channels, then draw your red circle into that:
bgr = cvtColor(ske, cv2.COLORGRAY2BGR)
cv2.circle(bgr, (centroid_x,centroid_y), 5, (0,0,255), -1)

above is a binary (8bit grayscale) (1 channel) image, -- you cannot draw something in color on that. only the 1st channel of your drawingcolor will be used, and that is 0, so you draw a black circle on black background.

solution1:

## draw a grey circle, so you have some contrast to both line & bg:
cv2.circle(ske, (centroid_x,centroid_y), 5, (127,0,0), -1)

solution2:

## convert to 3 channels, then draw your red circle into that:
bgr = cvtColor(ske, cv2.COLORGRAY2BGR)
cv2.circle(bgr, (centroid_x,centroid_y), 5, (0,0,255), -1)