Deviation-lib is a library that contains utilities to detect real time changes.
Change detection helps to detect live changes in road conditions and keep the driver updated. Detected objects / signs are compared against those received as an input (in close vicinity of detections) from various sources like maps, web-services. If there is a change in the detected feature vs. the input received, then an alert will be available.
Currently, the Change Detection function provides alerts for deviations in speed limits only.
The following list describes several mandatory inputs required for this function:
Not all raw detections will have a corresponding change detection result. Detections are filtered by an internal logic to remove duplicates i.e., identical object in multiple consecutive frames, and then used for comparison. If no input is provided, then no alert will be available.
For change detection to function, it requires an input from the map to be given to the
MapObject class. This value is then compared against any detections.
MapObject is a class attribute of the
var lsdRecognition : LSDPixelBufferRecognition? let mapObj : MapObject = MapObject() mapObj.numricValue = speedLimit?.converted(to:.milesPerHour).value mapObj.timeStamp = Date().millisecondsSince1970 mapObj.location = CLLocation.init(latitude: self.currentLocation.latitude, longitude:self.currentLocation.longitude) lsdRecognition?.setMapObject(mapObj: mapObj)
The alerts are received in
alertReceived delegate method.
@objc optional func alertReceived(alerts : [LSDAlert])