Git Product home page Git Product logo

cv-rocket-project's People

Contributors

sc2ad avatar

Watchers

 avatar  avatar  avatar

cv-rocket-project's Issues

Increase Filter speed: Current speed is: 0.0544 seconds per frame, or 18.37 FPS

Fix some issues:

  • weird time.sleep() issue: every ? frames, a time.sleep is called for 0.03 seconds, slowing down the process. cProfile can't find where it is from...
  • Find a way to speed up Filter.run(), in terms of sorting
  • Find a way to run some portion of the filters at some time, or run some filters on some frames, some on others, etc.
  • Find a way to not call contourArea on every contour, but only ones that matter.
  • Find a better way to speedup RGB filtering, inrange is better, but can it get even better?
  • I don't see an easy way to do this, but find a way to call findContours less often...

Various Capture Differences:
Capture Continuous has 10.50, 10.55, 10.56 FPS with an internal (Filtering) FPS of 1252.49, 1311.58, 1366.73. Need to find a way to get around this, this is essentially the baseline for capture continuous (NO FILTERING).
Has 7.91, 8.24, 7.81 FPS with an internal (Filtering) FPS of 29.54, 31.06, 29.56.
Capture Standard has 2.40, 3.01, 2.68 FPS with an internal (Filtering) FPS of 1036.71, 1058.91, 1101.43. Baseline for capture standard (NO FILTERING).
Has 2.89, 2.86, 2.91 FPS with an internal (Filtering) FPS of 24.81, 24.56, 25.09.
Capture Sequence has 12.32, 12.11, 12.68 FPS with an internal (Capturing) FPS of 12.34, 12.23, 12.71. Baseline for capture sequence (NO FILTERING).
Has 8.83, 8.81, 8.87 FPS with an internal (Capturing) FPS of 8.88, 8.85, 8.91.

Actually important calls cProfile output sample:
This is terminated in the middle of the 1176th frame, for reference.
It took ~20.34 seconds for 500 frames to process, approximately 24.58 FPS

  1. Notice the most consumption is on cv2.inrange, part of the RGB Filter. cv2.findContours, which happens every frame, perhaps shouldn't happen every frame.
  2. Filter.py:134(run) is called every frame, and filters every contour of the image: quite intensive.
  3. cv2.contourArea is called for EVERY contour, which is why it's numCalls is so high. There should be a way to optimize this further
  4. Numpy array manipulation still takes up a large amount of time, but is called quite more often than a frame, so not as much of an issue.
  5. Random time.sleep is still called without my explicit permission, seems to be called to delay between frames by picam or something like that, I have no idea why it is here, or how to fix it, but it does cause larger problems in longer analysis of frames.
  6. rgbGet is the core part of the rgb filter, runs every frame, its cumtime is high because it encompasses inrange, as well as numpy multiarrays.

ncalls tottime percall cumtime percall filename:lineno(function)
1176 28.446 0.024 28.446 0.024 {cv2.inrange}
1175 12.775 0.011 12.775 0.011 {cv2.findContours}
1175 2.407 0.002 4.821 0.004 Filter.py:134(run)
125225 2.388 0.000 2.388 0.000 {cv2.contourArea}
1 1.685 1.685 52.695 52.695 picamTest.py:1()
3565 1.324 0.000 1.324 0.000 {numpy.core.multiarray.array}
2 0.390 0.195 0.399 0.199 camera.py:722(enable camera)
13 0.361 0.028 0.361 0.028 {time.sleep}
1 0.353 0.353 0.353 0.353 camera.py:509(init camera)
1176 0.256 0.000 42.870 0.036 Filter.py:64(rgbGet)

Italicized: is things that are extremely hard to speed up
Bolded: is things that are relatively easy to speed up
Normal: is things that are impossible to speed up (Unknown to me, at least)

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.