Crates.io | bevy_webcam_facial |
lib.rs | bevy_webcam_facial |
version | 0.1.4 |
source | src |
created_at | 2023-08-02 07:48:02.132644 |
updated_at | 2023-08-07 17:32:16.825885 |
description | Webcam AI face recognition plugin for bevy game engine |
homepage | |
repository | https://github.com/muaddibus/bevy_webcam_facial |
max_upload_size | |
id | 932489 |
size | 1,855,897 |
Plugin for Bevy game engine. Captures webcam image, finds face and provides all available data (face rectangle coordinates, face probability) to Bevy game engine via events for further use in Bevy game engine.
Several parameters when including in .add_plugins
or use default camera and settings .add_plugins(WebcamFacialPlugin::default())
:
.add_plugins(WebcamFacialPlugin {
config_webcam_device: 0,
config_webcam_width: 640,
config_webcam_height: 480,
config_webcam_framerate: 15,
config_webcam_autostart: true,
config_filter_type: SmoothingFilterType::LowPass(0.1),
config_filter_length: 10,
})
Parameters:
/dev/video{number}
ResMut<WebcamFacialController>
)Enable/disable webcam capture and recognition from Bevy via mutable resource ResMut<WebcamFacialController>
pub struct WebcamFacialController {
...
pub control: bool,
...
}
<Event>WebcamFacialDataEvent
pub struct WebcamFacialData {
pub center_x: f32,
pub center_y: f32,
pub x: f32,
pub y: f32,
pub width: f32,
pub height: f32,
pub score: f32,
}
Coordinates are mapped as floating point number in range of -50.0 .. 50.0, camera resolution doesn't matter
[center_x) Face center point x coordinate
(center_y) Face center point y coordinate
(x) Face rectangle frame x coordinate
(y) Face rectangle frame y coordinate
(width) Face rectangle frame width
(height) Face rectangle frame height
(score) Probability of a detected object being a true face 0-30..
*Note: Use some interpolation for transforms for smoother transforms like "bevy_easings" or "bevy_mod_interp"
Three examples are provided in [examples] folder: (under construction)
Unchecked - not finished
bevy | bevy_webcam_facial |
---|---|
0.11 | 0.1.4 |
0.11 | 0.1.3 |
0.11 | 0.1.2 |
0.11 | 0.1.1 |
The following were used for coding of plugin:
Additional interesting sources for future research:
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.