@@ -40,6 +40,14 @@ pub unsafe fn dispatch_classifier_functions(ctx: *mut lib_hardsubx_ctx, im: *mut
4040 // function that calls the classifier functions
4141 match ( * ctx) . ocr_mode {
4242 0 => {
43+ let ret_char_arr = get_ocr_text_simple_threshold ( ctx, im, ( * ctx) . conf_thresh ) ;
44+ let text_out_result = ffi:: CString :: from_raw ( ret_char_arr) . into_string ( ) ;
45+ match text_out_result {
46+ Ok ( T ) => T ,
47+ Err ( _E) => "" . to_string ( ) ,
48+ }
49+ }
50+ 1 => {
4351 let ret_char_arr = get_ocr_text_wordwise_threshold ( ctx, im, ( * ctx) . conf_thresh ) ;
4452 if ret_char_arr. is_null ( ) {
4553 "" . to_string ( )
@@ -49,17 +57,8 @@ pub unsafe fn dispatch_classifier_functions(ctx: *mut lib_hardsubx_ctx, im: *mut
4957 . into_owned ( )
5058 }
5159 }
52- 1 => {
53- let ret_char_arr = get_ocr_text_letterwise_threshold ( ctx, im, ( * ctx) . conf_thresh ) ;
54- let text_out_result = ffi:: CString :: from_raw ( ret_char_arr) . into_string ( ) ;
55- match text_out_result {
56- Ok ( T ) => T ,
57- Err ( _E) => "" . to_string ( ) ,
58- }
59- }
60-
6160 2 => {
62- let ret_char_arr = get_ocr_text_simple_threshold ( ctx, im, ( * ctx) . conf_thresh ) ;
61+ let ret_char_arr = get_ocr_text_letterwise_threshold ( ctx, im, ( * ctx) . conf_thresh ) ;
6362 let text_out_result = ffi:: CString :: from_raw ( ret_char_arr) . into_string ( ) ;
6463 match text_out_result {
6564 Ok ( T ) => T ,
@@ -70,7 +69,6 @@ pub unsafe fn dispatch_classifier_functions(ctx: *mut lib_hardsubx_ctx, im: *mut
7069 _ => {
7170 eprintln ! ( "Invalid OCR Mode" ) ;
7271 exit ( EXIT_MALFORMED_PARAMETER ) ;
73- // "".to_string()
7472 }
7573 }
7674}
@@ -117,7 +115,7 @@ pub unsafe extern "C" fn _process_frame_white_basic(
117115 let mut gray_im: * mut Pix = pixConvertRGBToGray ( im, 0.0 , 0.0 , 0.0 ) ;
118116 let mut sobel_edge_im: * mut Pix =
119117 pixSobelEdgeFilter ( gray_im, L_VERTICAL_EDGES . try_into ( ) . unwrap ( ) ) ;
120- let mut dilate_gray_im: * mut Pix = pixDilateGray ( sobel_edge_im, 21 , 1 ) ;
118+ let mut dilate_gray_im: * mut Pix = pixDilateGray ( sobel_edge_im, 21 , 11 ) ;
121119 let mut edge_im: * mut Pix = pixThresholdToBinary ( dilate_gray_im, 50 ) ;
122120
123121 let mut feat_im: * mut Pix = pixCreate ( width, height, 32 ) ;
0 commit comments