I have a set of coordinates for an RGB image (1920 x 1080) stored as a list of list which is RoI (region of interests) as follows
[[1538, 234, 1626, 313],
[421, 231, 472, 288],
[918, 199, 988, 270],
[802, 0, 963, 114],
[1732, 0, 1909, 108]]
I then apply the following conditions to change specific pixel values within the co-ordinates in the list of the list above only to highlight these RoIs by changing the pixels into white and black.
for coords in list_of_coords:
roi = orig[coords[1]:coords[3], coords[0]:coords[2]]
roi [(roi > 200)] = 0
roi [(roi < 200)] = 255
How can I now take these new modified pixel values and apply them on top of the original image with a degree of transparency? Ideally, the rest of the image will be the same whilst the values within these coordinates will have a transparent mask on top of them.
Here is an example of how the desired output should look like. I have taken this from Mask RCNN, where within the rectangle coordinates, a slight shade of blue is added to highlight the RoI. The rectangle boxes are represented with the list of list above, and the shade of blue is the manipulation from the conditions mentioned above.


