Giter VIP home page Giter VIP logo

archeryvideotraining's People

Contributors

schmouk avatar

Watchers

 avatar  avatar

archeryvideotraining's Issues

Modify camera frames display mechanism

Current tests show that the frames acquisition from webcams is not that periodical with WIndows. Supposed to be captured at a 30 frames per second rate, i.e. with a 33.333 ms period, every 23 to 24 frames the delay passes to nearly 45 ms. Don't know why.
So, rather than synchronizing capturing and display of frames, even with a flip-flop buffer, let's test the acquisition at the rate it gets into the same flip-flop buffer, and let's display frames from this buffer at the expected 30 fps (or whatever the fps is for each webcam).

Implement base class for GUI controls

GUI controls must have common basic attributes and behaviors.
Let's implement a base class common to all GUI controls.
This will be relate to a first design which might be enhanced over time.

Implement class PeriodicalThread

This might help fixing bug #25.
A periodical thread gets its processing core called at periodical periods of time.
Let's implement this in package Utils.

Implement modification of displayed cursor

OpenCV shows in windows a cross-hair cursor. This is not really fair to use - but OpenCV is an image processing library, Let's implement mechanisms to modify the cursor aspect in OpenCV windows, according to the underlying Operating System used.

Implement class Utils.CircularBuffer

Circular buffers are buffers which contain at most n items and which remember the n last ones, removing the oldest one when appending a new one as soon as it is full.
This will be a mother class for class Utils.SummedCircularBuffer.

No more use CameraAcquisition

This class had been implemented but is now not that useful. Let's remove instantiations of and calls to CameraAcquisition and directly use class Camera instead - mainly with CamerasPool.

Implement class MainWindow

This work has already been started.
MainWindow is a singleton class. It embeds the code for the main window of AVT applicaation.
It inherits from base class AVTWindow and embeds Viewinstances.
The embedded views will show:

  • a control panel - this is an instance of class ControlView,
  • as many CameraView instances as there are cameras that are connected to the PC at launch time,
  • and if asked for, a TargetView to show the image of a chosen target.

Implement class RGBColor

Up to now a simple type PixelColor has been defined.
Library OpenCV uses a default BGR conding for colors which is not the usual RGB one.
To help developments, let's create a class RGBColor which will help coding colors in a usual way while the BGR conversion will be internally automated for its use with library OpenCV.

Implement a generic system class

In package Utils, this class should provide a wrapper to Python built-in libraries sys and platform. To be further augmented over time.

Camera View Mirroring

Mirroring views from cameras will greatly help archers visualize and fix their movements, placement and shooting.

Fix bug on not null object in _CtrlDelay

The exception message is "'NoneType' object has no attribute 'y' while drawing control <src.Display.control_view.ControlView._CtrlDelay object".
Let's check why this happens.

Implement a generic class for monitors specifications

This will help getting the dpi or the dots-per-cm for a monitor. It will be useful for the instance of TargetView, when deciding the size of a displayed target according to the true distance from screen and the simulated shooting distance.

Create GUI item Panel

Panels are views which contain controls and which are displayed as overlays.
Let's prepare their implementation.

Add generic 2D-shapes classes

Rect seems to be a class that will help working with views in displays. Point might be also, for instance for positionning things in views. The same stands also for Size.
Let's implement such basic entities.

Refactor CameraView - implement internal synchronized threads

To avoid access conflicts when acquiring and displaying camera frames, let's implement two internal threads and their synchronization:

  • one thread acquires camera frames, stores them in a flip-flop buffer and sends an Event to the other thread once frame acquisition is completed;
  • the other thread waits on the Event. Once signalled, it inserts the last acquired camera frame (extracted from the flip-flop buffer) within the CameraView content.

This might solve bug #25.
That's it!

Design and Implement class ControlView

The Control View embeds all control items that help controlling the AVT application behavior. For instance:

  • the setting of a delay before displaying captured frames;
  • the selection of a target to show on screen to help aiming;
  • the selection of a formerly recorded profile for the organization of the camera views display;
  • ...

Implement GUI control slider

Sliders help choosing a value within a range. They are constituted of a bar and a cursor which slides over the bar.
They can provide float values as well as integer ones. In the latter case, they get ticks displayed and the cursor moves from one tick to another.
They can e enabled or disabled.
Let's implement first their look and fill. Interaction will come later.

Create a Viewable GUI item

Class Viewable is the base class for all entities which get attribute .content which is a numpy ndarray.
Let's then make any such class inherit from it.

Create new package GUIItems

This package will contain definitiion of GUI controls, labels, etc.
Let's first create module label.py in it.

CamerasPool bug on multiple cameras

Capturing frames from only one camera is ok. Capturing frames from at least two cameras freezes then quits the application with warning error
"[ WARN:0] global ...\opencv\modules\videoio\src\cap_msmf.cpp (434) `anonymous-namespace'::SourceReaderCB::~SourceReaderCB terminating async callback".
Let's resolve this.

Design and Implement class TargetView

The Target view is used to display a specified target on screen. This should help at aiming while having the display in front of the archer. It aims at allowing also the archer to see herself drawing and aiming (while maybe not really shooting...)

Collect free sound files

Let's download free sounds such as swimming klaxon for instance, and may be pronounced numbers. This will be useful for playing this sound in some use cases of AVT application.

Create CameraView Control Panel

This panel will first control brightness and zooming in every camera view.
It should be poped-up on double clicking mouse button.
It should be either validated by ok or canceled by cancel actions.

Implement class Utils.SummedCircularBuffer

Summed buffers are circular buffers that contain scalar values or objects for which scalar casting operators are defined.
The sum of these values is maintained at any time.
The mean of this sum is also available at any time.
This will first be used with FPS rates.

Get and prepare pictures/icons for controls

Download pictures and icons to show controls in main window. Prepare them to fit the size of the ControlView. Create dedicated directory for these and put related stuff in it.

Fix capturing frames rate which is no more ok

(create a new branch to fix this bug)
The new mechanism for the display of camera captured frames is now ok, but still gets a concern with the refreshing rate of captures frames (about 20 fps rather than 30 fps).
Let's invertigate this, which might be due to not useful manipulations and/or copies on intermediate frames.

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.