remove MathUtils::distance()

This commit is contained in:
Vukašin Stepanović
2023-02-16 09:28:22 +00:00
parent 844ffc3b81
commit 79d9b28d19
10 changed files with 92 additions and 87 deletions

View File

@@ -2,10 +2,7 @@
use num::integer::Roots;
use crate::{
common::{
detector::MathUtils, BitMatrix, DefaultGridSampler, DetectorRXingResult, GridSampler,
Result,
},
common::{BitMatrix, DefaultGridSampler, DetectorRXingResult, GridSampler, Result},
Exceptions, Point,
};
@@ -349,8 +346,8 @@ pub fn detect(image: &BitMatrix, try_harder: bool) -> Result<MaxicodeDetectionRe
let [tl, bl, tr, br] = &symbol_box.0;
let target_width = MathUtils::distance(tl.0, tl.1, tr.0, tr.1);
let target_height = MathUtils::distance(br.0, br.1, tr.0, tr.1);
let target_width = Point::distance(tl.into(), tr.into());
let target_height = Point::distance(br.into(), tr.into());
// let target_width = (tr.0 - tl.0).round().abs() as u32;
// let target_height = (br.1 - tr.1).round().abs() as u32;