- Posts: 382
- Joined: Fri Jun 12, 2020 2:36 pm
- Real Name: Iain Fisher
Looking for trouble in that workflow, I think it would be easiest if the vectors were normalized, so you'd need to offset and rescale them back to their original range when you're done. If this is something you do a lot, it would probably be a good idea to make a macro with some expression links between the Min and Max sliders in CopyAux and a CustomTool to un-remap the vectors.
This was a fun exercise, and I can see it being useful in the future. Thanks!
- Code: Select all
{
Tools = ordered() {
OpticalFlow1 = Dimension.OpticalFlow {
Inputs = {
Method = Input { Value = FuID { "Advanced" }, },
},
ViewInfo = OperatorInfo { Pos = { 275, 16.5 } },
},
CopyAux1 = Dimension.CopyAux {
Inputs = {
Channel = Input { Value = FuID { "Vector" }, },
["Vector.Remap.Enable"] = Input { Value = 1, },
["Vector.Remap.From.MinX"] = Input { Value = -11.672646522522, },
["Vector.Remap.From.MaxX"] = Input { Value = 18.7788524627686, },
["Vector.Remap.From.MinY"] = Input { Value = -6.4090633392334, },
["Vector.Remap.From.MaxY"] = Input { Value = 11.1418828964233, },
Input = Input {
SourceOp = "OpticalFlow1",
Source = "Output",
},
},
ViewInfo = OperatorInfo { Pos = { 385, 16.5 } },
},
ChromaKeyer1 = ChromaKeyer {
Inputs = {
RedLow = Input { Value = 0.567502379417419, },
RedHigh = Input { Value = 0.617468476295471, },
GreenLow = Input { Value = 0.481564193964005, },
GreenHigh = Input { Value = 0.520915150642395, },
BlueLow = Input { Value = 0.296968758106232, },
BlueHigh = Input { Value = 0.334112018346786, },
LuminanceLow = Input { Value = 0.36242687702179, },
LuminanceHigh = Input { Value = 0.443495869636536, },
SoftRange = Input { Value = 0.0142, },
FringeSize = Input { Value = 0, },
Filter = Input { Value = FuID { "Fast Gaussian" }, },
InvertMatte = Input { Value = 1, },
Input = Input {
SourceOp = "CopyAux1",
Source = "Output",
},
},
ViewInfo = OperatorInfo { Pos = { 550, -16.5 } },
},
ColorCorrector1 = ColorCorrector {
Inputs = {
Channel = Input { Value = 1, },
MasterRedBrightness = Input { Value = -0.14, },
ColorRanges = Input {
Value = ColorCurves {
Curves = {
{
Points = {
{ 0, 1 },
{ 0.4, 0.2 },
{ 0.6, 0 },
{ 1, 0 }
}
},
{
Points = {
{ 0, 0 },
{ 0.4, 0 },
{ 0.6, 0.2 },
{ 1, 1 }
}
}
}
},
},
HistogramIgnoreTransparent = Input { Value = 1, },
Input = Input {
SourceOp = "CopyAux1",
Source = "Output",
},
EffectMask = Input {
SourceOp = "ChromaKeyer1",
Source = "Output",
},
},
ViewInfo = OperatorInfo { Pos = { 550, 16.5 } },
},
CustomTool1 = Custom {
Inputs = {
NumberIn1 = Input {
Value = -11.672646522522,
Expression = "CopyAux1.Vector.Remap.From.MinX",
},
NumberIn2 = Input {
Value = 18.7788524627686,
Expression = "CopyAux1.Vector.Remap.From.MaxX",
},
NumberIn3 = Input {
Value = -6.4090633392334,
Expression = "CopyAux1.Vector.Remap.From.MinY",
},
NumberIn4 = Input {
Value = 11.1418828964233,
Expression = "CopyAux1.Vector.Remap.From.MaxY",
},
LUTIn1 = Input {
SourceOp = "CustomTool1LUTIn1",
Source = "Value",
},
LUTIn2 = Input {
SourceOp = "CustomTool1LUTIn2",
Source = "Value",
},
LUTIn3 = Input {
SourceOp = "CustomTool1LUTIn3",
Source = "Value",
},
LUTIn4 = Input {
SourceOp = "CustomTool1LUTIn4",
Source = "Value",
},
Intermediate1 = Input { Value = "n2 - n1", },
Intermediate2 = Input { Value = "n4 - n3", },
AuxChannelNest = Input { Value = 1, },
XVectorExpression = Input { Value = "r1*i1+n1", },
YVectorExpression = Input { Value = "g1*i2+n3", },
NumberControls = Input { Value = 1, },
NameforNumber1 = Input { Value = "Min X", },
NameforNumber2 = Input { Value = "Max X", },
NameforNumber3 = Input { Value = "Min Y", },
NameforNumber4 = Input { Value = "Max Y", },
ShowNumber5 = Input { Value = 0, },
ShowNumber6 = Input { Value = 0, },
ShowNumber7 = Input { Value = 0, },
ShowNumber8 = Input { Value = 0, },
ShowPoint1 = Input { Value = 0, },
ShowPoint2 = Input { Value = 0, },
ShowPoint3 = Input { Value = 0, },
ShowPoint4 = Input { Value = 0, },
LUTControls = Input { Value = 1, },
ShowLUT1 = Input { Value = 0, },
ShowLUT2 = Input { Value = 0, },
ShowLUT3 = Input { Value = 0, },
ShowLUT4 = Input { Value = 0, },
Image1 = Input {
SourceOp = "ColorCorrector1",
Source = "Output",
},
},
ViewInfo = OperatorInfo { Pos = { 660, 16.5 } },
},
CustomTool1LUTIn1 = LUTBezier {
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
}
},
SplineColor = { Red = 204, Green = 0, Blue = 0 },
NameSet = true,
},
CustomTool1LUTIn2 = LUTBezier {
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
}
},
SplineColor = { Red = 0, Green = 204, Blue = 0 },
NameSet = true,
},
CustomTool1LUTIn3 = LUTBezier {
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
}
},
SplineColor = { Red = 0, Green = 0, Blue = 204 },
NameSet = true,
},
CustomTool1LUTIn4 = LUTBezier {
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
}
},
SplineColor = { Red = 204, Green = 204, Blue = 204 },
NameSet = true,
},
CustomTool2 = Custom {
CtrlWZoom = false,
Inputs = {
LUTIn1 = Input {
SourceOp = "CustomTool2LUTIn1",
Source = "Value",
},
LUTIn2 = Input {
SourceOp = "CustomTool2LUTIn2",
Source = "Value",
},
LUTIn3 = Input {
SourceOp = "CustomTool2LUTIn3",
Source = "Value",
},
LUTIn4 = Input {
SourceOp = "CustomTool2LUTIn4",
Source = "Value",
},
RedExpression = Input { Value = "if(vx1 == vx2, 0, abs(vx1-vx2))", },
GreenExpression = Input { Value = "if(vy1 == vy2, 0, abs(vy1-vy2))", },
Image1 = Input {
SourceOp = "CustomTool1",
Source = "Output",
},
Image2 = Input {
SourceOp = "OpticalFlow1",
Source = "Output",
},
},
ViewInfo = OperatorInfo { Pos = { 660, 82.5 } },
},
CustomTool2LUTIn1 = LUTBezier {
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
}
},
SplineColor = { Red = 204, Green = 0, Blue = 0 },
NameSet = true,
},
CustomTool2LUTIn2 = LUTBezier {
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
}
},
SplineColor = { Red = 0, Green = 204, Blue = 0 },
NameSet = true,
},
CustomTool2LUTIn3 = LUTBezier {
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
}
},
SplineColor = { Red = 0, Green = 0, Blue = 204 },
NameSet = true,
},
CustomTool2LUTIn4 = LUTBezier {
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
}
},
SplineColor = { Red = 204, Green = 204, Blue = 204 },
NameSet = true,
}
}
}
Above, I sampled an area of the vectors using a ChromaKeyer, then used the CC to reverse the x displacement of those pixels. CustomTool1 writes the modified vectors into the vector channel, and CustomTool2 is a utility viewer to verify that the original and new vectors are the same except for my change.