File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,7 +31,11 @@ impl<LS: LuminanceSource> OtsuLevelBinarizer<LS> {
3131
3232 let otsu_level = imageproc:: contrast:: otsu_level ( & image_buffer) ;
3333
34- let filtered_iamge = imageproc:: contrast:: threshold ( & image_buffer, otsu_level) ;
34+ let filtered_iamge = imageproc:: contrast:: threshold (
35+ & image_buffer,
36+ otsu_level,
37+ imageproc:: contrast:: ThresholdType :: Binary ,
38+ ) ;
3539
3640 let dynamic_filtered = DynamicImage :: from ( filtered_iamge) ;
3741
@@ -83,4 +87,14 @@ impl<LS: LuminanceSource> Binarizer for OtsuLevelBinarizer<LS> {
8387 fn get_height ( & self ) -> usize {
8488 self . height
8589 }
90+
91+ fn get_black_row_from_matrix ( & self , y : usize ) -> Result < Cow < BitArray > > {
92+ let matrix = self . get_black_matrix ( ) ?;
93+ let row = matrix. getRow ( y as u32 ) ;
94+ Ok ( Cow :: Owned ( row) )
95+ }
96+
97+ fn get_black_line ( & self , l : usize , lt : super :: LineOrientation ) -> Result < Cow < BitArray > > {
98+ unimplemented ! ( "get_black_line is not implemented for OtsuLevelBinarizer" ) ;
99+ }
86100}
You can’t perform that action at this time.
0 commit comments