Log in

View Full Version : How do you view edge masks?


Reclusive Eagle
24th October 2021, 19:55
I'm trying to create a Sobel Edge mask and I get no errors but literally nothing happens when I should be seeing detected edges.

I am using this (https://guide.encode.moe/encoding/masking-limiting-etc.html#example-build-a-simple-dehalo-mask) article as a guide however literally nothing happens.

The clip is YUV420P8 so 470BG

This code does nothing:
core.std.Binarize(clip,24, v0=0, v1=255)
clipmax = core.std.Maximum(clip)
clipmin = core.std.Minimum(clip)
minmax = core.std.Expr([clipmax, clipmin], 'x y -')
mask = core.std.Sobel(clip, 0)
luma = core.std.ShufflePlanes(mask, 0, colorfamily=vs.GRAY)


Neither does this:
This code does nothing:
core.std.Sobel(clip)
sx = core.std.Convolution(clip,[-1, -2, -1, 0, 0, 0, 1, 2, 1], saturate=False)
sy = core.std.Convolution(clip,[-1, 0, 1, -2, 0, 2, -1, 0, 1], saturate=False)
core.std.Expr([sx, sy], 'x y max')

Am I supposed to display the mask layer somehow?

ChaosKing
24th October 2021, 20:03
You need an add output at the end: your_clip_name.set_output()
In your case it would be
luma.set_output()

If you want the mask
mask.set_output()

Reclusive Eagle
24th October 2021, 20:09
You need an add output at the end: your_clip_name.set_output()
In your case it would be
luma.set_output()

If you want the mask
mask.set_output()

Yup that was it, thank you!
Was clip.set_output(). I guess there is more to the output than I realized