View Full Version : Edgemask on top
rkalwaitis
20th November 2009, 16:35
Here I am again asking you gurus to share some knowledge.
My problem is easily explained.
I want to put a mask edge back ONTOP of my denoised clip. Im sure this is old hat to you guys, but I do not want to damage edges via the denoising.
I think I have a probable answer.
clipedge=mt_edge()
clipclean=TTempsmooth()
Overlay (clipedge, clipclean, mode="blend", opacity=1)
Although I get an image back im not so sure its what I wanted. I want the edge ontop of the denoised not merged. That is why I tried overlay. So question 1 is the above alright for this? Is there another alternate way to do this?
thanks
wonkey_monkey
20th November 2009, 18:10
Overlay (clipedge, clipclean, mode="blend", opacity=1)
That just returns clipclean, because there's no transparency and mode="blend".
(rest deleted cos of muddlement on my part)
David
Gavino
20th November 2009, 18:40
How about
Overlay (clipclean, last, mask=clipedge, mode="blend", opacity=1)
where the original source is still in 'last'.
It could probably be done better with some masktools function, but Didée's your man for that. :)
LaTo
20th November 2009, 19:12
mt_merge(clipclean,clipedge.greyscale(),clipedge,luma=true,chroma="process") # but why do you want this?
Maybe it's this:
mt_merge(clipclean,last,clipedge,luma=true,chroma="process") # *last* is for the original source
rkalwaitis
20th November 2009, 19:19
Thanks Gavino and Lato.
Lato I thought that by replacing the original edges onto a denoised source, It would be helpful in Keeping the edges clean and counter act the denoising process. Am I thinking wrong?
LaTo
20th November 2009, 19:21
Thanks Gavino and Lato.
Lato I thought that by replacing the original edges onto a denoised source, It would be helpful in Keeping the edges clean and counter act the denoising process. Am I thinking wrong?
So you need the second line, this one:
mt_merge(clipclean,last,clipedge,luma=true,chroma="process") # *last* is for the original source
;)
rkalwaitis
20th November 2009, 19:38
Lato, It seems to work very well. Gavino's also seems to work equally as well. So I have two ways to do it. Is their a way to enhance the edges a bit once I have them?
LaTo
20th November 2009, 20:33
Yes, you can sharp them before...
Something like this:
clipclean=last.TTempSmooth()
clipsharp=last.LSFmod()
clipedge=last.mt_edge()
mt_merge(clipclean,clipsharp,clipedge,luma=true,chroma="process")
rkalwaitis
20th November 2009, 20:56
You da man!!
Thanks
rkalwaitis
21st November 2009, 09:30
so enhancing the edge is not feasible? I've tried and am not sure if Im doing anything at all.
Here is what I put.
clipedge=last.mt_edge(mode="prewitt").lsfmod()
would this be a possible use for mt_binarize()?
What is there to enhance on edges?
Thanks
LaTo
21st November 2009, 09:34
clipedge=last.mt_edge(mode="prewitt").lsfmod()
This is WRONG! clipedge is just a mask...
Here is the correct syntax:
clipclean=last.TTempSmooth() # your denoised clip
clipsharp=last.LSFmod() # your enhanced clip
clipedge=last.mt_edge() # the edgemask to merge the two
mt_merge(clipclean,clipsharp,clipedge,luma=true,chroma="process")
If you don't understand, you should read the masktools documentation...
rkalwaitis
21st November 2009, 19:07
Lato,
I understand that they are just a mask. However there are different modes for the edgemask. Ive looked at them and they are different. My question was once you have the edgemask can you do anything with it, like enhance...... But apparently not. I understood what you had given me before. So masks can only be merged. Understood. I did read the documentation and hence the questions. I dont understand why everyone is so quick to say read this as if a question is such an inconvienance. If its such a bother then dont respond in the first place. Not everyone is as knowledgeable about avisynth or perhaps masktools so I guess questions will come up no matter how WRONG they seem. Thanks for the explanation and your help.
LaTo
21st November 2009, 19:18
Lato,
I understand that they are just a mask. However there are different modes for the edgemask. Ive looked at them and they are different. My question was once you have the edgemask can you do anything with it, like enhance...... But apparently not. I understood what you had given me before. So masks can only be merged. Understood. I did read the documentation and hence the questions. I dont understand why everyone is so quick to say read this as if a question is such an inconvienance. If its such a bother then dont respond in the first place. Not everyone is as knowledgeable about avisynth or perhaps masktools so I guess questions will come up no matter how WRONG they seem. Thanks for the explanation and your help.
I said "should read"... it was just an advice :rolleyes:
But, you said this:
What is there to enhance on edges?
Your posted code was wrong because it enhanced directly the mask.
So, where is the problem with my answer?
Your question should be:
What is the way to enhance edgemask?
So, the answer of the proper question:
"prewitt" is a robust mode for mt_edge but it's slower, I always use this one (and "min/max" when I need speed)
:p
rkalwaitis
21st November 2009, 19:43
I should ask better questions. Thanks for your help. I apologize for being rude.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.