RSS/Atom feed Twitter
Site is read-only, email is disabled

tool: removing small isles from selection

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

4 of 4 messages available
Toggle history

Please log in to manage your subscriptions.

tool: removing small isles from selection mat974@web.de 15 May 10:54
  tool: removing small isles from selection David Hodson 15 May 11:53
   tool: removing small isles from selection vt 15 May 13:40
tool: removing small isles from selection mat974@web.de 15 May 20:13
mat974@web.de
2007-05-15 10:54:29 UTC (over 17 years ago)

tool: removing small isles from selection

In short, I'm looking for a tool, plug-in etc. which collects all isles of a selection up to a certain size (specified by maximum diameter or number of pixels) and subtracts them from the selection.

When dealing with a scan of a text document, the following problem often appears. Using the color or fuzzy selection tool, most of the white and lightgray background can be selected---with the exception of small isles of dirt (up to several hundreds) which have almost the same color as the characters. After inverting the selection, a tool would be very helpful which removes all isolated regions of the selection as long as they fall below a certain maximum size. As the majority of the dirt is generally smaller than the dot on the i or punctuation marks, such a method should be quite efficient. After applying it, the remaining big dirty regions may be removed from the selection, e.g., by the lasso tool.

Though OCR would be in principle useful, I can't use it for my documents. If there aren't any applicable tools, I would be glad to hear about some hints for writing a .scm file. Is there any appropriate extension as a good starting point (I didn't find any)? How to write a loop for isolated regions of a selection? Is there already a function for measuring the diameter/area of a (isolated region of a) selection?

Thanks in advance,
Max Montauk
______________________

David Hodson
2007-05-15 11:53:55 UTC (over 17 years ago)

tool: removing small isles from selection

mat974@web.de wrote:

In short, I'm looking for a tool, plug-in etc. which collects all isles of a selection up to a certain size (specified by maximum diameter or number of pixels) and subtracts them from the selection.

It would probably be easier to clean up the image before making the selection. Have you experimented with the various non-linear filters? I'd try [Filters/Generic/]Erode followed by Dilate (or maybe the other way around), or [Filters/Enhance/]Despeckle or [Filters/Emhance/]NL Filter.

vt
2007-05-15 13:40:42 UTC (over 17 years ago)

tool: removing small isles from selection

2007 m. geguž? 15 d., antradienis 12:53, David Hodson raš?:

mat974@web.de wrote:

In short, I'm looking for a tool, plug-in etc. which collects all isles of a selection up to a certain size (specified by maximum diameter or number of pixels) and subtracts them from the selection.

It would probably be easier to clean up the image before making the selection. Have you experimented with the various non-linear filters? I'd try [Filters/Generic/]Erode followed by Dilate (or maybe the other way around), or [Filters/Enhance/]Despeckle or [Filters/Emhance/]NL Filter.

What I do to eliminate isles. Select with Z, or Shift+O, then increase selection, lets say, by 3px, then decrease by the same amount. All isles smaller than 2x selection increase are selected.

mat974@web.de
2007-05-15 20:13:43 UTC (over 17 years ago)

tool: removing small isles from selection

mat974@web.de wrote on 15.05.2007 10:55:48:

In short, I'm looking for a tool, plug-in etc. which collects all isles of a selection up to a certain size (specified by maximum diameter or number of pixels) and subtracts them from the selection.

David Hodson's proposal [Filters/Generic/]Erode followed by Dilate is indeed a very fast and efficient method for removing small irregularities on the background. In future, I will use this method for documents having not to high demands on the accurate reproduction of characters, stamps, dithered areas etc. The NL filter is not a quarter as good for this purpose. The Despeckle filter works fine under some circumstances, but it is pretty tricky to find the right settings.

vt's method removes by increasing and decreasing the selection small isles outside the selection completely. While it does not alter the pixels of clean regions it has the disadvantage that filigree portions of characters (especially the serifs) get excluded from the selection.

While your suggested methods are pretty good for documents of minor demands on quality, for the scanned certificates, I still would prefer a tool as described in my initial mail: remove small isles of a selection according to their size. ______________________