update_current_objects: Removes dead objects, updates living objects and assign new...

View source: R/update_obj.R

update_current_objectsR Documentation

Removes dead objects, updates living objects and assign new uids to new born objects.

Description

Also, updates number of valid observations for each echo. This function is called when rain continues from the last frame. This is a complicated function to understand.

Usage

update_current_objects(old_frame1, frame1, frame2, pairs, old_objects)

Details

See how the pairs vector looks like for a real case. The pairs shows mapping of the current frame1 and frame2. This shows that frame2 has 4 objects. The objects [1, 2, 3, 4] in current frame2 are mapped with objects [0, 1, 2, 3] in current frame1. Thus, object 1 in frame2 is new born. Others can be traced back to frame1.

pairs>>

0, 1, 2, 3

Now check old_objects and remember that at this instant, id2 (in the old_objects) correspond to the objects in current frame1 which was frame2 in the earlier time-step, and that they are the same frame.

old_objects>>

id1, uid, id2, obs_num, xhead, yhead

1, 1, 1, 2, 1, 0

2, 12, 3, 2, 0, -1

So the object 1 and 3 in current frame1 (earlier it was frame2 with id2) existed before and has "uid" (11 and 12). We will copy their "uid" to our object_matrix and increament the observation number (obs_num). For object 2 and 4 in current frame2 which do not exist in frame1, we will ask for new uids. This information will be written in current_objects and return for writting in to the output file.


RBhupi/tracR documentation built on June 13, 2022, 4:42 a.m.