adityaarora1 / LiveEdgeDetection

LiveEdgeDetection is an Android document detection library built on top of OpenCV. It scans documents from camera live mode and allows you to adjust crop using the detected 4 edges and performs perspective transformation of the cropped image. It works best with a dark background.
354 stars 126 forks source link

Bad quality of image #17

Closed AlexanderBykin closed 1 year ago

AlexanderBykin commented 5 years ago

Hi After the photo is taken it is have poor quality, how to improve the quality? Impossible to read text

AlexanderBykin commented 5 years ago

Here is image taken with this library, i think it is very bad idea to resize resulting image to Display resolution as it did in this library LiveEdgeDetection bad quality

pavlo-hrytsiuk commented 5 years ago

Hello I found that picture size set at ScanSurfaceView in surfaceChanged method, I changed it on: // Camera.Size size = ScanUtils.determinePictureSize(camera, parameters.getPreviewSize()); Camera.Size size2 = ScanUtils.getOptimalPictureSize(camera, width, height, parameters.getPreviewSize());

it works better

AlexanderBykin commented 5 years ago

@PavloHrytsiuk thanks neighbour :)

alexxrealpee commented 5 years ago

@AlexanderShniperson @PavloHrytsiuk Can the resolution of the image be further improved? I'm looking to scan documents in small print, thanks.

Kampijo commented 5 years ago

@alexxrealpee in onPictureClicked callback, it resizes the image based on the width and height of the window. If you want a high quality image, it's best to remove that line. You could also change the way its saving into internal directory as it currently compresses in JPEG format.

zakblacki commented 4 years ago

@alexxrealpee in onPictureClicked callback, it resizes the image based on the width and height of the window. If you want a high quality image, it's best to remove that line. You could also change the way its saving into internal directory as it currently compresses in JPEG format.

what do you mean by that how do I do that ?

adityaarora1 commented 1 year ago

Image size can be customized as suggested by @Kampijo