Rectangular box to scan/analyze on the camera preview with Flutter Google-ml-kit Text Recognition - flutter

There's an example app using on-device Text Recognition of Google ML Kit: https://github.com/bharat-biradar/Google-Ml-Kit-plugin/tree/master/example
I'm using the "text recognition" part of that example app in my app and it works good. The only thing I need to do but can't do is that I want to show a rectangular box on the camera preview and only want to recognize texts inside this box. Other parts of the preview should be ignored. Otherwise, all the text in the preview would be recognized which is bad for my use case.
It's easy to show a rectangular box on the camera preview but I don't know how to only analyze the part in that rectangular box instead of the whole preview. Any help please?

There are two ideas you can consider:
(1) Crop your camera preview down to only the rectangular box and feed that cropped image to the ML Kit API.
(2) ML Kit's Text Recognition API returns a bounding box on Android (and frame on iOS). You can use that to determine if any of the text recognition results falls into or overlaps with your rectangular box. Depending on your use case and the input image, this approach may not be ideal since it can return text recognition result for text not entirely inside your rectangle.

Related

Issue of imaginary bounding box near coordinates for model when viewing results in Paraview for Computational Fluid Dynamics

When I try to upload the controlDict folder into Paraview, it is inconsistent in terms of display. At times, like the picture shown below, I can only view the image of the model at that particular size and if I try to drag it out, there seems to be an imaginary bounding box around it then prevents me from viewing the model. I am currently using WSL to learn how to use openFOAM and this is a tutorial that I followed along regarding flow in an elbow. I’d like help regarding this matter.
I was following through a tutorial online and I expected to see the model fill the screen but to my surprise, there was an imaginary bounding box that limited my ability to render it as senter image description hereeen from the screenshots below. enter image description here

Live OCR Flutter

I'm creating flutter app like google lens where I want to select specific word from image by touching on that word like google lens text recognization. How I can I achieve this. It will be good if it can be done with google or firebase ml kit.
One way you could do is to run ML Kit OCR on the image, and keep the detected words from the image. When you click on the screen, you could compare the touch point with the OCR detection results. If the touch point within one result, you know the detected word is selected.
Because ML Kit OCR detection results could be a character, a word or a sentence. It is your decision what should be selected.

Unity How do I Flow TextMesh Pro Text around an Image?

Unity Version: 5.6.5f1 Personal
TextMesh Pro Version: 1.0.56.0b3
I have a TextMesh Pro UI Text object whose area intersects the area of a UI Image. The text is dynamic, but the image will never change. Is there a way to make the TextMesh Pro UI Text flow around the image similar to how text would wrap to one side in HTML/CSS?
The image below shows two copies of the object in Unity. One object, denoted by a red space where the image is located, is what I'm currently getting. The text enters the space of the image. The other object, denoted by a blue space where the image is located, shows the desired outcome where text is wrapping properly.
Current vs. Desired Outcome:
Research so far:
How do I put an image inside text? - The Image that I'm using is a UI Image, not a text asset. The Image will only act as though it is inline with the text.
How do you wrap text around a rectangle?, Fluid layout for Unity UI - These are what I'm looking for. However, no suggestions have been posted in them.
I've explored the idea of using multiple TextMesh Pro UI Text Objects, with each one acting as a fragment of the complete text area. However, this isn't the same as wrapping the text around the Image. For dynamic text, if I pull content from one text area and push it into the next area, this will conflict with the Auto-Sizing functionality and cause unequal font sizes.
Another possibility is that I could insert characters one at a time, check to see if adding another character would result in a collision with the image, and add System.Environment.Newline to prevent this. However, I worry about the potential performance issues from dealing with large amounts of text.
TextMesh Pro Documentation - The TextMesh Pro Documentation has some tools for finding word wrap points, but I haven't figured out how to implement a means of comparing this to an anchor position of another object.
This can be accomplished with TextMeshPro's "Linked" overflow mode. See attached picture for an example. Essentially, you'll need to make two TMP objects and adjust the layout for each of them appropriately. Then:
1) change the overflow mode of the first one to "Linked" using the dropdown in the inspector.
2) place the second TMP object as the reference in the field that appears.

How to create a rectangle over camera preview

I am working on face recognition project. I want to create a rectangle over camera preview so that a person can adjust his/her face in that box before taking an image. Is it possible with any method? I have searched but haven't got any help of rectangle, people have written text and have used images.

Build Iphone app that can recognise colour from streaming camera

I am building an iphone app to recognise a specific colour through the iphone camera when placed onto a colour board.
Note that I want it to work through the streaming camera output not just a still image or photo.
My initial thoughts were to scan series of pixels (say 4 on each corner of the camera feed) and if the colours registered in each pixel match, then display colour (in text) to user.
Can someone please point me in the right direction as far as example code or API or even if there is a better design solution to the problem.