not âdetectâ. detection is for things that are already there but you donât know where.
what you do is âmarkingâ those points.
if you want to use different colors, then use different colors. you see the color argument to putTextâŚ
also, putText is for text. if you just want to draw a dot, use cv.circle() with thickness=cv.FILLED argument
Thank you for your comments.
However, to get I tested the 3 combinations of the color argument for the putText and I was able to get other colors for my points, as shown in the mage below.
Whether they are randomly colored or not, the main thing is that I manage to have these points of each mouse click with a specific color.
It is a small project of initiation that we realize for a course. Then to work on detector/describer (SIFT and SURF). At first, I want to display the point on which I clicked on the image with its specific color and print its coordinates.
so⌠you arenât asking for help, right? just chatting? because you keep not answering how you want to specify the color even though you keep talking about âspecific colorâ
or do you want to sample the color of the picture, instead of drawing a dot? because thatâs not what you asked for at any point. besides, your picture is grayscale.
Iâm sorry, but I donât know why youâre telling me this when Iâve answered all your questions!
I told you the result I wanted to obtain (display the point on which I clicked on the image with a specific color and print its coordinates), for the moment I used the function cv.putText(img, â.â, (x,y), font, .5 , (0, 0, 255), 4, cv.LINE_AA, False) but I get only one color for all the points.
So what Iâm asking you is if there is a function to add to my code or an argument that I need to configure to get the result I want?
N.B:
-Concerning the images, I work on the images at the gray scale.
-I donât know how to specify the color of my points, thatâs why I ask for your help!
-To sample the color of the image? ! I donât know. Could you tell me more, please?
-I want to tell you again that I am new in this field!
the (0, 0, 255) argument is the color. that value represents red. the order is (blue, green, red).
if youâre hoping to be handed complete code that does something you can send in to the instructor, that will not happen.
you keep repeating the goal but you keep not addressing my question as to how you think youâd want to specify different colors at runtime. if you change that constant in the code, thatâll only change the color, but for all points you draw. if you wanted multiple points with different colors, you would have to come up with something that lets you set the color at runtime. I already suggested to use random values, which does not require user interaction.
if youâre asking how to let the user enter different color values⌠lots of options. do you want a color picker dialog? thatâll require either using some real GUI (tkinter?) or opening a second imshow window, with a color palette, and a mouse handler, so you can click there and sample a color from that window.
Thank you very much for taking the time to answer.
Could you direct me to a tutorial that I can follow to get more details and better understand your proposal to use random values, to finally test it on my image?