p4 = center_coordinates2*np.ones_like(p1)

## binary looking at object vectors
looking_vector1, angle1_vector = beh_func.looking_at_vector(p2,p1,p3)
looking_vector2, angle2_vector = beh_func.looking_at_vector(p2,p1,p4)

## proximity vector between mouse position and objects
proximity_vector1 = beh_func.proximity_vector(position,p3,radius=150)
proximity_vector2 = beh_func.proximity_vector(position,p4,radius=150)

## super proximity vector for mouse position and objects (closer that proximity1)
super_proximity_vector1 = beh_func.proximity_vector(position,p3,radius=75)
super_proximity_vector2 = beh_func.proximity_vector(position,p4,radius=75)

## select events of a certain duration
looking_vector1_last = beh_func.long_duration_events(looking_vector1,10)
looking_vector2_last = beh_func.long_duration_events(looking_vector2,10)

proximity_vector1_last = beh_func.long_duration_events(proximity_vector1,10)
proximity_vector2_last = beh_func.long_duration_events(proximity_vector2,10)

super_proximity_vector1_last = beh_func.long_duration_events(super_proximity_vector1,5)
super_proximity_vector2_last = beh_func.long_duration_events(super_proximity_vector2,5)


####################################################################################################################
# FROM HERE THE SCRIPT IS RELATED TO GENERATE THE VIDEO!
####################################################################################################################
## load input video DLC using cv2

if not os.path.isfile(input_video_path_dlc):
Exemple #2
0
                ## proximity vector between mouse position and objects
                proximity_vector1 = beh_func.proximity_vector(position,
                                                              p3,
                                                              radius=RADIUS1)
                proximity_vector2 = beh_func.proximity_vector(position,
                                                              p4,
                                                              radius=RADIUS1)

                ## super proximity vector for mouse position and objects (closer that proximity1)
                super_proximity_vector1 = beh_func.proximity_vector(
                    position, p3, radius=RADIUS2)
                super_proximity_vector2 = beh_func.proximity_vector(
                    position, p4, radius=RADIUS2)

                ## select events of a certain duration
                looking_vector1_last = beh_func.long_duration_events(
                    looking_vector1, MIN_LOOKING)
                looking_vector2_last = beh_func.long_duration_events(
                    looking_vector2, MIN_LOOKING)

                proximity_vector1_last = beh_func.long_duration_events(
                    proximity_vector1, MIN_EXPLORATION)
                proximity_vector2_last = beh_func.long_duration_events(
                    proximity_vector2, MIN_EXPLORATION)

                super_proximity_vector1_last = beh_func.long_duration_events(
                    super_proximity_vector1, MIN_EXPLORATION)
                super_proximity_vector2_last = beh_func.long_duration_events(
                    super_proximity_vector2, MIN_EXPLORATION)

                ## now check for all data points
                for i in range(position.shape[0]):
            proximity_vector1 = beh_func.proximity_vector(position,
                                                          p3,
                                                          radius=RADIUS1)
            proximity_vector2 = beh_func.proximity_vector(position,
                                                          p4,
                                                          radius=RADIUS1)
            proximity_vector3 = beh_func.proximity_vector(position,
                                                          p5,
                                                          radius=RADIUS1)
            proximity_vector4 = beh_func.proximity_vector(position,
                                                          p6,
                                                          radius=RADIUS1)

            ## select events of a certain duration

            proximity_vector1_last = beh_func.long_duration_events(
                proximity_vector1, MIN_EXPLORATION)
            proximity_vector2_last = beh_func.long_duration_events(
                proximity_vector2, MIN_EXPLORATION)
            proximity_vector3_last = beh_func.long_duration_events(
                proximity_vector3, MIN_EXPLORATION)
            proximity_vector4_last = beh_func.long_duration_events(
                proximity_vector4, MIN_EXPLORATION)

            ## now check for all data points
            for i in range(position.shape[0]):
                if position[i, 0] != -1 and position[i, 1] != -1:
                    closeness = 0
                    inspection = 0
                    if proximity_vector1_last[i]:
                        ethogram_vector[init_trial + i] = exploratory_flag1
                    else: