detection_sim = SimpleDetectionSimulator( groundtruth=groundtruth_sim, measurement_model=measurement_model, meas_range=np.array([[-1, 1], [-1, 1]]) * 5000, # Area to generate clutter detection_probability=0.9, clutter_rate=1, seed=4 ) # Filter predictor = KalmanPredictor(transition_model) updater = KalmanUpdater(measurement_model) # Data Associator hypothesiser = DistanceHypothesiser(predictor, updater, Mahalanobis(), missed_distance=3) data_associator = GNNWith2DAssignment(hypothesiser) # Initiator & Deleter deleter = CovarianceBasedDeleter(covar_trace_thresh=1E3) initiator = MultiMeasurementInitiator( GaussianState(np.array([[0], [0], [0], [0]]), np.diag([0, 100, 0, 1000])), measurement_model=measurement_model, deleter=deleter, data_associator=data_associator, updater=updater, min_points=3, ) # Tracker tracker = MultiTargetTracker( initiator=initiator,
from stonesoup.predictor.kalman import ExtendedKalmanPredictor predictor = ExtendedKalmanPredictor(transition_model) init_predictor = ExtendedKalmanPredictor(init_transition_model) from stonesoup.updater.kalman import ExtendedKalmanUpdater updater = ExtendedKalmanUpdater(measurement_model=None) from stonesoup.hypothesiser.distance import DistanceHypothesiser from stonesoup.measures import Mahalanobis hypothesiser = DistanceHypothesiser(predictor, updater, Mahalanobis(), missed_distance=5) from stonesoup.dataassociator.neighbour import GNNWith2DAssignment data_associator = GNNWith2DAssignment(hypothesiser) from stonesoup.deleter.time import UpdateTimeDeleter deleter = UpdateTimeDeleter(datetime.timedelta(seconds=20), delete_last_pred=True) # %% # The Initiator # ------------- # We can now create the initiator. The :class:`~.MultiMeasurementInitiator` will initiate # and hold tracks until enough detections have been associated with the track. It will then # proceed to release the tracks to the tracker. from stonesoup.initiator.simple import MultiMeasurementInitiator from stonesoup.types.state import GaussianState