You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Detecting page angle currently requires that automatic page segmentation is enabled. Therefore, if rotateAuto is set to true but the current PSM does not support detecting the page angle, page segmentation is run with PSM set to 3 (AUTO), the page angle is retrieved, and then page segmentation is run a second time with PSM set to whatever is requested by the user.
If PSM is set to 3 by the user already, then page segmentation should only be run once (if no rotation is detected). However, due to a bug in the implementation of this feature, page segmentation is currently being run twice, even in this case.
Specifically, this code does not account for the fact that the PSM object stores the PSM values as strings, but api.GetPageSegMode returns an integer. Therefore, the check that occurs is ['3'].includes(3) which resolves to false.
The text was updated successfully, but these errors were encountered:
Detecting page angle currently requires that automatic page segmentation is enabled. Therefore, if
rotateAuto
is set totrue
but the currentPSM
does not support detecting the page angle, page segmentation is run withPSM
set to3
(AUTO
), the page angle is retrieved, and then page segmentation is run a second time withPSM
set to whatever is requested by the user.If
PSM
is set to3
by the user already, then page segmentation should only be run once (if no rotation is detected). However, due to a bug in the implementation of this feature, page segmentation is currently being run twice, even in this case.https://github.com/naptha/tesseract.js/blob/master/src/worker-script/index.js#L402-L407
Specifically, this code does not account for the fact that the
PSM
object stores the PSM values as strings, butapi.GetPageSegMode
returns an integer. Therefore, the check that occurs is['3'].includes(3)
which resolves tofalse
.The text was updated successfully, but these errors were encountered: