allgood / OpenNoteScanner

Android application for scanning and manipulating handwritten notes and documents.
Other
1.36k stars 283 forks source link

Not getting the green square anymore #185

Open callegar opened 4 years ago

callegar commented 4 years ago

Today I have tried using open note scanner after some time, and to my surprise I cannot see the green square indicating the paper boundaries anymore.

I do not believe that the app itself received any update since the last time when it worked. Hence I must assume that something else has happened on my device breaking the app (a system update?)

I see the issue on a Moto G6 with android 9.

Any help in trying to understand what is going on? Would it make sense to add some self-check in the app to help recognize if something in the platform does not let the app work correctly?

cilynx commented 4 years ago

I've noticed related odd behavior developing recently as well. The green highlight flickers and jumps around a lot recently and autocapture no longer works. When pressing the capture button, I get the "press again for whole image" popup, and if I do I usually get a properly cropped document, but occasionally get the entire image. Running on a Note 9.

callegar commented 4 years ago

For me, the situation has gone back to normal in the last days. Wonder what the reason may have been. I have a feeling that flickering neon lighting may create issues with the border detection. If this is the case, for me the bug can be closed (and sorry for the noise).

allgood commented 4 years ago

Hi @callegar and @cilynx

@callegar there is not a chance that the green box mess with border detection, it is screen only, it doesn't change the image being analized.

One thing that may be happening is that the surface behind the target doesn't have a solid color, but the algorithm doesn't changed since the very first version of the app, so it is very probable that is something with the image being fed to it.

callegar commented 4 years ago

Hi, I know the green box is screen only, but I guess it indicates that border detection works correctly. When I cannot get the green box, the whole image is saved, not just the page, and I do not get any geometry correction.

After some more experiments, I get a feeling that (at least with my phone) flickering lights prevent the correct perception of the solid background color. So, most likely, it is not a software problem in the end. Please, consider closing and again sorry for the noise. Initially I thought that some Android update was messing with opencv.

allgood commented 4 years ago

@callegar , yes, some type of lights can mess with the image algorithm. Unfortunately there is not much to be done with this.

callegar commented 4 years ago

@ctodobom , indeed. Possibly if I had a stronger flash that would help in some lighting conditions... On the software side some LP filtering may provide some benefit, but may also bring other disadvantages.

nicoursi commented 4 years ago

In my case it rarely works. It just takes the whole picture and then I will have to crop it with other softwares. Why, instead, not offer a cropping option from within the app. Other apps do it this way. They let you take a picture, without post processing, and then they try to autocrop it, and the user can adjust the cropping marks. After that the post processing takes place, just on the selected area. You can have a look at "tiny scanner" on the play store, just to see what I mean.

n33rj commented 4 years ago

Hello @ctodobom, Here is a suggestion, although I could try this myself, I do not have an android development setup.

Suggestion: It is a very simple and easy fix. See the following image - It has been scanned using Open Note Scanner without cropping the image: DOC-20200504-154546

The enhanceDocument() function is clearly able to highlight the outlines of the page even though i had lots of background noise.

Therefore, I think we can solve this problem to some extent by changing the detectDocument() function to enhance the document first and then finding the quadrilatteral and cropping the image.

Just try it. Hope the fix helps 😃 !

otede commented 4 years ago

Exactly the same behaviour here. No light or background configuration changes that. Still no green square.

legendofa commented 4 years ago

I am having the same problem. The green square flickers even with a different background.

Ploonet commented 3 years ago

I haven't been able to make the green square come up either. I've tried many different backgrounds, even a completely black one. OpenCV is installed.

kyoforkshomebrews commented 3 years ago

The only luck I've had with this app was when I put my notes on a black background so that they're surrounded by black. Other backgrounds such as light brown simply don't work.