Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
deploy:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
permissions: write-all

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
dependencies:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Install prerequisites
run: |
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,16 @@ on:

jobs:
dependencies:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Install prerequisites
run: |
sudo apt update
sudo apt install -y build-essential curl \
cmake clang libclang-dev llvm llvm-dev \
qt5-default libopencv-dev \
python3-dev python3-numpy python3-opencv
sudo apt install -y libopencv-dev

- uses: actions/checkout@v3
- name: Build project
run: cargo build --verbose --jobs $(nproc)

- name: Run tests
run: cargo test --lib --bins --tests --jobs $(nproc)

# - name: Build docs
# run: cargo doc --lib --verbose --jobs $(nproc)
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
create-release:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
permissions: write-all

outputs:
Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:

build-linux:
name: Build Linux version
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
needs: create-release
permissions:
contents: write
Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
ndarray = "^0.15"
opencv = "^0.85"
thiserror = "^1.0"
ndarray = "0.16.1"
opencv = "0.93.4"
thiserror = "2.0.3"

[build-dependencies]
cbindgen = "^0.24"
cbindgen = "0.27.0"

[[example]]
name = "file_example"
Expand Down
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ RUN apt-get update && apt-get install -y build-essential git curl cmake clang li
libcanberra-gtk3-module libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev libopencv-dev

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
sh -s -- --default-toolchain 1.71.0 -y && \
ln -s $HOME/.cargo/bin/* /usr/bin/

RUN rustup default nightly-unknown-linux-gnu
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.0
1.1.3
23 changes: 12 additions & 11 deletions examples/compute_statistic.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
extern crate cvlcore;

use cvlcore::api::capture::*;
use cvlcore::api::chain::*;
use cvlcore::errors::CaptureResult;
Expand All @@ -24,7 +25,7 @@ fn main() -> CaptureResult {
fn processing_stream(vcap: &mut CvlCapture, window: &MainWindow) {
let mut own_chain = ChainProcessing::default();
while let Ok(frame) = vcap.read_frame() {
let precessing_result = own_chain
let processing = own_chain
.run_chain(frame)
.grayscale()
.canny()
Expand All @@ -33,18 +34,18 @@ fn processing_stream(vcap: &mut CvlCapture, window: &MainWindow) {
.vibrating()
.statistic();

let dispersion = &precessing_result.get_dispersion();
if dispersion.is_some() {
println!("{:?}", dispersion.unwrap());
}
if let Some(dispersion) = processing.get_dispersion() {
println!("dispersion: {dispersion:?}");
};

let chain_result = precessing_result.get_result();
if chain_result.is_err() {
println!("{}", chain_result.err().unwrap());
continue;
}
let cvl_mat = match processing.get_result() {
Ok(mat) => mat,
Err(err) => {
println!("failed while processing frame: {err:#?}");
continue;
}
};

let cvl_mat = chain_result.unwrap();
window.show_frame(&cvl_mat);
match window.wait_event() {
WindowSignals::KeepProcessing => {}
Expand Down
16 changes: 9 additions & 7 deletions examples/file_example.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
extern crate cvlcore;

use cvlcore::api::capture::*;
use cvlcore::api::chain::*;
use cvlcore::errors::*;
Expand All @@ -24,21 +25,22 @@ fn main() -> CaptureResult {
fn processing_stream(vcap: &mut CvlCapture, window: &MainWindow) {
let mut own_chain = ChainProcessing::default();
while let Ok(frame) = vcap.read_frame() {
let precessing_result = own_chain
let processing = own_chain
.run_chain(frame)
.grayscale()
.canny()
.append_frame()
.reduce_abs()
.vibrating();

let chain_result = precessing_result.get_result();
if chain_result.is_err() {
println!("{}", chain_result.err().unwrap());
continue;
}
let cvl_mat = match processing.get_result() {
Ok(mat) => mat,
Err(err) => {
println!("failed while processing frame: {err:#?}");
continue;
}
};

let cvl_mat = chain_result.unwrap();
window.show_frame(&cvl_mat);
match window.wait_event() {
WindowSignals::KeepProcessing => {}
Expand Down
16 changes: 9 additions & 7 deletions examples/rtsp_example.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
extern crate cvlcore;

use cvlcore::api::capture::*;
use cvlcore::api::chain::*;
use cvlcore::errors::*;
Expand All @@ -24,21 +25,22 @@ fn main() -> CaptureResult {
fn processing_stream(vcap: &mut CvlCapture, window: &MainWindow) {
let mut own_chain = ChainProcessing::default();
while let Ok(frame) = vcap.read_frame() {
let precessing_result = own_chain
let processing = own_chain
.run_chain(frame)
.grayscale()
.canny()
.append_frame()
.reduce_abs()
.vibrating();

let chain_result = precessing_result.get_result();
if chain_result.is_err() {
println!("{}", chain_result.err().unwrap());
continue;
}
let cvl_mat = match processing.get_result() {
Ok(mat) => mat,
Err(err) => {
println!("failed while processing frame: {err:#?}");
continue;
}
};

let cvl_mat = chain_result.unwrap();
window.show_frame(&cvl_mat);
match window.wait_event() {
WindowSignals::KeepProcessing => {}
Expand Down
16 changes: 9 additions & 7 deletions examples/web_cam_example.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
extern crate cvlcore;

use cvlcore::api::capture::*;
use cvlcore::api::chain::*;
use cvlcore::errors::*;
Expand All @@ -20,21 +21,22 @@ fn main() -> CaptureResult {
fn processing_stream(vcap: &mut CvlCapture, window: &MainWindow) {
let mut own_chain = ChainProcessing::default();
while let Ok(frame) = vcap.read_frame() {
let precessing_result = own_chain
let processing = own_chain
.run_chain(frame)
.grayscale()
.canny()
.append_frame()
.reduce_abs()
.vibrating();

let chain_result = precessing_result.get_result();
if chain_result.is_err() {
println!("{}", chain_result.err().unwrap());
continue;
}
let cvl_mat = match processing.get_result() {
Ok(mat) => mat,
Err(err) => {
println!("failed while processing frame: {err:#?}");
continue;
}
};

let cvl_mat = chain_result.unwrap();
window.show_frame(&cvl_mat);
match window.wait_event() {
WindowSignals::KeepProcessing => {}
Expand Down
2 changes: 1 addition & 1 deletion src/api/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub struct ProcessingSettings {
impl Default for ProcessingSettings {
fn default() -> Self {
ProcessingSettings {
frames_count: 5,
frames_count: 15,
neighbours: 8,
window_size: 2,
is_reduced_abs: true,
Expand Down
Loading
Loading