MysteryX
24th May 2017, 17:50
I have a mask like this of stripe patterns in a frame. The stronger areas are the patterns of past frame, and the weaker areas are the patterns of next frame (when doing frame interpolation).
https://s13.postimg.org/7va7usms3/Stripes.png (https://postimg.org/image/7va7usms3/)
Now, I would like to detect large continuous areas and produce a mask from it. What I have so far is this.
EMstp = EMstp.BicubicResize(Round(C.Width/BlkSize/4.0)*2, Round(C.Height/BlkSizeV/4.0)*2)
\ .mt_expand(mode= mt_circle(zero=true, radius=1))
\ .mt_binarize(min(SkipTrh*2, 255))
\ .Blur(.3)
\ .BicubicResize(C.Width, C.Height)
I'm not totally satisfied by it although it generally gives an acceptable result.
https://s13.postimg.org/ohrs3vfpv/Mask.png (https://postimg.org/image/ohrs3vfpv/)
This selects or rejects large blocks based on the position of stripes within the blocks, so a large area half in a block and half in the next will be discarded, and a narrow but long stripe will also be discarded, while smaller areas matching a block will pass.
I might as well ask for advice here. What better technique can you come up with? Ideally, we could detect horizontal patches and vertical patches as well, not just large square patches.
If necessary, it's possible to write a new filter from scratch for the right algorithm, but ideally we'd do it with standard functions.
In this sample I want to include the whole barrier at the top and discard the bottom part, ideally.
https://s13.postimg.org/7va7usms3/Stripes.png (https://postimg.org/image/7va7usms3/)
Now, I would like to detect large continuous areas and produce a mask from it. What I have so far is this.
EMstp = EMstp.BicubicResize(Round(C.Width/BlkSize/4.0)*2, Round(C.Height/BlkSizeV/4.0)*2)
\ .mt_expand(mode= mt_circle(zero=true, radius=1))
\ .mt_binarize(min(SkipTrh*2, 255))
\ .Blur(.3)
\ .BicubicResize(C.Width, C.Height)
I'm not totally satisfied by it although it generally gives an acceptable result.
https://s13.postimg.org/ohrs3vfpv/Mask.png (https://postimg.org/image/ohrs3vfpv/)
This selects or rejects large blocks based on the position of stripes within the blocks, so a large area half in a block and half in the next will be discarded, and a narrow but long stripe will also be discarded, while smaller areas matching a block will pass.
I might as well ask for advice here. What better technique can you come up with? Ideally, we could detect horizontal patches and vertical patches as well, not just large square patches.
If necessary, it's possible to write a new filter from scratch for the right algorithm, but ideally we'd do it with standard functions.
In this sample I want to include the whole barrier at the top and discard the bottom part, ideally.