I want to scan driving license of a person like the gif below from my flutter app: The gif can be found here: Image Url
I looked for packages similar to the above image but did not find anything that might suit my needs. I also tried implementing object detection to detect the card object. It could detect the object but I could not implement the edge detection which will detect edges like the image and then take the picture. I would appreciate any sort of guidelines or direction on how I can achieve something like the image. Thanks in advance.
Update:
I am using object detection to get the boundingBox of the detected object.
final objects = await _objectDetector!.processImage(inputImage);
for (DetectedObject detectedObject in objects) {
final rect = detectedObject.boundingBox;
}
I have a square container inside a Stack widget, from which I get the boundingRegion of the square container.
The problem I am facing, as the CameraController has a resolution of (720*1280), The right offset and bottom offset of the object captured inside the square portion of the screen is always greater than my widgets offset position. The left and top offsets seems to be fine but because of the camera resolution to be greater than screen the bottom and right offsets never matches.