An orientation detection system sets an orientation of an image or a video based on the detection of an orientation of objects present within the image or video. The system detects the presence of one or more objects within the image or a frame of the video. The system determines spatial orientation parameters for the detected objects in the image. The system then constructs a histogram with a plurality of bins based on the determined spatial orientation parameters. The system counts the number of objects in each of the bins. The system determines the highest number of objects (M) in a single bin from the plurality of bins. Thereafter, the system determines whether there is only one bin with a number of objects greater than M/2. The system then determines the orientation of the image based on spatial orientation parameters for the bin with the number of objects greater than M/2. If there are multiple bins with a count of objects greater than M/2, the system does not change the orientation of the image.

Creative Commons License

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 License.