handwriting and skeleton

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
mmmaks2004
Posts: 5
Joined: 2016-04-13T07:46:37-07:00
Authentication code: 1151

handwriting and skeleton

Post by mmmaks2004 »

please, help
how to make the skeleton of letters?
Image
pixel size: 1
Image
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: handwriting and skeleton

Post by snibgo »

Code: Select all

convert f3ca1fa924da.jpg -negate -morphology Thinning:-1 Skeleton -negate s.png
See http://www.imagemagick.org/Usage/morpho ... g_skeleton
snibgo's IM pages: im.snibgo.com
mmmaks2004
Posts: 5
Joined: 2016-04-13T07:46:37-07:00
Authentication code: 1151

Re: handwriting and skeleton

Post by mmmaks2004 »

How to make that did not show the width of the letters?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: handwriting and skeleton

Post by snibgo »

mmmaks2004 wrote:How to make that did not show the width of the letters?
I don't understand the question. The output from my command is:
Image
snibgo's IM pages: im.snibgo.com
mmmaks2004
Posts: 5
Joined: 2016-04-13T07:46:37-07:00
Authentication code: 1151

Re: handwriting and skeleton

Post by mmmaks2004 »

Image
The output from your command is:
Image
how to remove the line width:
Image
best:
Image
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: handwriting and skeleton

Post by snibgo »

You want to remove some lines from the output. What rules determine which lines are to be removed?
snibgo's IM pages: im.snibgo.com
mmmaks2004
Posts: 5
Joined: 2016-04-13T07:46:37-07:00
Authentication code: 1151

Re: handwriting and skeleton

Post by mmmaks2004 »

maybe so,
Rules:
1. Find points that form a junction of 3 lines
3. Remove the shortest line (from 3 lines), if the length is less than 10 pixels


Is it possible to reduce the thickness of the lines of letters to 1 pixel?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: handwriting and skeleton

Post by snibgo »

See the morphology page I linked to.

Each line has two or more line-ends (except for loops), and zero or more junctions. The lines can be broken at junctions into segments. We can forget about segments that don't have a line-end. "-connected-components" tells us the size of each segment, so we can remove all segments that are smaller than a certain size.

When we have found segments, I can't see how to easily identify which segments have a common junction.
snibgo's IM pages: im.snibgo.com
Post Reply