File tree 1 file changed +2
-5
lines changed
1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -10,10 +10,6 @@ use opencv::{
10
10
} ;
11
11
use qr_reader_phone:: process_payload:: { process_decoded_payload, InProgress , Ready } ;
12
12
13
- // Default camera settings
14
- const DEFAULT_WIDTH : u32 = 640 ;
15
- const DEFAULT_HEIGHT : u32 = 480 ;
16
-
17
13
pub ( crate ) fn read_qr_file ( source_file : & Path ) -> anyhow:: Result < String > {
18
14
let mut camera = create_camera ( source_file) ?;
19
15
@@ -67,7 +63,8 @@ fn camera_capture(camera: &mut videoio::VideoCapture) -> anyhow::Result<GrayImag
67
63
Err ( e) => bail ! ( "Can`t read camera. {}" , e) ,
68
64
} ;
69
65
70
- let mut image: GrayImage = ImageBuffer :: new ( DEFAULT_WIDTH , DEFAULT_HEIGHT ) ;
66
+ let mut image: GrayImage =
67
+ ImageBuffer :: new ( frame. size ( ) ?. width as u32 , frame. size ( ) ?. height as u32 ) ;
71
68
let mut ocv_gray_image = Mat :: default ( ) ;
72
69
73
70
cvt_color ( & frame, & mut ocv_gray_image, COLOR_BGR2GRAY , 0 ) ?;
You can’t perform that action at this time.
0 commit comments