An advance Edge Detect node with a new algorithm and many controls
V_EdgeMatte
Updated: 3 March 2012
Author: victorperez
Compatible Nuke versions: 6.0 or later
Compatibility: Linux, Mac, Windows
An advance Edge Detect node with a new algorithm and many controls.
Internal and external edge independent controls, hardness, mask, center offset, preprocess and postprocess filtering.
You can select the channel containing the matte (set to alpha by default). For this instance, the A is our matte, the image to work on. [source channel]
You can decide to work with the external edge, the internal edge or both. [mode]
Independent controls for internal and external edges with the gang option to keep the proportion between them in any moment. [external edge, internal edge, gang]
By default the edge algorithm is soft, but there is a control to make your edge matte as hard (and crisp) as you like. [hardness].
Preprocessing
In case of soft matte sources like image above...
You can preserve the softness of the incoming matte or...
you can preprocess the source matte -using the preprocess controls- to make it harder, getting a more defined slice of the edge... or the other way around. [hard matte & threshold, preblur]
If the area of interest is not centered in the edge but more inside or outside the matte you can decide where the center using the 'center offset'. [center offset, filter]
Postprocesing
You can dilate/erode and add an extra blur to your edge matte using the postprocessing controls. [erode size, blur size, extra blur size, blur quality]
*I recommend to use this controls ONLY in case you are not able to get a desired result using the edge controls. It's more likely and accurate to work with the original edge instead or modifying/correcting the result by a postprocess.
Mask options applying this mask >
to this image >
You have a mask options as any other Nuke node to limit your edge selection. The 'mask' input is activated automatically when you connect something into it (or deactivate when nothing is connected), setting the mask input to alpha by default (same behavior as a grade or color correction nodes). [mask, invert, fringe, inject].
Of course you have a mix option (good for checking against the original). [mix]
Copyright (c) 2011, Victor Perez.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-Neither the name of Victor Perez may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.