Home
FISH TRACNKING - ECE
Contents
1. The area of noise also has pixel intensity so we can set a threshold value of pixel intensity 1f the intensity of area is below this threshold value then they are regarded as noise and ignored In AA AAA _ _ 12 this project we set the threshold value as 50K actually most noises could be eliminated and it worked fine Finally the setup of hardware also has effect on noise reduction Properly setup would increase the immunity of the program to noises 3 3 2 Static Error Static error exists because most of the time fish does not move so it s difficult to find the fish s location just by subtracting current frame with background When fish does not move there exist some frames in which the calculated location is not for fish but for some other moving object which has largest intensity in that frame it could be a bubble or water ripple An obvious solution is to define a flag with value one when fish is moving and vice versa When the flag is one do the calculation and find location otherwise keep the location the same as last frame However it s not that easy to directly define such a flag to identify a moving fish from an image An alternative approach is to define such a flag in an indirect way We define a threshold value of intensity T and pixel distance D Fish is the largest moving object we could easily define a threshold value T which is larger than normal noise but smaller than the fish
2. so we can analyze the data to master fish s activity rhythm Individual Contribution Xinjia Huan O Researched on purchase and constructed the hardware system O Accumulated error problem O Memory problem O Designed data analysis system Zhao Wei O Researched and created the main functions in tracking algorithm O Static error problem O Designed user interface O Designed data analysis system Executive Summary This project is the creation of software program to satisfy the specific needs of graduate students in Department of Neurobiology and Behavior to better study the behavior of a special kind of fish The program created in this project is called Fishtrack3 which is run in Matlab to take advantage of its image processing functionality The program is used to study the locomotor rhythm of a sound producing teleost the Plainfin Midshipman Currently most of the methods used to study the daily activity of the fish are very crude and inefficient a more sophisticated and accurate way is to design a vision based real time motion capture system to monitor daily locomotor rhythm of the fish which is what we did in this project The project is a concatenation of hardware and software it takes a infrared camera based video as input followed by a reliable program which could efficiently analyze and save data The program is capable of locating the fish on every frame from the video thus the fish s every move and activity i
3. the summer breeding season including vibrating muscles to produce long duration courtship calls at night to attract females and remain quiescent during the day We want to study whether the fish also performs a day night activity cycle during this breeding season It is believed that the midshipman is more active during night than day In order to reach a statistical result we need to monitor multiple fish each with multiple times for 24 hour period which incurs huge amount of data and calculation this leads us to the idea of designing a system concatenated with software and hardware to monitor the fish s activity for at least 24 hours The most straightforward configuration for such a system would be taking a camera based video as input followed by a reliable program which could efficiently analyze and save data Since visible light source would change the activity rhythm of midshipman an infrared based video recording camera is recommended in this system Other than that a Graphical User Interface GUI based program which is easy to read and use is also recommended in this system The video input from camera is analyzed on a frame base this program locates the fish s location on every frame and all the locations during the 24 hours will be saved into a file We will then analyze these data to find the distances the fish moved during the 24 hours and find out during which time period the fish moved the most which corresponds to the mos
4. Noise occurs randomly on the whole image if the calculated location is further than a distance D from previous location and at the same time the intensity is below T then this location would be ignored and treated as noise and the flag would be set to zero In this scenario the value of location remains the same as last frame Otherwise the program would do calculation and update the location This mechanism is also intuitive because a sudden jump of location is not expected since fish moves continuously Then the major issue is how to define such threshold T We assume average pixel difference between fish and background is 50 black is 0 white is 255 and smallest size of fish is at least 10 pixels by 12 pixels camera is 360 pixels by 240 pixels So the resulting T is 300 K We tested this T and everything was fine q A So 13 3 3 3 Accumulated Error When reviewing the video recorded for the first test we found that even the fish is not moving the red dot representing the stored location varied in a small range Although the variation is quite small which is usually couple of pixels the overall accumulated error could be very large for a long time duration when come to the total distance fish moved The accumulated error occurred because of the change of the centroid This happened when fish moves its tail but stays in the same location We attacked this problem with following approach Set first location point as a refe
5. FISH TRACNKING A Design Project Report Presented to the School of Electrical and Computer Engineering of Cornell University in Partial Fulfillment of the Requirement for the Degree of Master of Engineering Electrical and Computer Engineering Submitted by Xinjia Huan Zhao Wei MEng Field Advisor Dr Bruce Land MEng Outside Advisor Ni Feng Degree Date May 2012 Abstract Master of Engineering Program School of Electrical and Computer Engineering Cornell University Design Project Report Project Title Fish Tracking Author Zhao Wei amp Xinjia Huan Abstract In this project we constructed a vision based real time motion capture system to monitor daily locomotor rhythm of Plainfin Midshipman a vocal fish We used infrared cameras to collect input data and a GUI based Matlab program to display and analyze useful information We want to monitor midshipman s locomotion over 24 hour period of time but it is almost impossible for human to manually record for such a long time a reasonable approach is to design a vision based self recording system which is reliable and user friendly Also infrared camera does not impose any physical restrictions on fish which provides a natural way of measuring fish s daily activity In this system every frame of the picture captured by camera is treated as input of Matlab Program With this program we can find the fish s location on every frame Those locations will be saved in a file
6. ackground and current frame the equation of subtracted frame J n is given by 1 n i n Ig m Y 1 The intensity is calculated by summing up the square of the pixel number in the above area So the maximum intensity is associated both with magnitude of area and darkness of the area more details in Section 3 2 2 10 3 2 1 Background Frame The very first problem is how to efficiently and accurately define a background We used the algorithm from Analysis of the Trajectory of Drosophila melanogaster in a Circular Open Field Arena written by Dan Valente Ilan Golani and Partha P Mitra The background can be acquired first by averaging the first 20 frames and then update the background through running average which means we will combine the current background with current frame to get new background the equation can be expressed as Ip n 1 alg n 1 a I n 2 Where 0 9 lt a lt 1 Besides a subset image I around the location of fish is extracted from the new background Ig n 1 and replaced with the pixels of the same area in the original background Ig n This process prevents the fish been included into background 3 2 2 Area of Maximum Intensity In order to simplify the calculation we converted frames to gray based images white and black only from RGB based images red green and blue As a result calculation could be based on image intensity rather than relative ratio of RGB As shown in Fig
7. ared LED backlight TRO45 48 95 TV USB adaptor Hauppauge USB Live2 44 95 Table 1 Bill of Materials 3 2 Tracking Algorithm The basic idea of the tracking algorithm is to subtract well defined background Ig n from current frame n resulted in a subtracted frame I n Then we use Matlab to deal with I n to eliminate noises in recording and find the pixel of maximum intensity in J n then find out the centroid of the area with maximum intensity to locate the fish The subtracted frame I n could be like the figure below the circular area means the differences between background and current frame which could be potential fish Among them we then find the area with maximum intensity and find the centroid of this area The centroid is the calculated location of fish This algorithm is based on the fact that fish is the largest moving ee 9 object in the tank Largest not only means large in area but also means large magnitude in intensity more details about intensity is in Section 3 2 2 Maximum Intensity Figure 2 Subtracted frame I n with area of interest Since a frame is represented as a two dimensional matrix in Matlab each number in the matrix represents a pixel and the value of the number represents the color in that pixel so the subtraction between background and current frame is actually subtraction between two matrixes So in the above figure darker area means larger difference between b
8. ces and associated time periods will be stored to hard drive when program stops 3 4 2 Analysis To meet the requirement of later analysis we developed a program for data plotting Bar plot is the default way to present data And the time interval to save data could be changed based on the user s need Bj Figure 1 fo lle ls File Edit View Insert Tools Desktop Window Help Starting From 2012 4 21 23 18 T 30 7 7 7 H 4 a a E ee oe SS a a ee a ee eee oe 1 1 1 1 1 50 ee A A ee T AAA oe eee ee r 1 r r 1 1 1 1 1 1 1 Distance inch Figure 5 Data analysis for fish distance every 5 minutes 15 4 Test and Result In order to meet the requirement of long time reliability we tested this program 4 times in real setting All videos were recorded and more details are shown in following table Duration Hour Date Comment 1 24 3 22 2012 1 camera 2 9 4 6 2012 2 cameras 3 12 4 13 2012 2 cameras 4 24 5 2 2012 3 cameras Table 2 Duration and Data We met static error problem Section 3 3 2 accumulated error problem Section 3 3 3 and memory problem when doing tests in lab Memory occupation kept increasing even we deleted everything we used We spent couple of nights debugging the program line by line Memory problem was perfectly solved after we re wrote a build in Matlab function which kept eating memories It showed that this program fun
9. ctions well for long time duration the longest test lasted for 72 hours Besides accuracy was proved after we compared stored data with recorded video 5 Conclusion This program works well and all requirements are met O Accuracy comparison between recorded videos and stored data shows high accuracy O Reliability the 4 tests showed pretty good reliability of the program it supports 72 hour recording and does not occupy much memory e 3 fish in 3 tanks we could track 3 fish in 3 different tanks simultaneously besides more fish could be tracked just by making a slight change to the program but that is not the scope of the project we focus on 3 fish in 3 tanks here 16 O User friendly the program interface is easy to understand and use for non software background users Easy data access for later use all the fish locations will be saved into files and fish distances saved into a different file These data is accessible and could be used any time 6 Acknowledgements 1 We would like to acknowledge the advice and guidance of our ECE advisor Bruce Land and outside ECE advisor Ni Feng 2 We also want to thank Dawnis Chow from Department of Neurobiology and Behavior for sharing information and materials with us for the project 7 Reference 1 Dan Valente Ilan Golani Partha P Mitra 2007 Analysis of the Trajectory of Drosophila melanogaster in a Circular Open Field Arena PLoS ONE 2 10 e1083 17 Appe
10. ndix User Manual 1 About This program was created to the specific need of Cornell s Bass lab in the department of neurobiology All Matlab functions were created and tested in the Matlab 2010b version 2 Hardware Setup connect cameras to PC via adapter properly place cameras it should be in the same horizontal level with corresponding tank place backlight on the back of tank choose proper distance so that the whole tank could be lighted up place diffuse material on the back of tank try to smoothen light source and avoiding light spot Be cautious to 1 place camera backlight and tank at the same horizontal level 2 try to avoid light spot if can t make sure no objects in highlighted area program is more sensitive to objects in highlighted area 3 FishTrack run Fishtrack3 m choose directory to save data set Timer set File Name click Acquire ROI ROI should include the whole tank and be as large as possible click Start Tracking 4 FishTrackPlot run FishTrackPlot m 18 choose distancex mat must be distancex set Interval must be integer set bar and envelope click Plot set File Name after click Plot modified data could be saved as excel file by click Save xls File Name and Plot must be set before click Save xls figure could be saved by menu bar gt File gt Save As could be jpg or fig by choosing from Files of type 19
11. rence point and put its successive points within 5 pixels in one subset Then the first point which is out of 5 pixel range would be the next reference point and get another associated subset Repeat these procedures until allocate all location points into different subsets Then take average for each subset the resulting set of points are the new modified location points Here is a plot which compares the original location points with modified location points This plot is in 3D format z axis represents time File Edit View Insert Tools Desktop Window Help D ds 1 1494090 4 8 068 un original modified o o Uy o 250 0 200 y pixel 0 150 x pixel Figure 4 Comparison between original points blue and modified points red 14 3 4 Data Storage and Analysis 3 4 1 Data Storage Our objective is to measure the fish s activity level in different time periods A simple way to achieve that goal is to measure the moved distance in a fixed period Since everything is based on pixels and a fair comparison should be based on inches we define a parameter called PixelLength to convert pixels to inches PexelLength is calculated based on the size of tanks Basically locations in pixels are stored to hard drive every minute and release the memory they occupied which could prevent loss of data when unexpected crash happens and also save memory friendly for long time recording Besides total moving distan
12. s 3 Approach Our project requires both hardware and software support we need hardware to obtain video input and software program to process the input video to find fish location 3 1 Hardware Setup Since the main challenge of this project is to develop a sophisticated tracking algorithm we wish we could spend as less time as possible on hardware system As a result we focused on those commercially available off the shelf products for hardware setup After a little bit research we decided to construct the hardware system as follows _ Camera Backlight Figure 1 Hardware Setup In this setup we need a PC an infrared camera an infrared LED backlight and a TV USB adaptor PC To process the input video and save the acquired data from program O Infrared camera To monitor the 24 hour activity of the fish and provide video input for program Infrared camera can capture the fish during both day and night O Infrared LED backlight To provide infrared light to highlight the fish s location for camera also infrared light does not affect the fish s daily activity rhythm Also a diffuser is recommended to stick at the back of tank to smoothen the light e TV USB adaptor To transfer the data from camera to computer also to transform analog signal to digital signal for program to process Bill of Materials Name Serial Number Unit Price PC Infrared camera SVAT SVVU5 29 99 Infr
13. s under monitoring it can also analyze these data to provide plenty of information about the fish like during what time period the fish is most active We designed the program to support tracking 3 fish simultaneously for 24 hour period at the same time be system and memory friendly Accuracy is the most important requirement for this program at all stages of the project other requirements include reliability user friendly interface We are pleased to say they are all well met Analysis and study of animal behavior has always been a big topic in biology this program should see good use for this area and it was made to be easily extendable for other functionalities Table of Contents 1 troduction dp sien Den kien abe E ENEE A KEES REA R 6 2 REUS seas ote entre oe ee a costes tases o nc anno eat a wea Pa ee 7 J Approach a A li 8 Jek Hardware SCIP ie tu taraw og bates A E ad ean Ea eae 8 3 2 Tracking A cay dh anes 9 30 EXI BAIN AMON lt 2 s925 8 dewayin ones AAA 12 3A Data Storage and Anal SIS shank agueeen ei bead EE RAEES 15 4 Testand Result secs secs wicca se ed 16 CONCISO ri A aN ea HEAS 16 6 Acknowledgements oooooococoonoonncccncconnocnncco nro nr con n nor rca nora nro nn rca nnnonanoss 17 O RR 17 Appendix A E 18 1 Introduction The main focus of this project is to study the locomotor rhythm of a sound producing teleost the Plainfin Midshipman The male midshipman shows regular day night behavior cycle during
14. t active time period Other behaviors of the fish could also be analyzed after collecting the data like in which area of the tank the fish is most likely be how many turnings the fish made and so on in this project we focus on the distances 2 Requirements In order for the program to function well the following requirements should be met O accuracy Accuracy is crucial since any deviation of the acquired location from the actual location would give us inaccurate data which leads to inaccurate distances In this program we should make sure the red dot acquired fish location always stays on the fish without sudden jump O reliable for 24 hours This program should continuously run for at least 24 hours so any minor flaws may accumulate during this long time period and easily leads to instability to the program and burden to the system Especially this program should be able to release useless memory and be memory friendly O 3 fish in 3 tanks This program should be able to monitor 3 fish in 3 different tanks In order to reach a statistical result this program should provide some efficiency O user friendly Our program is mainly designed for non software background users Therefore a user friendly interface which is easy to use and understood is essential O easy data access for later analysis The data acquired by this program should be saved and accessible in a later time so as to support summarization and reanalysi
15. ure 3 fish is black and background is white in such setup After defining background the next step is to find the maximum intensity area As stated above the basic idea is to subtract current frame from updating background But we wish this program could be more sensitive to fish such that it would give more weights on black object A direct way is to enlarge the difference between fish and background based on the fact that fish is black and background is white So we squared the result and defined it as I n which is calculated based on Equation 1 on page 10 qe BD gue 1 File Est View inset Tools Destop Window Help Acquite RO Fan poston Timer File Name Video Praviti STOP Program 120000 322012 Figure 3 Sample Image 3 3 Error Elimination Fish could be found in ideal environment based on the algorithm described in Section 3 2 Unfortunately environment is not always as good as we expected There are some facts which could affect the accuracy of the tracking algorithm 3 3 1 Environmental Noise Noise is inevitable in this project Major noises could come from the process of transforming analog signal to digital signal of the input video small variation of light water ripple and bubble Noises have significant influence in accuracy so eliminating them seems crucial As we can see from Figure 2 on page 11 other than the area of maximum intensity which is the fish there is some other area which is referred as noise
Download Pdf Manuals
Related Search
Related Contents
Glacier Bay LAOJ25COM-WH Installation Guide Samsung RSA1RTSLA دليل المستخدم Hoshizaki KM-1601MRH User's Manual warning - Pontiac Automatic Detection of Vehicle Accidents and Theft EC11-FE 取扱説明書 CC-QS007 - Rockwell Automation Pravastatine Sandoz 30 mg comprimés Copyright © All rights reserved.
Failed to retrieve file