Administrator/Developer Documentation

Getting Started

  1. Download the iOS OpenCV and Aruco library from here. https://drive.google.com/file/d/1SpEmjRedHKq4XxWXAXiLv8alnKq1cuJ7/view?usp=sharing
  • This iOS library is different from the iOS version of the OpenCV library provided by OpenCV.org.
  • The standard OpenCV library only has its core library, and it does not contain OpenCV Contrib libraries.
  • The OpenCV Contrib libraries include Aruco library required for this iOS app.
  • The downloadable OpenCV library is built from the OpenCV and OpenCV Contrib code base.
  • Using this prebuilt library will save you time and effort, as building OpenCV Contrib and OpenCV from source is not an easy task.
  • Code base is base on the version: OpenCV v4.2.x for OpenCV and OpenCV Contrib libraries.
  • I will write a blog entry on how to build the OpenCV and OpenCV Contrib libraries from source on a Mac.
  • Place “opencv2.framework” under “opencv” directory under the Xcode project.
  • Build app under Xcode.
  • Launch app and scan the area until the app shows the feature points in a live view.
  • Generate an aruco marker.

Implementation of the Kalman Filter and Watch Data Streaming

  • Kalman Filter Setup:
    • Integrate a class definition of the KalmanFilter into your Swift project.
    • Ensure that the Kalman filter is correctly initialized with appropriate initial state and error covariance values.
  • Data Streaming from Apple Watch:
    • Set up a data stream from the Apple Watch to the iPhone using WatchKit. This stream will transmit accelerometer data to the iPhone app.
    • Implement a session handler in your iOS app to receive data from the Apple Watch.
  • Processing Accelerometer Data:
    • Once the accelerometer data is received from the Apple Watch, feed this data into the Kalman filter for processing.
    • Use a function to handle incoming data points and apply the Kalman filter.
  • Integration with OpenCV:
    • OpenCV Setup:
      • Ensure that the OpenCV library is correctly imported and set up in your Xcode project.
      • Link OpenCV frameworks to your project as required.
  • Data Processing:
    • After processing the data with the Kalman filter, use OpenCV functions to further analyze or visualize the data as per your application’s requirement

Deployment

  1. Application Setup:
    • Ensure that the OpenCV library and Kalman Filter algorithm are correctly integrated and functioning within the app.
  2. Device Configuration:
    • Pair the Apple Watch with the iPhone and ensure that the app is correctly installed and appearing on the Apple Watch.
  3. Data Synchronization and Calibration:
    • Ensure that data synchronization between the iPhone and Apple Watch is functioning. This can be tested by checking if accelerometer data from the Apple Watch is being received on the iPhone app.
  4. Testing and Validation:
    • Verify the accuracy of the Kalman Filter in processing the accelerometer data from the Apple Watch.
    • Test the integration and performance of the OpenCV library within the app.
  5. User Training and Documentation:
    • Provide users with training materials and documentation on how to use the application effectively.
    • Include guidelines on optimal lighting conditions, device positioning, and troubleshooting steps.
  6. Monitoring and Updates:
    • Continuously monitor the application for any issues post-deployment.
    • Schedule regular updates for the application to improve functionality and fix any identified bugs.

Additional Tips:

  • Check the accuracy of your Kalman Filter by using a linear trajectory testing method
  • Ensure that your watch data streaming is constant in sync with the rate that is received by the Kalman Filter method implementation itself.