-1

Is there any way to record a video horizontally ? Would gyroscope attitude help me to execute this feature. Please suggest me that what approach should i used?

umläute
  • 28,885
  • 9
  • 68
  • 122
Arpi
  • 397
  • 2
  • 5
  • 14

1 Answers1

0

It seems that you want to record images that are always correctly oriented.

correctly oriented usually means that the gravity points downwards (towards the center of the earth).

The easiest way to detect the downwards direction is by using the accelerometer (remember those bits about Einstein's theory of relativity that equates gravity with acceleration?). This will work as long as the device is not moved (fast) - but if it is moved fast the downwards direction is blurred anyhow... coincidentally, mobile devices are equipped with acceleromters exactly because the phone would like to know the downward direction (and rotate the device screen accordingly).

The gyroscopes will not help you much, as they have no notion of downwards.

once you have established the downward direction, simply rotate the image by the given amount (doing some basic vector maths to calculate the angle from the downwards vector as given by the accelerometer), and record the resulting image.

umläute
  • 28,885
  • 9
  • 68
  • 122