Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Segmentation Fault when attempting to import cv2 in Python 3

Hi, I'm trying to use OpenCV 4.1.0, cross-compiled for armv6l from source with Python 3. When I try to import cv2 in Python, I receieve a Segementation fault and the Python interpreter is closed. Also, I recieve errors about Python not being able to find OpenCV .so files if I do not run ldconfig.

cmake -D CMAKE_BUILD_TYPE=Release \
    -D CMAKE_INSTALL_PREFIX="${ROOTFS_DIR}/usr/local" \
    -D CMAKE_TOOLCHAIN_FILE=../platforms/linux/arm-gnueabi.toolchain.cmake \
    -D OPENCV_ENABLE_NONFREE=ON \
    -D PYTHON3_INCLUDE_PATH=/usr/include/python3.7m \
    -D PYTHON3_LIBRARIES=/usr/lib/arm-linux-gnueabihf/libpython3.7m.so \
    -D PYTHON3_NUMPY_INCLUDE_DIRS=/usr/lib/python3/dist-packages/numpy/core/include \
    -D BUILD_opencv_python3=ON \
    -D PYTHON3_CVPY_SUFFIX='.cpython-37m-arm-linux-gnueabihf.so' \
    -D ENABLE_NEON=ON \
    -D ENABLE_VFPV3=ON \
    -D WITH_GTK=OFF \
    -D BUILD_TESTS=OFF \
    -D BUILD_DOCS=OFF \
    -D BUILD_EXAMPLES=OFF \
    -D BUILD_PERF_TESTS=OFF \
    -B "${CV_DIR}/build/" \
    -S "${CV_DIR}"

CMake Output: https://ikl.sh/c6d6 Make Output: https://ikl.sh/oQTA Make Install Output: https://ikl.sh/QDrB

Thanks :)

Segmentation Fault when attempting to import cv2 in Python 3

Hi, I'm trying to use OpenCV 4.1.0, cross-compiled for armv6l from source with Python 3. When I try to import cv2 in Python, I receieve a Segementation fault and the Python interpreter is closed. Also, I recieve errors about Python not being able to find OpenCV .so files if I do not run ldconfig.

cmake -D CMAKE_BUILD_TYPE=Release \
    -D CMAKE_INSTALL_PREFIX="${ROOTFS_DIR}/usr/local" \
    -D CMAKE_TOOLCHAIN_FILE=../platforms/linux/arm-gnueabi.toolchain.cmake \
    -D OPENCV_ENABLE_NONFREE=ON \
    -D PYTHON3_INCLUDE_PATH=/usr/include/python3.7m \
    -D PYTHON3_LIBRARIES=/usr/lib/arm-linux-gnueabihf/libpython3.7m.so \
    -D PYTHON3_NUMPY_INCLUDE_DIRS=/usr/lib/python3/dist-packages/numpy/core/include \
    -D BUILD_opencv_python3=ON \
    -D PYTHON3_CVPY_SUFFIX='.cpython-37m-arm-linux-gnueabihf.so' \
    -D ENABLE_NEON=ON \
    -D ENABLE_VFPV3=ON \
    -D WITH_GTK=OFF \
    -D BUILD_TESTS=OFF \
    -D BUILD_DOCS=OFF \
    -D BUILD_EXAMPLES=OFF \
    -D BUILD_PERF_TESTS=OFF \
    -B "${CV_DIR}/build/" \
    -S "${CV_DIR}"

CMake Output: https://ikl.sh/c6d6 https://ikl.sh/c6d6

Make Output: https://ikl.sh/oQTA https://ikl.sh/oQTA

Make Install Output: https://ikl.sh/QDrB

Thanks :)

Segmentation Fault when attempting to import cv2 in Python 3

Hi, I'm trying to use OpenCV 4.1.0, cross-compiled for armv6l from source with Python 3. When I try to import cv2 in Python, I receieve a Segementation fault and the Python interpreter is closed. Also, I recieve errors about Python not being able to find OpenCV .so files if I do not run ldconfig.

cmake -D CMAKE_BUILD_TYPE=Release \
    -D CMAKE_INSTALL_PREFIX="${ROOTFS_DIR}/usr/local" \
    -D CMAKE_TOOLCHAIN_FILE=../platforms/linux/arm-gnueabi.toolchain.cmake \
    -D OPENCV_ENABLE_NONFREE=ON \
    -D PYTHON3_INCLUDE_PATH=/usr/include/python3.7m \
    -D PYTHON3_LIBRARIES=/usr/lib/arm-linux-gnueabihf/libpython3.7m.so \
    -D PYTHON3_NUMPY_INCLUDE_DIRS=/usr/lib/python3/dist-packages/numpy/core/include \
    -D BUILD_opencv_python3=ON \
    -D PYTHON3_CVPY_SUFFIX='.cpython-37m-arm-linux-gnueabihf.so' \
    -D ENABLE_NEON=ON \
    -D ENABLE_VFPV3=ON \
    -D WITH_GTK=OFF \
    -D BUILD_TESTS=OFF \
    -D BUILD_DOCS=OFF \
    -D BUILD_EXAMPLES=OFF \
    -D BUILD_PERF_TESTS=OFF \
    -B "${CV_DIR}/build/" \
    -S "${CV_DIR}"

CMake Output: https://ikl.sh/c6d6

Make Output: https://ikl.sh/oQTA

Make Install Output: https://ikl.sh/QDrB

Thanks :)

EDIT: I can't answer my own question since I'm a new user.

The issue was that I was trying to use QEMU for the ARM target. It turns out it runs just fine on real hardware.