FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour IA
Posts: 518
Joined: Fri Jun 29, 2012 12:49 PM
IA
Posted: Mon Apr 04, 2022 05:55 PM
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: IA
Posted: Mon Apr 04, 2022 08:12 PM
hi,

not sure to which Thread it belong.
as it talk about "Handwritten" recognition you can use Microsoft INK for it

have a look in HMG Forum
http://www.hmgforum.com/viewtopic.php?f=5&t=7206

you will find Source for this
greeting,

Jimmy
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: IA
Posted: Mon Apr 04, 2022 09:04 PM
Dear Jimmy,

A quick test with FWH. Many thanks! :-)
Code (fw): Select all Collapse
#include "FiveWin.ch"

STATIC myRecognizers
STATIC myInkCollector
static oWnd

PROCEDURE MAIN

   DEFINE WINDOW oWnd MENU BuildMenu()

   myRecognizers := CreateObject( "msinkaut.InkRecognizers" )

   myInkCollector := CreateObject( "msinkaut.InkCollector" )
   myInkCollector:hWnd := oWnd:hWnd
   myInkCollector:Enabled = .T.

   ACTIVATE WINDOW oWnd

RETURN

function BuildMenu()

   local oMenu

   MENU oMenu
      MENUITEM "Text" ACTION MsgInfo( myInkCollector:Ink:Strokes:ToString() )
      MENUITEM "Clean" ACTION ( myInkCollector:Ink:DeleteStrokes( myInkCollector:Ink:Strokes ), oWnd:Refresh() )
   ENDMENU 
   
return oMenu
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: IA
Posted: Mon Apr 04, 2022 09:20 PM

glad that i can help.

greeting,

Jimmy
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: IA
Posted: Mon Apr 04, 2022 09:27 PM

Dear Jimmy,

Do you know if there is a similar API to talk to Cortana ?

many thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: IA
Posted: Tue Apr 05, 2022 08:48 PM
hi Antonio,

i do not use Cortana ... i have de-install it :-)

Poweshell with Administrator Rights
Code (fw): Select all Collapse
 „Get-AppxPackage -allusers Microsoft.549981C3F5F10 | Remove-AppxPackage“

---

as i know "Dictate"
https://techcrunch.com/2017/06/20/microsofts-dictate-uses-cortanas-speech-recognition-to-enable-dictation-in-office/

have been integrate in Office 365 and Windows 10
https://www.microsoft.com/en-us/garage/profiles/dictate/

as i can say you need to learn "Windows Speech Recognition commands"
https://support.microsoft.com/en-us/windows/windows-speech-recognition-commands-9d25ef36-994d-f367-a81a-a326160128c7

p.s. as i know Cortana work only when Online
greeting,

Jimmy
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: IA
Posted: Wed Apr 06, 2022 06:42 AM

Is it possible to load from an image file a written text?

bye to all

marco

Marco Boschi
info@marcoboschi.it
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: IA
Posted: Wed Apr 06, 2022 06:24 PM
MarcoBoschi wrote:Is it possible to load from an image file a written text?

bye to all

marco


Plus

Can this image be car plate?
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: IA
Posted: Wed Apr 06, 2022 10:38 PM
hi,

Microsoft INK is made for Handwriting and Gesture and not work like OCR Apps

have a look at this Article
https://www.codemag.com/article/0512042
greeting,

Jimmy
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: IA
Posted: Wed Apr 06, 2022 11:28 PM
In this document it seems as they are able to use an image:

https://silo.tips/download/erstellen-von-tablet-pc-anwendungen-mit-visual

PROCEDURE cmdLoad.Click
lsInk = CREATEBINARY(FILETOSTR(GETFILE("isf")))
thisform.inkoverlay.Enabled = 0
thisform.inkoverlay.ink.Load(lsInk)
thisform.inkoverlay.Enabled = 1
*--Tell control to redraw, or changes will not be made visible.
*-- Use the InkRectangle object we
*-- created during form Init.
ThisForm.inkoverlay.Draw(ThisForm.InkRectangle)
ENDPROC
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: IA
Posted: Wed Apr 06, 2022 11:40 PM
Here is the document translated into english for better understanding and reading:

https://github.com/FiveTechSoft/screenshots/blob/master/Building%20Tablet%20PC%20Applications%20with%20Visual%20FoxPro.pdf
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1344
Joined: Wed Nov 16, 2005 09:14 PM
Re: IA
Posted: Thu Apr 07, 2022 12:45 AM
Antonio:
Hay equivalente en Fivewin a CREATEBINARY y FILETOSTR, tenemos algo asi?
FILETOSTR imagino que podría ser MemoRead()

Intente de algunas formas pero no tengo ningun resultado.
Esto funciona bien:
Code (fw): Select all Collapse
MENUITEM "Copy" ACTION myInkCollector:Ink:ClipBoardCopy()

Copia al portapapeles de manera correcta
Code (fw): Select all Collapse
MENUITEM "Paste" ACTION (myInkCollector:Enabled := .f.,myInkCollector:Ink:ClipBoardPaste(),myInkCollector:Enabled := .T.)

No da error pero no muestra nada
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: IA
Posted: Thu Apr 07, 2022 11:55 AM
César,

Me parece que ese método lo que hace es salvar lo escrito y luego recargarlo

Hay mucha documentación al respecto que hay que revisar:
https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-3.0/ms583746(v=vs.85)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: IA
Posted: Thu Apr 07, 2022 12:01 PM
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: IA
Posted: Thu Apr 07, 2022 10:50 PM
hi Antonio,

thx for the link.

i have read Germen VFP-PDF which work with ActiveX
Code (fw): Select all Collapse
Microsoft InkEdit Control
{E5CA59F5-57C4-4DD8-9BD6-1DEEEDD27AF4}
ProgID "InkEd.InkEdit.1"


you also point me to other ActiveX
Code (fw): Select all Collapse
Microsoft InkPicture Control
{04a1e553-fe36-4fde-865e-344194e69424}
ProgID "msinkaut.InkPicture.1"


---

C:\Program Files\Common Files\Microsoft Shared\Ink\
InkObj.dll seem me to be the ActiveX and have these Interface
Code (fw): Select all Collapse
InkDisp
InkOverlay
InkPicture
InkCollector
InkDrawingAttributes
InkRectangle
InkRenderer
InkTransform
InkRecognizers
InkRecognizerContext
InkRecognizerGuide
InkTablets
InkWordList
InkStrokes
Ink
SketchInk


my Sample work with InkCollector and InkRecognizers only

Load/Save are Method from InkDisp / InkOverlay so i need to learn more
https://docs.microsoft.com/en-us/windows/win32/tablet/inkdisp-class

about Save
https://docs.microsoft.com/en-us/windows/win32/api/msinkaut/nf-msinkaut-iinkdisp-save
default it use "InkSerializedFormat" to create ISF (ink serialized format) File.
when use GIF
Ink is persisted by using a Graphics Interchange Format (GIF) file that contains ISF as metadata that is embedded within the file.

Specification about ISF
https://download.microsoft.com/download/0/B/E/0BE8BDD7-E5E8-422A-ABFD-4342ED7AD886/InkSerializedFormat(ISF)Specification.pdf

about Load
https://docs.microsoft.com/en-us/windows/win32/api/msinkaut/nf-msinkaut-iinkdisp-load
The Save method allows you to persist the ink in an InkDisp object in Graphics Interchange Format (GIF) format, which consists of an array of byte data (the tla_gif persistence format is specified in the InkPersistenceFormat enumeration type). After you have the array of byte data, you can load the array of byte data into another InkDisp object. This means that you can load GIF-compatible byte array data into another InkDisp object in the same way as if you had called the Save method and received a byte array that was not in GIF format.


so how to create Byte Array
what can i use for CREATEBINARY() :-)
greeting,

Jimmy