pot-desktop
pot-desktop copied to clipboard
[BUG]: 截图OCR的时候,框选范围小的情况下,识别不到文字
Description
截图OCR的时候,框选范围正好围绕文字边缘,这种情况下识别不到文字;需要框选范围扩大一点。
希望优化一下这个框选的问题,因为有时候文字排列比较拥挤的情况下还是会用到。
Reproduction
https://github.com/user-attachments/assets/55b28c48-ea07-4cb0-b869-5e9728f3576e
Platform
Windows
System Version
Windows 11专业工作站 23H2
Window System (Linux Only)
None
Software Version
3.0.5
Log File
[2024-08-08][02:44:17][INFO][pot::window] Mouse position: 839, 378 [2024-08-08][02:44:17][INFO][pot::window] Current Monitor: Monitor { name: Some("\\.\DISPLAY1"), size: PhysicalSize { width: 1920, height: 1200 }, position: PhysicalPosition { x: 0, y: 0 }, scale_factor: 1.25 } [2024-08-08][02:44:17][INFO][pot::window] Window not existence, Creating new window: screenshot [2024-08-08][02:44:17][TRACE][os_info::imp] windows::current_platform is called [2024-08-08][02:44:17][TRACE][os_info::imp] Returning Info { os_type: Windows, version: Semantic(10, 0, 22631), edition: Some("Windows 11 ProfessionalWorkstation"), codename: None, bitness: X64, architecture: Some("x86_64") } [2024-08-08][02:44:17][INFO][pot::screenshot] Screenshot screen with position: x=0, y=0 [2024-08-08][02:44:17][INFO][pot::screenshot] Screen: DisplayInfo { id: 2776250164, raw_handle: HMONITOR(65537), x: 0, y: 0, width: 1920, height: 1200, rotation: 0.0, scale_factor: 1.0, frequency: 60.0, is_primary: true } [2024-08-08][02:44:19][TRACE][hyper::client::pool] idle interval checking for expired [2024-08-08][02:44:19][INFO][pot::cmd] Cut image: 177x36+315+257 [2024-08-08][02:44:19][INFO][pot::window] Mouse position: 493, 294 [2024-08-08][02:44:19][INFO][pot::window] Current Monitor: Monitor { name: Some("\\.\DISPLAY1"), size: PhysicalSize { width: 1920, height: 1200 }, position: PhysicalPosition { x: 0, y: 0 }, scale_factor: 1.25 } [2024-08-08][02:44:19][INFO][pot::window] Window not existence, Creating new window: translate [2024-08-08][02:44:19][INFO][webview::unknown] Focus [2024-08-08][02:44:19][INFO][webview::unknown] Focus [2024-08-08][02:44:19][INFO][webview::unknown] Focus [2024-08-08][02:44:19][INFO][webview::unknown] Move [2024-08-08][02:44:20][TRACE][os_info::imp] windows::current_platform is called [2024-08-08][02:44:20][TRACE][os_info::imp] Returning Info { os_type: Windows, version: Semantic(10, 0, 22631), edition: Some("Windows 11 ProfessionalWorkstation"), codename: None, bitness: X64, architecture: Some("x86_64") } [2024-08-08][02:44:20][TRACE][hyper::client::pool] checkout waiting for idle connection: ("https", fanyi.baidu.com) [2024-08-08][02:44:20][DEBUG][reqwest::connect] starting new connection: https://fanyi.baidu.com/ [2024-08-08][02:44:20][TRACE][hyper::client::connect::http] Http::connect; scheme=Some("https"), host=Some("fanyi.baidu.com"), port=None [2024-08-08][02:44:20][DEBUG][hyper::client::connect::dns] resolving host="fanyi.baidu.com" [2024-08-08][02:44:20][DEBUG][hyper::client::connect::http] connecting to 14.215.182.211:443 [2024-08-08][02:44:20][DEBUG][hyper::client::connect::http] connected to 14.215.182.211:443 [2024-08-08][02:44:20][TRACE][hyper::client::conn] client handshake Http1 [2024-08-08][02:44:20][TRACE][hyper::client::client] handshake complete, spawning background dispatcher task [2024-08-08][02:44:20][TRACE][hyper::proto::h1::conn] flushed({role=client}): State { reading: Init, writing: Init, keep_alive: Busy } [2024-08-08][02:44:20][TRACE][hyper::client::pool] checkout dropped for ("https", fanyi.baidu.com) [2024-08-08][02:44:20][TRACE][tracing::span] encode_headers; [2024-08-08][02:44:20][TRACE][tracing::span::active] -> encode_headers; [2024-08-08][02:44:20][TRACE][hyper::proto::h1::role] Client::encode method=POST, body=Some(Known(6)) [2024-08-08][02:44:20][TRACE][tracing::span::active] <- encode_headers; [2024-08-08][02:44:20][TRACE][tracing::span] -- encode_headers; [2024-08-08][02:44:20][TRACE][hyper::proto::h1::encode] sized write, len = 6 [2024-08-08][02:44:20][TRACE][hyper::proto::h1::io] buffer.flatten self.len=133 buf.len=6 [2024-08-08][02:44:20][DEBUG][hyper::proto::h1::io] flushed 139 bytes [2024-08-08][02:44:20][TRACE][hyper::proto::h1::conn] flushed({role=client}): State { reading: Init, writing: KeepAlive, keep_alive: Busy } [2024-08-08][02:44:20][TRACE][hyper::proto::h1::conn] Conn::read_head [2024-08-08][02:44:20][TRACE][hyper::proto::h1::io] received 482 bytes [2024-08-08][02:44:20][TRACE][tracing::span] parse_headers; [2024-08-08][02:44:20][TRACE][tracing::span::active] -> parse_headers; [2024-08-08][02:44:20][TRACE][hyper::proto::h1::role] Response.parse bytes=482 [2024-08-08][02:44:20][TRACE][hyper::proto::h1::role] Response.parse Complete(413) [2024-08-08][02:44:20][TRACE][tracing::span::active] <- parse_headers; [2024-08-08][02:44:20][TRACE][tracing::span] -- parse_headers; [2024-08-08][02:44:20][DEBUG][hyper::proto::h1::io] parsed 9 headers [2024-08-08][02:44:20][DEBUG][hyper::proto::h1::conn] incoming body is content-length (69 bytes) [2024-08-08][02:44:20][TRACE][hyper::proto::h1::decode] decode; state=Length(69) [2024-08-08][02:44:20][DEBUG][hyper::proto::h1::conn] incoming body completed [2024-08-08][02:44:20][TRACE][hyper::proto::h1::conn] maybe_notify; read_from_io blocked [2024-08-08][02:44:20][TRACE][hyper::proto::h1::conn] flushed({role=client}): State { reading: Init, writing: Init, keep_alive: Idle } [2024-08-08][02:44:20][TRACE][hyper::proto::h1::conn] flushed({role=client}): State { reading: Init, writing: Init, keep_alive: Idle } [2024-08-08][02:44:20][TRACE][hyper::client::pool] put; add idle connection for ("https", fanyi.baidu.com) [2024-08-08][02:44:20][DEBUG][hyper::client::pool] pooling idle connection for ("https", fanyi.baidu.com) [2024-08-08][02:44:20][TRACE][hyper::proto::h1::conn] flushed({role=client}): State { reading: Init, writing: Init, keep_alive: Idle } [2024-08-08][02:44:20][TRACE][hyper::client::pool] take? ("https", fanyi.baidu.com): expiration = Some(90s) [2024-08-08][02:44:20][DEBUG][hyper::client::pool] reuse idle connection for ("https", fanyi.baidu.com) [2024-08-08][02:44:20][TRACE][tracing::span] encode_headers; [2024-08-08][02:44:20][TRACE][tracing::span::active] -> encode_headers; [2024-08-08][02:44:20][TRACE][hyper::proto::h1::role] Client::encode method=POST, body=Some(Known(6)) [2024-08-08][02:44:20][TRACE][tracing::span::active] <- encode_headers; [2024-08-08][02:44:20][TRACE][tracing::span] -- encode_headers; [2024-08-08][02:44:20][TRACE][hyper::proto::h1::encode] sized write, len = 6 [2024-08-08][02:44:20][TRACE][hyper::proto::h1::io] buffer.flatten self.len=133 buf.len=6 [2024-08-08][02:44:20][DEBUG][hyper::proto::h1::io] flushed 139 bytes [2024-08-08][02:44:20][TRACE][hyper::proto::h1::conn] flushed({role=client}): State { reading: Init, writing: KeepAlive, keep_alive: Busy } [2024-08-08][02:44:20][TRACE][hyper::client::pool] idle interval checking for expired [2024-08-08][02:44:20][TRACE][hyper::proto::h1::conn] Conn::read_head [2024-08-08][02:44:20][TRACE][hyper::proto::h1::io] received 482 bytes [2024-08-08][02:44:20][TRACE][tracing::span] parse_headers; [2024-08-08][02:44:20][TRACE][tracing::span::active] -> parse_headers; [2024-08-08][02:44:20][TRACE][hyper::proto::h1::role] Response.parse bytes=482 [2024-08-08][02:44:20][TRACE][hyper::proto::h1::role] Response.parse Complete(413) [2024-08-08][02:44:20][TRACE][tracing::span::active] <- parse_headers; [2024-08-08][02:44:20][TRACE][tracing::span] -- parse_headers; [2024-08-08][02:44:20][DEBUG][hyper::proto::h1::io] parsed 9 headers [2024-08-08][02:44:20][DEBUG][hyper::proto::h1::conn] incoming body is content-length (69 bytes) [2024-08-08][02:44:20][TRACE][hyper::proto::h1::decode] decode; state=Length(69) [2024-08-08][02:44:20][DEBUG][hyper::proto::h1::conn] incoming body completed [2024-08-08][02:44:20][TRACE][hyper::proto::h1::conn] maybe_notify; read_from_io blocked [2024-08-08][02:44:20][TRACE][hyper::proto::h1::conn] flushed({role=client}): State { reading: Init, writing: Init, keep_alive: Idle } [2024-08-08][02:44:20][TRACE][hyper::proto::h1::conn] flushed({role=client}): State { reading: Init, writing: Init, keep_alive: Idle } [2024-08-08][02:44:20][TRACE][hyper::client::pool] put; add idle connection for ("https", fanyi.baidu.com) [2024-08-08][02:44:20][DEBUG][hyper::client::pool] pooling idle connection for ("https", fanyi.baidu.com) [2024-08-08][02:44:20][TRACE][hyper::proto::h1::conn] flushed({role=client}): State { reading: Init, writing: Init, keep_alive: Idle } [2024-08-08][02:44:22][TRACE][hyper::client::pool] idle interval checking for expired [2024-08-08][02:44:22][INFO][webview::unknown] Blur [2024-08-08][02:44:23][INFO][webview::unknown] Confirm Blur [2024-08-08][02:44:27][TRACE][hyper::client::pool] idle interval checking for expired
Additional Information
No response