Coder Social home page Coder Social logo

varvrar / ios_logger Goto Github PK

View Code? Open in Web Editor NEW
144.0 2.0 29.0 49 KB

Application for camera and sensor data logging (iOS)

Objective-C 11.19% Objective-C++ 77.81% Python 1.71% C++ 9.29%
ios imu gyroscope accelerometer gps camera logger magnetometer devicemotion arkit

ios_logger's Introduction

ios_logger

Application for logging camera images, accelerometer and gyroscope data, gps and heading data, motion data and magnet data.

This application was made for logging camera images and sensor data on Apple devices (iPad/iPhone).

Build and run:

  1. Open ios_logger.xcodeproj in XCode
  2. In project properties -> General set your team signing and make sure that signing certificate was successfully created
  3. Connect your device (you may have to wait for the debugger to be set up), select it (Product -> Destination) and run application (Product -> Run)

Collect datasets:

To start collecting dataset:

  • set required image resolution in upper-left corner
  • if you check ARKit segment - app will use ARKit to get camera images (with ARKit native resolution - depends on device) + app will logging ARKit poses of the device (with origin in place where "START" button was pressed)
  • set switches with required sensors to be logged
  • you can set AutoFocus on/off with "AF" button
  • with off AutoFocus you can set camera focal lenth by slider in bottom-right corned
  • press "START" button
  • when you want to stop collecting dataset press "STOP" :-)

Each dataset will be saved in separate folder on the device .

Get saved datasets:

After you have collected datasets connect your device to PC and run iTunes. In iTunes go to device-> File Sharing -> ios-logger, in right table check folders with datasets you needed and save it on your PC. In last versions of MacOS you should use finder to acess the device and get File Sharing.

Dataset format:

  • Accel.txt: time(s(from 1970)),ax(g-units),ay(g-units),az(g-units)
  • Gyro.txt: time(s),gx(rad/s),gy(rad/s),gz(rad/s)
  • GPS.txt: time(s),latitude(deg),longitude(deg),horizontalAccuracy(m),altitude(m),verticalAccuracy(m),floorLevel,course(dgr),speed(m/s)
  • Head.txt: time(s),trueHeading(dgr),magneticHeading(dgr),headingAccuracy(dgr)
  • Motion.txt: time(s),attitude.quaternion.w,attitude.quaternion.x,attitude.quaternion.y,attitude.quaternion.z
  • MotARH.txt: time(s),rotationRate.x(rad/s),rotationRate.y(rad/s),rotationRate.z(rad/s),gravity.x(g-units),gravity.y(g-units),gravity.z(g-units),userAccel.x(g-units),userAccel.y(g-units),userAccel.z(g-units),motionHeading(dgr)
  • MotMagnFull.txt: time(s),calibratedMagnField.x(microteslas),calibratedMagnField.y(microteslas),calibratedMagnField.z(microteslas),magnFieldAccuracy
  • Magnet.txt: time(s),magneticField.x(microteslas),magneticField.y(microteslas),magneticField.z(microteslas)
  • ARposes.txt: time(s),ARKit.translation.x(m),ARKit.translation.y(m),ARKit.translation.z(m),ARKit.quaternion.w,ARKit.quaternion.x,ARKit.quaternion.y,ARKit.quaternion.z
  • Frames.txt: time(s),frameNumber,focalLenghtX,focalLenghtY,principalPointX,principalPointY
  • Frames.m4v: frames compressed in video

Other:

To syncronize accelerometer and gyroscope data you can use python script sync-data.py:

python path_to_folder_with_sync-data/sync-data.py path_to_datasets_folder/dataset_folder

To get frames from video you can use ffmpeg or some video editor. For example:

ffmpeg -i Frames.m4v Frames/Frame%05d.png -hide_banner

or you can try to use VideoToPictures.cpp:

compile VideoToPictures.cpp and
VideoToPictures path_to_datasets_folder/dataset_folder/Frames.m4v

ios_logger's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ios_logger's Issues

Cannot find recorded files on iphone

Thanks for your nice work.
I have compiled and installed the ios_logger app on my iphone11, but after I click "start" to record a video and click "stop", I cannot find any recorded files on my iPhone's "File" app. No error message is reported from the ios_logger app. Is there anything I missed to run this app and record data?

Poses fitted on the sphere

Hello!
I tried to observe camera poses using COLMAP (by passed logged quat and translation vector to COLMAP), but faced the problem that camera poses from ios_logger look like something fitted on the sphere, but the real path of the camera definitely differs from the "spherical" one. Why does it happen? And how can I get the real poses?
Thanks!
image

Switch camera

Hello Varvrar!

Thanks for you great work! I have used this nice app to recorder data for pose estimation. I was wondering how I could choose different back cameras since there are multiple back cameras from iphone 7. For example, I was trying to use the TelephotoCamera or UltraWideCamera, and based on the apple documentation I need to use AVCaptureDeviceDiscoverySession:

AVCaptureDeviceDiscoverySession *session =
[AVCaptureDeviceDiscoverySession
discoverySessionWithDeviceTypes:AVCaptureDeviceTypeBuiltInUltraWideCamera
mediaType:AVMediaTypeVideo
position:AVCaptureDevicePositionUnspecified];

However, it doesn't work. Could you please give some suggestions?

Thanks!

Camera Setting Issue

Hello Varvrar,

First of all thanks a lot for the job you have done.
I managed to run your app on my iPhone X and everything works well.
Nevertheless, I have some trouble regarding the camera settings. The camera is not focusing properly leading to blurred images.
Moreover, is there a way to tune the camera parameters (resolution, etc.) ?

Thanks,
Pm

Distortion Coefficients

Hi,
Thanks for your great work!
I would like to ask is there a way to get distortion coefficients without using AVCameraCalibrationData?

the fps of emu

I change the imuFreq, but the fps of imu is not changed. I want to consult you about how to change the fps of imu.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.