Code Monkey home page Code Monkey logo

Comments (11)

colinlaney avatar colinlaney commented on June 3, 2024

I've fixed the error, but you'll face to another problem: the threshold between animal color and background color is very specific for my lab environment, therefore contour of your animal is corrupted.

So I'll try to make the threshold more adaptive, or at most to replace my detecting algorithm by common one, e.g. GOTURN. Thank you for new video provided with different environment, Shahrukh.

from animal-tracking.

colinlaney avatar colinlaney commented on June 3, 2024

As to file extension: you just need to replace all .avi by .mp4 in the end of track.py.

from animal-tracking.

 avatar commented on June 3, 2024

water-maze-lesion.zip
The trajectory of animal is not shown by the animal-tracking app and it shows the distance travelled by the animal is very negligible. How to correct the errors? And how to optimise it for circular arena? Can binary threshold images processed by Fiji used if the animal is not as white as snow in the video? I get some errors like encoder error when binary threshold videos are used

from animal-tracking.

 avatar commented on June 3, 2024

How much light intensity in lux is needed during video recording for perfect tracking of the animal?

from animal-tracking.

colinlaney avatar colinlaney commented on June 3, 2024

The trajectory of animal is not shown by the animal-tracking app and it shows the distance travelled by the animal is very negligible. How to correct the errors?

Download v0.1.1 and just fill full right half of UI window by the green quad. Your mistake in water-maze-lesion.zip was the highlighting of only the part of arena. Green quad is needed to get rid of perspective effect that is caused by optical aberrations.

And how to optimise it for circular arena?

What you need to fit units of the distance is normalize it by the length of the average side of red quad you've selected as frame in UI measured in meters:

after_lesion_full

E.g. if the length between top right and bottom right points of red frame is 2.1 meters then divide the distance by 2.1.

Can binary threshold images processed by Fiji used if the animal is not as white as snow in the video? I get some errors like encoder error when binary threshold videos are used.

That is exactly what cv2.threshold() does in my code, so you don't need do any preprocessing. Actually, metamarking of your video with orange centroid of an animal and green quadrants of the arena are overly.

How much light intensity in lux is needed during video recording for perfect tracking of the animal?

Everyday working lighting 200–400 lx is enough.

from animal-tracking.

amirprobuetmir avatar amirprobuetmir commented on June 3, 2024

im still have a war with trying to count a speed ,
speed = _x =_y = 0
distance += np.sqrt(((x - _x) / float(h))**2 + ((y - _y) / float(h))**2)
speed=(distance)/abs(time.time())
# speed1=str(speed)
from where i can get Time ?) And also your code with last corrections does not work when im pressing python track.py
it just
shows again this
PS C:\users\dark\dev\animal-tracking-master>

from animal-tracking.

colinlaney avatar colinlaney commented on June 3, 2024

im still have a war with trying to count a speed

Are you sure you have read my answer? The item 3 states: there is a variable t that stores elapsed time measured in seconds. How do you think the time appears on the left frame? It is possible due to this variable. So, for elapsed time

speed = distance / t
print(speed)

From where i can get Time?)

From the variable t. I'm not kidding.

And also your code with last corrections does not work when im pressing python track.py

If you don't see red frame on the right side then you have to highlight it manually before you press Enter. Look at the gif above.

from animal-tracking.

 avatar commented on June 3, 2024

May I know how you avoided the errors caused by water ripples? I am unable to reproduce the same results for the video I used.

from animal-tracking.

colinlaney avatar colinlaney commented on June 3, 2024

The only thing I did is average all frames and subtracted the sum from each current frame. It helped for your example, but not in general. Try to decrease THRESHOLD_ANIMAL_VS_FLOOR from 70 to 50: it will increase the area of animal and in the same time will make it possible to take the dark ripples for the animal.

We can introduce Kalman filter if you will continue facing the problem.

from animal-tracking.

 avatar commented on June 3, 2024

But what you say is actually the latest commits you did to tracker.py. Did you edit the video to get the results that avoid the errors caused by water ripples. I'm unable to reproduce the same result with the latest release.

from animal-tracking.

colinlaney avatar colinlaney commented on June 3, 2024

No, I did not. I use raw video you have attached. The only differences between our environments are OS and version of python modules, mine are:

  • macOS
  • opencv-contrib-python==4.0.0.21
  • numpy==1.15.4

from animal-tracking.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.