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
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Changelog

## [Unreleased]

## [0.2.4] - 2024-10-22

### Added

- Add initial unit and integration testing

### Fixed

- Fixed panics on images with small dimensions (#2, thanks @paulotten and
@str4d)
- Handle zero-length vectors in similarity function
- Fixed gridpoint misalignments
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "image-match"
version = "0.2.4-dev"
version = "0.2.4"
edition = "2021"
description = "Derives an image signature to be used in quick image comparisons"
license = "GPL-3.0"
Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ pub fn get_tuned_buffer_signature(
/// produced by calls to an un-tuned signature function or identical calls to a tuned version. Per
/// the source paper and out own research, when using the un-tuned signature calculation a cosine of
/// 0.6 or greater indicates significant similarity.
/// If either vector is all zeros,
/// For the edge case of vectors with all zeroes, we return a similarity of 0.0 if one vector is
/// all zeroes, and a similarity of 1.0 if both are.
pub fn cosine_similarity(a: &Vec<i8>, b: &Vec<i8>) -> f64 {
// For our purposes here, unequal lengths are a sign of major issues in client code.
// One of my favorite professors always said "Crash early, crash often."
Expand Down