Android Question How to capture 360 view on mobile camera and save to a video file?

YogiYang

Member
Hello,

I have received an assignment in which there will be a mobile mounted on a hardware which will rotate in circle (0 to 360 degree).

This rotation will take exactly 20 seconds. The app has to capture the video of the subject and save to a video file (mp4) and also save a panoramic like image (jpg).

I searched the forums but could not find any libraries that I can use.

The video part is easy but the creating an image is what I do not understand as to how to do it.

Please help as to how I can achieve this?

TIA

Yogi Yang
 

drgottjr

Expert
Licensed User
Longtime User
this was way easier than i thought: i just grap the preview every few seconds while the camera is shooting the video.
i assumed there would be all kinds of setup necessary. nothing; it just worked.

erel's camex2 class (for the camera2 api) has a method:

B4X:
Dim bitmap As Bitmap = cam.GetPreviewBitmap(640,480)

i add a timer fire every 5 seconds. when the timer tick event triggers, i grab the bitmap and save it. it worked.

so, while technically it's possible to have your device shoot a video while rotating 360, it's still tricky to create a 360 degree image.
pasting a series of jpg's side by side is easy; the problem is calculating the exact angle of view and the timing needed to create 360
degrees without any gaps. timing is never exact, so you are bound to miss something. furthermore, a moving camera is going to create
blur. maybe not on every frame, but how is that going to look? a nice panorama with a big blur in the middle. what does that say?
 
Upvote 0

Brian Dean

Well-Known Member
Licensed User
Longtime User
"What does that say?" I think it says that there is no way to do this without understanding quite a bit about image processing. There are obviously ways to analyse images and stitch them together, but maybe there are no shortcuts.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…