Hi Vincent,
Cool stuff :-)
OpenCV.NET does not have "CV2", only "CV". However, all the functions you are looking for should be there. You can check the documentation
here.
However, if you want to rotate frames given the angle, you can actually use the WarpAffine node directly, like this:

It's a bit involved, but once you get the hang of it it's actually quite powerful. There are two branches here:
1) WarpAffine just warps the image, but it needs to be given the Transform matrix, which is computed in the second branch;
2) The first part of this branch is just the normal tracking stuff (I just used color tracking here). After you get the largest object information (you can refine this with better heading information using Extremes, etc), you now need to create the transform matrix. You can do this by using the AffineTransform node. AffineTransform will simply create an affine transform matrix using the specified Translation, Rotation and Scale properties. Image transformations like rotation and scale are also applied around a defined Pivot point. So all there is left to do is specify these properties from the largest blob. In this case I used an expression script to do this (ExpressionTransform). It went like this:
new(
Centroid as pivot,
-Centroid.X + 320 as translationX,
-Centroid.Y + 240 as translationY,
Orientation as rotation)
Basically, I'm defining the Pivot, Translation and Scale properties. What I want to do is to rotate the image by the heading angle (Rotation), around the centroid (which is my Pivot), and then offset it by negative of the centroid (Translation) in order to bring the object to the image origin (0,0). Now, because the "origin" in these images (0,0) is in the top-left corner, we actually need to add (width/2,height/2) or (320,240) in this case, in order to bring the object to the "center".
I hope this makes sense. If you try it you should see this workflow always keeps the largest object neatly aligned in the center. Of course, the angle in this case can jump around in some cases because the orientation only gives you heading from [-pi/2 ; pi/2] but this you can fix with any of the other heading techniques discussed previously.
Finally, regarding your modifications to the angleline script, I think this may be because of the way you are comparing against NaN. In Python, the recommended way to do it would be to either use the math module:
import math
@returns(bool)
def process(value):
return math.isnan(value)
from System import Single
@returns(bool)
def process(value):
return Single.IsNaN(value)
I think any of these should work. In general you don't want to compare against NaN using the equality operator (probably because all comparisons with NaN return false as per the IEEE standard).
Hope this helps :-)