Code Monkey home page Code Monkey logo

Comments (8)

colinlaney avatar colinlaney commented on June 13, 2024
  1. You are right: disable all cropping of the frame by commenting of frame = frame[:, w-h : w] and check out what you will get.
  2. HALF_AREA has nothing to do with frame visibility, leave it untouched.
  3. Speed. There are two variables within the loop: distance and t – just divide deltas when you need, if you don't want wait my updates.
  4. Real-time out of the box. Not in the current version. But you can replace cv2.VideoCapture(filename) with cv2.VideoCapture(0) and the input will be changed from video file to your webcam.

Please open new issue when you'll run into new problem.

from animal-tracking.

amirprobuetmir avatar amirprobuetmir commented on June 13, 2024
  1. disable all cropping of the frame by commenting of frame = frame[:, w-h : w] and check out what you will get - when i did that it gives me errror :
    [libopenh264 @ 000002430bd46d00] Incorrect library version loaded
    Could not open codec 'libopenh264': Unspecified error

2.Speed. There are two variables within the loop: distance and t – just divide deltas when you need, if you don't want wait updates. -this what i didnt understand i've tried to name it average= distance / time . but error said that i must to disribe the average i tryed to make it as the distance average = _x = _y = 0 but it does not help.

Real-time out of the box. Not in the current version. But you can replace cv2.VideoCapture(filename) by cv2.VideoCapture(0) and the input will be changed from video file to your webcam. --- when i made that it showed me in preprocessing box my webcam but after i have choosen area it showed me 2 times smaller half version of my rat.mp4 movie in the left side and normal half version
and also it gives an error but works :
[ WARN:1] terminating async callback

Failed to load OpenH264 library: openh264-1.8.0-win64.dll
Please check environment and/or download library: https://github.com/cisco/openh264/releases

[libopenh264 @ 00000242f45b9f40] Incorrect library version loaded

from animal-tracking.

amirprobuetmir avatar amirprobuetmir commented on June 13, 2024

and also when i run your code without any chages it works but shows an error:
[libopenh264 @ 0000015610afadc0] Incorrect library version loaded
Could not open codec 'libopenh264': Unspecified error

from animal-tracking.

colinlaney avatar colinlaney commented on June 13, 2024
  1. What do you mean by

it works but shows an error

You mean, the processing runs on UI but you
Could not open codec 'libopenh264'
on your terminal in the same time?
If yes, so what is the problem with the step 1?


  1. May be the problem is not with average but with time variable? There is no time variable, there is t.

  1. but after i have choosen area it showed me 2 times smaller half version of my rat.mp4 movie in the left side and normal half version

It's about rat.mp4 or about the picture from your webcam? If you are observing the replacement the picture from webcam by picture from your movie, then probably you have replaced cv2.VideoCapture(filename) not everywhere.

Anyway such picture is exactly what you will get, because left side shows the selected area on the right side expanded to full size of left half of UI window. The point is to get rid of perspective deformations of the camera. If you don't care about perspective just select full area on the right side and then you'll get the same picture on the left side.

from animal-tracking.

colinlaney avatar colinlaney commented on June 13, 2024

and also when i run your code without any chages it works but shows an error:
[libopenh264 @ 0000015610afadc0] Incorrect library version loaded
Could not open codec 'libopenh264': Unspecified error

First of all try to install H.264 from K-Lite Codec Pack.

from animal-tracking.

amirprobuetmir avatar amirprobuetmir commented on June 13, 2024

Yeah , thanks I’ll try . Also I’ve made an experiments with black box and less illumination - and it worked in real time !))but it was not counting time .

from animal-tracking.

pent1162 avatar pent1162 commented on June 13, 2024

I comment all of the frame = frame[:, w-h : w] but got an error:
imgContour = cv2.add(imgPoints, imgTrack)
cv2.error: OpenCV(4.5.5) /Users/runner/work/opencv-python/opencv-python/opencv/modules/core/src/arithm.cpp:650: error: (-209:Sizes of input arguments do not match) The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array' in function 'arithm_op'.
My video size is 1960*1280. I print the imgPoints and imgTrack, get (1080, 1080, 3) (1080, 1920, 3).

from animal-tracking.

colinlaney avatar colinlaney commented on June 13, 2024

Nothing unexpected: you are trying to add frames of different sizes.

What is your goal? Why do you need to stack together non-squared frames, while the algorithm is supposed to stack square ones? Do you have a rectangular open field?

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.