Hello Tong,
Thanks for catching those problems and notifying me.
They were some oversights from copy and modifying the gradient script
to create the laplacian script. I think I have them both fixed now
and uploaded to my web page. Let me know if you still have trouble.
With respect to using the script:
You can get the first type of laplacian by typing either:
laplacian zelda3.jpg tmp.jpg (no parameters)
or
laplacian -f 1 zelda3.jpg tmp.jpg
The other two laplacians can be generated similarly by replacing -f 1
with -f 2 or -f 3
If you want to mix the laplacian with the original image then also
add -m 10 or -m 25 or some value between 0 and 100 as the mixing
percent. This will allow you to sharpen the image if you choose a
value for -m that is not too large or too small. You will have to
play with values for each different image you use.
The first printout on the terminal shows you the pure Laplacian
filter. The second one shows you the filter after it is mixed with
the input image. If there is no mixing, then the values will be the
same as in the first printout.
And the last message on the terminal is the 1D filter that you could
save to use with -convol in IM. IM uses 1D filters with commas
between coefficient as input (although in actuality it really uses
them in 2D form). But I printed the equivalent 2D filter for
education purposes.
By the way, I am still working on the Laplacian and have some changes
and additions to make in the script and the examples. So check back
in a few days and see if the mod date has changed.
Fred
___________________________________________
Two issues regarding the latest laplacian script.
1. The download link still points to gradient script.
2. I managed to "steal" the laplacian script, but I don't know how to use
it. E.g., how to apply the "Laplacian 1" convolution? Based on the help
text, I thought it should be:
$ laplacian -f 1 zelda3.jpg zelda3.l3.jpg
but, this is what I get:
2D Laplacian Kernel
0 -1 0
-1 4 -1
0 -1 0
2D Final Laplacian Kernel
0 -1.000 0
-1.000 4.000 -1.000
0 -1.000 0
IM Final Laplacian Kernel
0,-1.000,0,-1.000,4.000,-1.000,0,-1.000,0
convert: unable to open image `/laplacian_7058.mpc': Permission denied.
--- FILE zelda3.jpg DOES NOT EXIST OR IS NOT AN ORDINARY FILE, NOT
READABLE OR HAS ZERO SIZE ---
laplacian:
USAGE: laplacian [-f filter] [t thresh] [-m mix] infile outfile
USAGE: laplacian . . .
but I have the zelda3.jpg:
$ ls -lgG zelda3.jpg
-rw------- 1 17145 09-23 17:43 zelda3.jpg
Please help.
thanks
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users