In the above image I have a set of points (blue) and my goal is to get the green rectangle, specifically the right, left, top, and bottom coordinates of that rectangle. It is the non-rotated bounded rectangle of the ellipse. The ellipse is the least-square fit from the set of points.
Currently I am able to find the yellow rectangle, which is the non-rotated rectangle from the set of points using Emgu.CV.PointCollection.BoundingRectangle function, and also the red rectangle, which is the rotated rectangle representation of the ellipse from EmguCV's Ellipse.MCvBox2D function.
Any idea on how to find the green rectangle?
The code to get the ellipse, red, and yellow rectangle are below (the points are in an array of points called edgePA):
//Get Least-Square Fit Ellipse
Ellipse elps = PointCollection.EllipseLeastSquareFitting(edgePA);
//Rotated Rectangle of Ellipse
MCvBox2D boundR2 = elps.MCvBox2D;
//Bounding Rectangle of Points
Rectangle boundR = PointCollection.BoundingRectangle(edgePA);