DocScanner icon indicating copy to clipboard operation
DocScanner copied to clipboard

Add feature -> Edge detection and crop

Open Aman-zishan opened this issue 3 years ago • 22 comments

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.

  • [ ] edge detection after image is captured

  • [x] crop option incase if edge detection fails to get the required outcome

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.

Aman-zishan avatar Oct 04 '20 19:10 Aman-zishan

@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.

Amitbhave avatar Oct 06 '20 05:10 Amitbhave

@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)

Aman-zishan avatar Oct 06 '20 05:10 Aman-zishan

Sure, can I work on this?

Amitbhave avatar Oct 06 '20 05:10 Amitbhave

Sure, can I work on this?

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

Aman-zishan avatar Oct 06 '20 05:10 Aman-zishan

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

Amitbhave avatar Oct 06 '20 05:10 Amitbhave

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

Aman-zishan avatar Oct 06 '20 06:10 Aman-zishan

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

Amitbhave avatar Oct 06 '20 16:10 Amitbhave

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.

Aman-zishan avatar Oct 06 '20 16:10 Aman-zishan

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

Amitbhave avatar Oct 06 '20 18:10 Amitbhave

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

Aman-zishan avatar Oct 06 '20 19:10 Aman-zishan

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

sawankumarbundelkhandi avatar Oct 07 '20 20:10 sawankumarbundelkhandi

@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.

Aman-zishan avatar Oct 08 '20 07:10 Aman-zishan

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

Amitbhave avatar Oct 09 '20 06:10 Amitbhave

@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

Aman-zishan avatar Oct 09 '20 06:10 Aman-zishan

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

Amitbhave avatar Oct 15 '20 07:10 Amitbhave

?? what happened

Aman-zishan avatar Oct 15 '20 07:10 Aman-zishan

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

Amitbhave avatar Oct 15 '20 07:10 Amitbhave

No problem

Aman-zishan avatar Oct 15 '20 07:10 Aman-zishan

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.

Prakhar314 avatar Oct 17 '20 10:10 Prakhar314

Yes sure

Aman-zishan avatar Oct 17 '20 13:10 Aman-zishan

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

Aman-zishan avatar Oct 24 '20 08:10 Aman-zishan

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

Prakhar314 avatar Oct 26 '20 12:10 Prakhar314