Skip to content

info_edgesInfoEdgesInfoEdgesinfo_edgesT_info_edgesπŸ”—

Short descriptionπŸ”—

info_edgesInfoEdgesInfoEdgesinfo_edgesT_info_edges β€” Return the filter coefficients of a filter in edges_imageEdgesImage.

SignatureπŸ”—

info_edges( string Filter, string Mode, real Alpha, out integer Size, out integer Coeffs )void InfoEdges( const HTuple& Filter, const HTuple& Mode, const HTuple& Alpha, HTuple* Size, HTuple* Coeffs )static void HOperatorSet.InfoEdges( HTuple filter, HTuple mode, HTuple alpha, out HTuple size, out HTuple coeffs )def info_edges( filter: str, mode: str, alpha: float ) -> Tuple[int, Sequence[int]]

Herror T_info_edges( const Htuple Filter, const Htuple Mode, const Htuple Alpha, Htuple* Size, Htuple* Coeffs )

static Hlong HMisc::InfoEdges( const HString& Filter, const HString& Mode, double Alpha, HTuple* Coeffs )

static Hlong HMisc::InfoEdges( const char* Filter, const char* Mode, double Alpha, HTuple* Coeffs )

static Hlong HMisc::InfoEdges( const wchar_t* Filter, const wchar_t* Mode, double Alpha, HTuple* Coeffs ) (Windows only)

static int HMisc.InfoEdges( string filter, string mode, double alpha, out HTuple coeffs )

DescriptionπŸ”—

info_edgesInfoEdges returns the coefficients Coeffscoeffscoeffs and an estimate of the width Sizesizesize of any of the filters used in edges_imageEdgesImage. To do so, the corresponding continuous impulse responses of the filters are sampled until the first filter coefficient is smaller than five percent of the largest coefficient. Alphaalphaalpha is the filter parameter (see edges_imageEdgesImage). Seven edge operators are supported (parameter Filterfilterfilter):

'deriche1'"deriche1", 'lanser1'"lanser1", 'deriche2'"deriche2", 'lanser2'"lanser2", 'shen'"shen", 'mshen'"mshen" and 'canny'"canny".

The parameter Modemodemode ('edge'"edge"/'smooth'"smooth") is used to determine whether the corresponding edge or smoothing operator is to be sampled.

The Canny operator (which uses Gaussian smoothing) is implemented using conventional filter masks. Therefore, for the Canny filter, the coefficients Coeffscoeffscoeffs of the one-dimensional impulse responses are returned as \(f(n)\) with \(n \ge 0\). All other filters are implemented recursively; here, the Coeffscoeffscoeffs are coefficients of a corresponding non-recursive filter.

AttentionπŸ”—

Note that filter operators may return unexpected results if an image with a reduced domain is used as input. Please refer to the chapter Filters.

Execution informationπŸ”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

ParametersπŸ”—

Filterfilterfilter (input_control) string β†’ (string)HTuple (HString)HTuple (string)strHtuple (char*)

Name of the edge operator.

Default: 'lanser2'"lanser2"
List of values: 'canny', 'deriche1', 'deriche2', 'lanser1', 'lanser2', 'mshen', 'shen'"canny", "deriche1", "deriche2", "lanser1", "lanser2", "mshen", "shen"

Modemodemode (input_control) string β†’ (string)HTuple (HString)HTuple (string)strHtuple (char*)

1D edge filter (β€˜edge’) or 1D smoothing filter (β€˜smooth’).

Default: 'edge'"edge"
List of values: 'edge', 'smooth'"edge", "smooth"

Alphaalphaalpha (input_control) real β†’ (real)HTuple (double)HTuple (double)floatHtuple (double)

Filter parameter: small values result in strong smoothing, and thus less detail (opposite for β€˜canny’).

Default: 0.50.5
Minimum increment: 0.01
Recommended increment: 0.1
Restriction: Alpha > 0.0

Sizesizesize (output_control) integer β†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Filter width in pixels.

Coeffscoeffscoeffs (output_control) integer-array β†’ (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

For Canny filters: Coefficients of the β€œpositive” half of the 1D impulse response. All others: Coefficients of a corresponding non-recursive filter.

ExampleπŸ”—

(HDevelop)

read_image(Image,'fabrik')
info_edges('lanser2','edge',0.5,Size,Coeffs)
edges_image(Image,Amp,Dir,'lanser2',0.5,'none',-1,-1)
hysteresis_threshold(Amp,Margin,20,30,30)
(C)
read_image(&Image,"fabrik")\;
info_edges("lanser2","edge",0.5,Size,Coeffs)\;
edges_image(Image,&Amp,&Dir,"lanser2",0.5,"none",-1,-1)\;
hysteresis_threshold(Amp,&Margin,20,30,30)\;

ResultπŸ”—

info_edgesInfoEdges returns 2 (H_MSG_TRUE) if all parameters are correct. If the input is empty the behavior can be set via set_system('no_object_result',<Result>). If necessary, an exception is raised.

Combinations with other operatorsπŸ”—

Combinations

Possible successors

edges_imageEdgesImage, thresholdThreshold, skeletonSkeleton

See also

edges_imageEdgesImage

ModuleπŸ”—

Foundation