初版: 機車第一人稱影片自動去紅燈工具
- OCR 辨識畫面上的 GPS 時速表,連續停車超過門檻即判定為紅燈並無損剪除 - 中位數平滑濾波 + 補空值 + 相鄰段合併,抗 OCR 在 0 與雜訊間跳動的問題 - 支援 GPU(CUDA) 加速、互動式選單(空白鍵多選)、config.json 設定檔 - 附中文 README 與互動啟動批次檔 本工具由 Claude Opus 4.8 (1M context) 協助開發與處理。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
# 把 UTF-8 的 bat 內容轉成 Big5(cp950)+ CRLF,輸出成「啟動.bat」
|
||||
# 啟=U+555F 動=U+52D5(用碼位組檔名,避免中文在命令列被破壞)
|
||||
$dir = 'E:\videos\redlight_remover'
|
||||
$src = Join-Path $dir '_bat_src.txt'
|
||||
$dst = Join-Path $dir ([string][char]0x555F + [string][char]0x52D5 + '.bat')
|
||||
|
||||
$lines = Get-Content -Encoding UTF8 $src
|
||||
$t = [string]::Join([char]13 + [char]10, $lines) + [char]13 + [char]10
|
||||
|
||||
$enc = [Text.Encoding]::GetEncoding(950)
|
||||
[IO.File]::WriteAllText($dst, $t, $enc)
|
||||
|
||||
# 回讀驗證:若有字元無法以 Big5 表示會變成 '?',回讀就不會相等
|
||||
$b = [IO.File]::ReadAllText($dst, $enc)
|
||||
$bytes = [IO.File]::ReadAllBytes($dst).Length
|
||||
|
||||
Write-Output ("DST=" + $dst)
|
||||
Write-Output ("BYTES=" + $bytes)
|
||||
if ($t -eq $b) { Write-Output 'ROUNDTRIP_OK' } else { Write-Output 'ROUNDTRIP_MISMATCH' }
|
||||
Reference in New Issue
Block a user