Class OcrContrast
Get text contrast information using OCR for a line of text.
Inheritance
Inherited Members
Namespace: Phoenix.Tiresias
Assembly: Phoenix.Plugin.Tiresias.dll
Syntax
public class OcrContrast
Constructors
View SourceOcrContrast(Rect[], BitmapImage, String, Double)
Initializes a new instance of the OcrContrast class.
Declaration
public OcrContrast(Rect[] wordBoundaries, BitmapImage image, string foundText, double worstContrastCandidatePercentile)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Rect[] | wordBoundaries | Array of Rect objects that denotes the boundaries of each word in the line. |
System.Windows.Media.Imaging.BitmapImage | image | The original image that the OCR is run on. |
System.String | foundText | The text found by the OCR. |
System.Double | worstContrastCandidatePercentile | The bottom percentile of worst candidates to be discarded from consideration for the worst contrast. |
Properties
View SourceBackgroundColor
Gets or sets the System.Drawing.Color object containing the background color.
Declaration
public Color BackgroundColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color |
BackgroundX
Gets or sets the X-coordinate of the background point.
Declaration
public double BackgroundX { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
BackgroundY
Gets or sets the Y-coordinate of the background point.
Declaration
public double BackgroundY { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
ForegroundColor
Gets or sets the System.Drawing.Color object containing the foreground color.
Declaration
public Color ForegroundColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color |
ForegroundX
Gets or sets the X-coordinate of the foreground point.
Declaration
public double ForegroundX { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
ForegroundY
Gets or sets the Y-coordinate of the foreground point.
Declaration
public double ForegroundY { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Methods
View SourceColorToHex(Color)
Get the hex value of the color.
Declaration
public static string ColorToHex(Color color)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Color | color | System.Drawing.Color object containing the color. |
Returns
Type | Description |
---|---|
System.String | String indicating the hex value of the color. |
ColorToRGB(Color)
Get the RGB value of the color.
Declaration
public static int[] ColorToRGB(Color color)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Color | color | System.Drawing.Color object containing the color. |
Returns
Type | Description |
---|---|
System.Int32[] | int[3] indicating the RGB value of the color. |
RunColorBrightness()
Run color brightness test on the line of text.
Declaration
public ContrastTests RunColorBrightness()
Returns
Type | Description |
---|---|
ContrastTests | ContrastTests object containing the color brightness test results. |
RunColorDifference()
Run color difference test on the line of text.
Declaration
public ContrastTests RunColorDifference()
Returns
Type | Description |
---|---|
ContrastTests | ContrastTests object containing the color difference test results. |
RunLuminance()
Run luminance test on the line of text.
Declaration
public ContrastTests RunLuminance()
Returns
Type | Description |
---|---|
ContrastTests | ContrastTests object containing the luminance test results. |