RPi CM4 64 bit Bullseye platform question

173 views
Skip to first unread message

Horatio McDecibel

unread,
Mar 23, 2022, 1:31:58 PM3/23/22
to doubango-ai
Has anyone gotten the ultimateALPR modules running on the RPi 4 under Bullseye?

If so, can you direct me to any detailed installation directions?
I've done a git clone on the repository and tried following directions to the sample binaries but this isn't working.

Thank you.

Mamadou DIOP

unread,
Mar 23, 2022, 1:53:09 PM3/23/22
to Horatio McDecibel, doubango-ai
--
You received this message because you are subscribed to the Google Groups "doubango-ai" group.
To unsubscribe from this group and stop receiving emails from it, send an email to doubango-ai...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/doubango-ai/742e7b89-76e2-412d-80db-1cad5a131551n%40googlegroups.com.

Horatio McDecibel

unread,
Mar 23, 2022, 4:11:02 PM3/23/22
to Mamadou DIOP, doubango-ai
Thanks!  I should have realized that.  

So, in the /binaries/linux/aarch64 directory, the README file states to get the toolchain:

sudo apt-get update
sudo apt-get install gcc-aarch64-linux-gnu
sudo apt install g++-aarch64-linux-gnu

I've done that presumably to create the libultimate_alpr-sdk.so file.   
However, running the shell script:  python3 ../../../python/setup.py build_ext --inplace -v  exits with errors

python3 ../../../python/setup.py build_ext --inplace -v
Your platform: linux
running build_ext
building '_ultimateAlprSdk' extension
arm-linux-gnueabihf-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I../../../c++ -I/usr/include/python3.9 -c /home/pi/ultimateALPR-SDK/python/ultimateALPR-SDK-API-PUBLIC-SWIG_python.cxx -o build/temp.linux-armv7l-3.9/home/pi/ultimateALPR-SDK/python/ultimateALPR-SDK-API-PUBLIC-SWIG_python.o
In file included from /usr/include/string.h:495,
                 from /usr/include/python3.9/Python.h:30,
                 from /home/pi/ultimateALPR-SDK/python/ultimateALPR-SDK-API-PUBLIC-SWIG_python.cxx:150:
In function ‘char* strncpy(char*, const char*, size_t)’,
    inlined from ‘void SWIG_Python_FixMethods(PyMethodDef*, swig_const_info*, swig_type_info**, swig_type_info**)’ at /home/pi/ultimateALPR-SDK/python/ultimateALPR-SDK-API-PUBLIC-SWIG_python.cxx:6329:22,
    inlined from ‘PyObject* PyInit__ultimateAlprSdk()’ at /home/pi/ultimateALPR-SDK/python/ultimateALPR-SDK-API-PUBLIC-SWIG_python.cxx:6427:25:
/usr/include/arm-linux-gnueabihf/bits/string_fortified.h:106:34: warning: ‘char* __builtin_strncpy(char*, const char*, unsigned int)’ output truncated before terminating nul copying 10 bytes from a string of the same length [-Wstringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -Wl,-z,relro -g -fwrapv -O2 -g -ffile-prefix-map=/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.9/home/pi/ultimateALPR-SDK/python/ultimateALPR-SDK-API-PUBLIC-SWIG_python.o -L. -lultimate_alpr-sdk -o /home/pi/ultimateALPR-SDK/binaries/linux/aarch64/_ultimateAlprSdk.so
./libultimate_alpr-sdk.so: file not recognized: file format not recognized
collect2: error: ld returned 1 exit status
error: command '/usr/bin/arm-linux-gnueabihf-gcc' failed with exit code 1



Mamadou DIOP

unread,
Mar 23, 2022, 4:45:45 PM3/23/22
to Horatio McDecibel, doubango-ai
No, the link doesn’t states to get the toolchain it just gives information about the toolchain used to cross-compile the library. The library is cross-compiled on x86 machine and you must not install the toolchain on your RPI devices. Just the regular GCC/G++. To make it clear, we don’t build RPI or Jetson or any embedded device library on a device but on a x86_64 Linux server using cross-compilation as it’s faster and easier. We provide information about the toolchain used.

Also, you don’t have to and cannot build “libultimate_alpr-sdk.so”, it’s already at https://github.com/DoubangoTelecom/ultimateALPR-SDK/blob/master/binaries/linux/aarch64/libultimate_alpr-sdk.so

Your logs show that “arm-linux-gnueabihf-gcc” is being used. This is a 32-bit toolchain and I don’t know why you have it on a 64-bit platform. My theory is that you first tried the 32-bit binaries and installed the toolchain based on https://github.com/DoubangoTelecom/ultimateALPR-SDK/tree/master/binaries/raspbian/armv7l (again, the link doesn’t states to install it), then you installed the 64-bit toolchain based on https://github.com/DoubangoTelecom/ultimateALPR-SDK/tree/master/binaries/linux/aarch64

You MUST NOT INSTALL any toolchain on your RPI, remove them ALL. You mus not hava any ‘YYY-linux-XXXX-gcc’ or ‘YYY-linux-XXXX-gcc’. Install GCC and G++ as usual and they should be available as “gcc” or “g++" 

Mamadou DIOP

unread,
Mar 23, 2022, 4:58:13 PM3/23/22
to Horatio McDecibel, doubango-ai
To clarify: you're cross-compiling for ARM32 target on an ARM64 host. Go back from a clean sdcard

Our software is very easy to use on RPI or any Linux: don't install anything just to a git clone and that's it. Most devices already come with gcc/g++ and that's required only if you want to rebuild the samples or the Python extension.



Sent from my Galaxy

Horatio McDecibel

unread,
Mar 24, 2022, 3:24:16 PM3/24/22
to Mamadou DIOP, doubango-ai
Ok, thanks.  I started from scratch and have it working now.  Well at least the benchmarking program.    

Any examples of reading direction from the mipi camera on the rPI ?

Mamadou DIOP

unread,
Mar 24, 2022, 3:44:30 PM3/24/22
to Horatio McDecibel, doubango-ai

what do you mean by "Any examples of reading direction from the mipi camera on the rPI ?"?

Horatio McDecibel

unread,
Mar 24, 2022, 4:31:55 PM3/24/22
to Mamadou DIOP, doubango-ai
I mean using the raspberry pi camera connected to the CSI bus ex:  https://www.arducam.com/use-almost-any-mipi-camera-module-on-raspberry-pi/ 
Many of these cameras can then be outfit with lenses of various focal lengths.    So I'm seeking code to implement real time image grabbing rather than reading from jpg files

Thank You,

Mamadou DIOP

unread,
Mar 24, 2022, 4:43:47 PM3/24/22
to Horatio McDecibel, doubango-ai

We only provided an ANPR SDK that accept an image as input and returns the result as JSON string. We do not provide code on how to read images from a camera, an rtsp stream... as it's out of scoop.

It's pretty easy to read images from a camera using OpenCV (https://www.doubango.org/SDKs/anpr/docs/Getting_started.html#opencv), FFmpeg (https://www.doubango.org/SDKs/anpr/docs/Getting_started.html#ffmpeg), Gstreamer or writing your own v4l implementation (https://github.com/DoubangoTelecom/doubango/blob/master/tinyDAV/src/video/v4linux/tdav_producer_video_v4l2.c).

We do not provide support on these subjects.

Horatio McDecibel

unread,
Mar 24, 2022, 4:47:04 PM3/24/22
to Mamadou DIOP, doubango-ai
Running the recognizer demo is impressive since it captured 3 plates in this file.   
However, I'm surprised that the primary plate's last digit was not able to be determined properly.
I've attached the jpg file and the results output string.

results.txt
plate18.JPG

Mamadou DIOP

unread,
Mar 24, 2022, 4:51:40 PM3/24/22
to Horatio McDecibel, doubango-ai
Reply all
Reply to author
Forward
0 new messages