• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cropping since Version 2.8.7.
There isn't really an easy option for "sensitivity", because you have to think about what that means in regards to an algorithm that is scanning pixel by pixel trying to determine how much of the document it should cut off. Right now, this is the aggressive cropping algorithm:

1) Go to each side of the page and try to find the a line of white pixels along the entire extent of that side, going from the outward edge inwards. Stop the second you find a line of all white pixels. If none are found, use the line with the highest number of all white pixels

2) Now starting at the lines calculated in #1, work inward and try to find (on each side) a block of "significant" pixels. A pixel is considered significant if it is "dark enough" and each side of it has pixels that are also dark enough (below a certain threshold in terms of their RGB value). Find the block of significant pixels that is the furthest outward (i.e. closest to the beginning lines). 

3) Use the four points determined in #2 to define the rectangle of the cropped region.

So what does "sensitivity" mean when you think about the existing algorithm? Does it modify how dark or light the pixels have to be in ordered to be deemed "significant"? Does it require more than just a 3x3 block pixels and instead require 5x5 or 7x7 (where a certain number of those pixels are dark)? It obviously wouldn't make sense to need an entire 5x5 block of pixels to be dark content, as that wouldn't be encountered unless it was a just block of ink on the original document. 

If you are aware of existing algorithms for determining crop points accurately and ignoring scan marks near the edges, let me know. I can try making some adjustments to the current algorithm but I don't know if it will address your concerns.

If you are wanting to know why your document was cropped the way it was, it's because the algorithm saw that black line down the side as it was trying to find the cropping point for the top of the document, so it went pretty far down the page before picking the starting point, most likely because the pixels on the side of the page may have been slightly thinner there. So an adjustment I can make is to find the left/right coordinates first, then the top/bottom would only iterate between the left/right calculated positions, which would help in ignoring scan lines on the side.



With the adjustment I described, the page you posted is cropped is correctly el-Odysseas (I reproduced what was shown in your screenshot before that). So I will include this change with the next update which may address some of your concerns.

Messages In This Thread
Cropping since Version 2.8.7. - by el-Odysseas - 01-19-2020, 07:24 PM
RE: Cropping since Version 2.8.7. - by itsme - 01-19-2020, 08:36 PM
RE: Cropping since Version 2.8.7. - by Vibraphon - 01-20-2020, 12:27 AM
RE: Cropping since Version 2.8.7. - by itsme - 01-20-2020, 02:53 AM
RE: Cropping since Version 2.8.7. - by Zubersoft - 01-20-2020, 03:29 AM
RE: Cropping since Version 2.8.7. - by Zubersoft - 01-20-2020, 08:35 AM
RE: Cropping since Version 2.8.7. - by Gerd57 - 01-27-2020, 09:56 PM
RE: Cropping since Version 2.8.7. - by Zubersoft - 01-28-2020, 02:57 AM
RE: Cropping since Version 2.8.7. - by Gerd57 - 01-28-2020, 04:27 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

Users browsing this thread:
1 Guest(s)

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2023 MyBB Group.