Plugin for Bevy game engine. Captures webcam image, finds face and provides all available data (face rectangle coordinates, its width and height, face probability) to Bevy game engine via events for further use in Bevy game engine.
Needs several parameters when including in .add_plugins
:
rust
app.add_plugins(WebcamFacialPlugin {
config_webcam_device: String,
config_webcam_width: u32,
config_webcam_height: u32,
config_webcam_framerate: u32,
config_webcam_autostart: bool,
});
Parameters:
* Path to webcamera device ex."/dev/video0"
* Width of frame: 640
* Width of frame: 480
* Frames per second: 33
* Start capturing instantly after plugin activation: true/false (can be enabled anytime at runtime via
Enable/disable webcam capture and recognition from Bevy via mutable Resource
rust
<ResMut>WebcamFacialControl bool
rust
<Event>WebcamFacialDataEvent
rust
WebcamFacialData {
center_x: i32,
center_y: i32,
x: i32,
y: i32,
width: i32,
height: i32,
score: f32,
}
* [centerx) Face center point x coordinate
* (centery) 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..
Three examples are provided in [examples] folder:
| bevy | bevywebcamfacial | | ---:| ---:| | 0.11 | 0.1.0 |
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.