Skip to content

Commit

Permalink
Addressed Clippy comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
zlogic committed Aug 2, 2024
1 parent 31e71bb commit c2fe7a6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/orb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ fn find_fast_keypoints<PL: ProgressListener>(
pl.report_status(value);
}
let mut threshold_min = FAST_THRESHOLD as i16;
let mut threshold_max = std::u8::MAX as i16;
let mut threshold_max = u8::MAX as i16;
let mut threshold = (threshold_max + threshold_min) / 2;
while threshold_max > threshold_min + 1 {
if is_keypoint(img, threshold, p.x, p.y) {
Expand Down Expand Up @@ -453,8 +453,8 @@ fn is_keypoint(img: &Grid<u8>, threshold: i16, x: usize, y: usize) -> bool {
}

fn adjust_contrast(img: &mut Grid<u8>) {
let mut min: u8 = core::u8::MAX;
let mut max: u8 = core::u8::MIN;
let mut min: u8 = u8::MAX;
let mut max: u8 = u8::MIN;

for (_x, _y, p) in img.iter() {
min = min.min(*p);
Expand All @@ -465,7 +465,7 @@ fn adjust_contrast(img: &mut Grid<u8>) {
return;
}

let coeff = core::u8::MAX as f32 / ((max - min) as f32);
let coeff = u8::MAX as f32 / ((max - min) as f32);
for (_x, _y, p) in img.iter_mut() {
*p = (coeff * ((*p - min) as f32)).round() as u8;
}
Expand Down

0 comments on commit c2fe7a6

Please sign in to comment.