Checking the OpenCvSharp Wrapper for OpenCV

Joined
Aug 15, 2019
Messages
16
Programming Experience
Beginner
Can you find a bug in the code below?

C#:
public static RectanglesIntersectTypes
RotatedRectangleIntersection(RotatedRect rect1,
                             RotatedRect rect2,
                             out Point2f[] intersectingRegion)
{
  using (var intersectingRegionVec = new VectorOfPoint2f())
  {
    int ret = NativeMethods
                .imgproc_rotatedRectangleIntersection_vector(
                         rect1, rect2, intersectingRegionVec.CvPtr);
    intersectingRegion = intersectingRegionVec.ToArray();
    return (RectanglesIntersectTypes) ret;
  }
}

public void RotatedRectangleIntersectionVector()
{
  var rr1 = new RotatedRect(new Point2f(100, 100),
                            new Size2f(100, 100),
                            45);
  var rr2 = new RotatedRect(new Point2f(130, 100),
                            new Size2f(100, 100),
                            0);

  Cv2.RotatedRectangleIntersection(rr1, rr2,
                out var intersectingRegion);

  ....

  intersectingRegion.ToString();
}

Did you manage to? :) Check the answer in the article.
 
The ToString() doesn't do anything useful, but why is that a bug? Are you saying that all cases of initializing a variable and not using it is a bug? Are all cases of setting some values, or calling useless methods bugs?
 
I think the above is pretty useless. There's no info to describe what this post is even about despite the article of waffles which it's linked too.

Don't expect a reply from a non-programmer. OP is only posting this material to market their companies reputation by chain-linking SEO tactics. If OP was a programmer you'd be getting genuine replies, on this and their other topics...
 
Back
Top Bottom