Copyright © Fred Weinhaus My scripts are available free of charge for non-commercial (non-profit) use, ONLY. For use of my scripts in commercial (for-profit) environments or non-free applications, please contact me (Fred Weinhaus) for licensing arrangements. My email address is fmw at alink dot net. If you: 1) redistribute, 2) incorporate any of these scripts into other free applications or 3) reprogram them in another scripting language, then you must contact me for permission, especially if the result might be used in a commercial or for-profit environment. Usage, whether stated or not in the script, is restricted to the above licensing arrangements. It is also subject, in a subordinate manner, to the ImageMagick license, which can be found at: http://www.imagemagick.org/script/license.php Please read the Pointers For Use on my home page to properly install and customize my scripts. |
Detects corner structures in an image. |
last modified: December 15, 2018
USAGE: corners [-m method] [-t threshold] [-s smooth] [-r region] [-c color]
[-d dilate] [-p print] infile outfile1 [outfile2]
-m ... method ...... method of corner detection; choices are: morphology (m), PURPOSE: To detect corner structures in an image. DESCRIPTION: CORNERS detects corner structures in an image. Any of three methods may be used. The first is a morphology-based corner detector. The second is the Harris corner detector. The third is the Shi-Tomasi corner detector. The latter two require Imagemagick compiled in HDRI mode. The morphology corner detector uses two sets of morphology close operations using asymmetric structuring elements. The Harris and Shi-Tomasi corner detectors use a Gaussian weighted average of the squares and cross products of the X and Y Sobel directional derivatives. Note that the image is first converted to grayscale for the corner detection process. ARGUMENTS: -m method ... METHOD of corner detection. The choices are: morphology (m), harris (h) or shi-tomasi (s). The default=morphology. The harris and shi-tomasi methods require Imagemagick compile in HDRI mode. -t threshold ... THRESHOLD level (in percent) for choosing the strongest corners. Values are 0<=floats<=100. The default=50. Different values are needed for each method. The optimal threshold will also depend upon and smoothing applied and upon the region size. More smoothing or larger regions permit lower thresholds. -s smooth ... SMOOTH is the amount of smoothing to apply to the image as a preprocessing step to suppress noise. Values are 0<=integers<=5. The value represents the number of applications of -enhance to apply. The default=0. -r region ... REGION is either the morphology structure element size for the morphology method or the sigma value for the gaussian weighting of the neighborhood of derivatives in the harris and shi-tomasi methods. Values are floats>=0. The default=1. Values for method=morphology are typically integers. -c color ... COLOR of the corner points to be drawn on the first output image. Any valid opaque IM color is allowed. The default=red. -d dilate ... DILATE is the amount of dilation for enlarging the corner points drawn on the output image(s). Values are integer>=0. The default=1. -p print ... PRINT a list of the x,y corner points to the terminal. The choices are: yes (y) or no (n). The default=no. REQUIREMENTS: The Harris and the Shi-Tomasi methods require that Imagemagick be compile in HDRI mode. All methods require IM 6.8.9.10 or higher due to the use of -connected-components.
REFERENCES Morphology: CAVEAT: No guarantee that this script will work on all platforms, nor that trapping of inconsistent parameters is complete and foolproof. Use At Your Own Risk. |
Example 1 |
Original Image |
Arguments: |
Example 2 |
Original Image |
Arguments: |
Example 3 |
Original Image |
Arguments: |
Example 4 |
Original Image |
Arguments: |
Example 5 |
Original Image |
Arguments: |
What the script does for m=morphology is as follows:
|