UNIQ $RSI/uniq.pro
[Previous] [Next]
 NAME:
	UNIQ

 PURPOSE:
	Return the subscripts of the unique elements in an array.

	Note that repeated elements must be adjacent in order to be
	found.  This routine is intended to be used with the SORT
	function.  See the discussion of the IDX argument below.

	This command is inspired by the Unix uniq(1) command.

 CATEGORY:
	Array manipulation.

 CALLING SEQUENCE:
	UNIQ(Array [, Idx])

 INPUTS:
	Array:	The array to be scanned.  The type and number of dimensions
		of the array are not important.  The array must be sorted
		into monotonic order unless the optional parameter Idx is 
		supplied.

 OPTIONAL INPUT PARAMETERS:
	IDX:	This optional parameter is an array of indices into Array
		that order the elements into monotonic order.
		That is, the expression:

			Array(Idx)

		yields an array in which the elements of Array are
		rearranged into monotonic order.  If the array is not
		already in monotonic order, use the command:

			UNIQ(Array, SORT(Array))

		The expression below finds the unique elements of an unsorted
		array:

			Array(UNIQ(Array, SORT(Array)))

 OUTPUTS:
	An array of indicies into ARRAY is returned.  The expression:

		ARRAY(UNIQ(ARRAY))

	will be a copy of the sorted Array with duplicate adjacent
	elements removed.

 CALLED BY:
	BINARY_TEMPLATE, CRVLENGTH, INT_TABULATED, ONLINE_HELP_PDF_ND2FILE, READ_ASCII
	READ_BINARY, RESOLVE_ALL, SEARCH2D, SEARCH3D, XFONT, idlfflangcat__define
	idlitdatacontainer__define, idlitmaniptranslate__define [1]
	idlitmaniptranslate__define [2], idlitoprotateangle__define
	idlitparameter__define, idlitsystem__define, idlittool__define [1]
	idlittool__define [2], idlitvislineprofile3d__define [1]
	idlitvislineprofile3d__define [2], xobjview
 COMMON BLOCKS:
	None.

 MODIFICATION HISTORY:
	1988, AB, Written.
	29 July 1992, ACY - Corrected for case of all elements the same.
	Nov, 1995.  DMS, Return a 0 if argument is a scalar.


UNSHARP_MASK $RSI/unsharp_mask.pro
[Previous] [Next]
 NAME:
   UNSHARP_MASK

 PURPOSE:
   Implement the unsharp mask sharpening filter on a two-dimensional array
   or a truecolor image. For truecolor images the unsharp mask is applied
   to each channel.

 CALLING SEQUENCE:
   Result = UNSHARP_MASK(Image)

 INPUTS:
   Image: The two-dimensional array or multichannel image to be filtered.
       If Image is a multichannel image then the TRUE keyword may be used
       to indicate which dimension represents the channels.

 KEYWORD PARAMETERS:
   AMOUNT: Set this keyword to a float giving the amount (or strength)
       of filtering to be applied. The default is AMOUNT=1.0, which
       implies that 100% of the filter difference will be applied
       to the Image.

   RADIUS: Set this keyword to a float giving the radius in pixels
       of the Gaussian smoothing filter. The default is RADIUS=3.0.
       The Gaussian filter is designed to fall to 1/e at a distance
       of RADIUS/Sqrt(2). The total width of the Gaussian filter
       is given by CEIL(2*RADIUS)/2*2 + 1 (if RADIUS is an integer then
       this is just 2*RADIUS + 1).

       Tip: Use small RADIUS values (such as 1.0) for small images
       or images with fine details. Use larger RADIUS values for large
       images with larger details.

   THRESHOLD: Set this keyword to a non-negative integer (or a float
       if Image is floating point) giving the clipping threshold.
       For each element, if the absolute value of the difference between
       the original Image and the low-pass filtered array is greater than
       or equal to THRESHOLD then the filter is applied to that point.
       The default is THRESHOLD=0, which implies that every point will
       be filtered.

       Tip: Lower values of THRESHOLD will provide greater sharpening
       but may cause more speckling, while higher values of THRESHOLD
       will exclude regions of low contrast and cause less speckling.

   TRUE: If Image is a three-dimensional array (a multichannel image),
       then set this keyword to 1, 2, or 3 to indicate which dimension
       represents the channels. If TRUE is not set, and Image
       has three dimensions, then the default is TRUE=1.

 CALLED BY:
	idlitopunsharpmask__define
 EXAMPLE:

    file = FILEPATH('marsglobe.jpg', SUBDIR=['examples','data'])
    READ_JPEG, file, image

    ; Display the original image.
    iImage, image, VIEW_GRID=[2,1]

    ; Display the unsharp-mask-filtered image.
    result = UNSHARP_MASK(image, RADIUS=4)
    iImage, result, /VIEW_NEXT

 MODIFICATION HISTORY:
   Written by:  CT, RSI, July 2003
   Modified: