Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to invoke web service
#1
I tried a lot of OCR software and tools, for example, Microsoft's MODI, Google's Tesseract, the recognition effect is not accurate

Later, I found Baidu's online OCR service, the recognition effect is very good, in addition, it can identify 50,000 times a day for free, which is completely enough for individual users.

But I don't know how to call a web service in QM. The format of the web service call is as follows (Sample config files in the attachment):
——————————————————————————————————————————————

request URL:
https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic


method:
post
——————————————————————————————————————————————
headers:
Content-Type:application/x-www-form-urlencoded
——————————————————————————————————————————————
Body:
access_token:  free registration
image: Picture of BASE64 format (delete the prefix  data:image/png;base64,  )
language_type:CHN_ENG (Can see help doc)
probability:true (Can see help doc)
detect_direction:true (Can see help doc)
——————————————————————————————————————————————
I recorded a demo that invoke web service in the software postman
demo link : https://ibb.co/RzmxyfQ
Any suggestions are welcome, thanks in advance


Attached Files Image(s)
   

.txt   Base64.txt (Size: 5.84 KB / Downloads: 335)
.txt   OCR Config.txt (Size: 315 bytes / Downloads: 343)
#2
I very hope someone can finish it because Baidu has too many free services, Smile

such as: Image recognition, speech recognition, text recognition, etc.

These features are Very Friendly to personal
#3
I found someone wrote the VBS code.
 
Code:
Copy      Help
 
Rem CODE BY OLDLIU
Option Explicit
Randomize

Dim ExitCode
ExitCode = Main()
WSH.Quit ExitCode

Function Main()
    Const OCR_URL = "https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic"
    If WSH.Arguments.Count = 3 Then
        Dim fso,APIKey,SecretKey,Start_Time
        Start_Time = Timer
        Set fso = CreateObject("Scripting.FileSystemObject")
        APIKey = WSH.Arguments(0)
        SecretKey = WSH.Arguments(1)
        If fso.FileExists(WSH.Arguments(2)) Then    
            Dim ImageFilePath,Token
            ImageFilePath = fso.GetFile(WSH.Arguments(2)).Path 'Processing relative paths
            Token = GetToken(APIKey,SecretKey)
            If Token <> "ERROR" Then
                With CreateObject("HTMLFILE")
                    .ParentWindow.execScript _
                    "var ImageBase64String_URLEnc = encodeURIComponent('" & FileBase64Enc(ImageFilePath) & "');"
                    If Len(.ParentWindow.ImageBase64String_URLEnc) <= 4*1024*1024 Then
                        .ParentWindow.execScript _
                        "var JSON = " & _
                        HTTP_POST( _
                        OCR_URL & "?access_token=" & Token, _
                        "image="& .ParentWindow.ImageBase64String_URLEnc & _
                        "&language_type=CHN_ENG" & _
                        "&detect_direction=false" & _
                        "&detect_language=false" _
                        )
                        On Error Resume Next
                        Dim Error_Code
                        Error_Code = .ParentWindow.JSON.error_code
                        If Error_Code = Empty Then
                            On Error Goto 0
                            Dim i
                            For i = 0 To .ParentWindow.JSON.words_result_num - 1
                                WSH.Echo Eval(".ParentWindow.JSON.words_result.[" & i & "].words")
                            Next
                            Main = 0
                            WSH.StdErr.WriteLine "Success, time " & Timer - Start_Time & " sec。"
                        Else
                            On Error Goto 0
                            Main = 5
                            WSH.StdErr.WriteLine "Error! Code:" & Error_Code & ", msg:" & .ParentWindow.JSON.error_msg
                        End If
                    Else
                        Main = 4
                        WSH.StdErr.WriteLine "The file is too large."
                    End If
                End With
            Else
                Main = 3 
                WSH.StdErr.WriteLine "The APIKey or SecretKey is incorrect."
            End If
        Else
            Main = 2 
            WSH.StdErr.WriteLine "file not found."
        End If
    Else
        Main = 1
        WSH.StdErr.WriteLine "Image Cloud OCR Tool (Baidu Cloud Edition, support Chinese and English mixed)" & vbNewLine & vbNewLine & _
        "usage:" & vbNewLine & _
        "CSCRIPT -NOLOGO OCRImage.VBS        <APIKey>        <SecretKey>        <ImageFilePath>" & vbNewLine & vbNewLine & _
        "APIKey                        The APIKey that comes with the Baidu Cloud Artificial Intelligence app you created." & vbNewLine & _
        "SecretKey                The SecretKey that comes with the Baidu Cloud Artificial Intelligence app you created." & vbNewLine & _
        "ImageFilePath                Path to image file (support relative path)"& vbNewLine & vbNewLine & _
        "Baidu Cloud Artificial Intelligence OCR:        https://cloud.baidu.com/product/ocr" & vbNewLine & vbNewLine & _
        "Output information:" & vbNewLine & _
        "Handle 1                        OCR results" & vbNewLine & _
        "Handle 2                        Help, error message, execution time" & vbNewLine & vbNewLine & _
        "note:" & vbNewLine & _
        "First, does not support XP system." & vbNewLine & _
        "Second, the picture size must be less than 3M, it is recommended to be less than 1M. Otherwise it will be very slow (VBS pot, next time Vb.Net), and the recognition effect is very poor or even unrecognizable"
    End If
End Function


Function HTTP_POST(ByVal Address,ByVal Args)
    With CreateObject("MSXML2.XMLHTTP")
        .Open "POST",Address, False
        .SetRequestHeader "CONTENT-TYPE","application/x-www-form-urlencoded"
        .Send Args
        HTTP_POST = .ResponseText
    End With
End Function

Function GetToken(ByVal APIKey,ByVal SecretKey)
    Const GET_TOKEN_URL = "https://aip.baidubce.com/oauth/2.0/token"
    On Error Resume Next
    GetToken = _
    Split( _
    HTTP_POST( _
    GET_TOKEN_URL, _
    "grant_type=client_credentials" & _
    "&client_id="&APIKey & _
    "&client_secret=" & SecretKey _
    ) _
    ,"""")(3)
    If Err.Number <> 0 Then GetToken = "ERROR"
    On Error Goto 0
End Function

Function FileBase64Enc(ByVal strFilePath)
    Dim fso,WshShell,TmpFilePath,oReadFile
    Const ForReading = 1
    Const MyBirthDay = 1228
    Const WINDOW_HIDE = 0
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set WshShell = CreateObject("Wscript.Shell")
    TmpFilePath = fso.GetSpecialFolder(2) & "\" & Fix(Rnd * MyBirthDay) & ".TMP"
    WshShell.Run "Certutil.EXE -ENCODE """ & strFilePath & """ """ & TmpFilePath & """" ,WINDOW_HIDE ,True
    Set oReadFile = fso.OpenTextFile(TmpFilePath,ForReading)
    oReadFile.ReadLine 'Skip the first line”-----BEGIN CERTIFICATE-----“Sign
    Dim Str
    While Str <> "-----END CERTIFICATE-----"
        FileBase64Enc = FileBase64Enc & Str
        Str = oReadFile.ReadLine
    Wend
    oReadFile.Close
    fso.DeleteFile TmpFilePath
End Function
#4
before you press send on postman you can click on code its in orange from there you can get code snippets that you will better understand.
here is how you set 1 headers in qm
typelib WinHttp {662901FC-6951-4854-9EB2-D9A2570F2B2E} 5.1
WinHttp.WinHttpRequest xhrt._create
xhrt.Open("POST" F"https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic")

xhrt.setRequestHeader("content-type", "application/x-www-form-urlencoded");
#5
Thank you for your reminder, it has been successful
I have two problems now.
1. How to convert the image to base64 format, I did not find the relevant function
I use Online transcoding  https://tool.css-js.com/base64.html
________________________________________________________________________________
Body code format:
access_token:24.b305c9822131e65eda05e29c157dd719.2592000.1559103982.282335-16139329
image: image need Base64 format, delete the prefix data:image/png;base64, 
language_type:CHN_ENG
probability:true
detect_direction:true
________________________________________________________________________________

2. I can't get the result using the Ixml function.



Macro Macro2
Code:
Copy      Help
typelib WinHttp {662901FC-6951-4854-9EB2-D9A2570F2B2E} 5.1
WinHttp.WinHttpRequest r._create
r.Open("POST" F"https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic")
r.setRequestHeader("content-type", "application/x-www-form-urlencoded")
;out r.StatusText
;out r.Status

str body=
F
;access_token=24.b305c9822131e65eda05e29c157dd719.2592000.1559103982.282335-16139329&image=iVBORw0KGgoAAAANSUhEUgAAA18AAABeCAYAAADc8q5RAAARPUlEQVR4nO3diZXjKhaAYWqSsTuDl4VVGXQWdgiuLDqDcmXRGViOxqMNrSwXhJCr%2Bv%2FOqTNv2jYChICrBb09KwoAAAAAsKn%2F7Z0BAAAAAPgXEHwBAAAAQAYEXwAAAACQAcEXAAAAAGRA8AUAAAAAGRB8AQAAAEAGBF8AAAAAkAHBFwAAAABkQPAFAAAAABkQfAEAAABABgRfAAAAAJABwRcAAAAAZEDwBQAAAAAZEHwBAAAAQAYEXwAAAACQAcEXAAAAAGRA8AUAAAAAGRB8AQAAAEAGBF8AAAAAkAHBFwAAAABkQPAFAAAAABkQfAEAAABABgRfAAAAAJABwRcAAAAAZEDwBQAAAAAZEHwBAAAAQAYEXwAAAACQAcEXAAAAAGRA8AUAAAAAGRB8AQAAAEAGBF8AAAAAkAH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u7X5%2Fql3yzMr%2BlkgleuZ4rp9zttJ%2B4xBaJ%2Ftqru4dpagn64Xo3rvnjW62drO%2BPbD2AfTu1uZgm4b7J5564QvBBHat9j7g7DjOaSs3e1%2BoufG5ek2bfDePd800T0fMyl7zL4JcLyq0jhnrOtP8siGjH6WxzqXdMxP9xv%2F8vXpIdvZYu6Rcv4%2FT1dWrteY177VEVi65EZLmyZqKAAA4AeoJjZvVZBXT3IyzXH2s1VZv1u6ABYSv%2BerezD58aGKfOuQAwCAl9at5Hc4K8GiwN%2FcVmX9bukCMEkefLVLrne38e3yTigAAPBSdnx%2FVHZblfW7pQvAKPFth53u8vWgvr843T29AAAAAPDdbBN8AQAAAAAmEt92CAAAAAAwIfgCAAAAgAwIvgAAAAAgA4IvAAAAAMiA4AsAAAAAMiD4AgAAAIAMCL4AAAAAIAOCLwAAAADIgOALAAAAADIg%2BAIAAACADAi%2BAAAAACADgi8AAAAAyIDgCwAAAAAyIPgCAAAAgAwIvgAAAAAgA4IvAAAAAMiA4AsAAAAAMiD4AgAAAIAMCL4AAAAAIAOCLwAAAADIgOALAAAAADL4P%2BNTHNIY7Ho%2FAAAAAElFTkSuQmCC&language_type=CHN_ENG&probability=true&detect_direction=true
r.Send(body)
ARRAY(byte) a=r.ResponseBody
str s.fromn(&a[0] a.len)
out s

IXml x=JsonToXml(s 0)
IXmlNode ro=x.RootElement

;out ro.Child("words_result_num").Value
;out ro.Child("direction").Value

ARRAY(IXmlNode) a1; ro.Path("words_result/*" a1)
int i; for(i 0 a1.len) out a1[i].Value

I found the code for C# to base64.  Is there an easier way?

 
Code:
Copy      Help
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace ConvertImgToBase64
{
   class Program
   {
      static void Main(string[] args)
      {
         FileInfo file = new FileInfo("1.png");
         var stream = file.OpenRead();
         byte[] buffer = new byte[file.Length];
         //Read picture byte stream
         stream.Read(buffer, 0, Convert.ToInt32(file.Length));
         //Save the base64 string to the base64.txt file
         StreamWriter sw = new StreamWriter("base64.txt",false, Encoding.UTF8);
         //Convert byte stream to base64 string
         sw.Write(Convert.ToBase64String(buffer));
         sw.Close();
         Console.WriteLine("Convert successful!");
         Console.Read();
      }
   }
}

#6
Use the following code, Successful output  Tongue

But I feel very troublesome,Someone can provide a QM function? I didn't find any relevant information in the entire forum.



Macro IMG2Base64
Code:
Copy      Help
CsScript x
x.AddCode("")

str IMG64 = x.Call("ImgToBase64String" "c:\OCR test.png")
out IMG64

#ret
;using System;
;using System.Collections.Generic;
;using System.Drawing;
;using System.IO;
;using System.Linq;
;using System.Web;
;using System.Drawing.Imaging;

;namespace Html5Image.Tools
;{
;;;;;public class ImageTool
;;;;;{
;;;;;;;;;//Image to base64 encoded text
;;;;;;;;;public static string ImgToBase64String(string Imagefilename)
;;;;;;;;;{
;;;;;;;;;;;;;Bitmap bmp = new Bitmap(Imagefilename);
;;;;;;;;;;;;;//this.pictureBox1.Image = bmp;
;;;;;;;;;;;;;//FileStream fs = new FileStream(Imagefilename + ".txt", FileMode.Create);
;;;;;;;;;;;;;//StreamWriter sw = new StreamWriter(fs);
;
;;;;;;;;;;;;;MemoryStream ms = new MemoryStream();
;;;;;;;;;;;;;bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
;;;;;;;;;;;;;byte[] arr = new byte[ms.Length];
;;;;;;;;;;;;;ms.Position = 0;
;;;;;;;;;;;;;ms.Read(arr, 0, (int)ms.Length);
;;;;;;;;;;;;;ms.Close();
;;;;;;;;;;;;;String strbaser64 = Convert.ToBase64String(arr);
;
;;;;;;;;;;;;;return strbaser64;
;;;;;;;;;}
;
;;;;;;;;;public static Bitmap Base64StringToImage(string base64Img)
;;;;;;;;;{
;;;;;;;;;;;;;byte[] bytes = Convert.FromBase64String(base64Img);
;;;;;;;;;;;;;MemoryStream ms = new MemoryStream();
;;;;;;;;;;;;;ms.Write(bytes, 0, bytes.Length);
;;;;;;;;;;;;;Bitmap bmp = new Bitmap(ms);
;
;;;;;;;;;;;;;return bmp;
;;;;;;;;;}
;
;;;;;;;;;/// <summary>
;;;;;;;;;/// save Picture
;;;;;;;;;/// </summary>
;;;;;;;;;/// <param name="base64Img"></param>
;;;;;;;;;/// <param name="imgPath"></param>
;;;;;;;;;/// <param name="imgFormat">EX: System.Drawing.Imaging.Jpeg </param>
;;;;;;;;;public static void SaveFile(string base64Img, string imgPath, ImageFormat imgFormat )
;;;;;;;;;{
;;;;;;;;;;;;;string dir = Path.GetDirectoryName(imgPath);
;;;;;;;;;;;;;if (!Directory.Exists(dir))
;;;;;;;;;;;;;{
;;;;;;;;;;;;;;;;;Directory.CreateDirectory(dir);
;;;;;;;;;;;;;}
;;;;;;;;;;;;;var bitmap = Base64StringToImage(base64Img);
;;;;;;;;;;;;;bitmap.Save(imgPath, imgFormat);
;;;;;;;;;}
;;;;;}
;}
#7
much simpler way

Code:
Copy      Help
_s.getfile("$desktop$\1.png");; change to file location
_s.encrypt(4)
out _s
#8
Thank you, why is the line width fixed?

Invalid setting parameter

_s.getfile("$desktop$\1.png");; change to file location
_s.encrypt(4 0 0 2)
out _s


Attached Files Image(s)
   
#9
not sure but it should work just fine. will still need to prepend and append 
just and example 

Code:
Copy      Help
str ss.getfile("$desktop$\newatwindow.JPG");; change to file location
_s.encrypt(4 ss "" 2)
_s -"access_token=24.b305c9822131e65eda05e29c157dd719.2592000.1559103982.282335-16139329&image="
_s +"&language_type=CHN_ENG&probability=true&detect_direction=true"
out _s

try code above now
#10
No output Huh

Macro Macro3
Code:
Copy      Help
_s.getfile("$desktop$\1.png");; change to file location
_s.encrypt(4 "" "" 2)
mes _s
#11
wrong code look above at posted code
#12
success!!!

Macro Macro3
Code:
Copy      Help
str ss.getfile("$desktop$\1.png");; change to file location
_s.encrypt(4 ss "" 2)
out _s

I can't get the result, why?  Huh
I want to get the value of the array (words_result) and element (words)


Macro Macro4
Code:
Copy      Help
str s="{''log_id'': 3615722016662107394, ''direction'': 0, ''words_result_num'': 1, ''words_result'': [{''probability'': {''variance'': 0.002108, ''average'': 0.954701, ''min'': 0.838457}, ''words'': ''Quick Macros-automation software for Windows XP/Vista/7/8/10. Some features''}]}"

IXml x=JsonToXml(s 1)
IXmlNode ro=x.RootElement

;out ro.Child("words_result_num").Value
;out ro.Child("direction").Value

ARRAY(IXmlNode) a1; ro.Path("words_result/*" a1)
int i; for(i 0 a1.len) out a1[i].Value
#13
Code:
Copy      Help
IXml x=JsonToXml(s 1)
IXmlNode ro=x.Path("root/words_result/item/words")
str v1=ro.Value
out v1
#14
How get the value of the array (words_result)?
#15
Code:
Copy      Help
str s="{''log_id'': 3615722016662107394, ''direction'': 0, ''words_result_num'': 1, ''words_result'': [{''probability'': {''variance'': 0.002108, ''average'': 0.954701, ''min'': 0.838457}, ''words'': ''Quick Macros-automation software for Windows XP/Vista/7/8/10. Some features''}]}"

IXml x=JsonToXml(s)
int i
ARRAY(IXmlNode)
x.Path("root/words_result").GetAll(0 a)
for i 0 a.len
,out "%s %s" a[i].Name a[i].Value
#16
Using QM's base64 function, the body output results are inconsistent. Huh



Macro Q1
Code:
Copy      Help
str body=
F
;access_token=24.b305c9822131e65eda05e29c157dd719.2592000.1559103982.282335-16139329&image=iVBORw0KGgoAAAANSUhEUgAAA18AAABeCAYAAADc8q5RAAARPUlEQVR4nO3diZXjKhaAYWqSsTuDl4VVGXQWdgiuLDqDcmXRGViOxqMNrSwXhJCr%2Bv%2FOqTNv2jYChICrBb09KwoAAAAAsKn%2F7Z0BAAAAAPgXEHwBAAAAQAYEXwAAAACQAcEXAAAAAGRA8AUAAAAAGRB8AQAAAEAGBF8AAAAAkAHBFwAAAABkQPAFAAAAABkQfAEAAABABgRfAAAAAJABwRcAAAAAZEDwBQAAAAAZEHwBAAAAQAYEXwAAAACQAcEXAAAAAGRA8AUAAAAAGRB8AQAAAEAGBF8AAAAAkAHBFwAAAABkQPAFAAAAABkQfAEAAABABgRfAAAAAJABwRcAAAAAZEDwBQAAAAAZEHwBAAAAQAYEXwAAAACQAcEXAAAAAGRA8A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Vi9p1E2%2F%2Ba66tp5%2BXyIfsYu7X5%2Fql3yzMr%2BlkgleuZ4rp9zttJ%2B4xBaJ%2Ftqru4dpagn64Xo3rvnjW62drO%2BPbD2AfTu1uZgm4b7J5564QvBBHat9j7g7DjOaSs3e1%2BoufG5ek2bfDePd800T0fMyl7zL4JcLyq0jhnrOtP8siGjH6WxzqXdMxP9xv%2F8vXpIdvZYu6Rcv4%2FT1dWrteY177VEVi65EZLmyZqKAAA4AeoJjZvVZBXT3IyzXH2s1VZv1u6ABYSv%2BerezD58aGKfOuQAwCAl9at5Hc4K8GiwN%2FcVmX9bukCMEkefLVLrne38e3yTigAAPBSdnx%2FVHZblfW7pQvAKPFth53u8vWgvr843T29AAAAAPDdbBN8AQAAAAAmEt92CAAAAAAwIfgCAAAAgAwIvgAAAAAgA4IvAAAAAMiA4AsAAAAAMiD4AgAAAIAMCL4AAAAAIAOCLwAAAADIgOALAAAAADIg%2BAIAAACADAi%2BAAAAACADgi8AAAAAyIDgCwAAAAAyIPgCAAAAgAwIvgAAAAAgA4IvAAAAAMiA4AsAAAAAMiD4AgAAAIAMCL4AAAAAIAOCLwAAAADIgOALAAAAADL4P%2BNTHNIY7Ho%2FAAAAAElFTkSuQmCC&language_type=CHN_ENG&probability=true&detect_direction=true

out body

Macro Q2
Code:
Copy      Help
str ss.getfile("$desktop$\1.png");; change to file location
_s.encrypt(4 ss "" 2)

str body=
F
;access_token=24.b305c9822131e65eda05e29c157dd719.2592000.1559103982.282335-16139329&image={_s}&language_type=CHN_ENG&probability=true&detect_direction=true

out body


Attached Files
.zip   png.zip (Size: 4.06 KB / Downloads: 357)
#17
results are exactly the same on my test results are exactly the same as online conversion tools as well
#18
The base64 value of the image is the same, but, The output of the body is not the same, why?
I do not understand
#19
GIF demo
https://ibb.co/F8GNcbN
#20
It’s a bit strange, because the output code is different, I can’t get the result of the recognition.  Huh
#21
try

Function Function16
Code:
Copy      Help
str body=F"access_token=24.b305c9822131e65eda05e29c157dd719.2592000.1559103982.282335-16139329&image={_s}&language_type=CHN_ENG&probability=true&detect_direction=true"
out body
#22
Function Function17
Code:
Copy      Help
typelib WinHttp {662901FC-6951-4854-9EB2-D9A2570F2B2E} 5.1
WinHttp.WinHttpRequest r._create
r.Open("POST" F"https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic")
r.setRequestHeader("content-type", "application/x-www-form-urlencoded")
str data="access_token=24.b305c9822131e65eda05e29c157dd719.2592000.1559103982.282335-16139329&image=iVBORw0KGgoAAAANSUhEUgAAA18AAABeCAYAAADc8q5RAAARPUlEQVR4nO3diZXjKhaAYWqSsTuDl4VVGXQWdgiuLDqDcmXRGViOxqMNrSwXhJCr%2Bv%2FOqTNv2jYChICrBb09KwoAAAAAsKn%2F7Z0BAAAAAPgXEHwBAAAAQAYEXwAAAACQAcEXAAAAAGRA8AUAAAAAGRB8AQAAAEAGBF8AAAAAkAHBFwAAAABkQPAFAAAAABkQfAEAAABABgRfAAAAAJABwRcAAAAAZEDwBQAAAAAZEHwBAAAAQAYEXwAAAACQAcEXAAAAAGRA8AUAAAAAGRB8AQAAAEAGBF8AAAAAkAHBFwAAAABkQPAFAAAAABkQfAEAAABABgRfAAAAAJABwRcAAAAAZEDwBQAAAAAZEHwBAAAAQAYEXwAAAACQAcEXAAAAAGRA8AUAAAAAGRB8AQAAAEAGBF8AAAAAkAHBFwAAAABkQPAFAAAAABkQfAEAAABABgRfAAAAAJABwRcAAAAAZEDwBQAAAAAZEHwBAAAAQAYEXwAAAACQAcEXAAAAAGRA8AUAAAAAGRB8AQAAAEAGBF8AAAAAkAHBFwAAAABkQPAFAAAAABkQfAEAAABABgRfAAAAAJABwRcAAAAAZEDwBQAAAAAZEHwBAAAAQAYEXwAAAACQwb8RfJUXdXx7U2%2FFbe%2BcANjLrVBvdT%2Bg%2F%2BgPBtRNtPJybOqMKovX1uFRXcq9c7K9rcr63dLFxujTX9rK4KtUl%2BPbdAfXf8eLSnuc3lTRpF2o%2FZuPzouvnKPvvUS%2BAe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8vWgvr843T29AAAAAPDdbBN8AQAAAAAmEt92CAAAAAAwIfgCAAAAgAwIvgAAAAAgA4IvAAAAAMiA4AsAAAAAMiD4AgAAAIAMCL4AAAAAIAOCLwAAAADIgOALAAAAADIg%2BAIAAACADAi%2BAAAAACADgi8AAAAAyIDgCwAAAAAyIPgCAAAAgAwIvgAAAAAgA4IvAAAAAMiA4AsAAAAAMiD4AgAAAIAMCL4AAAAAIAOCLwAAAADIgOALAAAAADL4P%2BNTHNIY7Ho%2FAAAAAElFTkSuQmCC"
r.Send(data)
out r.ResponseText
#23
@redbull2k   @kevin

Still having problems with the output, indicating that the image format is incorrect. Huh


Macro Macro3
Code:
Copy      Help
typelib WinHttp {662901FC-6951-4854-9EB2-D9A2570F2B2E} 5.1
WinHttp.WinHttpRequest r._create
r.Open("POST" F"https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic")
r.setRequestHeader("content-type", "application/x-www-form-urlencoded")

str ss.getfile("$desktop$\1.png");; change to file location
_s.encrypt(4 ss "" 2)

;;;have problem with the output, indicating that the image format is incorrect.
;_s-"access_token=24.b305c9822131e65eda05e29c157dd719.2592000.1559103982.282335-16139329&image="
;_s+"&language_type=CHN_ENG&probability=true&detect_direction=true"
;mes _s

;;;have problem with the output, indicating that the image format is incorrect.
str body=F"access_token=24.b305c9822131e65eda05e29c157dd719.2592000.1559103982.282335-16139329&image={_s}&language_type=CHN_ENG&probability=true&detect_direction=true"
mes body

r.Send(body)
ARRAY(byte) a=r.ResponseBody
str s.fromn(&a[0] a.len)

IXml x=JsonToXml(s 1)
IXmlNode ro=x.Path("root/words_result/item/words")
str v1=ro.Value
mes v1
#24
i tried it using several base64 encoders(even used chrome and firefox to get the encoding)  all return image format error . Not sure what the problem is and since baudi is in chinese hard to translate
#25
https://tool.css-js.com/base64.html

I use the online transcoding above and manually enter it into the QM code to successfully identify it.

But using QM's base64 function will prompt the image format error.


Macro OK
Code:
Copy      Help
typelib WinHttp {662901FC-6951-4854-9EB2-D9A2570F2B2E} 5.1
WinHttp.WinHttpRequest r._create
r.Open("POST" F"https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic")
r.setRequestHeader("content-type", "application/x-www-form-urlencoded")

str body=
F
;access_token=24.b305c9822131e65eda05e29c157dd719.2592000.1559103982.282335-16139329&image=iVBORw0KGgoAAAANSUhEUgAAA18AAABeCAYAAADc8q5RAAARPUlEQVR4nO3diZXjKhaAYWqSsTuDl4VVGXQWdgiuLDqDcmXRGViOxqMNrSwXhJCr%2Bv%2FOqTNv2jYChICrBb09KwoAAAAAsKn%2F7Z0BAAAAAPgXEHwBAAAAQAYEXwAAAACQAcEXAAAAAGRA8AUAAAAAGRB8AQAAAEAGBF8AAAAAkAHBFwAAAABkQPAFAAAAABkQfAEAAABABgRfAAAAAJABwRcAAAAAZEDwBQAAAAAZEHwBAAAAQAYEXwAAAACQAcEXAAAAAGRA8AUAAAAAGRB8AQAAAEAGBF8AAAAAkAHBFwAAAABkQPAFAAAAABkQfAEAAABABgRfAAAAAJABwRcAAAAAZEDwBQAAAAAZEHwBAAAAQAYEXwAAAACQAcEXAAAAAGRA8AUAAAAAGRB8AQAAAEAGBF8AAAAAkAHBFwAAAABkQPAFAAAAABkQfAEAAABABgRfAAAAAJABwRcAAAAAZEDwBQAAAAAZEHwBAAAAQAYEXwAAAACQAcEXAAAAAGRA8AUAAAAAGRB8AQAAAEAGBF8AAAAAkAHBFwAAAABkQPAFAAAAABkQfAEAAABABgRfAAAAAJABwRcAAAAAZEDwBQAAAAAZEHwBAAAAQAYEXwAAAACQwb8RfJUXdXx7U2%2FFbe%2BcANjLrVBvdT%2Bg%2F%2BgPBtRNtPJybOqMKovX1uFRXcq9c7K9rcr63dLFxujTX9rK4KtUl%2BPbdAfXf8eLSnuc3lTRpF2o%2FZuPzouvnKPvvUS%2BAe2VjqdM6oHo%2FWvvXLyml6gb3SZtkzzf53osGrfpf7CdRxvGK%2BccTZ%2FInOyH8VgXMxco1Z%2FbQ6lDoX4f6%2BbY%2Fv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L4AAAAAIAOCLwAAAADIgOALAAAAADIg%2BAIAAACADAi%2BAAAAACADgi8AAAAAyIDgCwAAAAAyIPgCAAAAgAwIvgAAAAAgA4IvAAAAAMiA4AsAAAAAMiD4AgAAAIAMCL4AAAAAIAOCLwAAAADIgOALAAAAADL4P%2BNTHNIY7Ho%2FAAAAAElFTkSuQmCC&language_type=CHN_ENG&probability=true&detect_direction=true

r.Send(body)
ARRAY(byte) a=r.ResponseBody
str s.fromn(&a[0] a.len)

IXml x=JsonToXml(s 0)

IXmlNode ro=x.Path("root/words_result/item/words")
str v1=ro.Value
mes v1

note:
image need Base64 format, delete the prefix data:image/png;base64, 
The following parameters can only identify Chinese and English.
language_type:CHN_ENG


I used online transcoding and tried several pictures, all of which can be successfully identified and very accurate.
#26
if i manually put it in postman from qm generated base64 it works
#27
Yes, but using the function directly, can't succeed, why?  Huh
#28
don't know maybe there are other parameters it needs that postman adds when calling
#29
I feel that no other parameters are needed because there are no other parameters in the VBS code.

I think the problem is to use the value of QM's base64 function, which has changed during the delivery process.

I tested it from the link below.

http://www.quickmacros.com/forum/showthr...9#pid33509
#30
i used qm to base64 encode  an image then used postman and it works every time so its not the base64 encoding


Forum Jump:


Users browsing this thread: 9 Guest(s)