Jetson utils argument passing from C++ utils to Python

Can’t seem to see the argument correspondence (position & type) between the c++ util program and the python program like:
/home/my-name/jetson-inference/build/aarch64/bin/cuda-examples.py
having code like:
import jetson.utils
jetson.utils.cudaDrawLine(color_img, (25,150), (325,15), (255,0,200,200), 10)
color_img = input
(25,150) = x1,y1
(325,15) = x2,y2
(255,0,200 = color
200) = light transmission
10 = line width

and the C++ util programs:
/home/my-name/jetson-inference/utils/cuda/cudaDraw.cu & cudaDraw.h
having code like:
cudaError_t cudaDrawLine( void* input, void* output, size_t width, size_t height, imageFormat format, int x1, int y1, int x2, int y2, const float4& color, float line_width )

Where and what translates the positions between the calling python program and the util programs? Some
arguments seem missing from the calling python program .
I understands there is a program that decodes types between C++ and python but I don’t know if that’s in play here.

And yes this may be a basic C++ Python question. But if you could steer me in the right direction I’d appreciate it.

Which JetPack version and Jetson platform you’re using?

JetPack 4.6
Developer Kit with 4GB

Hi,

You can find the binding source below:

https://github.com/dusty-nv/jetson-utils/blob/master/python/bindings/PyCUDA.cpp#L1415

PyArg_ParseTupleAndKeywords(args, kwds, "O(ff)(ff)O|fO", kwlist, &pyInput, &x1, &y1, &x2, &y2, &pyColor, &line_width, &pyOutput)
...
PyCudaImage* input = PyCUDA_GetImage(pyInput);
PyCudaImage* output = PyCUDA_GetImage(pyOutput);
...
cudaDrawLine(input->base.ptr, output->base.ptr, input->width, input->height, input->format,
						    x1, y1, x2, y2, color, line_width)) )
...

The main difference is that the width, height and imageFormat information is retrieving from the pyInput variable directly.
You don’t need to feed these values in the python interface.

Thanks.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.