CR4® - The Engineer's Place for News and Discussion®


Previous in Forum: Phone or Tablet as Appliance UI?   Next in Forum: Creating An Extension Based Context Menu Item In Windows
Close
Close
Close
17 comments
Power-User

Join Date: Mar 2010
Location: Mindanao, Philippines
Posts: 258
Good Answers: 25

Image Processing Software with Line-Thinning Feature

01/02/2017 6:49 AM

I used to have an image processing program that I liked a lot, particularly because it included a line-thinning feature. It was very useful, particularly when I had scanned material in which lines had "grown" to the point where it was difficult to read. Alas, that program ran on an old version of Windows (I think Win95) and I had to leave it behind when I upgraded.

Can anybody suggest a program that runs on a current version of Windows?

Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

Comments rated to be Good Answers:

These comments received enough positive ratings to make them "good answers".

Comments rated to be "almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, rate them!
Guru

Join Date: Jul 2008
Posts: 1237
Good Answers: 104
#1

Re: Image processing software with line-thinning feature

01/02/2017 8:04 AM

I don't know if this is useful for your task but take a look at GIMP (GNU Image Manipulation Program). It is free and it is very powerful. It has a much stronger following in the Linux community but we use it on Windows boxes frequently.

__________________
Few things limit our potential as much as knowing answers and setting aside questions.
Register to Reply Score 1 for Good Answer
Guru

Join Date: Apr 2010
Posts: 5760
Good Answers: 577
#2
In reply to #1

Re: Image processing software with line-thinning feature

01/02/2017 9:23 AM

That's exactly what I was going to recommend. GIMP is very powerful and absolutely free!

Register to Reply Score 1 for Good Answer
2
Guru

Join Date: Dec 2016
Posts: 2914
Good Answers: 115
#3

Re: Image Processing Software with Line-Thinning Feature

01/02/2017 11:37 AM

GIMP gives you the ability to thin lines but it is pretty simple-minded about it. For instance, if the line is already thin in places, at those places gaps can result. If you're thinning characters this can cause problems for OCR, for example.

Register to Reply Good Answer (Score 2)
Power-User

Join Date: Mar 2010
Location: Mindanao, Philippines
Posts: 258
Good Answers: 25
#7
In reply to #3

Re: Image Processing Software with Line-Thinning Feature

01/02/2017 10:34 PM

I've downloaded and installed GIMP. So far I can't find the line-thinning feature, and the help system index says nothing under "lines" or about "thinning." This means that I am asking the wrong question, but which is the right one?

Help.

Register to Reply
3
Guru

Join Date: Dec 2016
Posts: 2914
Good Answers: 115
#8
In reply to #7

Re: Image Processing Software with Line-Thinning Feature

01/02/2017 11:21 PM

From the menu bar Select | By Color and click on the text. This will select all regions having that colour.

Now, if the characters contain more than one shade of that colour, this will only select the colour under the mouse cursor, and so you may need to Threshold the image first. On the menu bar this is under Color | Threshold

Back to select-by-colour, once you've selected it, go back to the menu bar and Select | Shrink ... and choose the number of pixels by which to shrink.

After you shrink, the selection will still be selected. Press Ctrl-c to copy them to the clipboard, then to the menu bar and File | New to create a new canvas on which to paste the shrunken/thinned characters, and on that press Ctrl-v to paste.

To save the image, from the menu bar File | Export ...

If the features are small to begin with - one or two pixels wide - you may end up with nothing but speckles. Like I said, it's very simple-minded. Very basic. It doesn't do any sort of morphological processing and so may not work for you. You just have to experiment.

Register to Reply Good Answer (Score 3)
Power-User

Join Date: Mar 2010
Location: Mindanao, Philippines
Posts: 258
Good Answers: 25
#12
In reply to #8

Re: Image Processing Software with Line-Thinning Feature

01/03/2017 5:51 AM

Thank you.

I think this will work on heavy, smeared type. Will try it later this evening.

Register to Reply
Power-User

Join Date: Mar 2010
Location: Mindanao, Philippines
Posts: 258
Good Answers: 25
#17
In reply to #8

Re: Image Processing Software with Line-Thinning Feature

01/26/2017 9:47 PM

I finally tested this, but I am still doing something wrong. The file that I saved after removing several pixels looks exactly like the original.

Register to Reply
Guru

Join Date: Dec 2016
Posts: 2914
Good Answers: 115
#9
In reply to #7

Re: Image Processing Software with Line-Thinning Feature

01/02/2017 11:30 PM

Here's a sample image before and after shrinking the features by one pixel:

Before...

After ...

Notice the triangle is missing altogether and the thinner features are 'jaggy.' You may wish resurrect your old program. Possibly also search online for FAX cleanup or something similar and see what turns up.

Or you could write your own app under Python.

Register to Reply
Guru

Join Date: Apr 2010
Posts: 5760
Good Answers: 577
#4

Re: Image Processing Software with Line-Thinning Feature

01/02/2017 12:13 PM

It's usually done by the morphological processes of erosion and dilation. I once used this technique for fingerprint analysis.

OpenCV Python has this capability.

Here is some information:

http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/py_morphological_ops/py_morphological_ops.html

Register to Reply
Power-User

Join Date: Mar 2010
Location: Mindanao, Philippines
Posts: 258
Good Answers: 25
#5
In reply to #4

Re: Image Processing Software with Line-Thinning Feature

01/02/2017 8:51 PM

This definitely does what I need it to do, since the examples use a script letter as a sample task - my main application is to carbon copies of typescripts, but the basic idea is the same.

The problem is that here, I have to download, install and master OpenCV, download, install and master Python and program in Python to get this result. Since this is one component of a much bigger task, which is cleaning up and re-printing classic technical material, I'm eager to find something like the old program that does all this from a now-conventional graphic user interface.

Register to Reply Score 1 for Good Answer
Guru

Join Date: Dec 2016
Posts: 2914
Good Answers: 115
#6
In reply to #5

Re: Image Processing Software with Line-Thinning Feature

01/02/2017 9:47 PM

What was the old program?

If you still have that program, it is possible that you may be able to run it under Windows 10. Check out this 'HowTo' out and see if this might work for you:

http://www.howtogeek.com/228689/how-to-make-old-programs-work-on-windows-10/

Register to Reply
Power-User

Join Date: Mar 2010
Location: Mindanao, Philippines
Posts: 258
Good Answers: 25
#15
In reply to #6

Re: Image Processing Software with Line-Thinning Feature

01/26/2017 9:43 PM

Forgot the name. I will try to dig it out of my never-thrown-away installation disks, which are in storage right now.

Sounds like an incentive to consider Windows 10.

Register to Reply
Guru

Join Date: Dec 2016
Posts: 2914
Good Answers: 115
#10

Re: Image Processing Software with Line-Thinning Feature

01/03/2017 12:21 AM

Check this out. ImageMagick. I've not used it myself.

http://www.imagemagick.org/discourse-server/viewtopic.php?t=13571

Register to Reply
Participant

Join Date: Dec 2009
Posts: 1
#11

Re: Image Processing Software with Line-Thinning Feature

01/03/2017 1:49 AM

Try using ImageJ (https://imagej.net/). The Erode function may be what you are looking for.

Register to Reply Score 1 for Good Answer
Power-User

Join Date: Jun 2006
Location: Rochester NY metro area
Posts: 220
Good Answers: 18
#13

Re: Image Processing Software with Line-Thinning Feature

01/03/2017 5:55 AM

Did you upgrade recently to Windows 10, or a while ago to Windows 7? I ask because back when I upgraded to Windows 7, I had a program, "Picture Publisher 10," that was a nice simple image processing program, not all bloated up like Photoshop. It wouldn't run on Windows 7. But there was a Win XP emulator that I installed, and it does run fine within that, and I am still using it. So if you have Windows 7, that might work. For Windows 10, whether or not the XP emulator would even install and run, I don't know. Plus it's been so long since I changed over to Win 7, I don't remember the details. I think I downloaded the emulator from the MS website and installed it. If you Google "Windows XP emulator," a lot will come up, including a You Tube video on installing it on Win 10 at www.youtube.com/watch?v=zgOugfLxEdU. So if you can't find a suitable image processing program, it *might* be possible to use your old one by installing the Win XP emulator on a Win 10 machine.

jhammond

Register to Reply
Power-User

Join Date: Mar 2010
Location: Mindanao, Philippines
Posts: 258
Good Answers: 25
#16
In reply to #13

Re: Image Processing Software with Line-Thinning Feature

01/26/2017 9:46 PM

Wow. I'm still using Windows XP, so this should work. I will check out Picture Publisher.

Register to Reply
Guru

Join Date: Aug 2005
Location: Hemel Hempstead, UK
Posts: 4144
Good Answers: 230
#14

Re: Image Processing Software with Line-Thinning Feature

01/26/2017 2:21 PM

This was interesting: I recently had to replace my PC and couldn’t find my old Paint Shop Pro install disc: so, I wanted to try out other image processing programs.

Both the GIMP and ImageJ seem interesting but both their image thinning and erode functions obliterate the triangle in Andrew's original picture.

However, ImageJ does have an interesting function: save as text file.

First you have to reduce the image to an eight bit grey scale black and white image. I did it in ImageJ, but, I suspect that it’s easier in other programs.

Then save it as a text file. If you open it in a text editor you get something you might be able to work with, but, if you open it again in ImageJ you get something a bit like this:-

Copy the whole lot into a spread sheet.

Bizarrely Excel does not seem to support relative referencing between sheets; I’d be grateful if anyone could tell me a simple way to do it; so, I did most of the work in Libre office calc.

First rename the sheets

The names stand for: Original, Mend1, trim from Left1, trim from Right1, Mend2 etc.

All the operations act on a single cell by looking at the 3x3 square around it.

Mend just looks for any white pixels with two opposite black pixels in the surrounding eight cells.

L1 gets rid of a black pixel with three white pixels to the left (/ above) and three black pixels diagonally opposite them. R1 does the same from right/bottom.

Here are the equations: you have to work from one pixel in from each of the corners so that you’re not trying to look at cells “off the sheet”

M1

=IF(OR(O!B2=0,AND(O!B2=255,SUM(O!A1:C3)=1785,OR(O!A1+O!C2=0,O!A1+O!C3=0,O!A1+O!B3=0,O!C1+O!A2=0,O!C1+O!A3=0,O!C1+O!B3=0,O!C3+O!A2=0,O!C3+O!B1=0,O!A3+O!B1=0,O!A3+O!C2=0,O!A2+O!C2=0,O!B1+O!B3=0))),0,255)

L1

=IF(OR('M1'!B2=255,AND('M1'!B2=0,OR(AND('M1'!C1+'M1'!B1+'M1'!A1=765,'M1'!A3+'M1'!B3+'M1'!C3=0),AND('M1'!B1+'M1'!A1+'M1'!A2=765,'M1'!B3+'M1'!C3+'M1'!C2=0),AND('M1'!A1+'M1'!A2+'M1'!A3=765,'M1'!C3+'M1'!C2+'M1'!C1=0),AND('M1'!A2+'M1'!A3+'M1'!B3=765,'M1'!C2+'M1'!C1+'M1'!B1=0)))),255,0)

R1

=IF(OR('L1'!B2=255,AND('L1'!B2=0,OR(AND('L1'!C1+'L1'!B1+'L1'!A1=0,'L1'!A3+'L1'!B3+'L1'!C3=765),AND('L1'!B1+'L1'!A1+'L1'!A2=0,'L1'!B3+'L1'!C3+'L1'!C2=765),AND('L1'!A1+'L1'!A2+'L1'!A3=0,'L1'!C3+'L1'!C2+'L1'!C1=765),AND('L1'!A2+'L1'!A3+'L1'!B3=0,'L1'!C2+'L1'!C1+'L1'!B1=765)))),255,0)

Notice that they’re in Excel format: that’s because when the file size got too large Libre office kept crashing. So I had to create and copy the B2 equations in Libre; save as excel then copy to all cells in excel.

Make sure you stop before the last column and row when copying.

For the final sheet, just copy all of sheet R6, and, Paste - Special – Values to Final

Then Paste the whole of the Final sheet back into the ImageJ text file in Image J.

Save it then re-import the text file into ImageJ, and save or export it in any format.

This is a .jpg

I’m sure that with a bit more effort I could fix those wiggly lines on the star, but that might make the problem with the last t in text worse. Also I see that I’ve “mended” the one pixel gap between the first t and the e; difficult to see how you could avoid that, maybe I should have left the first mend until after the first L and R.

If you were going to use a technique like this. You would only need to create a spread sheet large enough for your biggest sheet once. Then just paste the original into the first sheet then paste the last sheet back.

Did you solve the problem another way: virtual machine perhaps?

What was the original program?

__________________
We are alone in the universe, or, we are not. Either way it's incredible... Adapted from R. Buckminster Fuller/Arthur C. Clarke
Register to Reply
Register to Reply 17 comments
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

Comments rated to be Good Answers:

These comments received enough positive ratings to make them "good answers".

Comments rated to be "almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, rate them!
Copy to Clipboard

Users who posted comments:

Andrew Westman (5); BruceFlorida (1); jhammond (1); piolenc (6); Randall (1); Rixter (2); RobertC (1)

Previous in Forum: Phone or Tablet as Appliance UI?   Next in Forum: Creating An Extension Based Context Menu Item In Windows

Advertisement