mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avfilter/vf_edgedetect: properly implement double_threshold()
Important part of this algorithm is the double threshold step: pixels above "high" threshold being kept, pixels below "low" threshold dropped, pixels in between (weak edges) are kept if they are neighboring "high" pixels. The weak edge check uses a neighboring context and should not be applied on the plane's border. The condition was incorrect and has been fixed in the commit. Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com> Reviewed-by: Andriy Gelman <andriy.gelman@gmail.com>
This commit is contained in:
parent
235a5734e0
commit
855d51bf48
@ -294,7 +294,7 @@ static void double_threshold(int low, int high, int w, int h,
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((!i || i == w - 1 || !j || j == h - 1) &&
|
||||
if (!(!i || i == w - 1 || !j || j == h - 1) &&
|
||||
src[i] > low &&
|
||||
(src[-src_linesize + i-1] > high ||
|
||||
src[-src_linesize + i ] > high ||
|
||||
|
@ -1 +1 @@
|
||||
edgedetect 93ceace33f6636bcdbeb037317c65745
|
||||
edgedetect 04ff46bb35edff3dbad4102391516d25
|
||||
|
@ -1 +1 @@
|
||||
edgedetect-colormix 1b8658252e2f03fbae30e6d63dd24c7c
|
||||
edgedetect-colormix 9f50c5586f899a8f5a10059154d64bde
|
||||
|
Loading…
x
Reference in New Issue
Block a user