Hello ! I'm using cv2 in python to draw circles (representing stars) into a CV_8U
image. I'm drawing on average 5k small circles, radius goes from 1px
to 6px
with antialiasing.
Im taking ~80ms for drawing ~5k or few circles and (e.g.) ~3200ms for ~80k circles. Because each circle has a different size and color, I'm actually calling cv2.circle
each time I want to draw a circle which is for sure slowing the program down but no big deal (is there any other alternative to this anyway for different radius and colors?).
The issue is where some circles, for example, two red circles overlap:
circle A with radius=5px and color rgb=(200,10,30) at xy=(200, 300)
circle B with radius=2px and color rgb=( 20, 2, 1) at xy=(200, 300)
If circle A is drawn before and circle B later, because circle B's brightness is so low I will be left with a circumference in red and a very dark interior instead of the ideal of making the second circle values add to the already existing values at that position (like adding two light sources).
My current solution is to draw the circles to a buffer the size of the biggest possible circle and then add that buffer to the specific position in the final image. But I'm wondering if is there a parameter in OpenCV to define how the drawings to the image are made? (to make it additive) and prevent the need for that buffer.
Thanks.