This should ensure that the major axis of the ellipse is vertical.

img_rotate_refit(img, show_plot = F, ...)

Arguments

img

a cimg of the object to be rotated

show_plot

should plot of image and ellipse be displayed?

...

additional parameters to pass to imrotate