I am trying to use ippiRemap from intel IPP library shared object (libipp.so). by installing ipp using conda.
conda install -c intel ipp
The library shared object files are installed in the environment directory. When trying to use ippiRemap
function for image processing with python ctypes
import ctypes
ipp = ctypes.cdll.loadLibrary('libippi.so')
ippiRemap = ipp.ippiRemap
I got the error undefined symbol: ippiRemap
. However, this is might be due to name mangling of function symbol names by C++.
Trying readelf
command I got the following output:
$ readelf -D --symbol /home/user_name/anaconda3/envs/env_name/lib/libippi.so |grep -E "FUNC.*GLOBAL.*ippIRemap.*"
376: 000000000006a180 32 FUNC GLOBAL DEFAULT 10 ippiRemap_16s_AC4R
663: 000000000006a100 32 FUNC GLOBAL DEFAULT 10 ippiRemap_16u_AC4R
685: 000000000006a080 32 FUNC GLOBAL DEFAULT 10 ippiRemap_8u_AC4R
773: 000000000006a120 32 FUNC GLOBAL DEFAULT 10 ippiRemap_16s_C1R
862: 000000000006a140 32 FUNC GLOBAL DEFAULT 10 ippiRemap_16s_C3R
910: 000000000006a020 32 FUNC GLOBAL DEFAULT 10 ippiRemap_8u_C1R
920: 000000000006a160 32 FUNC GLOBAL DEFAULT 10 ippiRemap_16s_C4R
1028: 000000000006a040 32 FUNC GLOBAL DEFAULT 10 ippiRemap_8u_C3R
1079: 000000000006a060 32 FUNC GLOBAL DEFAULT 10 ippiRemap_8u_C4R
1433: 000000000006a200 32 FUNC GLOBAL DEFAULT 10 ippiRemap_32f_AC4R
1794: 000000000006a280 32 FUNC GLOBAL DEFAULT 10 ippiRemap_64f_AC4R
1866: 000000000006a0a0 32 FUNC GLOBAL DEFAULT 10 ippiRemap_16u_C1R
1985: 000000000006a0c0 32 FUNC GLOBAL DEFAULT 10 ippiRemap_16u_C3R
2049: 000000000006a0e0 32 FUNC GLOBAL DEFAULT 10 ippiRemap_16u_C4R
2424: 000000000006a220 32 FUNC GLOBAL DEFAULT 10 ippiRemap_64f_C1R
2451: 000000000006a1a0 32 FUNC GLOBAL DEFAULT 10 ippiRemap_32f_C1R
2523: 000000000006a240 32 FUNC GLOBAL DEFAULT 10 ippiRemap_64f_C3R
2562: 000000000006a1c0 32 FUNC GLOBAL DEFAULT 10 ippiRemap_32f_C3R
2585: 000000000006a260 32 FUNC GLOBAL DEFAULT 10 ippiRemap_64f_C4R
2615: 000000000006a1e0 32 FUNC GLOBAL DEFAULT 10 ippiRemap_32f_C4R
trying one of symbol names works.
>> ippiRemap = ipp.ippiRemap_16s_AC4R
>> ippiRemap
<_FuncPtr object at 0x7fc277ba2c80>
So my question what is difference between each symbol name, are they the same function? is there a standard way to use it with ctypes
?
I just refer to documentation for ippiRemap function in intel ipp. I don't have much experience with it. however, I would like to share this solution on how to interface with this function using ctypes from python. So, as far as I understand ippiRemap had several versions (It might not be name mangling as I mentioned in My question). So, this was the documentation from Intel.
so as long as I use a single channel grey microscopic image, I used
ippiRemap_8u_C1R
for single channel-raw major-uint_8 image.