Skip to content

emonetlab/fly-walk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flyWalk

flyWalk is a MATLAB class based on movieAnalyser that tracks flies in videos.

Usage

% Create a flyWalk object, open the movie and display the gui
fileName = 'my_movie.mat';
gui_on = 1;
f = openFileFlyWalk(fileName,gui_on);

You can now watch the tracking in real time using the Play button.

For programmatic access to flyWalk, see the Methods section below.

Video Format

flyWalk accepts videos in .mat format. It can run on .avi files with a few changes in the code.

In order to convert .avi files to .mat files use Vid2Mat function. flyWalk requires the user to define the location of the source and camera, the pixel to mm conversion factor, borders for exclusion etc. HandleFlyWalkVideo function can be used for this purpose.

Methods and functions

flyWalk inherits methods from movieAnalyser and from handle.

In addition, the following functions operate on flyWalk objects and are used for tracking, etc.:

  • assignObjectsToTheseFlies matches objects in current frame to specified flies. Look at the section on the algorithm to see how this matching is done efficiently
  • findAllObjectsInFrame finds objects in frame using regionprops
  • findSuspectedMergedObjects finds objects that are suspiciously large compared to the previous frame. these are probably the result of flies touching/colliding.
  • initTrackingInfo initialises some tracking info
  • mapObjectsOntoFlies wrapper function that co-ordinates mapping from objects to flies
  • markFlyMissing marks a given fly as missing in this frame
  • maskVideo masks each frame of the video using a mask generated by annotateVideo
  • resolveCollidingObjects wrapper for splitObject that separates objects based on findSuspectedMergedObjects
  • seperateTouchingObjects wrapper for splitObject that separates objects in the 1st frame
  • splitObject splits a object into two using k-means
  • wipeAllTrackingInfoAfterCurrentFrame debugging tool; wipes tracking info after current frame

Properties

  • show_live: {true,false} show tracking live as it happens.
  • fly_body_threshold: scalar, image thresholded with this
  • min_fly_area: scalar, objects smaller than this are ignored
  • use_gpu: {true, false} See section on GPU support
  • area_ratio_to_resolve: used by findSuspectedMergedObjects. ratio of area of object in current frame to area of fly in previous frame.
  • perimeter_ratio_to_resolve: this is used only in the first frame, to seperate touching flies based on the perimeter of each object.
  • maximum_distance_to_link_trajectories
  • start_frame: scalar. where do you want to start tracking from?
  • ft_debug: {true, false} show debug messages?
  • current_raw_frame: contains the raw frame that is currently being worked on
  • current_objects: list of objects in current frame
  • current_object_status
  • tracking_info: structure with all tracking info
  • mask: logical, same size as current_raw_frame
  • handles: handles to all GUI objects. inherited from movieAnalyser
  • path_name: path name to movie. inherited from movieAnalyser
  • current_frame: scalar, index of where we are in the movie
  • nframes: scalar, automatically set to the number of frames in the movie

Data Types and Formats

Output data types

Principally, the goal of flyWalk is total data capture. So for every fly, for every frame, you want to have all relevant tracking information.

flyWalk stores data in a structure called tracking_info, which has various fields, let's say, called A, B, etc. Each of those fields is a matrix, where each row corresponds to the frame #, and each column corresponds to a fly #.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages