File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -10,10 +10,6 @@ use opencv::{
1010} ;
1111use qr_reader_phone:: process_payload:: { process_decoded_payload, InProgress , Ready } ;
1212
13- // Default camera settings
14- const DEFAULT_WIDTH : u32 = 640 ;
15- const DEFAULT_HEIGHT : u32 = 480 ;
16-
1713pub ( crate ) fn read_qr_file ( source_file : & Path ) -> anyhow:: Result < String > {
1814 let mut camera = create_camera ( source_file) ?;
1915
@@ -67,7 +63,8 @@ fn camera_capture(camera: &mut videoio::VideoCapture) -> anyhow::Result<GrayImag
6763 Err ( e) => bail ! ( "Can`t read camera. {}" , e) ,
6864 } ;
6965
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 ) ;
7168 let mut ocv_gray_image = Mat :: default ( ) ;
7269
7370 cvt_color ( & frame, & mut ocv_gray_image, COLOR_BGR2GRAY , 0 ) ?;
You can’t perform that action at this time.
0 commit comments