Skip to content

[Android] OpenCV stitching fails due to missing directory #10

@wojciechzahradnikdeviniti

Description

Hello,

During the execution of panorama stitching, the operation fails with an OpenCV error indicating that a required directory cannot be found. As a result, the app restarts due to failed stitching.

I'm using this branch: https://github.com/maxal-studio/flutter-plugin-camera360/tree/added-stitcher-settings

Logs:

OpenCV(4.8.0) Error: Requested object was not found (could not open directory: /data/app/.../base.apk!/lib/arm64-v8a) in glob_rec, file .../opencv-4.8.0/modules/core/src/glob.cpp, line 279
...
'Panorama360': Stitching failed  
'Panorama360': Restarting app reason: Stitching failed  

Code

static const _stitcherSettings = StitcherSettings(
    confidenceThreshold: 0.2,
    panoConfidenceThresh: 0.5,
    featureMatcherImageRange: -1,
    registrationResol: 0.6,
    featureMatcherType: FeatureMatcherType.homography,
    blenderType: BlenderType.multiband,
    waveCorrection: WaveCorrectionType.horizontal,
    featureDetectionMethod: FeatureDetectionMethod.orb,
  );
static const _userSelectedCameraKey = 2;
  static const _panoramaDataKey = 'panorama';

Camera360(
                    debugMode: kDebugMode,
                    userCapturedImageWidth: 1600,
                    userCapturedImageQuality: 95,
                    userNrPhotos: 12,
                    stitcherSettings: Camera360Screen._stitcherSettings,
                    userLoadingText: context.strings.camera360ScreenUserLoadingText,
                    userHelperText: context.strings.camera360ScreenUserHelperText,
                    userHelperTiltLeftText: context.strings.camera360ScreenUserHelperTiltLeftText,
                    userHelperTiltRightText: context.strings.camera360ScreenUserHelperTiltRightText,
                    userSelectedCameraKey: Camera360Screen._userSelectedCameraKey,
                    cameraSelectorShow: false,
                    cameraSelectorInfoPopUpShow: false,
                    cameraNotReadyContent: const SizedBox.shrink(),
                    onCaptureEnded: (data) {
                      final panorama = data[Camera360Screen._panoramaDataKey] as XFile?;
                      if (panorama != null) {
                        final file = File(panorama.path);
                        if (!file.existsSync()) {
                          context.showSnackBarMessage(
                            SnackBarMessage.failure(context.strings.camera360ScreenPanoramaFileNotFound),
                          );
                          return;
                        }
                        argument.onImageCaptured(file);
                        context.pop();
                      } else {
                        context.showSnackBarMessage(
                          SnackBarMessage.failure(context.strings.camera360ScreenPanoramaFailed),
                        );
                      }
                    },
                  )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions