camera_360 1.0.3 copy "camera_360: ^1.0.3" to clipboard
camera_360: ^1.0.3 copied to clipboard

This plugin allows the users to take 360 Panoramic Images using the phone's Camera. It uses OpenCV to stitch the images together.

360 Camera #

This plugin allows the users to take 360 Panoramic Images using the phone's Camera. It uses OpenCV to stitch the images together. A simple UI guides the user throughout the process, by displaying dots on the screen that the user should follow.

Demo #

Checkout Tridiar - Virtual Tours application on iOS and Android

[Demo]

Installation #

IOS #

Add these lines into Info.plist

<key>NSCameraUsageDescription</key>
<string>This application needs access to your Camera in order to capture 360 Images</string>
<key>NSMicrophoneUsageDescription</key>
<string>This application needs access to your Microphone in order to capture videos</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This application needs access to your Photo Library in order to save the captured images</string>

Android #

Attention when building release versions since OpenCV has been built for different CPUS we recommend running this command to build multiple APKs:

flutter build apk --split-per-abi --release

Change the minimum Android sdk version to 21 (or higher) in your android/app/build.gradle file.

minSdkVersion 21

AndroidManifest.xml

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Dart #

import 'package:camera_360/camera_360.dart';
import 'package:image_picker/image_picker.dart';
Camera360(
  // Preparing panorama text
  userLoadingText: "Preparing panorama...",
  userHelperText: "Point the camera at the dot",
  // Suggested key for iPhone >= 11 is 2 to select the wide-angle camera
  // On android devices 0 is suggested as at the moment Camera switching is not possible on android
  userSelectedCameraKey: 2,
  // Camera selector Visibilitiy
  cameraSelectorShow: true,
  // Camera selector Info Visibilitiy
  cameraSelectorInfoPopUpShow: true,
  // Camera selector Info Widget
  cameraSelectorInfoPopUpContent: const Text(
    "Select the camera with the widest viewing angle below.",
    textAlign: TextAlign.center,
    style: TextStyle(
      color: Color(0xffEFEFEF),
    ),
  ),
  onCaptureEnded: (data) {
    // Returned data will be a map like below
    //{
    //  'success': true or false
    //  'panorama': XFile or null,
    //  'options': {
    //    'selected_camera': int KEY,
    //    'vertical_camera_angle': int DEG,
    //  }
    //}
    if (data['success'] == true) {
      XFile panorama = data['panorama'];
      print("Final image returned $panorama.toString()");
    } else {
      print("Final image failed");
    }
  },
  onCameraChanged: (cameraKey) {
    print("Camera changed ${cameraKey.toString()}");
  },
  onProgressChanged: (newProgressPercentage) {
    debugPrint("'Panorama360': Progress changed: $newProgressPercentage");
  }),
),

onCaptureEnded will return XFile or null

  • XFile if the panorama has been captured successfully
  • null if the panorama has failed

Developer Documentation #

18
likes
0
points
224
downloads

Publisher

verified publishermax.al

Weekly Downloads

This plugin allows the users to take 360 Panoramic Images using the phone's Camera. It uses OpenCV to stitch the images together.

Repository (GitHub)
View/report issues

Topics

#camera #panorama

License

unknown (license)

Dependencies

camera, dchs_motion_sensors, ffi, flutter, flutter_native_image, image_picker, path_provider, plugin_platform_interface, shared_preferences, vector_math, wakelock_plus

More

Packages that depend on camera_360