Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in the Android camera-calibration sample #24612

Closed
4 tasks done
AleksandrPanov opened this issue Nov 28, 2023 · 2 comments
Closed
4 tasks done

Crash in the Android camera-calibration sample #24612

AleksandrPanov opened this issue Nov 28, 2023 · 2 comments

Comments

@AleksandrPanov
Copy link
Contributor

AleksandrPanov commented Nov 28, 2023

System Information

The latest version OpenCV version was used

devices:

  • Huawei P20 Pro, EMUI 12.0.0, (Android 10?)
  • Xiaomi Mi 8, Android 10, MIUI 12.0.3

Detailed description

The problem may be related to android/ndk#289

Problem in findCirclesGrid() call, this func throw error:

2023-11-28 20:06:07.539  9151-9233  cv::error()             org...ncv.samples.cameracalibration  E  OpenCV(4.8.0-dev) Error: No Error (samples is empty) in filterOutliersByDensity, file ../../modules/calib3d/src/circlesgrid.cpp, line 1098
2023-11-28 20:06:07.541  9151-9233  libc                    org...ncv.samples.cameracalibration  A  Fatal signal 11 (SIGSEGV), code 2

Problem in this code:

if (samples.empty())
    CV_Error( 0, "samples is empty" );

This CV_Error( 0, "samples is empty" ); is located in try/catch block, but in this Android sample and my device this causes crash anyway.

The error is not reproduced on all devices.

error_logs.txt

Steps to reproduce

Build with build_sdk.py

export ANDROID_NDK_HOME=/Android/Sdk/ndk/18.1.5063045/
export ANDROID_SDK=/Android/Sdk/
python /opencv/platforms/android/build_sdk.py /opencv/build/ /home/alexander/all/opencv/opencv --ndk_path /Android/Sdk/ndk/18.1.5063045/ --sdk_path /Android/Sdk/ --config /opencv/platforms/android/ndk-18-api-level-21.config.py

run camera-calibration sample

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)
@AleksandrPanov
Copy link
Contributor Author

The problem is solved by using a newer version of NDK (NDK 25.2.9519653 was tested).

@AleksandrPanov
Copy link
Contributor Author

Use a newer version of NDK (25.2.9519653+) to avoid problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant