Change object color with the same range
Hi, I'm new, I have an application in android using opencv. I need to change the color of a object region and the ouput still have the same lightness (V
channel) and contrast with the original image, it's mean the object region will have the new color from dark to light same as the input image.
I have had detect the region need to change color (a mat of binary) using this solution https://github.com/opencv/opencv/blob....
I will summary the solution: when user touch on the image I will create a rectangle 8x8 arround the user touch point then I calculate the mean of H,S,V
chabbels of the rect and then I specify the range of each channel. In which pixel has the value of each channle in the range I will regconize to the same color with the touch point need to change color.
Can anyone tell me the best way to apply the new color to the region I had detected. Thanks.
The example input image
the result after I detect the skin of the dog
it seems, you came quite far here already, but now, it's a bit unclear, where your current problem is.
e.g. are you able to get the touch region ?
what do you have and what do you need ?
Hi Berak , I could able to get the region from the user (the rect 8x8 with the center is the user touch point) and then I have had detected the regoin where I think its the same color (you can see the second picture). So my question is how to apply a new color to that region and the result must be still the same lightness and contrast with the input image.