I've been working on a project for a week with the manipulation image coordinate, and I´m mostly done. However, I am experiencing some difficulties. I am programming with C# with the library Emgu.Cv (This is the image, I want to rotate the circles/objects in the image)(https://i.stack.imgur.com/FRwgO.png)
WHAT I HAVE TRIED
- From my Image I have calculated the center of all objects (small circles) in image and defined my origin. I have considered this center to be the pixel coordinate of my objects that I have in my image.
- I have defined my origin to be the biggest object in image and my aim is to write an algorithm that checks whether the image (the objects that I have in the image) is overturned (canted of flipped), if yes then it calculate the angle of rotation according to the x-axis, and rotate the center (pixel coordinate) of about the origin -Then at the end I'm having a list of all objects and in the list i can see the transformated coordinate (X= ... , Y= ... ) But I don't know how to visualize this transformation coordinate in order to clearly see the effect of it in my image .In order word I don't know how to read and display an image consisting of the new coordinate or to draw a rectangle around the new coordinate.
I have try to dray rectangle around the new coordinate but it hasn't work. Because CvInvoke.BoundingRectangle takes as parameter only InputArray and my new rotated coordinates are Points (X , Y ) . I have also Think of using WarpAffine but i did succeed with the implementation