Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creation of edge detection based image in PHP

I'm curious - is it possible to ahieve in PHP:

1) Send image file to server 2) Process image = detect edges and create simple strokes basing on the edges 3) Save file on server / send it to user's browser / whatever

Here is some "sample" file ;P (as You can see it wasn't made using any edge detection enabled program, but by hand - just as an example):

http://i51.tinypic.com/5vzo0x.jpg Thanks!

like image 584
Paul Avatar asked Oct 30 '10 10:10

Paul


1 Answers

If you can use ImageMagick, there is the --charcoal filter:

The charcoal effect is meant to simulate artist's charcoal sketch of the given image.

The "-charcoal" operator is in some respects similar to edge detection transforms used by Computer Vision. Basically it tries to convert the major borders and edges of object in the image into pencil and charcoal shades.

The one argument is supposed to represent the thickness of the edge lines.

The ImageMagick examples manual shows another way whose results look even better:

Artist Charcoal Sketch of Image

alt textalt text

like image 127
Pekka Avatar answered Sep 20 '22 02:09

Pekka