Search code examples
opencvpixel-manipulation

opencv: Manipulating edge-detected pixels


I am new to opencv image processing.

My task is simple. I have a canny-edge detected image. I have to get rid of some edge-detected pixels. For example, at the coordinates of say (20,20), the edge-detected pixel should be eliminated.

Is there any possibility to get some solution?

I would be really thankful if any of you can guide me in solving this.

Thank you very much, Karthik


Solution

  • You can change the parameters of the Canny edge detection and tune them to your needs. If you only want a specific point or say finite specific knows points which you want to get rid off then just access the underlying pixel data and set it to 0. width = image.cols i = y-position, j = x-position image.data[i*width + j] = 0.