cleanup failures for existing tests

This commit is contained in:
Henry Schimke
2023-04-03 16:08:15 -05:00
parent 169db55a82
commit 44e2d52599
2 changed files with 8 additions and 3 deletions

View File

@@ -117,8 +117,8 @@ impl<'a> PatternView<'_> {
}
pub fn end(&self) -> Option<PatternType> {
if self.start + self.count < self.data.0.len() {
Some(self.data.0[self.start + self.count])
}else {
Some(self.data.0[self.start + self.count])
} else {
None
}
}

View File

@@ -63,7 +63,7 @@ pub fn FindFinderPatterns(image: &BitMatrix, tryHarder: bool) -> FinderPatterns
while {
if let Ok(next) = FindLeftGuard(&next, 0, &PATTERN, 0.5) {
next.isValid()
}else {
} else {
false
}
// let Ok(next) = FindLeftGuard(&next, 0, &PATTERN, 0.5) else {
@@ -134,6 +134,11 @@ pub fn GenerateFinderPatternSets(patterns: &mut FinderPatterns) -> FinderPattern
let cosLower: f64 = (135.0_f64 / 180.0 * 3.1415).cos();
let nbPatterns = (patterns).len();
if nbPatterns < 2 {
return FinderPatternSets::default();
}
for i in 0..(nbPatterns - 2) {
// for (int i = 0; i < nbPatterns - 2; i++) {
for j in (i + 1)..(nbPatterns - 1) {