Log in

View Full Version : Edge detection help


redfordxx
24th April 2006, 13:24
Hi, I am working on new deblocking scrip (I will share later if successful). Inspired little by Deblock_QED, but different approach:
1) Similar to Deblock_QED, build block edges mask (called _block_ there). But here, I process horizontal and vertical edges separately, so it is two masks (_barsH_ and _barsV_).
2) Find blocking edges mask on these bars-masks (the higher block difference, the higher value on this mask)
3) Merge horizontal and vertical edges masks-->_BlockMask_
4) Blur the BlockMask into the 8x8 blocks inner areas (using convolution dimension 8)
Now we have blocking strength mask.
5) Create deblocked clips with different strength of deblocking (1-16777216, as preferred;-)
6) Maskmerge them according to the Blocking mask


I have a problem already in step 2):
I tried to find edges with mt_convolution("1 –1 1", "1"). It found nicely the blocking edges. Of course, there are real edges but I can filter them out (as lines with high values). But there are also diagonal edges caught by this kernel, and I can’t get rid of them. Pls help, I am not so familiar with edge detection. I see already kernels when I close my eyes.

What I need is kernel (or procedure) to detect strictly horizontal resp. vertical edges and not be confused by diagonals.

Thanks
R.

Mug Funky
26th April 2006, 11:34
you could use the vertical mask as well - if you get high values in both masks you must be on a diagonal. it's pretty simplistic though.

comb masks suffer a similar problem, and i had a convo that took diagonals into account which worked pretty well... i'll post it to see if it gives you an idea.

while you're using 3x3 kernels it can't hurt to use those outside 6...

[edit]

here's the comb mask:

mt_edge("-1 -2 -1
\ 2 4 2
\ -1 -2 -1 16",0,255)

redfordxx
26th April 2006, 21:47
you could use the vertical mask as well - if you get high values in both masks you must be on a diagonal.nice, thanx i'll try

while you're using 3x3 kernels it can't hurt to use those outside 6...don't understand...