Portrait or Landscape with OpenCV

How to know if an image received from a mobile is in Landscape or Portrait ?
Thank you

you’ll NEVER know (from the image content alone)
(why is this important ?)

To do feature matching between 2 images coming from 2 different smartphone.

ask the operating system’s APIs to give you that info. smartphones know which way they’re pointing. that’s included in all the picture taking APIs of all the popular smartphone OSes out there. you don’t even have to mess with any raw sensor info.