Fill the region of rotating bounding box with nearest pixel value

4 次查看(过去 30 天)
I have a rotating bounding box in an image. I want to fill region inside the bounding box with nearest pixel values outside the bounding box. I am thinking of going through the regions of the bounding box iteratively and calculating the left and right neighbour value for each row and fill that row with those values. Before doing that i want to know is there an elegant and better way of doing that in Matlab or opencv (python) by using some functions

回答(1 个)

Naman Chaturvedi
Naman Chaturvedi 2018-8-24
Hi Prashant
You can design the appropriate mask and then use the functions:- conv2 / filter2 / imfilter to apply the mask to your image and get the desired results.
Hope this helps.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by