AR-Lib

ar-lib contains classes related to alerts, camera, and AR overlays.

TTC - Time to Collision

Live Sense SDK provides the feature of alerting the user/driver of Time to Collision. This feature helps to avoid accidents and ensure driver safety.

The distance between each detection and the point of view is calculated and the alert is sent if the distance goes beyond the specified alertDistance.

LSDAlertManager contains extra heuristics for alerting user of possible hazards in their path. These include time-to-collision with the leading vehicle and people entering the vehicle's direct path.

For LSDAlertManager to fully function it requires the following input:

  • Certain properties of the camera being used. For more information, see LSDCameraProperties.
    • This only needs to be set once per camera setup. This does not include device rotation.
  • The vehicle's current speed, normally provided by the device's location services.
    • This should be continuously fed in via setCurrentSpeed().
  • The latest collection of LSDObjectRecognition.
    • Continuously fed in via determinAlerts().

The LSDAlertManager.onAlerts property is available for an asynchronous feed of alerts.

Kotlin

val alertManager = LSDAlertManager()
// Can set the minimum speed to activate certain alerts
//alertManager.setMinimumSpeed(metersPerSecond)

// Set LSDCameraProperties when camera is initialized or changed
// LSDCameraStream provides a LSDCameraProperties instance after LSDCameraStream.initCamera() is called
// If frame shape is modified (ex. custom cropping), provide a LSDCameraProperties with equally modified sensorSize for accurate proximity alerts
alertManager.setCameraProperties(cameraStream.cameraProperties)
// Listen for alerts, alerts are also returned by determineAlerts()
alertManager.onAlerts.addListener { alerts: MutableList<LSDAlert> ->
    // Process alerts
}

// When new speed is available
alertManager.setCurrentSpeed(speedMetersPerSecond)

// When new recognitions are available
alertManager.determineAlerts(objectRecognitions, imageWidth, imageHeight, imageRotation, imageTimestamp)

JAVA

LSDAlertManager alertManager = new LSDAlertManager();
// Can set the minimum speed to activate certain alerts
//alertManager.setMinimumSpeed(metersPerSecond)

// Set LSDCameraProperties when camera is initialized or changed
// LSDCameraStream provides a LSDCameraProperties instance after LSDCameraStream.initCamera() is called
// If frame shape is modified (ex. custom cropping), provide a LSDCameraProperties with equally modified sensorSize for accurate proximity alerts
alertManager.setCameraProperties(cameraStream.cameraProperties);
// Listen for alerts, alerts are also returned by determineAlerts()
alertManager.onAlerts.addListener(lsdAlerts -> {
    // Process alerts
}); 

// When new speed is available.
alertManager.setCurrentSpeed(speedMetersPerSecond);

// When new recognitions are available
alertManager.determineAlerts(objectRecognitions, imageWidth, imageHeight, imageRotation, imageTimestamp);

Distance Estimation

The distance filter estimates the distance of an object from the camera.

The StaticDistanceEstimator uses an assumed width/height and the camera's properties to determine the camera's distance from an object. The estimator works with cars and pedestrians by default, but may be extended if other objects are needed for your use case. Distances are in meters for default values. For any custom values, the distance unit is the same as the provided size.

public void estimateDistance(List<Recognition> recognitions, Size frameSize, int sensorRotation, float focalLength, SizeF sensorSize)

The following list describes the method parameters:

  • recognitions - List of recognitions to process.
  • frameSize - Size of the image that recognitions were derived from at 0 rotation.
  • sensorRotation - Clockwise rotation to each frames's natural orientation as a multiple of 90 degrees.
  • focalLength - Focal length of the capture camera in millimeters.
  • sensorSize - Size of the physical camera sensor in millimeters.

results matching ""

    No results matching ""