I’m writing some text on the screen using a NvOSD_TextParams txt_params structure.
when i left align it to something i can set:
txt_params->x_offset = obj_meta->rect_params.left;
txt_params->y_offset = obj_meta->rect_params.top;
however if i want to right align it then i need to do something like:
txt_params->x_offset = obj_meta->rect_params.left + obj_meta->rect_params.width - txt_params->width;
except that txt_params->width is not available.
is there a different way to right align the text ?
Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU)
• DeepStream Version
• JetPack Version (valid for Jetson only)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs)
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)
This is just a question about the API onscreen display API NVIDIA DeepStream SDK API Reference: On-Screen Display API
but anyway here are the details. I hope it helps you with answering the question about the API.
Issue Type: question
so the question is how to right align text NVIDIA DeepStream SDK API Reference: _NvOSD_TextParams Struct Reference if i can’t ask for the width of the TextParam.
Can you share more on the requirement in your use case? Why it benefit your use case?
i have 2 bits of text that i want to show if the inference detects something.
on the left of a persons face i want to show ‘on phone’ and on the right ‘facemask’ (detected)
│ on phone │ │ facemask │
│ ,─' '─. │
│ ,' `. │
│ ╱ ╲ │
│ ; : │
│ ; . . : │
│ ; ( ) ( ) : │
│ │ ' ' │ │
│ │ │ │ │
│ : │ ; │
│ : ▼ ; │
│ : ; │
│ ╲ ──┐ ┌─── ╱ │
│ ╲ └───┘ ╱ │
│ `. ,' │
│ '─. ,─' │
│ `─────' │
and because the face changes inside the image, i would like to draw it inside the face-box and have it left aligned for one text and right aligned for the other text.
Seems you can achieve your target with currently design. Right? Right align is one better to have feature. Right?
my question was if it was possible, then you ask what my use case is.
why don’t you just answer the question instead of passive aggressive “Right"s”?
i know i can make an ugly solution with the current api, i was just expecting a bit more from nvidia and nvidia support, that is all.
I want to conform if the feature blocked you. I also want to know the use case to understand if it is one valueable feature we can add it in following DS release. Thanks for your sharing.
so to get back to the original question:
can you confirm that there currently is no way to find out either the width of the text ? or is there a different way to right align text ?
No. We do not provide such functions now.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.