Skip to content

Latest commit

 

History

History
87 lines (66 loc) · 2.9 KB

README.md

File metadata and controls

87 lines (66 loc) · 2.9 KB

region_of_interest

The region_of_interest Flutter package empowers developers to effortlessly define regions of interest on a live camera view, enabling automatic calculation of precise bounding box coordinates. Designed for simplicity and versatility, this package streamlines the process of capturing image datasets easily with portable mobile devices.

Platform Support

More platforms will be added soon!

Android iOS

Usage and Usecases

First import Package

import 'package:region_of_interest/region_of_interest.dart';
  1. Basic Usage - Capturing Images with Defined Region

To capture images within a defined region on the camera view, use the CaptureRegionWidget. This widget allows users to specify the camera and callback for handling captured images and bounding box coordinates.

CaptureRegionWidget(
  camera: //provide your camera description,
  callback: (Uint8List originalImage, Uint8List imageWithBoundingBox, BoundingBox regionOfInterest) {
    // Handle the captured images and bounding box as needed
    // Example: Display images, send to server, etc.
  },
)
  1. Sending to Server - Utilizing Captured Images and Bounding Box
CaptureRegionWidget(
  camera: //provide your camera description,
  callback: (Uint8List originalImage, Uint8List imageWithBoundingBox, BoundingBox regionOfInterest) {
    // Handle the captured images and bounding box by sending them to a server
    // Example: Send images and bounding box data to your server
    YourServerCommunication.sendData(originalImage, imageWithBoundingBox, regionOfInterest);
  },
)
  1. Generating Dataset - Creating a Dataset on device with Original Images and Bounding Boxes
CaptureRegionWidget(
  camera: //provide your camera description,
  callback: (Uint8List originalImage, Uint8List imageWithBoundingBox, BoundingBox regionOfInterest) {
    // Handle the captured images and bounding box for generating a dataset
    // Example: Save images and bounding box coordinates for dataset creation
    YourDatasetGenerator.saveData(originalImage, regionOfInterest);
  },
)
  1. Displaying Images - Using DisplayPictureScreen to view captured Images for Region
CaptureRegionWidget(
  camera: //provide your camera description,
  callback: (Uint8List originalImage, Uint8List imageWithBoundingBox, BoundingBox regionOfInterest) {
    // Handle the captured images and bounding box as needed
    // Example: Display the original image and image with bounding box
    Navigator.push(
      context,
      MaterialPageRoute(
        builder: (context) => DisplayPictureScreen(
          originalImage: originalImage,
          imageWithBoundingBox: imageWithBoundingBox,
          boundingBox: regionOfInterest,
        ),
      ),
    );
  },
)

See Example for full implementation.