I'm trying to display text in rviz. I have used visualization_msgs/Marker TEXT_VIEW_FACING type, but in this case text always appears oriented correctly to the view. However I would like to display text in the same way as LINE_STRIP does, without dynamic orientation regard to the view.
I have thought in convert each character into LINE_STRIP (i.e. x,y,z spatial figure) but I would have to develop a template for each character.
Is there any tool that makes this for me? Or is there any other way to address this? Thank you in advance
Related
Recently I wanted to make a script which could convert images into game levels (the game is Antiyoy online), the game can give out levels in a special text form which makes them easy to edit just by changing specific text.
I am rather begginer to Python and don't know much yet. I didn't start doing anything yet because I can't figure out which module should I use for the task of the image reading. I want for it to read the color of a chosen pixel on the image (and average out the color of multiple pixels for scaling if possible) and give out it in hex or other form in which I can convert it to the color closest to the ones selected by me.
Doing some research I'm pretty sure NumPy can do this but I have no experience with it and there are probably more specialized modules for this.
If what am I asking for is hard to understand I'm open for questions, thank you in advance.
I want to define an rectangular area on top of an image, that has got a specific width and a specific height and in which a text should be pasted. I want the text to stay inside of this text field. If the text is longer, its size should be decreased and at one point it should be converted into a multiline text. How can I define such a text field using Pillow in python3?
I am looking for a clean and minimalist solution.
Sadly, I have no idea how to do this, since I am very new to python. I also didn't find any helpful and fitting information on how to do this, in the Internet. Thanks in advance!
I'm working on a project to help my visually impaired friend, a python script will first take a screenshot every second and whatever is on the image will be converted to text, and the character which is nearest to the coordinate of curser, will be the output.
User can move the curser anywhere on screen and nearest alphabet to curser will be the output of program.
Don't worry about the form of output, it will be in form audio. But for the sake of simplicity of question lets assume it's in the form of a single character text.
Every tutorial I could find explained how to use OCR dependencies just to convert all the text to a continuous text file.
For my particular application, each alphabet will be associated with a specific co-ordinate. But I just couldn't find a single resource to learn how to identify the location of converted character on the image.
Please enlighten me how to extract the coordinates of a character from an image.
This is a good project. But I think it is a chicken-and-egg problem. You need to have OCR performed by a capable OCR engine (most don't provide coordinates) and the result will have the text and associated coordinates. Your question "how to extract the coordinates of a character from an image" means perform OCR and get coordinates. If performing zonal OCR, i.e. Not the entire screen, you need to know what zone to OCR, and establishing this zone to make sure it includes all necessary text around your mouse location in that zone is probably the biggest challenge. My company at www.wisetrend.com builds such OCR-specialized projects per case. We'll be glad to help in this non-commercial project if you'd like to work jointly.
I have a set of tubes representing boreholes in a vtp-file (written by vtkXMLPolyDataWriter). Now for clarity I would like to add text labels to identify the boreholes when displaying them in paraview.
My idea was to create labels with vtkTextActor3D, to convert these actors to polydata, and then output these labels, split into polygons, to a vtp-file with the polydatawriter.
How can I do this? In paraview I was able to create a 3D Text source and save it to a vtp-file. However, I can't figure out how to do this in python.
Thanks!
I think to do it the way you described you should actually use vtkVectorText instead of vtkTextActor3D, because accroding to the documentation for vtkTextActor3D, it works like this: The input text is rendered into a buffer, which in turn is used as a texture applied onto a quad (a vtkImageActor is used under the hood). So you actually don't get any geometry for individual characters of your text, instead you would have to save the texture and display that in paraview. Meanwhile, vtkVectorText should (I've never used it personally...) produce an actual geometry for your characters so you can save them as any other polydata.
I have all the characters of a font rendered in a PNG. I want to use the PNG for texture-mapped font rendering in OpenGL, but I need to extract the glyph information - character position and size, etc.
Are there any tools out there to assist in that process? Most tools I see generate the image file and glyph data together. I haven't found anything to help me extract from an existing image.
I use the gimp as my primary image editor, and I've considered writing a plugin to assist me in the process of identifying the bounding box for each character. I know python but haven't done any gimp plugins before, so that would be a chore. I'm hoping something already exists...
Generally, the way this works is you use a tool to generate the glyph images. That tool will also generate metric information for those glyphs (how big they are, etc). You shouldn't be analyzing the image to find the glyphs; you should have additional information alongside your glyphs that tell where they are, how big they should be, etc.
Consider the letter "i". Depending on the font, there will be some space to the left and right of it. Even if you have a tool that can identify the glyph "i", you would need to know how many pixels of space the font put to the left and right of the glyph. This is pretty much impossible to do accurately for all letters. Not without some very advanced computer vision algorithms. And since the tool that generated those glyphs already knew how much spacing they were supposed to get, you would be better off changing the tool to write the glyph info as well.
You can use PIL to help you automate the process.
Assuming there is at least one row/column of background colour separating lines/characters, you can use the Image.crop method to check each row (and then each column of the row) if it contains only the background colour; thus you get the borders of each character.
Ping if you need further assistance.