Removing fence/bars from photo

I came across this article which shows how to remove fences from photo using photoshop.

Can it be done using opencv for images captured in a zoo like environment or similar to the ones shown below


no, there is no easy copy/paste solution for you.

hmm, that is true.
but do you think this approach might work
1.for any fence obtain its mask.
2.then we could use that mask for further processing lsimilar to how background removal works.

  1. good luck with that. it’s still an ardourous, human task
  2. rather look at “inpainting”

and even your photoshop article says to manually mark every bit of fence.

OpenCV’s inpainting is not content-aware. it looks tie-dyed. it can’t replicate texture.

if you did some research, you’d find some scientific papers on the problem of (semi)automatically calculating a mask for repetitive patterns like chain-link fence.

thanks for the pointers.
btw,this was a random idea that popped at 3AM in night so that’s why the lack of research.
for anyone who might be interested in this
https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=8933392

1 Like