-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tutorial for unicode support in pcl visualizer #4717
Comments
We definitely need more information to help you. In which way does it not work? Do you see an error message? A larger snippet of your code would be helpful. What PCL version do you use and how did you install it? What operating system do you use? |
@jiaobinbin152 If you mean that Chinese cannot be displayed (nothing), my experience in displaying Chinese on actor2d tells me that you can use the following code to convert string to utf8, and you need to set the font file. But for 3D text display, you can try it, I am not sure if it is feasible. Conversion function
Set font file
|
PCL version : 1.10.1 don't find "我是谁" and no error message |
Thanks WangZP10969 about PointSetToLabelHierarchy,I don't konw how to use? I'm only use PCLVisualizer。 |
@jiaobinbin152 But I don’t see "str" being used, the string after string_To_UTF8 conversion needs to be added If you add it, the display becomes a question mark "?", then I think you need to find a way to set the fontfile. |
@WangZP10969 This is quite a good writeup. Could you clean the code a bit, and add that as a tutorial? |
@kunaltyagi In fact, this is my experience of using VTK to display Chinese, and I currently have no experience using PCL for display. There are two points to note when displaying Chinese in VTK:
1.string_to_utf8, use this function for conversion
2.The code for displaying TextActor in vtk is for reference only, I don’t know what the corresponding display method is in PCL.
|
I referenced the method in the blog and modified addText3D. Currently, the white text can be displayed, but I have no idea how to modify the color. Modifications in pcl_visualizer.hpp:
change into
The test program code is as follows:
|
Again Thanks WangZP10969 . This issue has sloved. |
Original issue:
addText3D(std::string("我是谁"),position,1,255,0,0,"cubeTrackId");
don‘t work!
We can add a simple tutorial for unicode visualization (UTF-8, etc.). Starting link
The text was updated successfully, but these errors were encountered: