Thanks for adding standard-deviation. However, I don't believe it is implemented correctly as it should look like an edge image.
original:
convert lena2g.jpg -statistic standard-deviation 3x3 lena2g_std.jpg
However, from my statsfilt script (which is limited to a 3x3 neighborhood), I get
And after -normalize
convert lena2g_opt6.jpg -normalize lena2g_opt6_norm.jpg
My script uses:
ave="1,1,1,1,1,1,1,1,1"
# -gamma 2 is equivalent to sqrt
# $tmpA is the input image
convert $tmpA -convolve "$ave" $tmp0
convert \( $tmpA $tmpA -compose multiply -composite -convolve "$ave" \) \
\( $tmp0 $tmp0 -compose multiply -composite \) +swap \
-compose minus -composite -gamma 2 $outfile
Request Enhancments Similar to -mode
Re: Request Enhancments Similar to -mode
Look for a patch in ImageMagick 6.6.9-2 Beta by sometime tomorrow. Thanks.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Request Enhancments Similar to -mode
magick wrote:Look for a patch in ImageMagick 6.6.9-2 Beta by sometime tomorrow. Thanks.
Thanks. It is working fine in IM 6.6.9.2 Q16 Mac OSX Tiger
Fred
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Request Enhancments Similar to -mode
P.S. The non-peak option does a nice job of removing noise:
input:
convert lenag_noise_95.jpg -statistic nonpeak 3x3 lenag_noise_95_np3x3.jpg
Can you explain the algorithm concept in simple terms?
input:
convert lenag_noise_95.jpg -statistic nonpeak 3x3 lenag_noise_95_np3x3.jpg
Can you explain the algorithm concept in simple terms?
Re: Request Enhancments Similar to -mode
Replace the pixel with the pixel prior / adjacent to the median.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Request Enhancments Similar to -mode
I have edited the options page docs to indicate in simple terms what each does. Please correct if I am in error.magick wrote:Replace the pixel with the pixel prior / adjacent to the median.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Request Enhancments Similar to -mode
I don't understand how this represents a 'non-peak' statistic. That seems to be just another type of 'median'.magick wrote:Replace the pixel with the pixel prior / adjacent to the median.
Say you have a pixel of value 9, surrounded by other pixels forming a sorted list...
1,3,3,3,5,5,6,9,10
The minimum value is 1, maximum is 10, median (center of sorted list) is 5, most common is 3.
average or mean is add/divide or 5.0 (could be a floating-point value, rounded unless HDRI).
What then is non-peak?
Also would a statistic of (max-min)/2 => 4.5 be useful? (Centric)
Other ''statistics'' from morphology using flat shaped neighbourhood kernels -- EG Squares/Rectangles
Erode => as minimum 1
Dialate => as maximum 10
Convolve => mean 5
Gradient => abs( maximum - minimum ) => 9 (maximum difference in area)
TopHat => abs( pixel - minimum ) => 8 (difference from minimum)
BottomHat => abs( maximim - pixel ) => 1 (difference from maximim)
I am planning on making all 5 operations primitives in IM morphology, At this moment only erode and dialate are primitives, with the other three implemented as composition of primitives (1 or 2 convolutions and 1 compositions of the images)
ASIDE:
Alternative meaning of TopHat (I found BOTH in various papers)
TopHat => pixel - minimum => 8 (difference from minimum)
BottomHat => maximim - pixel => 1 (difference from maximim)
However I can not find a case where the two will be different to the previous definition, though Fred at one point indicated that their was. Fred can you enlighten!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Request Enhancments Similar to -mode
Sorry I mad a mistake with the "Hat" operation defintions above, They are based on Open and Close operations, not dialate and erode (maximum and minimum) and these really does need to be separate operations, so you can't easilly merge them.anthony wrote:Other ''statistics'' from morphology using flat shaped neighbourhood kernels -- EG Squares/Rectangles
Erode => as minimum 1
Dialate => as maximum 10
Convolve => mean 5
Gradient => abs( maximum - minimum ) => 9 (maximum difference in area)
TopHat => abs( pixel - minimum ) => 8 (difference from minimum)
BottomHat => abs( maximim - pixel ) => 1 (difference from maximim)
...
Alternative meaning of TopHat (I found BOTH in various papers)
TopHat => pixel - minimum => 8 (difference from minimum)
BottomHat => maximim - pixel => 1 (difference from maximim)
Gradient however can be implemented as a primitive statistic.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/