schmouk / archeryvideotraining Goto Github PK
View Code? Open in Web Editor NEWMulti camera video training for Archery, with real-time as well as delayed and slow-motion captures.
License: MIT License
Multi camera video training for Archery, with real-time as well as delayed and slow-motion captures.
License: MIT License
Write first content for file ReadMe.md
Use class RGBColor
everywhere instead of PixelColor type.
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).
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.
All classes defining specific AVT views should inherit now from AVTView
and AVTViewProp
.
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
.
When 2 cameras are connected to the app, the main window craches.
This is not the case with 1 and with 3 cameras.
What's going on?
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.
These Views
use the default background color that is specified in AVTConfig
.
Controls in class ``Display.ControlViewwill then take benefit of all the mechanisms already implemented in base class
GUIItems.Controls.GUIControlBase`.
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
.
AVTWindows define method insert_view_content()
which is guarded by a Lock and which is thread safe.
We currently don't use it in views. Let's implement its call anywhere this will benefit to AVT application displays !
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
.
Will always be useful...
Camera views show cameras captures
This will avoid calls to view.draw()
outside hte text drawing method of Font
.
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 View
instances.
The embedded views will show:
ControlView
,CameraView
instances as there are cameras that are connected to the PC at launch time,TargetView
to show the image of a chosen target.Search for such a free library, then download it for it to be accessible from application AVT.
When clicking the targert button in Control View, a control panel should pop-up for the selection of targets and for the choice of true and simulated distances.
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
.
In package Utils
, this class should provide a wrapper to Python built-in libraries sys
and platform
. To be further augmented over time.
Mirroring views from cameras will greatly help archers visualize and fix their movements, placement and shooting.
Frames buffers seem not to be properly synchronized between acquisition and display.
It appears that some previous frames might be displayed back.
Check why!
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.
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.
Panels are views which contain controls and which are displayed as overlays.
Let's prepare their implementation.
This module will be imported in module GUILib.label.py
.
There will be a base class and dedicated ones, maybe.
They will help creating target faces from files and displaying them with the correct resolution when simulating distances shooting.
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.
To avoid access conflicts when acquiring and displaying camera frames, let's implement two internal threads and their synchronization:
This might solve bug #25.
That's it!
The Control View embeds all control items that help controlling the AVT application behavior. For instance:
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 directory src
and packages App
and Utils
in it. We will then create other packages while designing "on the fly" the software architecture of the application.
New target models can be found there: https://rcore.co/the-stay-at-home-target-face-generator/
Let's download the currently missing ones and let's prepare them.
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.
Let's check why and fix what needs to be.
In ControlView
, modify the drawing of the Delay control by using a graphical icon instead of the current text.
This package will contain definitiion of GUI controls, labels, etc.
Let's first create module label.py
in it.
Camera IDs start ร 0, let's make them starting at 1 now in a single place.
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.
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...)
Connecting to mny cameras takes time. Let's show connections progress.
... according to the new specification of CameraView
.
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.
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.
Before going further in implementation, let's test the newly created class Font
.
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.
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.
(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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.