Re: using a sobel operator - edge detection
Posted: 2009-08-21T10:53:24-07:00
Here is a LOG (no zero crossing added yet) on the grayscale version of the image.
For comparison, here is the DOG simulation of the LOG.
g1=1
g2=1.6
convert flowers3.jpg -colorspace gray \
\( -clone 0 -blur 0x$g1 \) \
\( -clone 0 -blur 0x$g2 \) \
-delete 0 +swap -compose minus -composite -contrast-stretch 0 -negate \
flowers3g_dog_${g1}_${g2}_b.png
And here is the LOG implementing the laplacian in the frequency domain via -fft, with the best result at about c1=20 (tried 8, 16, 20, 24, 32)
g1=1
c1=20
dim=256
cxy=`convert xc: -format "%[fx:$dim/2]" info:`
cy2=`convert xc: -format "%[fx:$cxy + $c1 - 1]" info:`
echo "cxy=$cxy; cy2=$cy2"
convert flowers3.jpg -colorspace gray \
\( -clone 0 -blur 0x$g1 -fft \) \
\( -size ${dim}x${dim} xc:black -fill white \
-draw "circle $cxy,$cxy $cxy,$cy2" -alpha off -negate \) \
\( -clone 1 -clone 3 -compose multiply -composite \) \
-delete 0,1,3 +swap -ift -contrast-stretch 0 -negate \
flowers3g_log_${g1}_${c1}.png
I actually thing the DOG simulation of the LOG is better (sharper and cleaner)
For comparison, here is the DOG simulation of the LOG.
g1=1
g2=1.6
convert flowers3.jpg -colorspace gray \
\( -clone 0 -blur 0x$g1 \) \
\( -clone 0 -blur 0x$g2 \) \
-delete 0 +swap -compose minus -composite -contrast-stretch 0 -negate \
flowers3g_dog_${g1}_${g2}_b.png
And here is the LOG implementing the laplacian in the frequency domain via -fft, with the best result at about c1=20 (tried 8, 16, 20, 24, 32)
g1=1
c1=20
dim=256
cxy=`convert xc: -format "%[fx:$dim/2]" info:`
cy2=`convert xc: -format "%[fx:$cxy + $c1 - 1]" info:`
echo "cxy=$cxy; cy2=$cy2"
convert flowers3.jpg -colorspace gray \
\( -clone 0 -blur 0x$g1 -fft \) \
\( -size ${dim}x${dim} xc:black -fill white \
-draw "circle $cxy,$cxy $cxy,$cy2" -alpha off -negate \) \
\( -clone 1 -clone 3 -compose multiply -composite \) \
-delete 0,1,3 +swap -ift -contrast-stretch 0 -negate \
flowers3g_log_${g1}_${c1}.png
I actually thing the DOG simulation of the LOG is better (sharper and cleaner)