this is displaying the correct result but it is colouring the objects with grey colour and its shades, i want them to be in different colours instead of shades of grey, like red, blue, green, pink, yellow etc.. How shall I do that? Plus, I would like to know, if it is possible to also see the image’s matrix like in 0s, 1s form?
Share
Your problem is that you are trying to draw the contours on the same black&white image. You should make a different image like this:
This will be a 3 channel image and you will be able to draw BGR colors.
If you wanna see the intensity matrix representing all the pixels in the b&w image you can just output them in a text file or something.You can access any element like this: