jhansireddy / AndroidScannerDemo

ScanLibrary is an android document scanning library built on top of OpenCV, using the app you will be able to select the exact edges and crop the document accordingly from the selected 4 edges and change the perspective transformation of the cropped image.
MIT License
1.07k stars 472 forks source link

Picture is not clear and cropping problem #133

Open arunkush opened 4 years ago

arunkush commented 4 years ago

Hello When I click the image and crop it which part i have crop that not showing in the app some different part show the app.

  1. when i save the picture and check it again it is not clear how i can in create picture quality.
jhansireddy commented 3 years ago

Agreed with the second issue of picture quality, but first issue I never experienced.

arunkush commented 3 years ago

What I can do for picture quality.

On Sun, 18 Oct, 2020, 7:27 pm Jhansi Karee, notifications@github.com wrote:

Agreed with the second issue of picture quality, but first issue I never experienced.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jhansireddy/AndroidScannerDemo/issues/133#issuecomment-711171590, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG7UKM7HWKEKMA25BID2S63SLLX4LANCNFSM4QLXCQKA .

OmkarSsawant commented 3 years ago

In Case , Your Image is Simply getting cropped then just change the following things :

In ScanFragment.java

change method

              private Bitmap scaledBitmap(Bitmap bitmap, int width, int height){
        Matrix m = new Matrix();
       m.setRectToRect(new RectF(0, 0, bitmap.getWidth(), bitmap.getHeight()), new RectF(0, 0, width, height),         Matrix.ScaleToFit.CENTER);
       return Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), m, false);

    }

to :

 private Bitmap scaledBitmap(Bitmap bitmap, int width, int height){
       return Bitmap.createScaledBitmap(bitmap,width,height,false);
    }
ashwinjawale24 commented 3 years ago

@arunkush @jhansireddy did you got resolution of improving image quality?