YCG09 / chinese_ocr

CTPN + DenseNet + CTC based end-to-end Chinese OCR implemented using tensorflow and keras
Apache License 2.0
2.74k stars 1.08k forks source link

自己拍的照片有一定的倾斜角度时,不能识别,或者识别很不理想,如何解决呢? #297

Open sxk000 opened 4 years ago

sxk000 commented 4 years ago

自己拍的照片有一定的倾斜角度时,不能识别,或者识别很不理想,如何解决呢?

kellylin841015 commented 4 years ago

我也正解決這個問題,你可以用opencv 或 YOLO 抓取輪廓,轉正他,但目前來說,背景太複雜就很難處理,如果你有更好的解決方式,我們可以分享一下想法

sxk000 commented 4 years ago

@kellylin841015 你好,谢谢分享,但是这种方法具体如何操作呢?可以加我QQ:2323350313交流吗?非常感谢!

kellylin841015 commented 4 years ago

你好,因為目前我這邊是有簽計畫的,所以要遵守保密協定,可能不能分享具體細節,但一些概念以及嘗試結果我們可以交流一下 可以加一下QQ,我需要下載跟註冊,今天有事,晚上用

自我介紹ㄧ下,我叫芸琦

sxk000 notifications@github.com於 2019年10月22日 週二,上午11:04寫道:

@kellylin841015 https://github.com/kellylin841015 你好,谢谢分享,但是这种方法具体如何操作呢?可以加我QQ:2323350313交流吗?非常感谢!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/YCG09/chinese_ocr/issues/297?email_source=notifications&email_token=AC5NYMO2KC7P24YPZMWZJH3QPZUTFA5CNFSM4JDJ2A62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEB4M4AI#issuecomment-544787969, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5NYMOJIU7QZW3GF6FX7QTQPZUTFANCNFSM4JDJ2A6Q .

sxk000 commented 4 years ago

@kellylin841015 好的,非常感谢!

sxk000 commented 4 years ago

@kellylin841015 我觉得 这个应该是在文本检测时,ctpn模型对倾斜角度字体行没能准备检测并框出来,如果这一步处理好的话,问题应该就解决了

kellylin841015 commented 4 years ago

是,他的ctpn只能訂正一點傾斜,將基本上水平的proposal box串連後,再微調歪斜 所以理論上,依照ctpn論文找文字的方式,無法辨識文字傾斜

P.s. 忘記辦帳號,抱歉,我晚點辦XD

sxk000 notifications@github.com於 2019年10月23日 週三,下午3:44寫道:

@kellylin841015 https://github.com/kellylin841015 我觉得 这个应该是在文本检测时,ctpn模型对倾斜角度字体行没能准备检测并框出来,如果这一步处理好的话,问题应该就解决了

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/YCG09/chinese_ocr/issues/297?email_source=notifications&email_token=AC5NYMJD4E46D5KYR5H7AK3QP76HXA5CNFSM4JDJ2A62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECANO7Y#issuecomment-545314687, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5NYMPYDD6OQPDFYCINTHLQP76HXANCNFSM4JDJ2A6Q .

kellylin841015 commented 4 years ago

我能看一下你的test image嗎? 確認一下我們對圖片的傾斜度是一樣的認知 我也可以傳給你我這邊的

Benote r101086616@gmail.com於 2019年10月23日 週三,下午4:08寫道:

是,他的ctpn只能訂正一點傾斜,將基本上水平的proposal box串連後,再微調歪斜 所以理論上,依照ctpn論文找文字的方式,無法辨識文字傾斜

P.s. 忘記辦帳號,抱歉,我晚點辦XD

sxk000 notifications@github.com於 2019年10月23日 週三,下午3:44寫道:

@kellylin841015 https://github.com/kellylin841015 我觉得 这个应该是在文本检测时,ctpn模型对倾斜角度字体行没能准备检测并框出来,如果这一步处理好的话,问题应该就解决了

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/YCG09/chinese_ocr/issues/297?email_source=notifications&email_token=AC5NYMJD4E46D5KYR5H7AK3QP76HXA5CNFSM4JDJ2A62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECANO7Y#issuecomment-545314687, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5NYMPYDD6OQPDFYCINTHLQP76HXANCNFSM4JDJ2A6Q .

sxk000 commented 4 years ago

@kellylin841015 git上不能贴图片,你那边一般用什么实时社交软件,账号发一下,我加你吧

kellylin841015 commented 4 years ago

Line:Kelly 841015 我一直以為你是使用信箱XD沒注意到

sxk000 notifications@github.com於 2019年10月23日 週三,下午4:20寫道:

@kellylin841015 https://github.com/kellylin841015 git上不能贴图片,你那边一般用什么实时社交软件,账号发一下,我加你吧

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/YCG09/chinese_ocr/issues/297?email_source=notifications&email_token=AC5NYMOCR2NBC37Q5AMHQGTQQACOFA5CNFSM4JDJ2A62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECAQWXA#issuecomment-545327964, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5NYMIYM2ZEBNY2KY26PGDQQACOFANCNFSM4JDJ2A6Q .

sxk000 commented 4 years ago

@kellylin841015 图片太大,退信了,我发你r101086616@gmail.com邮箱了,注意查收

kellylin841015 commented 4 years ago

沒有收到圖呢,我給你我的吧,我給你我的吧,在附件裡,不知道你收不收的到,有收到跟我說 sxk000 notifications@github.com於 2019年10月23日 週三,下午4:44寫道:

@kellylin841015 https://github.com/kellylin841015 图片太大,退信了,我发你 r101086616@gmail.com邮箱了,注意查收

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/YCG09/chinese_ocr/issues/297?email_source=notifications&email_token=AC5NYMMFFFP4IRKEUNKU2TLQQAFIRA5CNFSM4JDJ2A62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECATBPY#issuecomment-545337535, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5NYMPEPAG4B2EWE32DXNDQQAFIRANCNFSM4JDJ2A6Q .

kellylin841015 commented 4 years ago

照片不要傳上網或經過其他傳訊軟體,我忘記打碼了,看完就刪了吧

Benote r101086616@gmail.com 於 2019年10月24日 週四 下午3:30寫道:

沒有收到圖呢,我給你我的吧,我給你我的吧,在附件裡,不知道你收不收的到,有收到跟我說 sxk000 notifications@github.com於 2019年10月23日 週三,下午4:44寫道:

@kellylin841015 https://github.com/kellylin841015 图片太大,退信了,我发你 r101086616@gmail.com邮箱了,注意查收

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/YCG09/chinese_ocr/issues/297?email_source=notifications&email_token=AC5NYMMFFFP4IRKEUNKU2TLQQAFIRA5CNFSM4JDJ2A62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECATBPY#issuecomment-545337535, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5NYMPEPAG4B2EWE32DXNDQQAFIRANCNFSM4JDJ2A6Q .

northeastsquare commented 4 years ago

请问,倾斜有多倾斜,可以发一些图片样例到 issue里面吗,谢谢

sxk000 commented 4 years ago

@northeastsquare 这个上面不能贴图片,抱歉

kellylin841015 commented 4 years ago

抱歉,近期廠商在驗收,我比較忙 我給你發我的train跟test image 大致上我的train img跟原本網站的長得差不多 我的雲端連結: https://drive.google.com/drive/folders/1cVx7BbmYyLimSw8A9Zr16XeLBNxz6pHL?usp=sharing 我把我雲端這個資料夾設成共用 而且不登入也可以編輯檢視

sxk000 notifications@github.com 於 2020年1月20日 週一 下午4:41寫道:

@northeastsquare https://github.com/northeastsquare 这个上面不能贴图片,抱歉

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/YCG09/chinese_ocr/issues/297?email_source=notifications&email_token=AC5NYML36GVJV42AOMI7LXLQ6VPTFA5CNFSM4JDJ2A62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJLZ5JA#issuecomment-576167588, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5NYMJ2EJ46YP6VWMNINA3Q6VPTFANCNFSM4JDJ2A6Q .

kellylin841015 commented 4 years ago

新年快樂

Benote r101086616@gmail.com 於 2020年1月20日 週一 下午10:11寫道:

抱歉,近期廠商在驗收,我比較忙 我給你發我的train跟test image 大致上我的train img跟原本網站的長得差不多 我的雲端連結: https://drive.google.com/drive/folders/1cVx7BbmYyLimSw8A9Zr16XeLBNxz6pHL?usp=sharing 我把我雲端這個資料夾設成共用 而且不登入也可以編輯檢視

sxk000 notifications@github.com 於 2020年1月20日 週一 下午4:41寫道:

@northeastsquare https://github.com/northeastsquare 这个上面不能贴图片,抱歉

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/YCG09/chinese_ocr/issues/297?email_source=notifications&email_token=AC5NYML36GVJV42AOMI7LXLQ6VPTFA5CNFSM4JDJ2A62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJLZ5JA#issuecomment-576167588, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5NYMJ2EJ46YP6VWMNINA3Q6VPTFANCNFSM4JDJ2A6Q .

sxk000 commented 4 years ago

@kellylin841015 新年快乐!你发的地址应该需要翻墙,我明天看一下,非常感谢你的分享!我后来用的YOLO3,这个对倾斜文本检测的效果会好很多,建议你尝试一下!

kellylin841015 commented 4 years ago

好的,非常感謝你的建議,我目前訓練及正確率97% 但測試集正確率一直在80幾徘徊 真的非常苦惱

看起來你是從ctpn抓取文字來改善 我一直懶得從新訓練 從你的建議來看直接換成yolo或許是個好主意

我這邊是從densenet辨識文字來改善的 如果你文字抓取結果抓得不錯 但辨識loss依舊下降不了 我建議你可以試著加深 densenet 網路 至少對我來說效果是很顯著的

感謝你的分享

sxk000 notifications@github.com 於 2020年1月20日 週一 下午10:25寫道:

@kellylin841015 https://github.com/kellylin841015 新年快乐!你发的地址应该需要翻墙,我明天看一下,非常感谢你的分享!我后来用的YOLO3,这个对倾斜文本检测的效果会好很多,建议你尝试一下!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/YCG09/chinese_ocr/issues/297?email_source=notifications&email_token=AC5NYMIXGIXFPNHTNEG7FE3Q6WX6FA5CNFSM4JDJ2A62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJMZUHI#issuecomment-576297501, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5NYMPCDTCJWUOOQACYANTQ6WX6FANCNFSM4JDJ2A6Q .

sxk000 commented 4 years ago

@kellylin841015 好的,我后面试试,相互学习!上海现在11点了,要睡了,明天还要上最后一天班呢!

sxk000 commented 4 years ago

@kellylin841015 我看了你的图片,上面的文字不算倾斜吧,我的图片是人用手机拍摄的,有时候还有一定的弧度,倾斜角度比较大,此模型在文本检查的时候不能完全检测出来

kellylin841015 commented 4 years ago

阿是的,我是直接先影像處理調正之後才拿進模型裡做測試 不過我後期開始負責神經網路部分 前期影像處理的調正交給其他人做了 抱歉實在是過了一段時間我有點忘記原本討論調正 我可能很難給你提供調正意見了,覺得很遺憾 但如果你有其他問題也可以討論

的確我看了CTPN調整傾斜方面,他只能應對小程度的傾斜 我是看了CTPN論文之後覺得應該是他的連續anchor垂直距離設定的閥值比較小 的確他的ctpn網路裡是有參數可以調整的 不過我這邊因為測試資料集比較單純,所以直接採用影像處理 沒有嘗試調整ctpn

倒是如果你在文字抓取有正確後 文字辨識順利嗎 我發現在大小字混雜以及中文數字混雜 或是數字過度緊密的情形 在切字方面會出現問題 (當然就先不論中文字本身切字就有問題) 可以以訓練相似訓練及改善這個問題 但似乎不能完全避免錯誤

p.s.上海跟台灣沒有時差 話說 android 的ocr app 有點過度厲害了吧,我很想加入他們公司,了解一下

sxk000 notifications@github.com 於 2020年1月21日 週二 上午10:28寫道:

@kellylin841015 https://github.com/kellylin841015 我看了你的图片,上面的文字不算倾斜吧,我的图片是人用手机拍摄的,有时候还有一定的弧度,倾斜角度比较大,此模型在文本检查的时候不能完全检测出来

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/YCG09/chinese_ocr/issues/297?email_source=notifications&email_token=AC5NYMOB6B3YBOTM5BOMSXTQ6ZMTBA5CNFSM4JDJ2A62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJOJAFY#issuecomment-576491543, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5NYMPT5HXE4AHWUDJ6BFLQ6ZMTBANCNFSM4JDJ2A6Q .