2023年9月22日 星期五

3-Ingredient Coconut Oil Biscuits Recipe

 https://youtu.be/QJ6kZ9HJ6Z4?si=CCnabAXQwBrg9-aA

ms office image scanner MODI OCR Microsoft Office Document Imaging OCR

 _MODIDocument OCR _MODIParameters Language  _MODIParameters WithAutoRotation _MODIParameters WithStraightenImage

 https://github.com/A9T9/OCR.Space-OCR-API-Code-Snippets/blob/master/delphi%20ocr%20api.pas

 https://github.com/r1me/TTesseractOCR4

 https://github.com/onursert/OpticalCharacterRecognition

https://github.com/geoffsmith82/DelphiTransymOCR 

https://www.codeproject.com/articles/17291/ocr-with-modi-in-visual-c?fid=378728&df=90&mpp=25&sort=Position&view=Normal&spc=Relaxed&select=2073309&fr=26&prof=True

https://stackoverflow.com/questions/23862530/ocr-using-modi-office-2007

https://stackoverflow.com/questions/12345811/i-have-to-work-with-microsoft-office-document-imaging-withms-office-2010-through

https://www.codeproject.com/Articles/17291/OCR-With-MODI-in-Visual-C

https://www.codeproject.com/Articles/10130/OCR-with-Microsoft-Office

https://www.thoughtco.com/creating-components-dynamically-at-run-time-1058151

MODI dll  mdivwctl.dll IDispatch  Com Object Createobject('MODI.Document')

Do the following:
1.- #import the library.
2.- ::CoInitialize(NULL);
3.- MODI::IDocumentPtr pDoc = NULL;
4.- pDoc.CreateInstance(__uuidof(MODI::Document));

CreateObject("MODI.Document")  

CreateOLEOBject('MODI.DOcument')

CreateOLEOBject('MODI.DOcument')

 CreateObject("MODI.Document")
 CreateObject("MODI.Image")
 CreateObject("MODI.Layout")
 CreateObject("MODI.IMiSelectableItem")

https://qa.social.msdn.microsoft.com/Forums/en-US/a5dbed36-1279-49b6-b5e1-745a33afb1cd/problem-trying-to-use-ocr?forum=csharpgeneral

https://stackoverflow.com/questions/1130473/net-ocring-an-image

https://social.msdn.microsoft.com/Forums/en-US/729f9d0c-7265-4320-a6d9-3de012ad0962/modi-ocrmodimilanguagesmilangenglish-true-true-method-causes-ocr-running-error?forum=officegeneral

https://learn.microsoft.com/en-us/previous-versions/office/developer/office-2003/aa203281(v=office.11)

https://www.codeproject.com/Articles/10130/OCR-with-Microsoft-Office?msg=1381513#xx1381513xx

Type Lib: C:\Program Files\Common Files\Microsoft Shared\MODI\11.0\MDIVWCTL.DLL (1)
// LIBID: {A5EDEDF4-2BBC-45F3-822B-E60C278A1A79}
// LCID: 0
// Helpfile:
// HelpString: Microsoft Office Document Imaging 11.0 Type Library
// DepndLst:
//   (1) v2.0 stdole, (C:\WINDOWS\system32\stdole2.tlb)
 office2003 regsvr32.exe mdivwctl.dll,
 regsvr32.exe "C:\Program Files\Common Files\Microsoft Shared\MODI\11.0\mdivwctl.dll"
 C:\Program Files\Common Files\Microsoft Shared\MODI\11.0,
ADVERTISEMENT
 Microsoft Office Document Imaging 11.0 Type Library
ODIによるOCRプログラミング
https://so-zou.jp/software/tech/library/modi/introduction/

MODI\\MDI writer";. static String Provider = "Software\\Microsoft\\Protected ...

https://github.com/ands904/SEnum/blob/master/SEnumLib.cpp


Option Explicit

Const miLANG_JAPANESE = 17

On Error Resume Next
With CreateObject("MODI.Document")
  .Create "D:\TestFiles\OCRTest.jpg"
  .OCR miLANG_JAPANESE
  MsgBox .Images(0).Layout.Text
End With
If Err.Number <> 0 Then MsgBox Err.Description
Err.Clear
On Error GoTo 0 

http://www.vbaexpress.com/forum/showthread.php?43784-Read-Image-Pdf-Attachment-Using-Modi-Ocr-Then-Extract-Certain-Text-amp-Use-As-Filename



 https://learn.microsoft.com/en-us/previous-versions/office/developer/office-2003/aa203255(v=office.11)
http://www.corrupteddatarecovery.com/Products/ScanSoft-API.asp
http://www.corrupteddatarecovery.com/Products/Asian-OCR-for-ScanSoft-API.asp
https://topic.alibabacloud.com/tc/a/ocr-modules-in-the-modi_8_8_31334292.html
 
 MODI ScanSoft API
http://www.corrupteddatarecovery.com/Products/ScanSoft-API.asp
http://www.corrupteddatarecovery.com/Products/Asian-OCR-for-ScanSoft-API.asp

 ScanSoft API MODI  ScanSoft API MODI (MSPVIEW.EXE)

——————           MSPVIEW.EXE
應用程式層                ┃
——————            MODI介面
介面層                ┃
                 ScanSoft API
             ┏━━━━━┻━━━━━┓
             ┃     ScanSoft API亞洲語言支援(清華文通)
——————       ┃              ┃
資料層      西歐11國、東歐3國、     亞洲語言檔案
         俄、希、土語言檔案    (簡、繁、日、朝)
 

 Office或SharePoint Designer  Office 2007 MODI SharePoint Designer 2007
IDocument doc;
doc.CreateDispatch(_T("MODI.Document"));

在註冊表中搜尋字串“MODI.Document”,可以知道此COM對象對應的DLL是MODI安裝資料夾下的MDIVWCTL.DLL。再看一眼VC++的Debug視窗,可以知道在調用此DLL後,還接著調用了同檔案夾下的MSPGIMME.DLL、MSPCORE.DLL,及OFFICE12檔案夾下的MSO.DLL等。從檔案屬性看,這些檔案都是微軟鼓搗出來的,因此可以認為是介面層中MODI介面部分的東西。
 MODI安裝資料夾下的XOCR3.PSP、THOCR.PSP、XFILE.PSP PSP DLL ScanSoft API OFFICE12 OGL.DLL、MSORES.DLL、2052\MSOINTL.DLL
介面層     MODI     MDIVWCTL.DLL     Microsoft Office Document Imaging Viewer Control
MSPCORE.DLL     Microsoft® Office Document Imaging Object Library
MSPGIMME.DLL     Microsoft® Gimme library
OFFICE12\MSO.DLL     2007 Microsoft Office component
ScanSpft
API     BINDER.DLL     XDoc Binder module for the ScanSoft SDK
PSOM.DLL     Component Management Module for PefectScan API
XIMAGE3B.DLL     Image Processing Module for the ScanSoft SDK
XPAGE3C.DLL     Page Management Module for ScanSoft SDK
XOCR3.PSP     OCR Module for ScanSoft SDK
XFILE.PSP     Asian OCR Module for ScanSoft SDK
THOCR.PSP     Asian OCR Module for ScanSoft SDK
ScanSoft
API亞洲
語言     FORM.DLL     Table Recognition for Asian OCR
REVERSE.DLL     Reverse Video Detection for Asian OCR
THOCRAPI.DLL     Asian OCR API
TWCUTCHR.DLL     Character Segmentation for Asian OCR
TWCUTLIN.DLL     Line Segmentation for Asian OCR
TWLAY32.DLL     Layout Analysis for Asian OCR
TWORIENT.DLL     Orientataion Detection for Asian OCR
TWRECC.DLL     Chinese Recognition for Asian OCR
TWRECE.DLL     English Recognition for Asian OCR
TWRECS.DLL     Punctuation Recognition for Asian OCR
TWSTRUCT.DLL     Document Structure Processing for Asian OCR
資料層     英文     LATIN1.SHP     西歐11國(含英文)通用特徵庫
CharSetTable.chr     字元編碼轉換表,文字檔
ENGLISH.LNG     英文語言檔案
簡體中文     ENGDIC.DAT     清華文通的英文字典檔案,貌似它也支援中、英文
ENGIDX.DAT     清華文通的英文索引
JFONT.DAT      
LOOKUP.DAT      
OCRHC.DAT      
OCRVC.DAT      
TWGB32.DLL     Simplified Chinese code Conversion
SCCODE.UNI      
SCPRINT.DAT      
SCPRINT2.DAT      
SCSERHT.DAT      
SCTREE.DAT      
TW_GU.DAT      
TW_UG.DAT      

如果還想增加對其他語言的OCR能力,可以參閱《用MODI OCR 21種語言》,增加相關語言對應的檔案。

另外在上表中,在PSOM.DLL檔案描述中出現了一個新的名字:PefectScan API。google了一下,找到其官網http://perfectscan.com/,從介紹上看是做影像處理的:
PerfectScan is an image processing program that automatically analyzes an image, then makes adjustments to that image rendering a black and white image that contains all viewable data as if it were a gray scale scan, only at 15% of the size of a gray scale image.
看來MODI還真是一個大雜燴。不過PefectScan官網上的一句話,感覺道盡了程式員的悲涼:
We built the software after 10 years of hard work, now all we have to do is build the website...OOPS!!

言歸正傳。搞定檔案後,還需要搞定登錄機碼才行。與MODI相關的登錄機碼包括兩個部分:COM相關與Office相關。

COM相關就是與MODI的COM組件相關的登錄機碼,這個直接用regsvr32匯入即可:啟動命令列,進入MODI安裝資料夾,執行下面的命令:
regsvr32 MDIVWCTL.DLL
regsvr32 MSPCORE.DLL
即可完成MODI COM組件的註冊。
 

[HKEY_CLASSES_ROOT\Installer\Components\61BA386016BD0C340BBEAC273D84FD5F]
"2052"=hex(7):76,00,55,00,70,00,41,00,56,00,53,00,2e,00,7d,00,58,00,25,00,21,\
00,21,00,21,00,21,00,21,00,4d,00,4b,00,4b,00,53,00,6b,00,4f,00,43,00,52,00,\
5f,00,32,00,30,00,35,00,32,00,3c,00,00,00,00,00

[HKEY_CLASSES_ROOT\Installer\Features\00002109F10040800000000000F01FEC]
"OCR_2052"=""

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\00002109F10040800000000000F01FEC\Features]
"OCR_2052"="%mEMae,7q9*[email protected]="

[HKEY_CLASSES_ROOT\Installer\Products\00002109710000000000000000F01FEC]

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\3F745FF6A76FF2F4797DB74FC7B3FD8B]
"00002109710000000000000000F01FEC"="C:\\Program Files\\Common Files\\Microsoft Shared\\MODI\\12.0\\XPAGE3C.DLL"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\4080B9FA1A0BBF34FB7813E87159FC64]
"00002109F10040800000000000F01FEC"="C:\\Program Files\\Common Files\\Microsoft Shared\\MODI\\12.0\\SCCODE.UNI"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\48AD0082D02B3D24C9A56FA50728CCAB]
"00002109710000000000000000F01FEC"="C:\\Program Files\\Common Files\\Microsoft Shared\\MODI\\12.0\\MSPCORE.DLL"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\D94C8360B8BB1DC41B1950E0F8237563]
"00002109710000000000000000F01FEC"="C:\\Program Files\\Common Files\\Microsoft Shared\\OFFICE12\\MSO.DLL"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\00002109710000000000000000F01FEC\InstallProperties]
"WindowsInstaller"=dword:00000001
 

[HKEY_CLASSES_ROOT\Installer\Components\61BA386016BD0C340BBEAC273D84FD5F]
"1036"=hex(7):76,00,55,00,70,00,41,00,56,00,57,00,3f,00,57,00,41,00,24,00,21,\
00,21,00,21,00,21,00,21,00,4d,00,4b,00,4b,00,53,00,6b,00,4f,00,43,00,52,00,\
5f,00,31,00,30,00,33,00,36,00,3c,00,00,00,00,00

[HKEY_CLASSES_ROOT\Installer\Features\00002109F100C0400000000000F01FEC]
"OCR_1036"=""

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\00002109F100C0400000000000F01FEC\Features]
"OCR_1036"=")aEMae,7q9*[email protected]="

[HKEY_CLASSES_ROOT\Installer\Products\00002109710000000000000000F01FEC]

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\3F745FF6A76FF2F4797DB74FC7B3FD8B]
"00002109710000000000000000F01FEC"="C:\\Program Files\\Common Files\\Microsoft Shared\\MODI\\12.0\\XPAGE3C.DLL"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\48AD0082D02B3D24C9A56FA50728CCAB]
"00002109710000000000000000F01FEC"="C:\\Program Files\\Common Files\\Microsoft Shared\\MODI\\12.0\\MSPCORE.DLL"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\C040B9FA1A0BBF34FB7813E87159FC64]
"00002109F100C0400000000000F01FEC"="C:\\Program Files\\Common Files\\Microsoft Shared\\MODI\\12.0\\FRENCH.LNG"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\D94C8360B8BB1DC41B1950E0F8237563]
"00002109710000000000000000F01FEC"="C:\\Program Files\\Common Files\\Microsoft Shared\\OFFICE12\\MSO.DLL"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\00002109710000000000000000F01FEC\InstallProperties]
"WindowsInstaller"=dword:00000001

 

[HKEY_CLASSES_ROOT\Installer\Components\61BA386016BD0C340BBEAC273D84FD5F]
"1033"=hex(7):76,00,55,00,70,00,41,00,56,00,54,00,28,00,38,00,41,00,24,00,21,\
00,21,00,21,00,21,00,21,00,4d,00,4b,00,4b,00,53,00,6b,00,4f,00,43,00,52,00,\
5f,00,31,00,30,00,33,00,33,00,3e,00,26,00,61,00,45,00,4d,00,61,00,65,00,2c,\
00,37,00,71,00,39,00,2a,00,44,00,58,00,64,00,55,00,40,00,45,00,50,00,69,00,\
3d,00,00,00,00,00

[HKEY_CLASSES_ROOT\Installer\Features\00002109F10090400000000000F01FEC]
"OCR_1033"=""

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\00002109F10090400000000000F01FEC\Features]
"OCR_1033"="&aEMae,7q9*[email protected]=OFu[`t.WO9zoh+x^{BHE"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\9040B9FA1A0BBF34FB7813E87159FC64]
"00002109F10090400000000000F01FEC"="C:\\Program Files\\Common Files\\Microsoft Shared\\MODI\\12.0\\ENGLISH.LNG"

CAWT is a utility package based on TWAPI to script Microsoft Windows® applications with Tcl


CAWT twapi comobj MODI.Document