How to detect a range of colours and change them to a different colour

asked 2017-11-15 07:40:02 -0500

Hi everyone!

I am currently attempting to use Open CV to recognise specific areas/object within a set of pictures, however I seem to have hit a bit of a wall.

Whilst trying to detect a range of colours (in BGR) and change them to a different colour (ie yellow to show they have been detected) I can't seem to find a way to do this whilst keeping the whole picture. For example, I have found a way to create 'a mask' which can then be used as part of a 'bitwise_and' operation, this however just blacks out the entire image apart from the object. I want the entire image with the object in other words 'highlighted'. The object is likely to be of a range of colours hence why I am finding this more of a task.

Can anyone suggest how I may be able to do this? Thanks

edit retag flag offensive close merge delete