Last updated:
0 purchases
region of interest
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';
copied to clipboard
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.
},
)
copied to clipboard
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);
},
)
copied to clipboard
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);
},
)
copied to clipboard
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,
),
),
);
},
)
copied to clipboard
See Example for full implementation.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.