Interactive Ink

Answered

unable to convert pointerEvents to text in android or accurately at MyScriptJS

I have been trying to convert x-y coordinates obtained from the wacom clipboard my handwritten text-

image

i have converted it to PointerEvents as-

image

follows as how i obtained pointer events array from clipboard strokes

pointerEvents2[k] = new PointerEvent(PointerEventType.CANCEL, saved_strokes.get(i)[j].x, saved_strokes.get(i)[j].y, saved_strokes.get(i)[j].timestampInMillis, 1.0f, PointerType.PEN, 1);

editor.pointerEvents(pointerEvents2,false);
editor.waitForIdle();
try {
editor.export_(null, MimeType.TEXT);
} catch (IOException e) {
e.printStackTrace();
}

*Editor have been initialised and all but i still get error at editor.pointerEvents(pointerEvents2,false);

Please help me out where it got wrong.

I also tried same text points conversion on MyScriptJs but it isn't accurate with words its doing fine with the characters-

image

at-

https://myscript.github.io/MyScriptJS/examples/v4/pointer_events.html

txt

Best Answer

Dear Jai,


after reviewing your code, the issue occurs because yur array has an empty element.


When declaring the pointerEvent2 arrays, you have one element over: PointerEvent[] pointerEvents2 = new PointerEvent[size + 1];

Instead, you should declare it as follows: PointerEvent[] pointerEvents2 = new PointerEvent[size + 1];


Regarding your second question, you do not have the possibility to force to multi-line mode. This is managed internally.


Best regards,


Olivier



1 person has this question

Dear Olivier,

Good morning

Thanks for your answer.

Yes, you exactly got my point what i was trying to saying.

Nevertheless, if writing a word that is not among our standard lexicons, adding a custom lexicon is likely to help recognize it (e.g. medical terms, or abbreviations). This can be done as indicated in our documentation.

>> Yes, I already done it.

Please note that the 1.3 release of the iink that is to be released shortly (within few days) will have the possibility to compile lexicons on the device.

>> That's a good news. Best wishes for your next release. Eagerly waiting for next release.

We were not sure you were using the native our Cloud version of the iink.

>>No ,I am not using this.

Thanks for your support.

Regards,

Pankaj Tyagi

Dear Pankaj,


thank you for your question.


If I understand well, after export to JIIX, you would like to modify the "label" of the JIIX with a candidate that is not among the candidates of the JIIX and import this JIIX? This is not possible, you can only update the label with one of the candidates.


Nevertheless, if writing a word that is not among our standard lexicons, adding a custom lexicon is likely to help recognize it (e.g. medical terms, or abbreviations). This can be done as indicated in our documentation.


Please note that the 1.3 release of the iink that is to be released shortly (within few days) will have the possibility to compile lexicons on the device.


I think the link you provided me in last post is for web platform.

>>We were not sure you were using the native our Cloud version of the iink.


Best regards,


Olivier

Dear Olivier,

Thanks for your Reply.

I think the link you provided me in last post is for web platform.

I am using this for android app with wacom babmoo smart pad.

I have done with adding own resource file by your support.

Now i have one question :

After exporting JIIX format label(" actual word") and candidates appear .I completed with this and show label and candidates on view(my app custom view).

but now i want know that if i don't find my written and expected word in the candidate list then how to change that word .

Is there  only way that is to add own resource or any other way is also there.

Thanks & Regards

Pankaj Tyagi 


Dear Pankaj,


did you follow the instructions in the "Advanced -> Custom recognition" part of the documentation: https://developer.myscript.com/docs/interactive-ink/1.2/web/advanced/custom-recognition/


Also, did you give a try to the REST API: https://developer.myscript.com/docs/interactive-ink/1.2/web/rest/architecture/


The latter may better match your expectations.


Best regards,


Olivier

Dear Olivier,

I am getting problem in adding my own resource file .

Also i am not able to see my last post posted a day ago.

[EMAIL removed, only forum contact]

Thanks & Regards 

Pankaj Tyagi

Dear Pankaj,


thank you for the update.


Indeed, when getting strokes from an external device, conversion to pointerEvents shall be done very carefully.


it  will pleasure if you provide any your contact info so that i can contact you there for further assistance.

>>Developer portal users are only entitled to our forum for any technical question.


Best regards,


Olivier

Dear Pankaj,


Thank you for contacting us.


As stated above in this thread, can you confirm you set the text.guides.enable to false? This is usually the cause of inaccurate recognition.


In web, it can be done as follows: https://developer.myscript.com/docs/interactive-ink/1.2/web/reference/configuration-myscriptjs/#text

Android/iOS: https://developer.myscript.com/docs/interactive-ink/1.2/reference/configuration/#text


Best regards,


Olivier

Hello,

I am trying the same but text conversion is not accurate for single character and also for a word.

ex- if i write P on wacom bamboo writing pad then it recognise it as either ' s ' or ' g '.

need your help to short out this.

Thanks & Regards

Pankaj Tyagi


1 person likes this

Dear Olivier,

Thanks for all your prompt support it does solved all my issues.


Thanks with regards,

Jai Singh Hada

Answer

Dear Jai,


after reviewing your code, the issue occurs because yur array has an empty element.


When declaring the pointerEvent2 arrays, you have one element over: PointerEvent[] pointerEvents2 = new PointerEvent[size + 1];

Instead, you should declare it as follows: PointerEvent[] pointerEvents2 = new PointerEvent[size + 1];


Regarding your second question, you do not have the possibility to force to multi-line mode. This is managed internally.


Best regards,


Olivier



1 person likes this

Hello Olivier,

I also want  to ask how to get multi line text as recognition result as for now it returns single line text regardless input strokes were multi line.

Is there any way to make inputTextType to multi_line_text kind of something as i couldn't find for MyScriptJS.

image

is textInputMode i found related can it work?

Thanks and regards

Jai Singh Hada


Dear Olivier,

thanks for your solution on MyScriptJS text.guides.enable to false did solved my problem, now conversion is quite accurate.

>I am nevertheless puzzled by your "saved_strokes" variable. What does it look like? 

and on java saved_strokes is the array_list of strokes array

image

>When doing "size+=saved_strokes.get(z).length;" what is the value of the size variable?

here each item represent a stroke and each stroke contains a collection of x-y coordinates which you can see here 98, 112, 46.. so so size+=saved_strokes.get(z).length it give sum of all x-y points of all stroke just to initialise the pointerEvents array so size for above case will be 540 as instance.

>When filling your pointerEvents2 array, is it properly filled? Indeed, I am thinking it may not be properly filled. Can you please check it carefully?

pointsEvents2 array is accurate according to me as the size also equals the 540 equal to above points and same data now fed on MyScriptJS it does return accurate conversion, so i am not sure what is wrong here.

I do appreciate your time and effort please help this crash solution

Regards 

Jai Singh Hada

Dear Nadeem,


I am not sure to understand your message.


Is it related to the current topic? If not, please let us know, as we want to avoid topics to be mixed.


Otherwise, I checked your account, and I confirm it was properly created with the email address you used for this post.


Also, what are you say you are "not able to download this app", which application are you referring to? Which error message do you exactly have? Feel free to attach a screenshot if it helps understand.


Best regards,


Olivier

iam not able to download this app pls help it says wrong email address when i click on certificate where as email id is correct 

Dear Jai,


First, regarding the MyScriptJS not accurate, this is likely because the guidelines are activated by default, while they should not be in off-screen usage. This can be done setting the guidelines option to false ("text.guides.enable" option to "false"). You should also ensure to set it to false in your JAVA project.


Regarding your JAVA code, after looking at it, it looks correct. I am nevertheless puzzled by your "saved_strokes" variable. What does it look like? When doing "size+=saved_strokes.get(z).length;" what is the value of the size variable? When filling your pointerEvents2 array, is it properly filled? Indeed, I am thinking it may not be properly filled. Can you please check it carefully?


Best regards,


Olivier