Log in

View Full Version : GenericFilters [Now part of VS core]


Pages : 1 [2]

mawen1250
28th March 2015, 16:22
Thanks for the updates, Myrsloik!

core.generic.Canny(src, 2.5, 2.5, 0.5, [0,1,2])
After some tests with it, here's some findings:
1. The pixel near the border is always zero (two pixels for the bottom due to the shift).
2. For the new one, the shift remains unchanged.
3. For the new one, with 8bit input and the above threshold, there's an unexpected line in the result.
4. For the new one, with 16bit input and the above threshold (which may be too low for 16bit input in practice), there's an unexpected line in a different position. After multiplying the threshold by 256, the unexpected line disappeared.

input image
http://i683.photobucket.com/albums/vv197/mawen1250/Test_zpsslcmjqxf.png
old generic.Canny with 8/16bit input
http://i683.photobucket.com/albums/vv197/mawen1250/Test%20-%20old%20generic.Canny_zpswmqg3lto.png
new generic.Canny with 8bit input
http://i683.photobucket.com/albums/vv197/mawen1250/Test%20-%20new%20generic.Canny%208bit_zpsaxmcoc81.png
new generic.Canny with 16bit input
http://i683.photobucket.com/albums/vv197/mawen1250/Test%20-%20new%20generic.Canny%2016bit_zpsneblnmrh.png

YamashitaRen
1st April 2015, 19:21
I have found a bug in generic.Median :
Output is different between simd and non-simd build (non-simd build were tested on armhf and x86_64).
Source : http://pix.toile-libre.org/upload/original/1427912051.jpg
Simd build : http://pix.toile-libre.org/upload/original/1427912127.jpg
Non-simd build : http://pix.toile-libre.org/upload/original/1427912155.jpg

Non-simd build output seems very wrong...

Myrsloik
1st April 2015, 19:25
I have found a bug in generic.Median :
Output is different between simd and non-simd build (non-simd build were tested on armhf and x86_64).
Source : http://pix.toile-libre.org/upload/original/1427912051.jpg
Simd build : http://pix.toile-libre.org/upload/original/1427912127.jpg
Non-simd build : http://pix.toile-libre.org/upload/original/1427912155.jpg

Non-simd build output seems very wrong...

This code just keeps on giving... I'll try to fix this too I guess...

YamashitaRen
2nd April 2015, 13:30
IMHO generic.Median could just be dropped and rgvs.RemoveGrain(mode=4) can do the same job as well. But it depends on you though.
Good point !

By the way, I would have believed that rgvs.RemoveGrain(mode=20)=generic.Median(), but you're right. It's rgvs.RemoveGrain(mode=4) that has the same output as generic.Median() in my script...

edit : Understood, median=/=mean.

Overdrive80
29th September 2015, 17:10
Thanks, for filters.

How could translate this sentence: mt_edge("hprewitt",thY1=8, thY2=255,thc1=0,thc2=255)?

I had tried translate knowing that "hprewitt" is the same than: mt_logic(mt_edge("1 2 1 0 0 0 -1 -2 -1 1"), mt_edge("1 0 -1 2 0 -2 1 0 -1 1"), mode="max"), but mt_logic is not implemented, is it??

Thanks in advance.

foxyshadis
29th September 2015, 22:12
Thanks, for filters.

How could translate this sentence: mt_edge("hprewitt",thY1=8, thY2=255,thc1=0,thc2=255)?

I had tried translate knowing that "hprewitt" is the same than: mt_logic(mt_edge("1 2 1 0 0 0 -1 -2 -1 1"), mt_edge("1 0 -1 2 0 -2 1 0 -1 1"), mode="max"), but mt_logic is not implemented, is it??

Thanks in advance.

If you ever run across mt_logic in a script, you can replace it with std.Expr([c1, c2], expr=['x y op']), where op is min, max, and, or, xor. (andn isn't supported, but I've never seen that used.) mt_logic is no longer needed because VS's expression syntax is more flexible, and sometimes you can use it to combine multiple avisynth expressions into one.

But yeah, in this case Sobel is exactly equivalent to what masktools calls hprewitt.

Overdrive80
29th September 2015, 23:09
Thanks to both, I'll use sobel althougth I tested TEdge too.