Skip to content

Commit 6231bba

Browse files
committed
0.0.9
bumped deps dropped ordered-float
1 parent a0f8ee2 commit 6231bba

File tree

7 files changed

+25
-17
lines changed

7 files changed

+25
-17
lines changed

.cargo/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
test-all = "test --all --features=clang-runtime"
33
clippy-all = "clippy --all --all-targets --features=clang-runtime"
44
fmt-all = "fmt --all"
5+
doc-all = "rustdoc"

.github/workflows/rust.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- name: Clone OpenCV repositories
4444
run: |
4545
set -e # Exit immediately on error
46-
OPENCV_VERSION=4.11.0
46+
OPENCV_VERSION=4.12.0
4747
git clone --depth 1 --branch $OPENCV_VERSION https://github.com/opencv/opencv.git
4848
git clone --depth 1 --branch $OPENCV_VERSION https://github.com/opencv/opencv_contrib.git
4949
mkdir -p opencv/build
@@ -61,7 +61,7 @@ jobs:
6161
path: |
6262
opencv/build
6363
${{ github.workspace }}/opencv_install
64-
key: opencv-${{ runner.os }}-${{ hashFiles('opencv/CMakeLists.txt') }}-4.11.0
64+
key: opencv-${{ runner.os }}-${{ hashFiles('opencv/CMakeLists.txt') }}-4.12.0
6565

6666
# Build OpenCV if cache miss
6767
- name: Build OpenCV from source

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
authors = ["eadf <lacklustr@protonmail.com>"]
33
name = "libstacker"
44
license = "MIT OR Apache-2.0"
5-
version = "0.0.8"
5+
version = "0.0.9"
66
edition = "2024"
77
readme = "README.md"
88
keywords = ["opencv", "image_stacking"]
99
repository = "https://github.com/eadf/libstacker.rs"
1010
description = "Image alignment and stacking functions based on OpenCV and Rayon"
11-
rust-version = "1.85.1"
11+
rust-version = "1.87.0"
1212

1313
[[example]]
1414
name = "main"
1515
path = "examples/main.rs"
16+
doc = false
1617

1718
[dependencies]
18-
opencv = { version = "0.94.3" , features = ["features2d"] }
19-
thiserror = "2.0.12"
20-
ordered-float = "5.0.0"
21-
rayon = "1.10.0"
19+
opencv = { version = "0.97.2", features = ["features2d"] }
20+
thiserror = "2.0.17"
21+
rayon = "1.11.0"
2222

2323
[features]
2424
default = ["clang-runtime"]

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
[![Documentation](https://docs.rs/libstacker/badge.svg)](https://docs.rs/libstacker)
33
[![Rust test](https://github.com/eadf/libstacker.rs/actions/workflows/rust.yml/badge.svg?branch=main)](https://github.com/eadf/libstacker.rs/actions/workflows/rust.yml)
44
[![dependency status](https://deps.rs/crate/libstacker/0.0.8/status.svg)](https://deps.rs/crate/libstacker/0.0.8)
5-
![license](https://img.shields.io/crates/l/libstacker)
5+
[![license](https://img.shields.io/crates/l/libstacker?maxAge=2592000)](https://github.com/eadf/libstacker.rs#license)
6+
[![Sponsor](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/eadf)
67

78
# libstacker
89
A multithreaded port of the python code found [here: github.com/maitek/image_stacking](https://github.com/maitek/image_stacking)
@@ -20,7 +21,7 @@ Read more about image alignment with OpenCV [here](https://learnopencv.com/image
2021
Opencv-rust can be little tricky to install. Follow the instructions from [rust opencv](https://crates.io/crates/opencv)
2122

2223
You will need the "clang-runtime" feature if you <a href="https://github.com/twistedfall/opencv-rust#Troubleshooting">experience problems with your clang environment</a>
23-
Disclaimer: the library is only built and tested against opencv 4.11.0.
24+
Disclaimer: the library is only built and tested against opencv 4.12.0.
2425

2526
```bash
2627
cargo build --release
@@ -91,3 +92,9 @@ Licensed under either of
9192
* MIT license ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT)>
9293

9394
at your option.
95+
96+
## Contribution
97+
98+
Unless explicitly stated otherwise, any contribution intentionally submitted
99+
for inclusion in the project by you, as defined in the Apache-2.0 license,
100+
shall be dual-licensed as above, without any additional terms or conditions.

examples/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ fn main() -> Result<(), StackerError> {
5050
println!("Calculated sharpness() in {:?}", now.elapsed());
5151

5252
// sort images by sharpness using TENG for now
53-
files.sort_by_key(|f| ordered_float::OrderedFloat(f.3));
53+
files.sort_by(|a, b| a.3.partial_cmp(&b.3).unwrap_or(std::cmp::Ordering::Equal));
5454

5555
println!("Files ordered by TENG (low quality first)");
5656
for f in files.iter() {

src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//! Copyright (c) 2021, 2025 Eadf <lacklustr@protonmail.com>.
88
//! License: MIT/Apache 2.0
99
//!
10-
//! The is a port of code written by Mathias Sundholm.
10+
//! This is a port of code written by Mathias Sundholm.
1111
//! Copyright (c) 2021 <https://github.com/maitek/image_stacking>
1212
//! License: MIT
1313
//!
@@ -19,7 +19,6 @@ pub mod utils;
1919
pub use opencv;
2020
use opencv::core::{Point2f, Vector};
2121
use opencv::{calib3d, core, features2d, imgcodecs, imgproc, prelude::*};
22-
use ordered_float::OrderedFloat;
2322
use rayon::prelude::*;
2423
use std::path::PathBuf;
2524
use thiserror::Error;
@@ -231,8 +230,7 @@ where
231230
.collect::<Vec<_>>();
232231

233232
// Sort by distance
234-
filtered_matches.sort_by(|a, b| OrderedFloat(a.distance).cmp(&OrderedFloat(b.distance)));
235-
233+
filtered_matches.sort_by(|a, b| a.distance.partial_cmp(&b.distance).unwrap_or(std::cmp::Ordering::Equal));
236234
// Keep only the best 50% of matches (optional)
237235
let num_to_keep = (filtered_matches.len() as f32 * params.match_keep_ratio).round() as usize;
238236
filtered_matches.truncate(num_to_keep);
@@ -464,7 +462,9 @@ where
464462

465463
// Sort by distance
466464
filtered_matches.sort_by(|a, b| {
467-
OrderedFloat(a.distance).cmp(&OrderedFloat(b.distance))
465+
a.distance
466+
.partial_cmp(&b.distance)
467+
.unwrap_or(std::cmp::Ordering::Equal)
468468
});
469469

470470
// Keep only the best 50% of matches (optional)

src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ unsafe impl Sync for UnsafeVectorKeyPointSyncWrapper {}
3434
pub(super) struct UnsafeMatSyncWrapper(pub(super) Mat);
3535
unsafe impl Sync for UnsafeMatSyncWrapper {}
3636

37-
/// Trait for setting value in a 2d Mat<T>
37+
/// Trait for setting value in a 2d `Mat<T>`
3838
/// Todo:There must be a better way to do this
3939
pub trait SetMValue {
4040
fn set_2d<T: opencv::prelude::DataType>(

0 commit comments

Comments
 (0)