Lines Matching full:threshold
13 % MagickCore Image Threshold Methods %
88 #include "MagickCore/threshold.h"
121 #include "MagickCore/threshold-map.h"
127 " <threshold map=\"threshold\" alias=\"1x1\">"
128 " <description>Threshold 1x1 (non-dither)</description>"
132 " </threshold>"
133 " <threshold map=\"checks\" alias=\"2x1\">"
139 " </threshold>"
160 % AdaptiveThresholdImage() selects an individual threshold for each pixel
209 Initialize threshold image attributes. in AdaptiveThresholdImage()
229 Threshold image. in AdaptiveThresholdImage()
386 % o image: The image to auto-threshold.
412 threshold; in KapurThreshold() local
415 Compute optimal threshold from the entopy of the histogram. in KapurThreshold()
477 threshold=0; in KapurThreshold()
482 threshold=(size_t) j; in KapurThreshold()
490 return(100.0*threshold/MaxIntensity); in KapurThreshold()
502 threshold; in OTSUThreshold() local
508 Compute optimal threshold from maximization of inter-class variance. in OTSUThreshold()
546 Sigma maximization: inter-class variance and compute optimal threshold. in OTSUThreshold()
548 threshold=0; in OTSUThreshold()
559 threshold=(double) i; in OTSUThreshold()
569 return(100.0*threshold/MaxIntensity); in OTSUThreshold()
595 threshold; in TriangleThreshold() local
598 Compute optimal threshold with triangle algorithm. in TriangleThreshold()
623 Compute threshold at split point. in TriangleThreshold()
635 threshold=0; in TriangleThreshold()
644 threshold=i; in TriangleThreshold()
655 threshold=i; in TriangleThreshold()
659 return(100.0*threshold/MaxIntensity); in TriangleThreshold()
675 threshold; in AutoThresholdImage() local
730 Discover threshold from histogram. in AutoThresholdImage()
736 threshold=KapurThreshold(image,histogram,exception); in AutoThresholdImage()
742 threshold=OTSUThreshold(image,histogram,exception); in AutoThresholdImage()
747 threshold=TriangleThreshold(histogram); in AutoThresholdImage()
752 if (threshold < 0.0) in AutoThresholdImage()
757 Threshold image. in AutoThresholdImage()
759 (void) FormatLocaleString(property,MagickPathExtent,"%g%%",threshold); in AutoThresholdImage()
760 (void) SetImageProperty(image,"auto-threshold:threshold",property,exception); in AutoThresholdImage()
761 if (IsStringTrue(GetImageArtifact(image,"auto-threshold:verbose")) != MagickFalse) in AutoThresholdImage()
762 (void) FormatLocaleFile(stdout,"%.*g%%\n",GetMagickPrecision(),threshold); in AutoThresholdImage()
763 return(BilevelImage(image,QuantumRange*threshold/100.0,exception)); in AutoThresholdImage()
784 % This function is what is used to implement the "-threshold" operator for
792 % MagickBooleanType BilevelImage(Image *image,const double threshold,
799 % o threshold: define the threshold values.
804 % with the 'threshold' value for both the black_point and the white_point.
807 MagickExport MagickBooleanType BilevelImage(Image *image,const double threshold, in BilevelImage() argument
810 #define ThresholdImageTag "Threshold/Image" in BilevelImage()
833 Bilevel threshold image. in BilevelImage()
875 q[i]=(Quantum) (pixel <= threshold ? 0 : QuantumRange); in BilevelImage()
912 % the threshold into black while leaving all pixels at or above the threshold
918 % const char *threshold,ExceptionInfo *exception)
924 % o threshold: define the threshold value.
932 #define ThresholdImageTag "Threshold/Image" in BlackThresholdImage()
947 threshold; in BlackThresholdImage() local
965 GetPixelInfo(image,&threshold); in BlackThresholdImage()
967 threshold.red=geometry_info.rho; in BlackThresholdImage()
968 threshold.green=geometry_info.rho; in BlackThresholdImage()
969 threshold.blue=geometry_info.rho; in BlackThresholdImage()
970 threshold.black=geometry_info.rho; in BlackThresholdImage()
971 threshold.alpha=100.0; in BlackThresholdImage()
973 threshold.green=geometry_info.sigma; in BlackThresholdImage()
975 threshold.blue=geometry_info.xi; in BlackThresholdImage()
977 threshold.alpha=geometry_info.psi; in BlackThresholdImage()
978 if (threshold.colorspace == CMYKColorspace) in BlackThresholdImage()
981 threshold.black=geometry_info.psi; in BlackThresholdImage()
983 threshold.alpha=geometry_info.chi; in BlackThresholdImage()
987 threshold.red*=(MagickRealType) (QuantumRange/100.0); in BlackThresholdImage()
988 threshold.green*=(MagickRealType) (QuantumRange/100.0); in BlackThresholdImage()
989 threshold.blue*=(MagickRealType) (QuantumRange/100.0); in BlackThresholdImage()
990 threshold.black*=(MagickRealType) (QuantumRange/100.0); in BlackThresholdImage()
991 threshold.alpha*=(MagickRealType) (QuantumRange/100.0); in BlackThresholdImage()
994 White threshold image. in BlackThresholdImage()
1036 if (pixel < GetPixelInfoChannel(&threshold,channel)) in BlackThresholdImage()
1223 #define ThresholdImageTag "Threshold/Image" in ColorThresholdImage()
1248 Color threshold image. in ColorThresholdImage()
1414 % ThresholdMap *DestroyThresholdMap(Threshold *map)
1418 % o map: Pointer to the Threshold map to destroy
1445 % GetThresholdMap() loads and searches one or more threshold map files for the
1504 % GetThresholdMapFile() look for a given threshold map name or alias in the
1514 % o xml: The threshold map list in XML format.
1516 % o filename: The threshold map XML filename.
1545 *threshold, in GetThresholdMapFile() local
1549 "Loading threshold map file \"%s\" ...",filename); in GetThresholdMapFile()
1554 for (threshold=GetXMLTreeChild(thresholds,"threshold"); in GetThresholdMapFile()
1555 threshold != (XMLTreeInfo *) NULL; in GetThresholdMapFile()
1556 threshold=GetNextXMLTreeTag(threshold)) in GetThresholdMapFile()
1558 attribute=GetXMLTreeAttribute(threshold,"map"); in GetThresholdMapFile()
1561 attribute=GetXMLTreeAttribute(threshold,"alias"); in GetThresholdMapFile()
1565 if (threshold == (XMLTreeInfo *) NULL) in GetThresholdMapFile()
1570 description=GetXMLTreeChild(threshold,"description"); in GetThresholdMapFile()
1578 levels=GetXMLTreeChild(threshold,"levels"); in GetThresholdMapFile()
1590 attribute=GetXMLTreeAttribute(threshold,"map"); in GetThresholdMapFile()
1710 % ListThresholdMapFile() lists the threshold maps and their descriptions
1722 % o xml: The threshold map list in XML format.
1724 % o filename: The threshold map XML filename.
1739 *threshold, in ListThresholdMapFile() local
1745 "Loading threshold map file \"%s\" ...",filename); in ListThresholdMapFile()
1752 threshold=GetXMLTreeChild(thresholds,"threshold"); in ListThresholdMapFile()
1753 for ( ; threshold != (XMLTreeInfo *) NULL; in ListThresholdMapFile()
1754 threshold=GetNextXMLTreeTag(threshold)) in ListThresholdMapFile()
1756 map=GetXMLTreeAttribute(threshold,"map"); in ListThresholdMapFile()
1764 alias=GetXMLTreeAttribute(threshold,"alias"); in ListThresholdMapFile()
1765 description=GetXMLTreeChild(threshold,"description"); in ListThresholdMapFile()
1799 % ListThresholdMaps() lists the threshold maps and their descriptions
1800 % as defined by "threshold.xml" to a file.
1830 "\n Threshold Maps for Ordered Dither Operations\n"); in ListThresholdMaps()
1855 % of pre-defined dithering threshold maps, but over multiple intensity
1868 % o threshold_map: A string containing the name of the threshold dither
2008 threshold; in OrderedDitherImage() local
2019 threshold=(ssize_t) (QuantumScale*q[i]*(levels[n]*(map->divisor-1)+1)); in OrderedDitherImage()
2020 level=threshold/(map->divisor-1); in OrderedDitherImage()
2021 threshold-=level*(map->divisor-1); in OrderedDitherImage()
2022 q[i]=ClampToQuantum((double) (level+(threshold >= in OrderedDitherImage()
2074 % o epsilon: the epsilon threshold (e.g. 1.0e-9).
2210 % intensity of each pixel compared to a random threshold. The result is a
2231 #define ThresholdImageTag "Threshold/Image" in RandomThresholdImage()
2243 threshold; in RandomThresholdImage() local
2264 GetPixelInfo(image,&threshold); in RandomThresholdImage()
2266 Random threshold image. in RandomThresholdImage()
2304 threshold; in RandomThresholdImage() local
2311 threshold=min_threshold; in RandomThresholdImage()
2314 threshold=max_threshold; in RandomThresholdImage()
2316 threshold=(double) (QuantumRange* in RandomThresholdImage()
2318 q[i]=(double) q[i] <= threshold ? 0 : QuantumRange; in RandomThresholdImage()
2367 % o low_black: Define the minimum black threshold value.
2369 % o low_white: Define the minimum white threshold value.
2371 % o high_white: Define the maximum white threshold value.
2373 % o high_black: Define the maximum black threshold value.
2382 #define ThresholdImageTag "Threshold/Image" in RangeThresholdImage()
2405 Range threshold image. in RangeThresholdImage()
2501 % the threshold into white while leaving all pixels at or below the threshold
2507 % const char *threshold,ExceptionInfo *exception)
2513 % o threshold: Define the threshold value.
2521 #define ThresholdImageTag "Threshold/Image" in WhiteThresholdImage()
2536 threshold; in WhiteThresholdImage() local
2554 GetPixelInfo(image,&threshold); in WhiteThresholdImage()
2556 threshold.red=geometry_info.rho; in WhiteThresholdImage()
2557 threshold.green=geometry_info.rho; in WhiteThresholdImage()
2558 threshold.blue=geometry_info.rho; in WhiteThresholdImage()
2559 threshold.black=geometry_info.rho; in WhiteThresholdImage()
2560 threshold.alpha=100.0; in WhiteThresholdImage()
2562 threshold.green=geometry_info.sigma; in WhiteThresholdImage()
2564 threshold.blue=geometry_info.xi; in WhiteThresholdImage()
2566 threshold.alpha=geometry_info.psi; in WhiteThresholdImage()
2567 if (threshold.colorspace == CMYKColorspace) in WhiteThresholdImage()
2570 threshold.black=geometry_info.psi; in WhiteThresholdImage()
2572 threshold.alpha=geometry_info.chi; in WhiteThresholdImage()
2576 threshold.red*=(MagickRealType) (QuantumRange/100.0); in WhiteThresholdImage()
2577 threshold.green*=(MagickRealType) (QuantumRange/100.0); in WhiteThresholdImage()
2578 threshold.blue*=(MagickRealType) (QuantumRange/100.0); in WhiteThresholdImage()
2579 threshold.black*=(MagickRealType) (QuantumRange/100.0); in WhiteThresholdImage()
2580 threshold.alpha*=(MagickRealType) (QuantumRange/100.0); in WhiteThresholdImage()
2583 White threshold image. in WhiteThresholdImage()
2625 if (pixel > GetPixelInfoChannel(&threshold,channel)) in WhiteThresholdImage()