DanBloomberg / leptonica

Leptonica is an open source library containing software that is broadly useful for image processing and image analysis applications. The official github repository for Leptonica is: danbloomberg/leptonica. See leptonica.org for more documentation.
Other
1.76k stars 387 forks source link

pixAutoPhotoinvert - the sequel #630

Open rmast opened 2 years ago

rmast commented 2 years ago

175789293-f39ddfdb-6f3e-4598-8d16-80a1f4a88b36

results with defaults 0,NULL,NULL in

Plaatje achteraf

The KVK on top left should be left as it was, or at least the bottom half of the V should be one way or the other to be covered by MRC. The text print - wis - clear on the top right should invert.

The applied algorithm might not be sufficiënt. If so DjVu has an expired patented algorithm for foreground/background separation: https://patents.google.com/patent/US6901169

However it performs less when there's noise in the scan that looks like holes in the mask: https://github.com/jwilk/didjvu/issues/21

But in this example, straightly converted from an electronic PDF form, there should be no issue at all.

DanBloomberg commented 1 year ago

Thank you for pointing out the deficiency in the photoinvert algorithm! This is pretty hard to make robust. It did OK with the text in the larger block on the left, did not attempt to invert the text in the small block at UR, and made a mess of the "KVK" logo at UL. I see that you've also noted deficiencies in the djvu algorithm which is about 20 years old.

I'll try to look at the leptonica failure on your example in the next week or so.

rmast commented 1 year ago

Yes, unfortunately DjVu-development of the segmenter has been stalled during the attempts to make it pay off by software patents which by now have expired. Don't know if those old algorithms are still worth something nowadays in the AI age.

Outlook voor Android downloadenhttps://aka.ms/ghei36


From: Dan Bloomberg @.> Sent: Thursday, October 20, 2022 7:16:21 PM To: DanBloomberg/leptonica @.> Cc: rmast @.>; Author @.> Subject: Re: [DanBloomberg/leptonica] pixAutoPhotoinvert - the sequel (Issue #630)

Thank you for pointing out the deficiency in the photoinvert algorithm! This is pretty hard to make robust. It did OK with the text in the larger block on the left, did not attempt to invert the text in the small block at UR, and made a mess of the "KVK" logo at UL. I see that you've also noted deficiencies in the djvu algorithm which is about 20 years old.

I'll try to look at the leptonica failure on your example in the next week or so.

— Reply to this email directly, view it on GitHubhttps://github.com/DanBloomberg/leptonica/issues/630#issuecomment-1285894697, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAZPZ5RFWWD32YIWIJ4QRQDWEF46LANCNFSM535FLO2A. You are receiving this because you authored the thread.Message ID: @.***>