Aman-zishan / DocScanner

:fire:Document Scanner and PDF Creator app
GNU General Public License v3.0
81 stars 27 forks source link

Add feature -> Edge detection and crop #13

Open Aman-zishan opened 4 years ago

Aman-zishan commented 4 years ago

AS of now the app simply converts the captured image to pdf without scaling or cropping. It would be better to add a crop option and edge detection feature while scanning documents.

Probably we will need to add a new screen with the preview of image and then processsing the new cropped or scaled image to generate pdf page.

Amitbhave commented 4 years ago

@Aman-zishan do you have anything in mind what should be used for edge detection? For image crop, I was thinking to use image_cropper plugin.

Aman-zishan commented 4 years ago

@Aman-zishan do you have anything in mind what should be used for edge detection? For image crop, I was thinking to use image_cropper plugin.

There is edge detection plugin too, the problem is to split the logic into different processes and implement the idea. As of now the camera takes a pic and goes directly to share and print so we have to create a new preview screen which triggers for this edge detection and crop . This screen should also be triggered when users switch to greyscale or multi image capture/picker mode(which will be implemented later #11 and #10)

Amitbhave commented 4 years ago

Sure, can I work on this?

Aman-zishan commented 4 years ago

Sure, can I work on this?

Are you implementing the same logic? Please do share a Screenshot while opening a PR too. Thank you!

Amitbhave commented 4 years ago

Will it be okay, if we do edge detection at the time of capturing the image only?

Aman-zishan commented 4 years ago

Will it be okay, if we do edge detection at the time of capturing the image only?

As in whenever the camera is used right, umm that would be ok i guess cause if we make use of crop for images thats uploaded from gallery there isnt a requirement for edge detection. Yeah that would do

Amitbhave commented 4 years ago

There is this issue with edge_detection package. https://github.com/sawankumarbundelkhandi/edge_detection/issues/20

Aman-zishan commented 4 years ago

There is this issue with edge_detection package. sawankumarbundelkhandi/edge_detection#20

Did you try in a physical device?

Have you made a good amount of progress?. Then i guess we can open a new branch and work on this in that branch?. So we both can try and fix

I have created a new branch maybe you can PR to this branch so that i can look into it.

Amitbhave commented 4 years ago

Why do you need new branch? I have forked your repo.. While raising PR, I will attach screenshots as well don't worry.

Aman-zishan commented 4 years ago

Oh cool then..i thought you were stuck at that error so we could work on it in that branch

sawankumarbundelkhandi commented 4 years ago

@Aman-zishan @Amitbhave Please try using the plugin on a real device. I have never tested the edge_detection plugin on the emulator.

Aman-zishan commented 4 years ago

@Aman-zishan @Amitbhave Please try using the plugin on a real device. I have never tested the edge_detection plugin on the emulator.

Yeah saw a lot of issues with emulators while using this package.

Amitbhave commented 4 years ago

@Aman-zishan so should we be using this package or not as it doesn't work on emulator?

Aman-zishan commented 4 years ago

@Aman-zishan so should we be using this package or not as it doesn't work on emulator?

I'm actually using a physical device. Can you use one too

Amitbhave commented 4 years ago

@Aman-zishan you can go ahead with this using actual physical device.

Aman-zishan commented 4 years ago

?? what happened

Amitbhave commented 4 years ago

Actually I prefer to use emulator only for testing rather than using my own device.

Aman-zishan commented 4 years ago

No problem

Prakhar314 commented 4 years ago

Can I work on this? I am thinking of using this plugin. It is using opencv using dart:ffi. The example there has an implementation of edge detection and crop. Maybe we can add some filters as well, using this.

Aman-zishan commented 4 years ago

Yes sure

Aman-zishan commented 4 years ago

Hey @Prakhar314 , we have already implemented crop feature would be better if you work on edge detection

Prakhar314 commented 4 years ago

I'm sorry, I won't be able to work on this any time soon.