How to find the orientation of a simple solid shape in OpenCV

I’m trying to find orientation of the axis of this cylindrical shape solid object. Also need to check whether the object is a cylinder or not. Answers in python or C++ are welcome.
My input image:-

Detecting axis line as shown in the above image is sufficient. Color of the object is fixed but some hue range will be needed due to slight variation of expected colors

try to use PCA to find the major axes (from contours)

next to impossible from a 2d image (while doable with a 3d point cloud)