feat(desktop): screen text capture (OCR) overlay with selectable text
A rebindable screen-ocr action (default Ctrl+Alt+O) freezes the monitor under the cursor and covers it with a focusable overlay. Text is selected by flow drag, rectangle drag, double/triple click, Shift+click or Ctrl+A, then copied, saved as PNG or searchable PDF, translated, summarized, read aloud, opened as a link or searched. - Selection, text assembly and the PDF document are pure functions in @d3ro/core/screen-ocr, shared by the main process and the overlay. - Recognition uses Windows.Media.Ocr through powershell.exe -EncodedCommand with 2x upscaling; the capture reaches disk only as a temp PNG that is removed right after recognition. - Capture uses GDI BitBlt for the target monitor (39 ms) because desktopCapturer captured all three monitors and took 2.9 s when DXGI duplication timed out. - The accelerator is reserved only where the feature is available, so macOS does not swallow the key for a feature it cannot run (fails closed with a message). Map: CAP-17 [~], GAP-OCR-01 (live hotkey journey not yet driven in the running app), GAP-OCR-02 (macOS engine, mixed-language accuracy).
This commit is contained in:
parent
6791e29f27
commit
03cd8bf890
41 changed files with 4561 additions and 17 deletions
|
|
@ -1,5 +1,17 @@
|
|||
# D3RO-VOICE 프로젝트 현황
|
||||
|
||||
## 화면 글자 읽기(OCR) 오버레이 — CAP-17 (2026-11-20, 구현·검증 완료 / 미커밋·미배포)
|
||||
|
||||
- 요청: 단축키로 화면을 캡처해 덮고, 그 위 글자를 사각형/일반 끌기로 고르기 + PDF 저장 등 부가 기능.
|
||||
- 구현: `screen-ocr` 재바인딩 액션(기본 `Ctrl+Alt+O`) → 커서가 있는 모니터를 GDI 로 캡처(`utils/win32-screen-capture.ts`) → `screen-ocr` 팝업(포커스 받는 유일한 팝업, 2단계 표시)이 화면을 덮음 → Windows 내장 OCR(`services/screen-ocr/windows-ocr-engine.ts`, powershell.exe -EncodedCommand, 2배 확대) 결과로 단어 상자 선택.
|
||||
- 선택: 단어에서 끌면 글 흐름, 빈 곳에서 끌면 사각형(영역 모드는 항상 사각형), 더블클릭 단어, 세 번 클릭 줄, Shift+클릭 이어 고르기, Ctrl+A.
|
||||
- 동작: 복사 / 한 줄 복사 / 이미지 복사 / PNG 저장 / 검색 가능한 PDF(그림 아래 글자 층) / 번역·요약(LlmGateway) / 읽어 주기(TTS) / 링크 열기·웹 검색 / 인식 언어 변경(`screenOcrLanguage`).
|
||||
- 정본: 순수 로직 `packages/core/src/screen-ocr.ts`, 서비스 `ScreenOcrService.ts`(포트 주입), 조립 `screen-ocr-wiring.ts`, 창 `windows/screen-ocr-overlay.ts`, 문구 41키 × 12로케일.
|
||||
- 실측: desktopCapturer 는 모니터 3대에서 2.9초(DXGI 500ms 대기 × 모니터) → GDI BitBlt 39ms 로 교체(폴백으로만 남김). 실제 화면 2560×1440 인식 0.76초(프로세스 포함 1.2초).
|
||||
- 검증: core 34 + 데스크톱 42 신규 테스트, 데스크톱 전체 214 files / 2,933 GREEN(Node 24.19.0), workspace typecheck·lint·hygiene·design·i18n·contract GREEN, 실엔진 프로브, 헤드리스 Electron 43 에서 오버레이(흐름/사각형 선택·복사·번역·PDF 요청·닫힘 정리) + 인쇄한 PDF 글자 층 검색 확인.
|
||||
- **남은 것:** 실행 중인 앱에서 단축키→포커스→선택 실사용 확인(`GAP-OCR-01`, 그래서 카탈로그는 `[~]`), macOS 엔진 없음(`GAP-OCR-02`, fail-closed 안내).
|
||||
- 함정: 기본 셸 Node 는 23 — 테스트는 `PATH="$APPDATA/npm:$PATH"`(Node 24.19.0, better-sqlite3 ABI 137)로 돌려야 한다. 한국어 OCR 팩만 있으면 작은 영문 UI 글자를 가끔 오독한다(영어 언어 팩 설치 시 오버레이에서 언어 전환 가능).
|
||||
|
||||
## 학습 어휘를 회의록 전사 교열에 연결 (2026-11-05)
|
||||
|
||||
- 사용자 보고: "키보드로 치는 건 다 학습하는데 회의록 전사에 활용을 못 한다, 전사가 엉망".
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue