#include "HxImageRep.h"
Go to the source code of this file.
Functions | |
HxImageRep L_HXIMAGEREP | HxDefuz (HxImageRep im, int windowSzX=5, int windowSzY=5, double thr=0.5) |
(from ScilImage Help) defuz() performs a sharpening operation on the grey value image "in" and stores the result in the grey value image "out". More... |
|
(from ScilImage Help) defuz() performs a sharpening operation on the grey value image "in" and stores the result in the grey value image "out". The image is scanned with a moving window with sizes "filt_x" and "filt_y". For each position, both minimum and maximum value are determined. The values of the minimum, maximum and center pixel value are denoted by MIN, MAX and C resp. The value of the last parameter "thr" is denoted by THR. The new value of the center pixel is calculated as follows: if(C < MIN + THR * (MAX - MIN)) C = MIN; else C = MAX; The last parameter THR indicates a bias towards either the local minimum or the local maximum value. In case THR == 0.5 there is no bias towards a direction. This means that if THR == 0.5 the center value is substituted by either min or max depending on whichever of the two is closest in value. If THR has value 0 the result is identical to a local maximum operation and if THR has value 1 the result is that of a local minimum filter. For non-linear sharpening the value of 0.5 is recommended for THR. The bernsen_threshold() operation is comparable to defuz() without bias. However, instead of replacing the value of the center pixel by the local minimum or maximum, this pixel is assigned 0 or 1. The result of this operation will become very noisy in areas where there is no distinct difference between minimum and maximum. Therefore, with the last parameter "max_diff" the user can indicate the minimum required difference between the local minimum and maximum. If the difference is less, the center pixel is assigned 1 by default.
00012 { 00013 HxTagList tags; 00014 HxAddTag(tags, "windowSzX", windowSzX); 00015 HxAddTag(tags, "windowSzY", windowSzY); 00016 HxAddTag(tags, "thr", thr); 00017 00018 return im.neighbourhoodOp("defuz", tags); 00019 00020 } |