is there a way to set a rectangular block of pixels to a colour in opencv (specifically in python) other than looping through them? e.g. some kind of 2d slice syntax or once an ROI is set change all inside.
i have tried im[0:100, 200:300] = (255,255,255) with no luck
You should have a look at CV.Rectangle, which does exactly what you want 🙂
http://opencv.willowgarage.com/documentation/python/core_drawing_functions.html?highlight=rectangle#Rectangle