diff --git a/HCI Assignment 1.sln b/HCI Assignment 1.sln
new file mode 100644
index 0000000..f353787
--- /dev/null
+++ b/HCI Assignment 1.sln
@@ -0,0 +1,44 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.40629.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Part 1 - Record a Video", "Part 1 - Record Video\Part 1 - Record a Video.csproj", "{BCE01DD9-E151-436C-9FF8-D324A13D38C1}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Part 2 - Take a Snapshot", "Part 2 - Take a Snapshot\Part 2 - Take a Snapshot.csproj", "{8B5A42D2-662F-429B-8CDA-3D01BC55B213}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Part 3 - Movement Detection", "Part 3 - Movement Detection\Part 3 - Movement Detection.csproj", "{F2B1E967-D7EB-4410-AE1A-7CC3110255B6}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {BCE01DD9-E151-436C-9FF8-D324A13D38C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {BCE01DD9-E151-436C-9FF8-D324A13D38C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {BCE01DD9-E151-436C-9FF8-D324A13D38C1}.Debug|x86.ActiveCfg = Debug|x86
+ {BCE01DD9-E151-436C-9FF8-D324A13D38C1}.Debug|x86.Build.0 = Debug|x86
+ {BCE01DD9-E151-436C-9FF8-D324A13D38C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {BCE01DD9-E151-436C-9FF8-D324A13D38C1}.Release|Any CPU.Build.0 = Release|Any CPU
+ {BCE01DD9-E151-436C-9FF8-D324A13D38C1}.Release|x86.ActiveCfg = Release|x86
+ {BCE01DD9-E151-436C-9FF8-D324A13D38C1}.Release|x86.Build.0 = Release|x86
+ {8B5A42D2-662F-429B-8CDA-3D01BC55B213}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8B5A42D2-662F-429B-8CDA-3D01BC55B213}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8B5A42D2-662F-429B-8CDA-3D01BC55B213}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {8B5A42D2-662F-429B-8CDA-3D01BC55B213}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8B5A42D2-662F-429B-8CDA-3D01BC55B213}.Release|Any CPU.Build.0 = Release|Any CPU
+ {8B5A42D2-662F-429B-8CDA-3D01BC55B213}.Release|x86.ActiveCfg = Release|Any CPU
+ {F2B1E967-D7EB-4410-AE1A-7CC3110255B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F2B1E967-D7EB-4410-AE1A-7CC3110255B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F2B1E967-D7EB-4410-AE1A-7CC3110255B6}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {F2B1E967-D7EB-4410-AE1A-7CC3110255B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F2B1E967-D7EB-4410-AE1A-7CC3110255B6}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F2B1E967-D7EB-4410-AE1A-7CC3110255B6}.Release|x86.ActiveCfg = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/Part 1 - Record Video/App.config b/Part 1 - Record Video/App.config
new file mode 100644
index 0000000..9c05822
--- /dev/null
+++ b/Part 1 - Record Video/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Part 1 - Record Video/Part 1 - Record a Video.csproj b/Part 1 - Record Video/Part 1 - Record a Video.csproj
new file mode 100644
index 0000000..6d56338
--- /dev/null
+++ b/Part 1 - Record Video/Part 1 - Record a Video.csproj
@@ -0,0 +1,127 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {BCE01DD9-E151-436C-9FF8-D324A13D38C1}
+ WinExe
+ Properties
+ HCI_Assignment_1
+ HCI Assignment 1
+ v4.5.1
+ 512
+ true
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+ true
+ bin\x86\Debug\
+ DEBUG;TRACE
+ full
+ x86
+ prompt
+ MinimumRecommendedRules.ruleset
+ true
+
+
+ bin\x86\Release\
+ TRACE
+ true
+ pdbonly
+ x86
+ prompt
+ MinimumRecommendedRules.ruleset
+ true
+
+
+
+ E:\University\ANAS 6\Human Computer Interaction\AForge.NET Framework-2.2.5\Release\AForge.Video.dll
+
+
+ E:\University\ANAS 6\Human Computer Interaction\AForge.NET Framework-2.2.5\Release\AForge.Video.DirectShow.dll
+
+
+ E:\University\ANAS 6\Human Computer Interaction\AForge.NET Framework-2.2.5\Release\AForge.Video.FFMPEG.dll
+
+
+ E:\University\ANAS 6\Human Computer Interaction\AForge.NET Framework-2.2.5\Release\AForge.Video.Kinect.dll
+
+
+ E:\University\ANAS 6\Human Computer Interaction\AForge.NET Framework-2.2.5\Release\AForge.Video.VFW.dll
+
+
+ E:\University\ANAS 6\Human Computer Interaction\AForge.NET Framework-2.2.5\Release\AForge.Video.Ximea.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Form
+
+
+ RecordVideo.cs
+
+
+
+
+ RecordVideo.cs
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+
+ True
+ Resources.resx
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ True
+ Settings.settings
+ True
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Part 1 - Record Video/Program.cs b/Part 1 - Record Video/Program.cs
new file mode 100644
index 0000000..539b0a4
--- /dev/null
+++ b/Part 1 - Record Video/Program.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HCI_Assignment_1
+{
+ static class Program
+ {
+ ///
+ /// The main entry point for the application.
+ ///
+ [STAThread]
+ static void Main()
+ {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new RecordVideo());
+ }
+ }
+}
diff --git a/Part 1 - Record Video/Properties/AssemblyInfo.cs b/Part 1 - Record Video/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..e6609d9
--- /dev/null
+++ b/Part 1 - Record Video/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HCI Assignment 1")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HCI Assignment 1")]
+[assembly: AssemblyCopyright("Copyright © 2016")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("689b26ee-6339-422d-b616-6f53fb076417")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Part 1 - Record Video/Properties/Resources.Designer.cs b/Part 1 - Record Video/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..db4b12a
--- /dev/null
+++ b/Part 1 - Record Video/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace HCI_Assignment_1.Properties
+{
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HCI_Assignment_1.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/Part 1 - Record Video/Properties/Resources.resx b/Part 1 - Record Video/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/Part 1 - Record Video/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Part 1 - Record Video/Properties/Settings.Designer.cs b/Part 1 - Record Video/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..bc3ee10
--- /dev/null
+++ b/Part 1 - Record Video/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace HCI_Assignment_1.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/Part 1 - Record Video/Properties/Settings.settings b/Part 1 - Record Video/Properties/Settings.settings
new file mode 100644
index 0000000..3964565
--- /dev/null
+++ b/Part 1 - Record Video/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/Part 1 - Record Video/RecordVideo.Designer.cs b/Part 1 - Record Video/RecordVideo.Designer.cs
new file mode 100644
index 0000000..78b463b
--- /dev/null
+++ b/Part 1 - Record Video/RecordVideo.Designer.cs
@@ -0,0 +1,84 @@
+namespace HCI_Assignment_1
+{
+ partial class RecordVideo
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.toggleButton = new System.Windows.Forms.Button();
+ this.pictureBox1 = new System.Windows.Forms.PictureBox();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
+ this.SuspendLayout();
+ //
+ // toggleButton
+ //
+ this.toggleButton.AutoSize = true;
+ this.toggleButton.Location = new System.Drawing.Point(5, 498);
+ this.toggleButton.Name = "toggleButton";
+ this.toggleButton.Size = new System.Drawing.Size(640, 23);
+ this.toggleButton.TabIndex = 0;
+ this.toggleButton.Text = "Start Rec.";
+ this.toggleButton.UseVisualStyleBackColor = true;
+ this.toggleButton.Click += new System.EventHandler(this.button1_Click);
+ //
+ // pictureBox1
+ //
+ this.pictureBox1.Location = new System.Drawing.Point(5, 12);
+ this.pictureBox1.Name = "pictureBox1";
+ this.pictureBox1.Size = new System.Drawing.Size(640, 480);
+ this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
+ this.pictureBox1.TabIndex = 1;
+ this.pictureBox1.TabStop = false;
+ this.pictureBox1.WaitOnLoad = true;
+ //
+ // RecordVideo
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(650, 526);
+ this.Controls.Add(this.pictureBox1);
+ this.Controls.Add(this.toggleButton);
+ this.MaximizeBox = false;
+ this.MaximumSize = new System.Drawing.Size(666, 565);
+ this.MinimumSize = new System.Drawing.Size(666, 565);
+ this.Name = "RecordVideo";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = "Record Video";
+ this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.RecordVideo_FormClosing);
+ this.Load += new System.EventHandler(this.RecordVideo_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Button toggleButton;
+ private System.Windows.Forms.PictureBox pictureBox1;
+ }
+}
+
diff --git a/Part 1 - Record Video/RecordVideo.cs b/Part 1 - Record Video/RecordVideo.cs
new file mode 100644
index 0000000..1381d3d
--- /dev/null
+++ b/Part 1 - Record Video/RecordVideo.cs
@@ -0,0 +1,67 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using AForge.Video;
+using AForge.Video.DirectShow;
+using AForge.Video.FFMPEG;
+using AForge.Video.Kinect;
+using AForge.Video.VFW;
+
+namespace HCI_Assignment_1
+{
+ public partial class RecordVideo : Form
+ {
+ public RecordVideo()
+ {
+ InitializeComponent();
+ }
+ VideoCaptureDevice webCam = null;
+ AVIWriter saveVideo = null;
+ private void button1_Click(object sender, EventArgs e)
+ {
+ if (this.toggleButton.Text == "Start Rec.")
+ {
+ this.toggleButton.Text = "STOP Rec.";
+ this.toggleButton.BackColor = Color.Black;
+ toggleButton.ForeColor = Color.White;
+ saveVideo = new AVIWriter("wmv3");
+ saveVideo.FrameRate = 15;
+ saveVideo.Open("video.avi", 640, 480);
+ }
+ else
+ {
+ this.toggleButton.Text = "Start Rec.";
+ toggleButton.ForeColor = Color.Black;
+ toggleButton.BackColor = Color.White;
+ saveVideo.Close();
+ }
+ }
+ private void webCam_NewFrame(object sender, AForge.Video.NewFrameEventArgs eventArgs)
+ {
+ pictureBox1.BackgroundImage = (Bitmap)eventArgs.Frame.Clone();
+ if(saveVideo!=null)
+ saveVideo.AddFrame((Bitmap)eventArgs.Frame.Clone());
+ }
+
+ private void RecordVideo_Load(object sender, EventArgs e)
+ {
+ FilterInfoCollection allCameras = new FilterInfoCollection(FilterCategory.VideoInputDevice);
+ webCam = new VideoCaptureDevice(allCameras[0].MonikerString);
+ webCam.NewFrame += new AForge.Video.NewFrameEventHandler(webCam_NewFrame);
+ webCam.Start();
+ }
+ private void RecordVideo_FormClosing(object sender, System.ComponentModel.CancelEventArgs e)
+ {
+ if(saveVideo!=null)
+ saveVideo.Close();
+
+ webCam.SignalToStop();
+ }
+ }
+}
diff --git a/Part 1 - Record Video/RecordVideo.resx b/Part 1 - Record Video/RecordVideo.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/Part 1 - Record Video/RecordVideo.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Part 1 - Record Video/bin/Debug/AForge.Imaging.dll b/Part 1 - Record Video/bin/Debug/AForge.Imaging.dll
new file mode 100644
index 0000000..150e87d
Binary files /dev/null and b/Part 1 - Record Video/bin/Debug/AForge.Imaging.dll differ
diff --git a/Part 1 - Record Video/bin/Debug/AForge.Imaging.xml b/Part 1 - Record Video/bin/Debug/AForge.Imaging.xml
new file mode 100644
index 0000000..bd85baf
--- /dev/null
+++ b/Part 1 - Record Video/bin/Debug/AForge.Imaging.xml
@@ -0,0 +1,19015 @@
+
+
+
+ AForge.Imaging
+
+
+
+
+ Corners detector's interface.
+
+
+ The interface specifies set of methods, which should be implemented by different
+ corners detection algorithms.
+
+
+
+
+ Process image looking for corners.
+
+
+ Source image to process.
+
+ Returns list of found corners (X-Y coordinates).
+
+
+
+
+ Process image looking for corners.
+
+
+ Source image data to process.
+
+ Returns list of found corners (X-Y coordinates).
+
+
+
+
+ Process image looking for corners.
+
+
+ Unmanaged source image to process.
+
+ Returns list of found corners (X-Y coordinates).
+
+
+
+
+ Shrink an image by removing specified color from its boundaries.
+
+
+ Removes pixels with specified color from image boundaries making
+ the image smaller in size.
+
+ The filter accepts 8 bpp grayscale and 24 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Shrink filter = new Shrink( Color.Black );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Base class for filters, which may produce new image of different size as a
+ result of image processing.
+
+
+ The abstract class is the base class for all filters, which
+ do image processing creating new image of the size, which may differ from the
+ size of source image. Filters based on this class cannot be applied directly
+ to the source image, which is kept unchanged.
+
+ The base class itself does not define supported pixel formats of source
+ image and resulting pixel formats of destination image. Filters inheriting from
+ this base class, should specify supported pixel formats and their transformations
+ overriding abstract property.
+
+
+
+
+
+ Image processing filter interface.
+
+
+ The interface defines the set of methods, which should be
+ provided by all image processing filters. Methods of this interface
+ keep the source image unchanged and returt the result of image processing
+ filter as new image.
+
+
+
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The filter accepts bitmap data as input and returns the result
+ of image processing filter as new image. The source image data are kept
+ unchanged.
+
+
+
+
+ Apply filter to an image.
+
+
+ Image in unmanaged memory.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to be processed.
+ Destination image to store filter's result.
+
+ The method keeps the source image unchanged and puts the
+ the result of image processing filter into destination image.
+
+ The destination image must have the size, which is expected by
+ the filter.
+
+
+ In the case if destination image has incorrect
+ size.
+
+
+
+
+ Interface which provides information about image processing filter.
+
+
+ The interface defines set of properties, which provide different type
+ of information about image processing filters implementing interface
+ or another filter's interface.
+
+
+
+
+ Format translations dictionary.
+
+
+ The dictionary defines, which pixel formats are supported for
+ source images and which pixel format will be used for resulting image.
+
+
+ Keys of this dictionary defines all pixel formats which are supported for source
+ images, but corresponding values define what will be resulting pixel format. For
+ example, if value Format16bppGrayScale
+ is put into the dictionary with the
+ Format48bppRgb key, then it means
+ that the filter accepts color 48 bpp image and produces 16 bpp grayscale image as a result
+ of image processing.
+
+ The information provided by this property is mostly actual for filters, which can not
+ be applied directly to the source image, but provide new image a result. Since usually all
+ filters implement interface, the information provided by this property
+ (if filter also implements interface) may be useful to
+ user to resolve filter's capabilities.
+
+ Sample usage:
+
+ // get filter's IFilterInformation interface
+ IFilterInformation info = (IFilterInformation) filter;
+ // check if the filter supports our image's format
+ if ( info.FormatTranslations.ContainsKey( image.PixelFormat )
+ {
+ // format is supported, check what will be result of image processing
+ PixelFormat resultingFormat = info.FormatTranslations[image.PixelFormat];
+ }
+ ///
+
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The filter accepts bitmap data as input and returns the result
+ of image processing filter as new image. The source image data are kept
+ unchanged.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+ Destination image in unmanaged memory to put result into.
+
+ The method keeps the source image unchanged and puts result of image processing
+ into destination image.
+
+ The destination image must have the same width and height as source image. Also
+ destination image must have pixel format, which is expected by particular filter (see
+ property for information about pixel format conversions).
+
+
+ Unsupported pixel format of the source image.
+ Incorrect destination pixel format.
+ Destination image has wrong width and/or height.
+
+
+
+
+ Calculates new image size.
+
+
+ Source image data.
+
+ New image size - size of the destination image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+ The dictionary defines, which pixel formats are supported for
+ source images and which pixel format will be used for resulting image.
+
+
+ See for more information.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Color to remove from boundaries.
+
+
+
+
+ Calculates new image size.
+
+
+ Source image data.
+
+ New image size - size of the destination image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Color to remove from boundaries.
+
+
+
+
+
+ Rotate image using nearest neighbor algorithm.
+
+
+ The class implements image rotation filter using nearest
+ neighbor algorithm, which does not assume any interpolation.
+
+ Rotation is performed in counterclockwise direction.
+
+ The filter accepts 8/16 bpp grayscale images and 24/48 bpp color image
+ for processing.
+
+ Sample usage:
+
+ // create filter - rotate for 30 degrees keeping original image size
+ RotateNearestNeighbor filter = new RotateNearestNeighbor( 30, true );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Base class for image rotation filters.
+
+
+ The abstract class is the base class for all filters,
+ which implement rotating algorithms.
+
+
+
+
+ Rotation angle.
+
+
+
+
+ Keep image size or not.
+
+
+
+
+ Fill color.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Rotation angle.
+
+ This constructor sets property to false.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Rotation angle.
+ Keep image size or not.
+
+
+
+
+ Calculates new image size.
+
+
+ Source image data.
+
+ New image size - size of the destination image.
+
+
+
+
+ Rotation angle, [0, 360].
+
+
+
+
+ Keep image size or not.
+
+
+ The property determines if source image's size will be kept
+ as it is or not. If the value is set to false, then the new image will have
+ new dimension according to rotation angle. If the valus is set to
+ true, then the new image will have the same size, which means that some parts
+ of the image may be clipped because of rotation.
+
+
+
+
+
+ Fill color.
+
+
+ The fill color is used to fill areas of destination image,
+ which don't have corresponsing pixels in source image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Rotation angle.
+
+ This constructor sets property to
+ .
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Rotation angle.
+ Keep image size or not.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Conservative smoothing.
+
+
+ The filter implements conservative smoothing, which is a noise reduction
+ technique that derives its name from the fact that it employs a simple, fast filtering
+ algorithm that sacrifices noise suppression power in order to preserve the high spatial
+ frequency detail (e.g. sharp edges) in an image. It is explicitly designed to remove noise
+ spikes - isolated pixels of exceptionally low or high pixel intensity
+ (salt and pepper noise).
+
+ If the filter finds a pixel which has minimum/maximum value compared to its surrounding
+ pixel, then its value is replaced by minimum/maximum value of those surrounding pixel.
+ For example, lets suppose the filter uses kernel size of 3x3,
+ which means each pixel has 8 surrounding pixel. If pixel's value is smaller than any value
+ of surrounding pixels, then the value of the pixel is replaced by minimum value of those surrounding
+ pixels.
+
+ The filter accepts 8 bpp grayscale images and 24/32 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ ConservativeSmoothing filter = new ConservativeSmoothing( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Base class for filters, which require source image backup to make them applicable to
+ source image (or its part) directly.
+
+
+ The base class is used for filters, which can not do
+ direct manipulations with source image. To make effect of in-place filtering,
+ these filters create a background copy of the original image (done by this
+ base class) and then do manipulations with it putting result back to the original
+ source image.
+
+ The background copy of the source image is created only in the case of in-place
+ filtering. Otherwise background copy is not created - source image is processed and result is
+ put to destination image.
+
+ The base class is for those filters, which support as filtering entire image, as
+ partial filtering of specified rectangle only.
+
+
+
+
+
+ In-place filter interface.
+
+
+ The interface defines the set of methods, which should be
+ implemented by filters, which are capable to do image processing
+ directly on the source image. Not all image processing filters
+ can be applied directly to the source image - only filters, which do not
+ change image's dimension and pixel format, can be applied directly to the
+ source image.
+
+
+
+
+
+
+
+ Apply filter to an image.
+
+
+ Image to apply filter to.
+
+ The method applies filter directly to the provided image data.
+
+
+
+
+ Apply filter to an image.
+
+
+ Image to apply filter to.
+
+ The method applies filter directly to the provided image data.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Image in unmanaged memory.
+
+ The method applies filter directly to the provided image data.
+
+
+
+
+ In-place partial filter interface.
+
+
+ The interface defines the set of methods, which should be
+ implemented by filters, which are capable to do image processing
+ directly on the source image. Not all image processing filters
+ can be applied directly to the source image - only filters, which do not
+ change image dimension and pixel format, can be applied directly to the
+ source image.
+
+ The interface also supports partial image filtering, allowing to specify
+ image rectangle, which should be filtered.
+
+
+
+
+
+
+
+
+ Apply filter to an image or its part.
+
+
+ Image to apply filter to.
+ Image rectangle for processing by filter.
+
+ The method applies filter directly to the provided image data.
+
+
+
+
+ Apply filter to an image or its part.
+
+
+ Image to apply filter to.
+ Image rectangle for processing by filter.
+
+ The method applies filter directly to the provided image data.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Image in unmanaged memory.
+ Image rectangle for processing by filter.
+
+ The method applies filter directly to the provided image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The filter accepts bitmap data as input and returns the result
+ of image processing filter as new image. The source image data are kept
+ unchanged.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+ Destination image in unmanaged memory to put result into.
+
+ The method keeps the source image unchanged and puts result of image processing
+ into destination image.
+
+ The destination image must have the same width and height as source image. Also
+ destination image must have pixel format, which is expected by particular filter (see
+ property for information about pixel format conversions).
+
+
+ Unsupported pixel format of the source image.
+ Incorrect destination pixel format.
+ Destination image has wrong width and/or height.
+
+
+
+
+ Apply filter to an image.
+
+
+ Image to apply filter to.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Image data to apply filter to.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an unmanaged image.
+
+
+ Unmanaged image to apply filter to.
+
+ The method applies the filter directly to the provided source unmanaged image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image or its part.
+
+
+ Image to apply filter to.
+ Image rectangle for processing by the filter.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image or its part.
+
+
+ Image data to apply filter to.
+ Image rectangle for processing by the filter.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an unmanaged image or its part.
+
+
+ Unmanaged image to apply filter to.
+ Image rectangle for processing by the filter.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+ The dictionary defines, which pixel formats are supported for
+ source images and which pixel format will be used for resulting image.
+
+
+ See for more information.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Kernel size.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Kernel size, [3, 25].
+
+
+ Determines the size of pixel's square used for smoothing.
+
+ Default value is set to 3.
+
+ The value should be odd.
+
+
+
+
+
+ Rotate RGB channels.
+
+
+ The filter rotates RGB channels: red channel is replaced with green,
+ green channel is replaced with blue, blue channel is replaced with red.
+
+ The filter accepts 24/32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ RotateChannels filter = new RotateChannels( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Base class for filters, which may be applied directly to the source image or its part.
+
+
+ The abstract class is the base class for all filters, which can
+ be applied to an image producing new image as a result of image processing or
+ applied directly to the source image (or its part) without changing its size and
+ pixel format.
+
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The filter accepts bitmap data as input and returns the result
+ of image processing filter as new image. The source image data are kept
+ unchanged.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+ Destination image in unmanaged memory to put result into.
+
+ The method keeps the source image unchanged and puts result of image processing
+ into destination image.
+
+ The destination image must have the same width and height as source image. Also
+ destination image must have pixel format, which is expected by particular filter (see
+ property for information about pixel format conversions).
+
+
+ Unsupported pixel format of the source image.
+ Incorrect destination pixel format.
+ Destination image has wrong width and/or height.
+
+
+
+
+ Apply filter to an image.
+
+
+ Image to apply filter to.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Image data to apply filter to.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an unmanaged image.
+
+
+ Unmanaged image to apply filter to.
+
+ The method applies the filter directly to the provided source unmanaged image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image or its part.
+
+
+ Image to apply filter to.
+ Image rectangle for processing by the filter.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image or its part.
+
+
+ Image data to apply filter to.
+ Image rectangle for processing by the filter.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an unmanaged image or its part.
+
+
+ Unmanaged image to apply filter to.
+ Image rectangle for processing by the filter.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+ The dictionary defines, which pixel formats are supported for
+ source images and which pixel format will be used for resulting image.
+
+
+ See for more information.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Gamma correction filter.
+
+
+ The filter performs gamma correction
+ of specified image in RGB color space. Each pixels' value is converted using the Vout=Ving
+ equation, where g is gamma value.
+
+ The filter accepts 8 bpp grayscale and 24 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ GammaCorrection filter = new GammaCorrection( 0.5 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Gamma value.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Gamma value, [0.1, 5.0].
+
+
+ Default value is set to 2.2.
+
+
+
+
+ Brightness adjusting in RGB color space.
+
+
+ The filter operates in RGB color space and adjusts
+ pixels' brightness by increasing every pixel's RGB values by the specified
+ adjust value. The filter is based on
+ filter and simply sets all input ranges to (0, 255-) and
+ all output range to (, 255) in the case if the adjust value is positive.
+ If the adjust value is negative, then all input ranges are set to
+ (-, 255 ) and all output ranges are set to
+ ( 0, 255+).
+
+ See documentation for more information about the base filter.
+
+ The filter accepts 8 bpp grayscale and 24/32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ BrightnessCorrection filter = new BrightnessCorrection( -50 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Brightness adjust value.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Brightness adjust value, [-255, 255].
+
+
+ Default value is set to 10, which corresponds to increasing
+ RGB values of each pixel by 10.
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Dithering using Stucki error diffusion.
+
+
+ The filter represents binarization filter, which is based on
+ error diffusion dithering with Stucki coefficients. Error is diffused
+ on 12 neighbor pixels with next coefficients:
+
+ | * | 8 | 4 |
+ | 2 | 4 | 8 | 4 | 2 |
+ | 1 | 2 | 4 | 2 | 1 |
+
+ / 42
+
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ StuckiDithering filter = new StuckiDithering( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Base class for error diffusion dithering, where error is diffused to
+ adjacent neighbor pixels.
+
+
+ The class does error diffusion to adjacent neighbor pixels
+ using specified set of coefficients. These coefficients are represented by
+ 2 dimensional jugged array, where first array of coefficients is for
+ right-standing pixels, but the rest of arrays are for bottom-standing pixels.
+ All arrays except the first one should have odd number of coefficients.
+
+ Suppose that error diffusion coefficients are represented by the next
+ jugged array:
+
+
+ int[][] coefficients = new int[2][] {
+ new int[1] { 7 },
+ new int[3] { 3, 5, 1 }
+ };
+
+
+ The above coefficients are used to diffuse error over the next neighbor
+ pixels (* marks current pixel, coefficients are placed to corresponding
+ neighbor pixels):
+
+ | * | 7 |
+ | 3 | 5 | 1 |
+
+ / 16
+
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ ErrorDiffusionToAdjacentNeighbors filter = new ErrorDiffusionToAdjacentNeighbors(
+ new int[3][] {
+ new int[2] { 5, 3 },
+ new int[5] { 2, 4, 5, 4, 2 },
+ new int[3] { 2, 3, 2 }
+ } );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+
+
+
+
+ Base class for error diffusion dithering.
+
+
+ The class is the base class for binarization algorithms based on
+ error diffusion.
+
+ Binarization with error diffusion in its idea is similar to binarization based on thresholding
+ of pixels' cumulative value (see ). Each pixel is binarized based not only
+ on its own value, but on values of some surrounding pixels. During pixel's binarization, its binarization
+ error is distributed (diffused) to some neighbor pixels with some coefficients. This error diffusion
+ updates neighbor pixels changing their values, what affects their upcoming binarization. Error diffuses
+ only on unprocessed yet neighbor pixels, which are right and bottom pixels usually (in the case if image
+ processing is done from upper left corner to bottom right corner). Binarization error equals
+ to processing pixel value, if it is below threshold value, or pixel value minus 255 otherwise.
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+
+
+
+
+ Current processing X coordinate.
+
+
+
+
+ Current processing Y coordinate.
+
+
+
+
+ Processing X start position.
+
+
+
+
+ Processing Y start position.
+
+
+
+
+ Processing X stop position.
+
+
+
+
+ Processing Y stop position.
+
+
+
+
+ Processing image's stride (line size).
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Do error diffusion.
+
+
+ Current error value.
+ Pointer to current processing pixel.
+
+ All parameters of the image and current processing pixel's coordinates
+ are initialized in protected members.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Threshold value.
+
+
+ Default value is 128.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Diffusion coefficients.
+
+
+
+
+ Do error diffusion.
+
+
+ Current error value.
+ Pointer to current processing pixel.
+
+ All parameters of the image and current processing pixel's coordinates
+ are initialized by base class.
+
+
+
+
+ Diffusion coefficients.
+
+
+ Set of coefficients, which are used for error diffusion to
+ pixel's neighbors.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Interpolation routines.
+
+
+
+
+
+ Bicubic kernel.
+
+
+ X value.
+
+ Bicubic cooefficient.
+
+ The function implements bicubic kernel W(x) as described on
+ Wikipedia
+ (coefficient a is set to -0.5).
+
+
+
+
+ Binary erosion operator from Mathematical Morphology with 3x3 structuring element.
+
+
+ The filter represents an optimized version of
+ filter, which is aimed for binary images (containing black and white pixels) processed
+ with 3x3 structuring element. This makes this filter ideal for removing noise in binary
+ images – it removes all white pixels, which are neighbouring with at least one blank pixel.
+
+
+ See filter, which represents generic version of
+ erosion filter supporting custom structuring elements and wider range of image formats.
+
+ The filter accepts 8 bpp grayscale (binary) images for processing.
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+ Processing rectangle mast be at least 3x3 in size.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Filter iterator.
+
+
+ Filter iterator performs specified amount of filter's iterations.
+ The filter take the specified base filter and applies it
+ to source image specified amount of times.
+
+ The filter itself does not have any restrictions to pixel format of source
+ image. This is set by base filter.
+
+ The filter does image processing using only
+ interface of the specified base filter. This means
+ that this filter may not utilize all potential features of the base filter, like
+ in-place processing (see ) and region based processing
+ (see ). To utilize those features, it is required to
+ do filter's iteration manually.
+
+ Sample usage (morphological thinning):
+
+ // create filter sequence
+ FiltersSequence filterSequence = new FiltersSequence( );
+ // add 8 thinning filters with different structuring elements
+ filterSequence.Add( new HitAndMiss(
+ new short [,] { { 0, 0, 0 }, { -1, 1, -1 }, { 1, 1, 1 } },
+ HitAndMiss.Modes.Thinning ) );
+ filterSequence.Add( new HitAndMiss(
+ new short [,] { { -1, 0, 0 }, { 1, 1, 0 }, { -1, 1, -1 } },
+ HitAndMiss.Modes.Thinning ) );
+ filterSequence.Add( new HitAndMiss(
+ new short [,] { { 1, -1, 0 }, { 1, 1, 0 }, { 1, -1, 0 } },
+ HitAndMiss.Modes.Thinning ) );
+ filterSequence.Add( new HitAndMiss(
+ new short [,] { { -1, 1, -1 }, { 1, 1, 0 }, { -1, 0, 0 } },
+ HitAndMiss.Modes.Thinning ) );
+ filterSequence.Add( new HitAndMiss(
+ new short [,] { { 1, 1, 1 }, { -1, 1, -1 }, { 0, 0, 0 } },
+ HitAndMiss.Modes.Thinning ) );
+ filterSequence.Add( new HitAndMiss(
+ new short [,] { { -1, 1, -1 }, { 0, 1, 1 }, { 0, 0, -1 } },
+ HitAndMiss.Modes.Thinning ) );
+ filterSequence.Add( new HitAndMiss(
+ new short [,] { { 0, -1, 1 }, { 0, 1, 1 }, { 0, -1, 1 } },
+ HitAndMiss.Modes.Thinning ) );
+ filterSequence.Add( new HitAndMiss(
+ new short [,] { { 0, 0, -1 }, { 0, 1, 1 }, { -1, 1, -1 } },
+ HitAndMiss.Modes.Thinning ) );
+ // create filter iterator for 10 iterations
+ FilterIterator filter = new FilterIterator( filterSequence, 10 );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Filter to iterate.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Filter to iterate.
+ Iterations amount.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The filter accepts bitmap data as input and returns the result
+ of image processing filter as new image. The source image data are kept
+ unchanged.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+ Destination image in unmanaged memory to put result into.
+
+ The method keeps the source image unchanged and puts result of image processing
+ into destination image.
+
+ The destination image must have the same width and height as source image. Also
+ destination image must have pixel format, which is expected by particular filter (see
+ property for information about pixel format conversions).
+
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+ The filter provides format translation dictionary taken from
+ filter.
+
+
+
+
+
+ Base filter.
+
+
+ The base filter is the filter to be applied specified amount of iterations to
+ a specified image.
+
+
+
+
+ Iterations amount, [1, 255].
+
+
+ The amount of times to apply specified filter to a specified image.
+
+ Default value is set to 1.
+
+
+
+
+
+ Threshold binarization.
+
+
+ The filter does image binarization using specified threshold value. All pixels
+ with intensities equal or higher than threshold value are converted to white pixels. All other
+ pixels with intensities below threshold value are converted to black pixels.
+
+ The filter accepts 8 and 16 bpp grayscale images for processing.
+
+ Since the filter can be applied as to 8 bpp and to 16 bpp images,
+ the value should be set appropriately to the pixel format.
+ In the case of 8 bpp images the threshold value is in the [0, 255] range, but in the case
+ of 16 bpp images the threshold value is in the [0, 65535] range.
+
+ Sample usage:
+
+ // create filter
+ Threshold filter = new Threshold( 100 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Threshold value.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Threshold value.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Threshold value.
+
+
+ Default value is set to 128.
+
+
+
+
+ Base class for filters, which may be applied directly to the source image.
+
+
+ The abstract class is the base class for all filters, which can
+ be applied to an image producing new image as a result of image processing or
+ applied directly to the source image without changing its size and pixel format.
+
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The filter accepts bitmap data as input and returns the result
+ of image processing filter as new image. The source image data are kept
+ unchanged.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+ Destination image in unmanaged memory to put result into.
+
+ The method keeps the source image unchanged and puts result of image processing
+ into destination image.
+
+ The destination image must have the same width and height as source image. Also
+ destination image must have pixel format, which is expected by particular filter (see
+ property for information about pixel format conversions).
+
+
+ Unsupported pixel format of the source image.
+ Incorrect destination pixel format.
+ Destination image has wrong width and/or height.
+
+
+
+
+ Apply filter to an image.
+
+
+ Image to apply filter to.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Image data to apply filter to.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an unmanaged image.
+
+
+ Unmanaged image to apply filter to.
+
+ The method applies the filter directly to the provided source unmanaged image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+
+
+
+
+ Format translations dictionary.
+
+
+ The dictionary defines, which pixel formats are supported for
+ source images and which pixel format will be used for resulting image.
+
+
+ See for more information.
+
+
+
+
+
+ Add fillter - add pixel values of two images.
+
+
+ The add filter takes two images (source and overlay images)
+ of the same size and pixel format and produces an image, where each pixel equals
+ to the sum value of corresponding pixels from provided images (if sum is greater
+ than maximum allowed value, 255 or 65535, then it is truncated to that maximum).
+
+ The filter accepts 8 and 16 bpp grayscale images and 24, 32, 48 and 64 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Add filter = new Add( overlayImage );
+ // apply the filter
+ Bitmap resultImage = filter.Apply( sourceImage );
+
+
+ Source image:
+
+ Overlay image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Base class for filters, which operate with two images of the same size and format and
+ may be applied directly to the source image.
+
+
+ The abstract class is the base class for all filters, which can
+ be applied to an image producing new image as a result of image processing or
+ applied directly to the source image without changing its size and pixel format.
+
+ The base class is aimed for such type of filters, which require additional image
+ to process the source image. The additional image is set by
+ or property and must have the same size and pixel format
+ as source image. See documentation of particular inherited class for information
+ about overlay image purpose.
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Overlay image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged overlay image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+
+ Source and overlay images have different pixel formats and/or size.
+ Overlay image is not set.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Overlay image data.
+
+ Overlay image size and pixel format is checked by this base class, before
+ passing execution to inherited class.
+
+
+
+
+ Overlay image.
+
+
+
+ The property sets an overlay image, which will be used as the second image required
+ to process source image. See documentation of particular inherited class for information
+ about overlay image purpose.
+
+
+ Overlay image must have the same size and pixel format as source image.
+ Otherwise exception will be generated when filter is applied to source image.
+
+ Setting this property will clear the property -
+ only one overlay image is allowed: managed or unmanaged.
+
+
+
+
+
+ Unmanaged overlay image.
+
+
+
+ The property sets an overlay image, which will be used as the second image required
+ to process source image. See documentation of particular inherited class for information
+ about overlay image purpose.
+
+
+ Overlay image must have the same size and pixel format as source image.
+ Otherwise exception will be generated when filter is applied to source image.
+
+ Setting this property will clear the property -
+ only one overlay image is allowed: managed or unmanaged.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Overlay image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged overlay image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Overlay image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Color dithering using Stucki error diffusion.
+
+
+ The image processing routine represents color dithering algorithm, which is based on
+ error diffusion dithering with Stucki coefficients. Error is diffused
+ on 12 neighbor pixels with next coefficients:
+
+ | * | 8 | 4 |
+ | 2 | 4 | 8 | 4 | 2 |
+ | 1 | 2 | 4 | 2 | 1 |
+
+ / 42
+
+
+ The image processing routine accepts 24/32 bpp color images for processing. As a result this routine
+ produces 4 bpp or 8 bpp indexed image, which depends on size of the specified
+ color table - 4 bpp result for
+ color tables with 16 colors or less; 8 bpp result for larger color tables.
+
+ Sample usage:
+
+ // create color image quantization routine
+ ColorImageQuantizer ciq = new ColorImageQuantizer( new MedianCutQuantizer( ) );
+ // create 64 colors table
+ Color[] colorTable = ciq.CalculatePalette( image, 64 );
+ // create dithering routine
+ StuckiColorDithering dithering = new StuckiColorDithering( );
+ dithering.ColorTable = colorTable;
+ // apply the dithering routine
+ Bitmap newImage = dithering.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Base class for error diffusion color dithering, where error is diffused to
+ adjacent neighbor pixels.
+
+
+ The class does error diffusion to adjacent neighbor pixels
+ using specified set of coefficients. These coefficients are represented by
+ 2 dimensional jugged array, where first array of coefficients is for
+ right-standing pixels, but the rest of arrays are for bottom-standing pixels.
+ All arrays except the first one should have odd number of coefficients.
+
+ Suppose that error diffusion coefficients are represented by the next
+ jugged array:
+
+
+ int[][] coefficients = new int[2][] {
+ new int[1] { 7 },
+ new int[3] { 3, 5, 1 }
+ };
+
+
+ The above coefficients are used to diffuse error over the next neighbor
+ pixels (* marks current pixel, coefficients are placed to corresponding
+ neighbor pixels):
+
+ | * | 7 |
+ | 3 | 5 | 1 |
+
+ / 16
+
+
+ The image processing routine accepts 24/32 bpp color images for processing.
+
+ Sample usage:
+
+ // create dithering routine
+ ColorErrorDiffusionToAdjacentNeighbors dithering = new ColorErrorDiffusionToAdjacentNeighbors(
+ new int[3][] {
+ new int[2] { 5, 3 },
+ new int[5] { 2, 4, 5, 4, 2 },
+ new int[3] { 2, 3, 2 }
+ } );
+ // apply the dithering routine
+ Bitmap newImage = dithering.Apply( image );
+
+
+
+
+
+
+ Base class for error diffusion color dithering.
+
+
+ The class is the base class for color dithering algorithms based on
+ error diffusion.
+
+ Color dithering with error diffusion is based on the idea that each pixel from the specified source
+ image is substituted with a best matching color (or better say with color's index) from the specified color
+ table. However, the error (difference between color value in the source image and the best matching color)
+ is diffused to neighbor pixels of the source image, which affects the way those pixels are substituted by colors
+ from the specified table.
+
+ The image processing routine accepts 24/32 bpp color images for processing. As a result this routine
+ produces 4 bpp or 8 bpp indexed image, which depends on size of the specified color table - 4 bpp result for
+ color tables with 16 colors or less; 8 bpp result for larger color tables.
+
+
+
+
+
+ Current processing X coordinate.
+
+
+
+
+ Current processing Y coordinate.
+
+
+
+
+ Processing image's width.
+
+
+
+
+ Processing image's height.
+
+
+
+
+ Processing image's stride (line size).
+
+
+
+
+ Processing image's pixel size in bytes.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Do error diffusion.
+
+
+ Error value of red component.
+ Error value of green component.
+ Error value of blue component.
+ Pointer to current processing pixel.
+
+ All parameters of the image and current processing pixel's coordinates
+ are initialized in protected members.
+
+
+
+
+ Perform color dithering for the specified image.
+
+
+ Source image to do color dithering for.
+
+ Returns color dithered image. See for information about format of
+ the result image.
+
+ Unsupported pixel format of the source image. It must 24 or 32 bpp color image.
+
+
+
+
+ Perform color dithering for the specified image.
+
+
+ Source image to do color dithering for.
+
+ Returns color dithered image. See for information about format of
+ the result image.
+
+ Unsupported pixel format of the source image. It must 24 or 32 bpp color image.
+
+
+
+
+ Color table to use for image dithering. Must contain 2-256 colors.
+
+
+ Color table size determines format of the resulting image produced by this
+ image processing routine. If color table contains 16 color or less, then result image will have
+ 4 bpp indexed pixel format. If color table contains more than 16 colors, then result image will
+ have 8 bpp indexed pixel format.
+
+ By default the property is initialized with default 16 colors, which are:
+ Black, Dark Blue, Dark Green, Dark Cyan, Dark Red, Dark Magenta, Dark Khaki, Light Gray,
+ Gray, Blue, Green, Cyan, Red, Magenta, Yellow and White.
+
+
+ Color table length must be in the [2, 256] range.
+
+
+
+
+ Use color caching during color dithering or not.
+
+
+ The property specifies if internal cache of already processed colors should be used or not.
+ For each pixel in the original image the color dithering routine does search in target color palette to find
+ the best matching color. To avoid doing the search again and again for already processed colors, the class may
+ use internal dictionary which maps colors of original image to indexes in target color palette.
+
+
+ The property provides a trade off. On one hand it may speedup color dithering routine, but on another
+ hand it increases memory usage. Also cache usage may not be efficient for very small target color tables.
+
+ Default value is set to .
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Diffusion coefficients (see
+ for more information).
+
+
+
+
+ Do error diffusion.
+
+
+ Error value of red component.
+ Error value of green component.
+ Error value of blue component.
+ Pointer to current processing pixel.
+
+ All parameters of the image and current processing pixel's coordinates
+ are initialized by base class.
+
+
+
+
+ Diffusion coefficients.
+
+
+ Set of coefficients, which are used for error diffusion to
+ pixel's neighbors.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Interface which is implemented by different color quantization algorithms.
+
+
+ The interface defines set of methods, which are to be implemented by different
+ color quantization algorithms - algorithms which are aimed to provide reduced color table/palette
+ for a color image.
+
+ See documentation to particular implementation of the interface for additional information
+ about the algorithm.
+
+
+
+
+
+ Process color by a color quantization algorithm.
+
+
+ Color to process.
+
+ Depending on particular implementation of interface,
+ this method may simply process the specified color or store it in internal list for
+ later color palette calculation.
+
+
+
+
+ Get palette of the specified size.
+
+
+ Palette size to return.
+
+ Returns reduced color palette for the accumulated/processed colors.
+
+ The method must be called after continuously calling method and
+ returns reduced color palette for colors accumulated/processed so far.
+
+
+
+
+ Clear internals of the algorithm, like accumulated color table, etc.
+
+
+ The methods resets internal state of a color quantization algorithm returning
+ it to initial state.
+
+
+
+
+ Color dithering using Floyd-Steinberg error diffusion.
+
+
+ The image processing routine represents color dithering algorithm, which is based on
+ error diffusion dithering with Floyd-Steinberg
+ coefficients. Error is diffused on 4 neighbor pixels with the next coefficients:
+
+
+ | * | 7 |
+ | 3 | 5 | 1 |
+
+ / 16
+
+
+ The image processing routine accepts 24/32 bpp color images for processing. As a result this routine
+ produces 4 bpp or 8 bpp indexed image, which depends on size of the specified
+ color table - 4 bpp result for
+ color tables with 16 colors or less; 8 bpp result for larger color tables.
+
+ Sample usage:
+
+ // create color image quantization routine
+ ColorImageQuantizer ciq = new ColorImageQuantizer( new MedianCutQuantizer( ) );
+ // create 16 colors table
+ Color[] colorTable = ciq.CalculatePalette( image, 16 );
+ // create dithering routine
+ FloydSteinbergColorDithering dithering = new FloydSteinbergColorDithering( );
+ dithering.ColorTable = colorTable;
+ // apply the dithering routine
+ Bitmap newImage = dithering.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Template match class keeps information about found template match. The class is
+ used with template matching algorithms implementing
+ interface.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Rectangle of the matching area.
+ Similarity between template and found matching, [0..1].
+
+
+
+
+ Rectangle of the matching area.
+
+
+
+
+ Similarity between template and found matching, [0..1].
+
+
+
+
+ Susan corners detector.
+
+
+ The class implements Susan corners detector, which is described by
+ S.M. Smith in: S.M. Smith, "SUSAN - a new approach to low level image processing",
+ Internal Technical Report TR95SMS1, Defense Research Agency, Chobham Lane, Chertsey,
+ Surrey, UK, 1995.
+
+ Some implementation notes:
+
+ - Analyzing each pixel and searching for its USAN area, the 7x7 mask is used,
+ which is comprised of 37 pixels. The mask has circle shape:
+
+ xxx
+ xxxxx
+ xxxxxxx
+ xxxxxxx
+ xxxxxxx
+ xxxxx
+ xxx
+
+
+ - In the case if USAN's center of mass has the same coordinates as nucleus
+ (central point), the pixel is not a corner.
+ - For noise suppression the 5x5 square window is used.
+
+ The class processes only grayscale 8 bpp and color 24/32 bpp images.
+ In the case of color image, it is converted to grayscale internally using
+ filter.
+
+ Sample usage:
+
+ // create corners detector's instance
+ SusanCornersDetector scd = new SusanCornersDetector( );
+ // process image searching for corners
+ List<IntPoint> corners = scd.ProcessImage( image );
+ // process points
+ foreach ( IntPoint corner in corners )
+ {
+ // ...
+ }
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Brightness difference threshold.
+ Geometrical threshold.
+
+
+
+
+ Process image looking for corners.
+
+
+ Source image to process.
+
+ Returns list of found corners (X-Y coordinates).
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Process image looking for corners.
+
+
+ Source image data to process.
+
+ Returns list of found corners (X-Y coordinates).
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Process image looking for corners.
+
+
+ Unmanaged source image to process.
+
+ Returns array of found corners (X-Y coordinates).
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Brightness difference threshold.
+
+
+ The brightness difference threshold controls the amount
+ of pixels, which become part of USAN area. If difference between central
+ pixel (nucleus) and surrounding pixel is not higher than difference threshold,
+ then that pixel becomes part of USAN.
+
+ Increasing this value decreases the amount of detected corners.
+
+ Default value is set to 25.
+
+
+
+
+
+ Geometrical threshold.
+
+
+ The geometrical threshold sets the maximum number of pixels
+ in USAN area around corner. If potential corner has USAN with more pixels, than
+ it is not a corner.
+
+ Decreasing this value decreases the amount of detected corners - only sharp corners
+ are detected. Increasing this value increases the amount of detected corners, but
+ also increases amount of flat corners, which may be not corners at all.
+
+ Default value is set to 18, which is half of maximum amount of pixels in USAN.
+
+
+
+
+
+ Rotate image using bilinear interpolation.
+
+
+ Rotation is performed in counterclockwise direction.
+
+ The class implements image rotation filter using bilinear
+ interpolation algorithm.
+
+ The filter accepts 8 bpp grayscale images and 24 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter - rotate for 30 degrees keeping original image size
+ RotateBilinear filter = new RotateBilinear( 30, true );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Rotation angle.
+
+ This constructor sets property
+ to .
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Rotation angle.
+ Keep image size or not.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Simple water wave effect filter.
+
+
+ The image processing filter implements simple water wave effect. Using
+ properties of the class, it is possible to set number of vertical/horizontal waves,
+ as well as their amplitude.
+
+ Bilinear interpolation is used to create smooth effect.
+
+ The filter accepts 8 bpp grayscale images and 24/32
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ WaterWave filter = new WaterWave( );
+ filter.HorizontalWavesCount = 10;
+ filter.HorizontalWavesAmplitude = 5;
+ filter.VerticalWavesCount = 3;
+ filter.VerticalWavesAmplitude = 15;
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Base class for filters, which produce new image of the same size as a
+ result of image processing.
+
+
+ The abstract class is the base class for all filters, which
+ do image processing creating new image with the same size as source.
+ Filters based on this class cannot be applied directly to the source
+ image, which is kept unchanged.
+
+ The base class itself does not define supported pixel formats of source
+ image and resulting pixel formats of destination image. Filters inheriting from
+ this base class, should specify supported pixel formats and their transformations
+ overriding abstract property.
+
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The filter accepts bitmap data as input and returns the result
+ of image processing filter as new image. The source image data are kept
+ unchanged.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+ Destination image in unmanaged memory to put result into.
+
+ The method keeps the source image unchanged and puts result of image processing
+ into destination image.
+
+ The destination image must have the same width and height as source image. Also
+ destination image must have pixel format, which is expected by particular filter (see
+ property for information about pixel format conversions).
+
+
+ Unsupported pixel format of the source image.
+ Incorrect destination pixel format.
+ Destination image has wrong width and/or height.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+ The dictionary defines, which pixel formats are supported for
+ source images and which pixel format will be used for resulting image.
+
+
+ See for more information.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Number of horizontal waves, [1, 10000].
+
+
+ Default value is set to 5.
+
+
+
+
+ Number of vertical waves, [1, 10000].
+
+
+ Default value is set to 5.
+
+
+
+
+ Amplitude of horizontal waves measured in pixels, [0, 10000].
+
+
+ Default value is set to 10.
+
+
+
+
+ Amplitude of vertical waves measured in pixels, [0, 10000].
+
+
+ Default value is set to 10.
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Filter to mark (highlight) corners of objects.
+
+
+
+ The filter highlights corners of objects on the image using provided corners
+ detection algorithm.
+
+ The filter accepts 8 bpp grayscale and 24/32 color images for processing.
+
+ Sample usage:
+
+ // create corner detector's instance
+ SusanCornersDetector scd = new SusanCornersDetector( );
+ // create corner maker filter
+ CornersMarker filter = new CornersMarker( scd, Color.Red );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Interface of corners' detection algorithm.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Interface of corners' detection algorithm.
+ Marker's color used to mark corner.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Color used to mark corners.
+
+
+
+
+ Interface of corners' detection algorithm used to detect corners.
+
+
+
+
+ Flood filling with mean color starting from specified point.
+
+
+ The filter performs image's area filling (4 directional) starting
+ from the specified point. It fills
+ the area of the pointed color, but also fills other colors, which
+ are similar to the pointed within specified tolerance.
+ The area is filled using its mean color.
+
+
+ The filter is similar to filter, but instead
+ of filling the are with specified color, it fills the area with its mean color. This means
+ that this is a two pass filter - first pass is to calculate the mean value and the second pass is to
+ fill the area. Unlike to filter, this filter has nothing
+ to do in the case if zero tolerance is specified.
+
+ The filter accepts 8 bpp grayscale images and 24 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ PointedMeanFloodFill filter = new PointedMeanFloodFill( );
+ // configre the filter
+ filter.Tolerance = Color.FromArgb( 150, 92, 92 );
+ filter.StartingPoint = new IntPoint( 150, 100 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Flood fill tolerance.
+
+
+ The tolerance value determines the level of similarity between
+ colors to fill and the pointed color. If the value is set to zero, then the
+ filter does nothing, since the filling area contains only one color and its
+ filling with mean is meaningless.
+
+ The tolerance value is specified as ,
+ where each component (R, G and B) represents tolerance for the corresponding
+ component of color. This allows to set different tolerances for red, green
+ and blue components.
+
+ Default value is set to (16, 16, 16).
+
+
+
+
+
+ Point to start filling from.
+
+
+ The property allows to set the starting point, where filling is
+ started from.
+
+ Default value is set to (0, 0).
+
+
+
+
+
+ Color filtering.
+
+
+ The filter filters pixels inside/outside of specified RGB color range -
+ it keeps pixels with colors inside/outside of specified range and fills the rest with
+ specified color.
+
+ The filter accepts 24 and 32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ ColorFiltering filter = new ColorFiltering( );
+ // set color ranges to keep
+ filter.Red = new IntRange( 100, 255 );
+ filter.Green = new IntRange( 0, 75 );
+ filter.Blue = new IntRange( 0, 75 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Red components filtering range.
+ Green components filtering range.
+ Blue components filtering range.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Range of red color component.
+
+
+
+
+ Range of green color component.
+
+
+
+
+ Range of blue color component.
+
+
+
+
+ Fill color used to fill filtered pixels.
+
+
+
+
+ Determines, if pixels should be filled inside or outside of specified
+ color ranges.
+
+
+ Default value is set to , which means
+ the filter removes colors outside of the specified range.
+
+
+
+
+ Color dithering using Jarvis, Judice and Ninke error diffusion.
+
+
+ The image processing routine represents color dithering algorithm, which is based on
+ error diffusion dithering with Jarvis-Judice-Ninke coefficients. Error is diffused
+ on 12 neighbor pixels with next coefficients:
+
+ | * | 7 | 5 |
+ | 3 | 5 | 7 | 5 | 3 |
+ | 1 | 3 | 5 | 3 | 1 |
+
+ / 48
+
+
+ The image processing routine accepts 24/32 bpp color images for processing. As a result this routine
+ produces 4 bpp or 8 bpp indexed image, which depends on size of the specified
+ color table - 4 bpp result for
+ color tables with 16 colors or less; 8 bpp result for larger color tables.
+
+ Sample usage:
+
+ // create color image quantization routine
+ ColorImageQuantizer ciq = new ColorImageQuantizer( new MedianCutQuantizer( ) );
+ // create 32 colors table
+ Color[] colorTable = ciq.CalculatePalette( image, 32 );
+ // create dithering routine
+ JarvisJudiceNinkeColorDithering dithering = new JarvisJudiceNinkeColorDithering( );
+ dithering.ColorTable = colorTable;
+ // apply the dithering routine
+ Bitmap newImage = dithering.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Simple skeletonization filter.
+
+
+ The filter build simple objects' skeletons by thinning them until
+ they have one pixel wide "bones" horizontally and vertically. The filter uses
+ and colors to distinguish
+ between object and background.
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ SimpleSkeletonization filter = new SimpleSkeletonization( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Background pixel color.
+ Foreground pixel color.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Background pixel color.
+
+
+ The property sets background (none object) color to look for.
+
+ Default value is set to 0 - black.
+
+
+
+
+ Foreground pixel color.
+
+
+ The property sets objects' (none background) color to look for.
+
+ Default value is set to 255 - white.
+
+
+
+
+ Connected components labeling.
+
+
+ The filter performs labeling of objects in the source image. It colors
+ each separate object using different color. The image processing filter treats all none
+ black pixels as objects' pixels and all black pixel as background.
+
+ The filter accepts 8 bpp grayscale images and 24/32 bpp color images and produces
+ 24 bpp RGB image.
+
+ Sample usage:
+
+ // create filter
+ ConnectedComponentsLabeling filter = new ConnectedComponentsLabeling( );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+ // check objects count
+ int objectCount = filter.ObjectCount;
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Blob counter used to locate separate blobs.
+
+
+ The property allows to set blob counter to use for blobs' localization.
+
+ Default value is set to .
+
+
+
+
+
+ Colors used to color the binary image.
+
+
+
+
+ Specifies if blobs should be filtered.
+
+
+ See documentation for property
+ of class for more information.
+
+
+
+
+ Specifies if size filetering should be coupled or not.
+
+
+ See documentation for property
+ of class for more information.
+
+
+
+
+ Minimum allowed width of blob.
+
+
+
+
+
+ Minimum allowed height of blob.
+
+
+
+
+
+ Maximum allowed width of blob.
+
+
+
+
+
+ Maximum allowed height of blob.
+
+
+
+
+
+ Objects count.
+
+
+ The amount of objects found in the last processed image.
+
+
+
+
+ Morph filter.
+
+
+ The filter combines two images by taking
+ specified percent of pixels' intensities from source
+ image and the rest from overlay image. For example, if the
+ source percent value is set to 0.8, then each pixel
+ of the result image equals to 0.8 * source + 0.2 * overlay, where source
+ and overlay are corresponding pixels' values in source and overlay images.
+
+ The filter accepts 8 bpp grayscale and 24 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Morph filter = new Morph( overlayImage );
+ filter.SourcePercent = 0.75;
+ // apply the filter
+ Bitmap resultImage = filter.Apply( sourceImage );
+
+
+ Source image:
+
+ Overlay image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Overlay image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged overlay image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Overlay image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Percent of source image to keep, [0, 1].
+
+
+ The property specifies the percentage of source pixels' to take. The
+ rest is taken from an overlay image.
+
+
+
+
+ Filtering of frequencies outside of specified range in complex Fourier
+ transformed image.
+
+
+ The filer keeps only specified range of frequencies in complex
+ Fourier transformed image. The rest of frequencies are zeroed.
+
+ Sample usage:
+
+ // create complex image
+ ComplexImage complexImage = ComplexImage.FromBitmap( image );
+ // do forward Fourier transformation
+ complexImage.ForwardFourierTransform( );
+ // create filter
+ FrequencyFilter filter = new FrequencyFilter( new IntRange( 20, 128 ) );
+ // apply filter
+ filter.Apply( complexImage );
+ // do backward Fourier transformation
+ complexImage.BackwardFourierTransform( );
+ // get complex image as bitmat
+ Bitmap fourierImage = complexImage.ToBitmap( );
+
+
+ Initial image:
+
+ Fourier image:
+
+
+
+
+
+
+ Image processing filter, which operates with Fourier transformed
+ complex image.
+
+
+ The interface defines the set of methods, which should be
+ provided by all image processing filter, which operate with Fourier
+ transformed complex image.
+
+
+
+
+ Apply filter to complex image.
+
+
+ Complex image to apply filter to.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Range of frequencies to keep.
+
+
+
+
+ Apply filter to complex image.
+
+
+ Complex image to apply filter to.
+
+ The source complex image should be Fourier transformed.
+
+
+
+
+ Range of frequencies to keep.
+
+
+ The range specifies the range of frequencies to keep. Values is frequencies
+ outside of this range are zeroed.
+
+ Default value is set to [0, 1024].
+
+
+
+
+ Resize image using bicubic interpolation algorithm.
+
+
+ The class implements image resizing filter using bicubic
+ interpolation algorithm. It uses bicubic kernel W(x) as described on
+ Wikipedia
+ (coefficient a is set to -0.5).
+
+ The filter accepts 8 grayscale images and 24 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ ResizeBicubic filter = new ResizeBicubic( 400, 300 );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Base class for image resizing filters.
+
+
+ The abstract class is the base class for all filters,
+ which implement image rotation algorithms.
+
+
+
+
+
+ New image width.
+
+
+
+
+ New image height.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Width of the new resized image.
+ Height of the new resize image.
+
+
+
+
+ Calculates new image size.
+
+
+ Source image data.
+
+ New image size - size of the destination image.
+
+
+
+
+ Width of the new resized image.
+
+
+
+
+
+ Height of the new resized image.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Width of new image.
+ Height of new image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Performs quadrilateral transformation of an area in a given source image.
+
+
+ The class implements quadrilateral transformation algorithm,
+ which allows to transform any quadrilateral from a given source image
+ to a rectangular image. The idea of the algorithm is based on homogeneous
+ transformation and its math is described by Paul Heckbert in his
+ "Projective Mappings for Image Warping" paper.
+
+
+ The image processing filter accepts 8 grayscale images and 24/32 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // define quadrilateral's corners
+ List<IntPoint> corners = new List<IntPoint>( );
+ corners.Add( new IntPoint( 99, 99 ) );
+ corners.Add( new IntPoint( 156, 79 ) );
+ corners.Add( new IntPoint( 184, 126 ) );
+ corners.Add( new IntPoint( 122, 150 ) );
+ // create filter
+ QuadrilateralTransformation filter =
+ new QuadrilateralTransformation( corners, 200, 200 );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ New image width.
+
+
+
+
+ New image height.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Corners of the source quadrilateral area.
+ Width of the new transformed image.
+ Height of the new transformed image.
+
+ This constructor sets to
+ , which means that destination image will have width and
+ height as specified by user.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Corners of the source quadrilateral area.
+
+ This constructor sets to
+ , which means that destination image will have width and
+ height automatically calculated based on property.
+
+
+
+
+ Calculates new image size.
+
+
+ Source image data.
+
+ New image size - size of the destination image.
+
+ Source quadrilateral was not set.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Automatic calculation of destination image or not.
+
+
+ The property specifies how to calculate size of destination (transformed)
+ image. If the property is set to , then
+ and properties have effect and destination image's size is
+ specified by user. If the property is set to , then setting the above
+ mentioned properties does not have any effect, but destionation image's size is
+ automatically calculated from property - width and height
+ come from length of longest edges.
+
+
+ Default value is set to .
+
+
+
+
+
+ Quadrilateral's corners in source image.
+
+
+ The property specifies four corners of the quadrilateral area
+ in the source image to be transformed.
+
+
+
+
+
+ Width of the new transformed image.
+
+
+ The property defines width of the destination image, which gets
+ transformed quadrilateral image.
+
+ Setting the property does not have any effect, if
+ property is set to . In this case destination image's width
+ is calculated automatically based on property.
+
+
+
+
+
+ Height of the new transformed image.
+
+
+ The property defines height of the destination image, which gets
+ transformed quadrilateral image.
+
+ Setting the property does not have any effect, if
+ property is set to . In this case destination image's height
+ is calculated automatically based on property.
+
+
+
+
+
+ Specifies if bilinear interpolation should be used or not.
+
+
+ Default value is set to - interpolation
+ is used.
+
+
+
+
+
+ Saturation adjusting in HSL color space.
+
+
+ The filter operates in HSL color space and adjusts
+ pixels' saturation value, increasing it or decreasing by specified percentage.
+ The filters is based on filter, passing work to it after
+ recalculating saturation adjust value to input/output
+ ranges of the filter.
+
+ The filter accepts 24 and 32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ SaturationCorrection filter = new SaturationCorrection( -0.5f );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Saturation adjust value.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Saturation adjust value, [-1, 1].
+
+
+ Default value is set to 0.1, which corresponds to increasing
+ saturation by 10%.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Convolution filter.
+
+
+ The filter implements convolution operator, which calculates each pixel
+ of the result image as weighted sum of the correspond pixel and its neighbors in the source
+ image. The weights are set by convolution kernel. The weighted
+ sum is divided by before putting it into result image and also
+ may be thresholded using value.
+
+ Convolution is a simple mathematical operation which is fundamental to many common
+ image processing filters. Depending on the type of provided kernel, the filter may produce
+ different results, like blur image, sharpen it, find edges, etc.
+
+ The filter accepts 8 and 16 bpp grayscale images and 24, 32, 48 and 64 bpp
+ color images for processing. Note: depending on the value of
+ property, the alpha channel is either copied as is or processed with the kernel.
+
+ Sample usage:
+
+ // define emboss kernel
+ int[,] kernel = {
+ { -2, -1, 0 },
+ { -1, 1, 1 },
+ { 0, 1, 2 } };
+ // create filter
+ Convolution filter = new Convolution( kernel );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Convolution kernel.
+
+ Using this constructor (specifying only convolution kernel),
+ division factor will be calculated automatically
+ summing all kernel values. In the case if kernel's sum equals to zero,
+ division factor will be assigned to 1.
+
+ Invalid kernel size is specified. Kernel must be
+ square, its width/height should be odd and should be in the [3, 25] range.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Convolution kernel.
+ Divisor, used used to divide weighted sum.
+
+ Invalid kernel size is specified. Kernel must be
+ square, its width/height should be odd and should be in the [3, 25] range.
+ Divisor can not be equal to zero.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Convolution kernel.
+
+
+
+ Convolution kernel must be square and its width/height
+ should be odd and should be in the [3, 99] range.
+
+ Setting convolution kernel through this property does not
+ affect - it is not recalculated automatically.
+
+
+ Invalid kernel size is specified.
+
+
+
+
+ Division factor.
+
+
+ The value is used to divide convolution - weighted sum
+ of pixels is divided by this value.
+
+ The value may be calculated automatically in the case if constructor
+ with one parameter is used ().
+
+
+ Divisor can not be equal to zero.
+
+
+
+
+ Threshold to add to weighted sum.
+
+
+ The property specifies threshold value, which is added to each weighted
+ sum of pixels. The value is added right after division was done by
+ value.
+
+ Default value is set to 0.
+
+
+
+
+
+ Use dynamic divisor for edges or not.
+
+
+ The property specifies how to handle edges. If it is set to
+ , then the same divisor (which is specified by
+ property or calculated automatically) will be applied both for non-edge regions
+ and for edge regions. If the value is set to , then dynamically
+ calculated divisor will be used for edge regions, which is sum of those kernel
+ elements, which are taken into account for particular processed pixel
+ (elements, which are not outside image).
+
+ Default value is set to .
+
+
+
+
+
+ Specifies if alpha channel must be processed or just copied.
+
+
+ The property specifies the way how alpha channel is handled for 32 bpp
+ and 64 bpp images. If the property is set to , then alpha
+ channel's values are just copied as is. If the property is set to
+ then alpha channel is convolved using the specified kernel same way as RGB channels.
+
+ Default value is set to .
+
+
+
+
+
+ Convert grayscale image to RGB.
+
+
+ The filter creates color image from specified grayscale image
+ initializing all RGB channels to the same value - pixel's intensity of grayscale image.
+
+ The filter accepts 8 bpp grayscale images and produces
+ 24 bpp RGB image.
+
+ Sample usage:
+
+ // create filter
+ GrayscaleToRGB filter = new GrayscaleToRGB( );
+ // apply the filter
+ Bitmap rgbImage = filter.Apply( image );
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Adaptive thresholding using the internal image.
+
+
+ The image processing routine implements local thresholding technique described
+ by Derek Bradley and Gerhard Roth in the "Adaptive Thresholding Using the Integral Image" paper.
+
+
+ The brief idea of the algorithm is that every image's pixel is set to black if its brightness
+ is t percent lower (see ) than the average brightness
+ of surrounding pixels in the window of the specified size (see ), othwerwise it is set
+ to white.
+
+ Sample usage:
+
+ // create the filter
+ BradleyLocalThresholding filter = new BradleyLocalThresholding( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+
+
+
+
+ Window size to calculate average value of pixels for.
+
+
+ The property specifies window size around processing pixel, which determines number of
+ neighbor pixels to use for calculating their average brightness.
+
+ Default value is set to 41.
+
+ The value should be odd.
+
+
+
+
+
+ Brightness difference limit between processing pixel and average value across neighbors.
+
+
+ The property specifies what is the allowed difference percent between processing pixel
+ and average brightness of neighbor pixels in order to be set white. If the value of the
+ current pixel is t percent (this property value) lower than the average then it is set
+ to black, otherwise it is set to white.
+
+ Default value is set to 0.15.
+
+
+
+
+
+ Format translations dictionary.
+
+
+ See for more information.
+
+
+
+
+ Integral image.
+
+
+ The class implements integral image concept, which is described by
+ Viola and Jones in: P. Viola and M. J. Jones, "Robust real-time face detection",
+ Int. Journal of Computer Vision 57(2), pp. 137–154, 2004.
+
+ "An integral image I of an input image G is defined as the image in which the
+ intensity at a pixel position is equal to the sum of the intensities of all the pixels
+ above and to the left of that position in the original image."
+
+ The intensity at position (x, y) can be written as:
+
+ x y
+ I(x,y) = SUM( SUM( G(i,j) ) )
+ i=0 j=0
+
+
+ The class uses 32-bit integers to represent integral image.
+
+ The class processes only grayscale (8 bpp indexed) images.
+
+ This class contains two versions of each method: safe and unsafe. Safe methods do
+ checks of provided coordinates and ensure that these coordinates belong to the image, what makes
+ these methods slower. Unsafe methods do not do coordinates' checks and rely that these
+ coordinates belong to the image, what makes these methods faster.
+
+ Sample usage:
+
+ // create integral image
+ IntegralImage im = IntegralImage.FromBitmap( image );
+ // get pixels' mean value in the specified rectangle
+ float mean = im.GetRectangleMean( 10, 10, 20, 30 )
+
+
+
+
+
+
+ Intergral image's array.
+
+
+ See remarks to property.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image width.
+ Image height.
+
+ The constractor is protected, what makes it imposible to instantiate this
+ class directly. To create an instance of this class or
+ method should be used.
+
+
+
+
+ Construct integral image from source grayscale image.
+
+
+ Source grayscale image.
+
+ Returns integral image.
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Construct integral image from source grayscale image.
+
+
+ Source image data.
+
+ Returns integral image.
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Construct integral image from source grayscale image.
+
+
+ Source unmanaged image.
+
+ Returns integral image.
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Calculate sum of pixels in the specified rectangle.
+
+
+ X coordinate of left-top rectangle's corner.
+ Y coordinate of left-top rectangle's corner.
+ X coordinate of right-bottom rectangle's corner.
+ Y coordinate of right-bottom rectangle's corner.
+
+ Returns sum of pixels in the specified rectangle.
+
+ Both specified points are included into the calculation rectangle.
+
+
+
+
+ Calculate horizontal (X) haar wavelet at the specified point.
+
+
+ X coordinate of the point to calculate wavelet at.
+ Y coordinate of the point to calculate wavelet at.
+ Wavelet size to calculate.
+
+ Returns value of the horizontal wavelet at the specified point.
+
+ The method calculates horizontal wavelet, which is a difference
+ of two horizontally adjacent boxes' sums, i.e. A-B. A is the sum of rectangle with coordinates
+ (x, y-radius, x+radius-1, y+radius-1). B is the sum of rectangle with coordinates
+ (x-radius, y-radius, x-1, y+radiys-1).
+
+
+
+
+ Calculate vertical (Y) haar wavelet at the specified point.
+
+
+ X coordinate of the point to calculate wavelet at.
+ Y coordinate of the point to calculate wavelet at.
+ Wavelet size to calculate.
+
+ Returns value of the vertical wavelet at the specified point.
+
+ The method calculates vertical wavelet, which is a difference
+ of two vertical adjacent boxes' sums, i.e. A-B. A is the sum of rectangle with coordinates
+ (x-radius, y, x+radius-1, y+radius-1). B is the sum of rectangle with coordinates
+ (x-radius, y-radius, x+radius-1, y-1).
+
+
+
+
+ Calculate sum of pixels in the specified rectangle without checking it's coordinates.
+
+
+ X coordinate of left-top rectangle's corner.
+ Y coordinate of left-top rectangle's corner.
+ X coordinate of right-bottom rectangle's corner.
+ Y coordinate of right-bottom rectangle's corner.
+
+ Returns sum of pixels in the specified rectangle.
+
+ Both specified points are included into the calculation rectangle.
+
+
+
+
+ Calculate sum of pixels in the specified rectangle.
+
+
+ X coordinate of central point of the rectangle.
+ Y coordinate of central point of the rectangle.
+ Radius of the rectangle.
+
+ Returns sum of pixels in the specified rectangle.
+
+ The method calculates sum of pixels in square rectangle with
+ odd width and height. In the case if it is required to calculate sum of
+ 3x3 rectangle, then it is required to specify its center and radius equal to 1.
+
+
+
+
+
+ Calculate sum of pixels in the specified rectangle without checking it's coordinates.
+
+
+ X coordinate of central point of the rectangle.
+ Y coordinate of central point of the rectangle.
+ Radius of the rectangle.
+
+ Returns sum of pixels in the specified rectangle.
+
+ The method calculates sum of pixels in square rectangle with
+ odd width and height. In the case if it is required to calculate sum of
+ 3x3 rectangle, then it is required to specify its center and radius equal to 1.
+
+
+
+
+
+ Calculate mean value of pixels in the specified rectangle.
+
+
+ X coordinate of left-top rectangle's corner.
+ Y coordinate of left-top rectangle's corner.
+ X coordinate of right-bottom rectangle's corner.
+ Y coordinate of right-bottom rectangle's corner.
+
+ Returns mean value of pixels in the specified rectangle.
+
+ Both specified points are included into the calculation rectangle.
+
+
+
+
+ Calculate mean value of pixels in the specified rectangle without checking it's coordinates.
+
+
+ X coordinate of left-top rectangle's corner.
+ Y coordinate of left-top rectangle's corner.
+ X coordinate of right-bottom rectangle's corner.
+ Y coordinate of right-bottom rectangle's corner.
+
+ Returns mean value of pixels in the specified rectangle.
+
+ Both specified points are included into the calculation rectangle.
+
+
+
+
+ Calculate mean value of pixels in the specified rectangle.
+
+
+ X coordinate of central point of the rectangle.
+ Y coordinate of central point of the rectangle.
+ Radius of the rectangle.
+
+ Returns mean value of pixels in the specified rectangle.
+
+ The method calculates mean value of pixels in square rectangle with
+ odd width and height. In the case if it is required to calculate mean value of
+ 3x3 rectangle, then it is required to specify its center and radius equal to 1.
+
+
+
+
+
+ Calculate mean value of pixels in the specified rectangle without checking it's coordinates.
+
+
+ X coordinate of central point of the rectangle.
+ Y coordinate of central point of the rectangle.
+ Radius of the rectangle.
+
+ Returns mean value of pixels in the specified rectangle.
+
+ The method calculates mean value of pixels in square rectangle with
+ odd width and height. In the case if it is required to calculate mean value of
+ 3x3 rectangle, then it is required to specify its center and radius equal to 1.
+
+
+
+
+
+ Width of the source image the integral image was constructed for.
+
+
+
+
+ Height of the source image the integral image was constructed for.
+
+
+
+
+ Provides access to internal array keeping integral image data.
+
+
+
+ The array should be accessed by [y, x] indexing.
+
+ The array's size is [+1, +1]. The first
+ row and column are filled with zeros, what is done for more efficient calculation of
+ rectangles' sums.
+
+
+
+
+
+ Gather statistics about image in RGB color space.
+
+
+ The class is used to accumulate statistical values about images,
+ like histogram, mean, standard deviation, etc. for each color channel in RGB color
+ space.
+
+ The class accepts 8 bpp grayscale and 24/32 bpp color images for processing.
+
+ Sample usage:
+
+ // gather statistics
+ ImageStatistics stat = new ImageStatistics( image );
+ // get red channel's histogram
+ Histogram red = stat.Red;
+ // check mean value of red channel
+ if ( red.Mean > 128 )
+ {
+ // do further processing
+ }
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+
+ Source pixel format is not supported.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+ Mask image which specifies areas to collect statistics for.
+
+ The mask image must be a grayscale/binary (8bpp) image of the same size as the
+ specified source image, where black pixels (value 0) correspond to areas which should be excluded
+ from processing. So statistics is calculated only for pixels, which are none black in the mask image.
+
+
+ Source pixel format is not supported.
+ Mask image must be 8 bpp grayscale image.
+ Mask must have the same size as the source image to get statistics for.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+ Mask array which specifies areas to collect statistics for.
+
+ The mask array must be of the same size as the specified source image, where 0 values
+ correspond to areas which should be excluded from processing. So statistics is calculated only for pixels,
+ which have none zero corresponding value in the mask.
+
+
+ Source pixel format is not supported.
+ Mask must have the same size as the source image to get statistics for.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged image to gather statistics about.
+
+ Source pixel format is not supported.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+ Mask image which specifies areas to collect statistics for.
+
+ The mask image must be a grayscale/binary (8bpp) image of the same size as the
+ specified source image, where black pixels (value 0) correspond to areas which should be excluded
+ from processing. So statistics is calculated only for pixels, which are none black in the mask image.
+
+
+ Source pixel format is not supported.
+ Mask image must be 8 bpp grayscale image.
+ Mask must have the same size as the source image to get statistics for.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+ Mask array which specifies areas to collect statistics for.
+
+ The mask array must be of the same size as the specified source image, where 0 values
+ correspond to areas which should be excluded from processing. So statistics is calculated only for pixels,
+ which have none zero corresponding value in the mask.
+
+
+ Source pixel format is not supported.
+ Mask must have the same size as the source image to get statistics for.
+
+
+
+
+ Histogram of red channel.
+
+
+ The property is valid only for color images
+ (see property).
+
+
+
+
+ Histogram of green channel.
+
+
+ The property is valid only for color images
+ (see property).
+
+
+
+
+ Histogram of blue channel.
+
+
+ The property is valid only for color images
+ (see property).
+
+
+
+
+ Histogram of gray channel.
+
+
+ The property is valid only for grayscale images
+ (see property).
+
+
+
+
+ Histogram of red channel excluding black pixels.
+
+
+ The property keeps statistics about red channel, which
+ excludes all black pixels, what affects mean, standard deviation, etc.
+
+ The property is valid only for color images
+ (see property).
+
+
+
+
+ Histogram of green channel excluding black pixels.
+
+
+ The property keeps statistics about green channel, which
+ excludes all black pixels, what affects mean, standard deviation, etc.
+
+ The property is valid only for color images
+ (see property).
+
+
+
+
+ Histogram of blue channel excluding black pixels
+
+
+ The property keeps statistics about blue channel, which
+ excludes all black pixels, what affects mean, standard deviation, etc.
+
+ The property is valid only for color images
+ (see property).
+
+
+
+
+ Histogram of gray channel channel excluding black pixels.
+
+
+ The property keeps statistics about gray channel, which
+ excludes all black pixels, what affects mean, standard deviation, etc.
+
+ The property is valid only for grayscale images
+ (see property).
+
+
+
+
+ Total pixels count in the processed image.
+
+
+
+
+
+ Total pixels count in the processed image excluding black pixels.
+
+
+
+
+
+ Value wich specifies if the processed image was color or grayscale.
+
+
+ If the value is set to then
+ property should be used to get statistics information about image. Otherwise
+ , and properties should be used
+ for color images.
+
+
+
+
+ Horizontal intensity statistics.
+
+
+ The class provides information about horizontal distribution
+ of pixel intensities, which may be used to locate objects, their centers, etc.
+
+
+ The class accepts grayscale (8 bpp indexed and 16 bpp) and color (24, 32, 48 and 64 bpp) images.
+ In the case of 32 and 64 bpp color images, the alpha channel is not processed - statistics is not
+ gathered for this channel.
+
+ Sample usage:
+
+ // collect statistics
+ HorizontalIntensityStatistics his = new HorizontalIntensityStatistics( sourceImage );
+ // get gray histogram (for grayscale image)
+ Histogram histogram = his.Gray;
+ // output some histogram's information
+ System.Diagnostics.Debug.WriteLine( "Mean = " + histogram.Mean );
+ System.Diagnostics.Debug.WriteLine( "Min = " + histogram.Min );
+ System.Diagnostics.Debug.WriteLine( "Max = " + histogram.Max );
+
+
+ Sample grayscale image with its horizontal intensity histogram:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Source image data.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Source unmanaged image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Gather horizontal intensity statistics for specified image.
+
+
+ Source image.
+
+
+
+
+ Histogram for red channel.
+
+
+
+
+
+ Histogram for green channel.
+
+
+
+
+
+ Histogram for blue channel.
+
+
+
+
+
+ Histogram for gray channel (intensities).
+
+
+
+
+
+ Value wich specifies if the processed image was color or grayscale.
+
+
+ If the property equals to true, then the
+ property should be used to retrieve histogram for the processed grayscale image.
+ Otherwise , and property
+ should be used to retrieve histogram for particular RGB channel of the processed
+ color image.
+
+
+
+
+ Performs quadrilateral transformation using nearest neighbor algorithm for interpolation.
+
+
+ The class is deprecated and should be used instead.
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Corners of the source quadrilateral area.
+ Width of the new transformed image.
+ Height of the new transformed image.
+
+ This constructor sets to
+ , which means that destination image will have width and
+ height as specified by user.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Corners of the source quadrilateral area.
+
+ This constructor sets to
+ , which means that destination image will have width and
+ height automatically calculated based on property.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Calculates new image size.
+
+
+ Source image data.
+
+ New image size - size of the destination image.
+
+ The specified quadrilateral's corners are outside of the given image.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Automatic calculation of destination image or not.
+
+
+ The property specifies how to calculate size of destination (transformed)
+ image. If the property is set to , then
+ and properties have effect and destination image's size is
+ specified by user. If the property is set to , then setting the above
+ mentioned properties does not have any effect, but destionation image's size is
+ automatically calculated from property - width and height
+ come from length of longest edges.
+
+
+
+
+
+ Quadrilateral's corners in source image.
+
+
+ The property specifies four corners of the quadrilateral area
+ in the source image to be transformed.
+
+
+
+
+
+ Width of the new transformed image.
+
+
+ The property defines width of the destination image, which gets
+ transformed quadrilateral image.
+
+ Setting the property does not have any effect, if
+ property is set to . In this case destination image's width
+ is calculated automatically based on property.
+
+
+
+
+
+ Height of the new transformed image.
+
+
+ The property defines height of the destination image, which gets
+ transformed quadrilateral image.
+
+ Setting the property does not have any effect, if
+ property is set to . In this case destination image's height
+ is calculated automatically based on property.
+
+
+
+
+
+ Median filter.
+
+
+ The median filter is normally used to reduce noise in an image, somewhat like
+ the mean filter. However, it often does a better job than the mean
+ filter of preserving useful detail in the image.
+
+ Each pixel of the original source image is replaced with the median of neighboring pixel
+ values. The median is calculated by first sorting all the pixel values from the surrounding
+ neighborhood into numerical order and then replacing the pixel being considered with the
+ middle pixel value.
+
+ The filter accepts 8 bpp grayscale images and 24/32 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Median filter = new Median( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Processing square size.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Processing square size for the median filter, [3, 25].
+
+
+ Default value is set to 3.
+
+ The value should be odd.
+
+
+
+
+
+ Textured filter - filter an image using texture.
+
+
+ The filter is similar to filter in its
+ nature, but instead of working with source image and overly, it uses provided
+ filters to create images to merge (see and
+ properties). In addition, it uses a bit more complex formula for calculation
+ of destination pixel's value, which gives greater amount of flexibility:
+ dst = * ( src1 * textureValue + src2 * ( 1.0 - textureValue ) ) + * src2,
+ where src1 is value of pixel from the image produced by ,
+ src2 is value of pixel from the image produced by ,
+ dst is value of pixel in a destination image and textureValue is corresponding value
+ from provided texture (see or ).
+
+ It is possible to set to . In this case
+ original source image will be used instead of result produced by the second filter.
+
+ The filter 24 bpp color images for processing.
+
+ Sample usage #1:
+
+ // create filter
+ TexturedFilter filter = new TexturedFilter( new CloudsTexture( ),
+ new HueModifier( 50 ) );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Sample usage #2:
+
+ // create filter
+ TexturedFilter filter = new TexturedFilter( new CloudsTexture( ),
+ new GrayscaleBT709( ), new Sepia( ) );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image #1:
+
+ Result image #2:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Generated texture.
+ First filter.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Generated texture.
+ First filter.
+ Second filter.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Texture generator.
+ First filter.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Texture generator.
+ First filter.
+ Second filter.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+ Texture size does not match image size.
+ Filters should not change image dimension.
+
+
+
+
+ Format translations dictionary.
+
+
+ See for more information.
+
+
+
+
+ Filter level value, [0, 1].
+
+
+ Filtering factor determines portion of the destionation image, which is formed
+ as a result of merging source images using specified texture.
+
+ Default value is set to 1.0.
+
+ See class description for more details.
+
+
+
+
+
+ Preserve level value
+
+
+ Preserving factor determines portion taken from the image produced
+ by (or from original source) without applying textured
+ merge to it.
+
+ Default value is set to 0.0.
+
+ See class description for more details.
+
+
+
+
+
+ Generated texture.
+
+
+ Two dimensional array of texture intensities.
+
+ Size of the provided texture should be the same as size of images, which will
+ be passed to the filter.
+
+ The property has priority over this property - if
+ generator is specified than the static generated texture is not used.
+
+
+
+
+
+ Texture generator.
+
+
+ Generator used to generate texture.
+
+ The property has priority over the property.
+
+
+
+
+
+ First filter.
+
+
+ Filter, which is used to produce first image for the merge. The filter
+ needs to implement interface, so it could be possible
+ to get information about the filter. The filter must be able to process color 24 bpp
+ images and produce color 24 bpp or grayscale 8 bppp images as result.
+
+
+ The specified filter does not support 24 bpp color images.
+ The specified filter does not produce image of supported format.
+ The specified filter does not implement IFilterInformation interface.
+
+
+
+
+ Second filter
+
+
+ Filter, which is used to produce second image for the merge. The filter
+ needs to implement interface, so it could be possible
+ to get information about the filter. The filter must be able to process color 24 bpp
+ images and produce color 24 bpp or grayscale 8 bppp images as result.
+
+ The filter may be set to . In this case original source image
+ is used as a second image for the merge.
+
+
+ The specified filter does not support 24 bpp color images.
+ The specified filter does not produce image of supported format.
+ The specified filter does not implement IFilterInformation interface.
+
+
+
+
+ Top-hat operator from Mathematical Morphology.
+
+
+ Top-hat morphological operator subtracts
+ result of morphological opening on the input image
+ from the input image itself.
+
+ Applied to binary image, the filter allows to get all those object (their parts)
+ which were removed by opening filter, but never restored.
+
+ The filter accepts 8 and 16 bpp grayscale images and 24 and 48 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ TopHat filter = new TopHat( );
+ // apply the filter
+ filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Structuring element to pass to operator.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Difference edge detector.
+
+
+ The filter finds objects' edges by calculating maximum difference
+ between pixels in 4 directions around the processing pixel.
+
+ Suppose 3x3 square element of the source image (x - is currently processed
+ pixel):
+
+ P1 P2 P3
+ P8 x P4
+ P7 P6 P5
+
+ The corresponding pixel of the result image equals to:
+
+ max( |P1-P5|, |P2-P6|, |P3-P7|, |P4-P8| )
+
+
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ DifferenceEdgeDetector filter = new DifferenceEdgeDetector( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Mean filter.
+
+
+ The filter performs each pixel value's averaging with its 8 neighbors, which is
+ convolution filter using the mean kernel:
+
+
+ 1 1 1
+ 1 1 1
+ 1 1 1
+
+
+ For the list of supported pixel formats, see the documentation to
+ filter.
+
+ With the above kernel the convolution filter is just calculates each pixel's value
+ in result image as average of 9 corresponding pixels in the source image.
+
+ By default this filter sets property to
+ , so the alpha channel of 32 bpp and 64 bpp images is blurred as well.
+
+
+ Sample usage:
+
+ // create filter
+ Mean filter = new Mean( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Linear correction of RGB channels.
+
+
+ The filter performs linear correction of RGB channels by mapping specified
+ channels' input ranges to output ranges. It is similar to the
+ , but the remapping is linear.
+
+ The filter accepts 8 bpp grayscale and 24/32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ LevelsLinear filter = new LevelsLinear( );
+ // set ranges
+ filter.InRed = new IntRange( 30, 230 );
+ filter.InGreen = new IntRange( 50, 240 );
+ filter.InBlue = new IntRange( 10, 210 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Calculate conversion map.
+
+
+ Input range.
+ Output range.
+ Conversion map.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Red component's input range.
+
+
+
+
+ Green component's input range.
+
+
+
+
+ Blue component's input range.
+
+
+
+
+ Gray component's input range.
+
+
+
+
+ Input range for RGB components.
+
+
+ The property allows to set red, green and blue input ranges to the same value.
+
+
+
+
+ Red component's output range.
+
+
+
+
+ Green component's output range.
+
+
+
+
+ Blue component's output range.
+
+
+
+
+ Gray component's output range.
+
+
+
+
+ Output range for RGB components.
+
+
+ The property allows to set red, green and blue output ranges to the same value.
+
+
+
+
+ Threshold using Simple Image Statistics (SIS).
+
+
+ The filter performs image thresholding calculating threshold automatically
+ using simple image statistics method. For each pixel:
+
+ - two gradients are calculated - ex = |I(x + 1, y) - I(x - 1, y)| and
+ |I(x, y + 1) - I(x, y - 1)|;
+ - weight is calculated as maximum of two gradients;
+ - sum of weights is updated (weightTotal += weight);
+ - sum of weighted pixel values is updated (total += weight * I(x, y)).
+
+ The result threshold is calculated as sum of weighted pixel values divided by sum of weight.
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ SISThreshold filter = new SISThreshold( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image (calculated threshold is 127):
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Calculate binarization threshold for the given image.
+
+
+ Image to calculate binarization threshold for.
+ Rectangle to calculate binarization threshold for.
+
+ Returns binarization threshold.
+
+ The method is used to calculate binarization threshold only. The threshold
+ later may be applied to the image using image processing filter.
+
+ Source pixel format is not supported by the routine. It should be
+ 8 bpp grayscale (indexed) image.
+
+
+
+
+ Calculate binarization threshold for the given image.
+
+
+ Image to calculate binarization threshold for.
+ Rectangle to calculate binarization threshold for.
+
+ Returns binarization threshold.
+
+ The method is used to calculate binarization threshold only. The threshold
+ later may be applied to the image using image processing filter.
+
+ Source pixel format is not supported by the routine. It should be
+ 8 bpp grayscale (indexed) image.
+
+
+
+
+ Calculate binarization threshold for the given image.
+
+
+ Image to calculate binarization threshold for.
+ Rectangle to calculate binarization threshold for.
+
+ Returns binarization threshold.
+
+ The method is used to calculate binarization threshold only. The threshold
+ later may be applied to the image using image processing filter.
+
+ Source pixel format is not supported by the routine. It should be
+ 8 bpp grayscale (indexed) image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Threshold value.
+
+
+ The property is read only and represents the value, which
+ was automaticaly calculated using image statistics.
+
+
+
+
+ Difference filter - get the difference between overlay and source images.
+
+
+ The difference filter takes two images (source and
+ overlay images)
+ of the same size and pixel format and produces an image, where each pixel equals
+ to absolute difference between corresponding pixels from provided images.
+
+ The filter accepts 8 and 16 bpp grayscale images and 24, 32, 48 and 64 bpp
+ color images for processing.
+
+ In the case if images with alpha channel are used (32 or 64 bpp), visualization
+ of the result image may seem a bit unexpected - most probably nothing will be seen
+ (in the case if image is displayed according to its alpha channel). This may be
+ caused by the fact that after differencing the entire alpha channel will be zeroed
+ (zero difference between alpha channels), what means that the resulting image will be
+ 100% transparent.
+
+ Sample usage:
+
+ // create filter
+ Difference filter = new Difference( overlayImage );
+ // apply the filter
+ Bitmap resultImage = filter.Apply( sourceImage );
+
+
+ Source image:
+
+ Overlay image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Overlay image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged overlay image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Overlay image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Image in unmanaged memory.
+
+
+
+ The class represents wrapper of an image in unmanaged memory. Using this class
+ it is possible as to allocate new image in unmanaged memory, as to just wrap provided
+ pointer to unmanaged memory, where an image is stored.
+
+ Usage of unmanaged images is mostly beneficial when it is required to apply multiple
+ image processing routines to a single image. In such scenario usage of .NET managed images
+ usually leads to worse performance, because each routine needs to lock managed image
+ before image processing is done and then unlock it after image processing is done. Without
+ these lock/unlock there is no way to get direct access to managed image's data, which means
+ there is no way to do fast image processing. So, usage of managed images lead to overhead, which
+ is caused by locks/unlock. Unmanaged images are represented internally using unmanaged memory
+ buffer. This means that it is not required to do any locks/unlocks in order to get access to image
+ data (no overhead).
+
+ Sample usage:
+
+ // sample 1 - wrapping .NET image into unmanaged without
+ // making extra copy of image in memory
+ BitmapData imageData = image.LockBits(
+ new Rectangle( 0, 0, image.Width, image.Height ),
+ ImageLockMode.ReadWrite, image.PixelFormat );
+
+ try
+ {
+ UnmanagedImage unmanagedImage = new UnmanagedImage( imageData ) );
+ // apply several routines to the unmanaged image
+ }
+ finally
+ {
+ image.UnlockBits( imageData );
+ }
+
+
+ // sample 2 - converting .NET image into unmanaged
+ UnmanagedImage unmanagedImage = UnmanagedImage.FromManagedImage( image );
+ // apply several routines to the unmanaged image
+ ...
+ // conver to managed image if it is required to display it at some point of time
+ Bitmap managedImage = unmanagedImage.ToManagedImage( );
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Pointer to image data in unmanaged memory.
+ Image width in pixels.
+ Image height in pixels.
+ Image stride (line size in bytes).
+ Image pixel format.
+
+ Using this constructor, make sure all specified image attributes are correct
+ and correspond to unmanaged memory buffer. If some attributes are specified incorrectly,
+ this may lead to exceptions working with the unmanaged memory.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Locked bitmap data.
+
+ Unlike method, this constructor does not make
+ copy of managed image. This means that managed image must stay locked for the time of using the instance
+ of unamanged image.
+
+
+
+
+ Destroys the instance of the class.
+
+
+
+
+
+ Dispose the object.
+
+
+ Frees unmanaged resources used by the object. The object becomes unusable
+ after that.
+
+ The method needs to be called only in the case if unmanaged image was allocated
+ using method. In the case if the class instance was created using constructor,
+ this method does not free unmanaged memory.
+
+
+
+
+
+ Dispose the object.
+
+
+ Indicates if disposing was initiated manually.
+
+
+
+
+ Clone the unmanaged images.
+
+
+ Returns clone of the unmanaged image.
+
+ The method does complete cloning of the object.
+
+
+
+
+ Copy unmanaged image.
+
+
+ Destination image to copy this image to.
+
+ The method copies current unmanaged image to the specified image.
+ Size and pixel format of the destination image must be exactly the same.
+
+ Destination image has different size or pixel format.
+
+
+
+
+ Allocate new image in unmanaged memory.
+
+
+ Image width.
+ Image height.
+ Image pixel format.
+
+ Return image allocated in unmanaged memory.
+
+ Allocate new image with specified attributes in unmanaged memory.
+
+ The method supports only
+ Format8bppIndexed,
+ Format16bppGrayScale,
+ Format24bppRgb,
+ Format32bppRgb,
+ Format32bppArgb,
+ Format32bppPArgb,
+ Format48bppRgb,
+ Format64bppArgb and
+ Format64bppPArgb pixel formats.
+ In the case if Format8bppIndexed
+ format is specified, pallete is not not created for the image (supposed that it is
+ 8 bpp grayscale image).
+
+
+
+ Unsupported pixel format was specified.
+ Invalid image size was specified.
+
+
+
+
+ Create managed image from the unmanaged.
+
+
+ Returns managed copy of the unmanaged image.
+
+ The method creates a managed copy of the unmanaged image with the
+ same size and pixel format (it calls specifying
+ for the makeCopy parameter).
+
+
+
+
+ Create managed image from the unmanaged.
+
+
+ Make a copy of the unmanaged image or not.
+
+ Returns managed copy of the unmanaged image.
+
+ If the is set to , then the method
+ creates a managed copy of the unmanaged image, so the managed image stays valid even when the unmanaged
+ image gets disposed. However, setting this parameter to creates a managed image which is
+ just a wrapper around the unmanaged image. So if unmanaged image is disposed, the
+ managed image becomes no longer valid and accessing it will generate an exception.
+
+ The unmanaged image has some invalid properties, which results
+ in failure of converting it to managed image. This may happen if user used the
+ constructor specifying some
+ invalid parameters.
+
+
+
+
+ Create unmanaged image from the specified managed image.
+
+
+ Source managed image.
+
+ Returns new unmanaged image, which is a copy of source managed image.
+
+ The method creates an exact copy of specified managed image, but allocated
+ in unmanaged memory.
+
+ Unsupported pixel format of source image.
+
+
+
+
+ Create unmanaged image from the specified managed image.
+
+
+ Source locked image data.
+
+ Returns new unmanaged image, which is a copy of source managed image.
+
+ The method creates an exact copy of specified managed image, but allocated
+ in unmanaged memory. This means that managed image may be unlocked right after call to this
+ method.
+
+ Unsupported pixel format of source image.
+
+
+
+
+ Collect pixel values from the specified list of coordinates.
+
+
+ List of coordinates to collect pixels' value from.
+
+ Returns array of pixels' values from the specified coordinates.
+
+ The method goes through the specified list of points and for each point retrievs
+ corresponding pixel's value from the unmanaged image.
+
+ For grayscale image the output array has the same length as number of points in the
+ specified list of points. For color image the output array has triple length, containing pixels'
+ values in RGB order.
+
+ The method does not make any checks for valid coordinates and leaves this up to user.
+ If specified coordinates are out of image's bounds, the result is not predictable (crash in most cases).
+
+
+ This method is supposed for images with 8 bpp channels only (8 bpp grayscale image and
+ 24/32 bpp color images).
+
+
+ Unsupported pixel format of the source image. Use Collect16bppPixelValues() method for
+ images with 16 bpp channels.
+
+
+
+
+ Collect coordinates of none black pixels in the image.
+
+
+ Returns list of points, which have other than black color.
+
+
+
+
+ Collect coordinates of none black pixels within specified rectangle of the image.
+
+
+ Image's rectangle to process.
+
+ Returns list of points, which have other than black color.
+
+
+
+
+ Set pixels with the specified coordinates to the specified color.
+
+
+ List of points to set color for.
+ Color to set for the specified points.
+
+ For images having 16 bpp per color plane, the method extends the specified color
+ value to 16 bit by multiplying it by 256.
+
+
+
+
+ Set pixel with the specified coordinates to the specified color.
+
+
+ Point's coordiates to set color for.
+ Color to set for the pixel.
+
+ See for more information.
+
+
+
+
+ Set pixel with the specified coordinates to the specified color.
+
+
+ X coordinate of the pixel to set.
+ Y coordinate of the pixel to set.
+ Color to set for the pixel.
+
+ For images having 16 bpp per color plane, the method extends the specified color
+ value to 16 bit by multiplying it by 256.
+
+ For grayscale images this method will calculate intensity value based on the below formula:
+
+ 0.2125 * Red + 0.7154 * Green + 0.0721 * Blue
+
+
+
+
+
+
+
+ Set pixel with the specified coordinates to the specified value.
+
+
+ X coordinate of the pixel to set.
+ Y coordinate of the pixel to set.
+ Pixel value to set.
+
+ The method sets all color components of the pixel to the specified value.
+ If it is a grayscale image, then pixel's intensity is set to the specified value.
+ If it is a color image, then pixel's R/G/B components are set to the same specified value
+ (if an image has alpha channel, then it is set to maximum value - 255 or 65535).
+
+ For images having 16 bpp per color plane, the method extends the specified color
+ value to 16 bit by multiplying it by 256.
+
+
+
+
+
+ Get color of the pixel with the specified coordinates.
+
+
+ Point's coordiates to get color of.
+
+ Return pixel's color at the specified coordinates.
+
+ See for more information.
+
+
+
+
+ Get color of the pixel with the specified coordinates.
+
+
+ X coordinate of the pixel to get.
+ Y coordinate of the pixel to get.
+
+ Return pixel's color at the specified coordinates.
+
+
+ In the case if the image has 8 bpp grayscale format, the method will return a color with
+ all R/G/B components set to same value, which is grayscale intensity.
+
+ The method supports only 8 bpp grayscale images and 24/32 bpp color images so far.
+
+
+ The specified pixel coordinate is out of image's bounds.
+ Pixel format of this image is not supported by the method.
+
+
+
+
+ Collect pixel values from the specified list of coordinates.
+
+
+ List of coordinates to collect pixels' value from.
+
+ Returns array of pixels' values from the specified coordinates.
+
+ The method goes through the specified list of points and for each point retrievs
+ corresponding pixel's value from the unmanaged image.
+
+ For grayscale image the output array has the same length as number of points in the
+ specified list of points. For color image the output array has triple length, containing pixels'
+ values in RGB order.
+
+ The method does not make any checks for valid coordinates and leaves this up to user.
+ If specified coordinates are out of image's bounds, the result is not predictable (crash in most cases).
+
+
+ This method is supposed for images with 16 bpp channels only (16 bpp grayscale image and
+ 48/64 bpp color images).
+
+
+ Unsupported pixel format of the source image. Use Collect8bppPixelValues() method for
+ images with 8 bpp channels.
+
+
+
+
+ Pointer to image data in unmanaged memory.
+
+
+
+
+ Image width in pixels.
+
+
+
+
+ Image height in pixels.
+
+
+
+
+ Image stride (line size in bytes).
+
+
+
+
+ Image pixel format.
+
+
+
+
+ Clouds texture.
+
+
+ The texture generator creates textures with effect of clouds.
+
+ The generator is based on the Perlin noise function.
+
+ Sample usage:
+
+ // create texture generator
+ CloudsTexture textureGenerator = new CloudsTexture( );
+ // generate new texture
+ float[,] texture = textureGenerator.Generate( 320, 240 );
+ // convert it to image to visualize
+ Bitmap textureImage = TextureTools.ToBitmap( texture );
+
+
+ Result image:
+
+
+
+
+
+
+ Texture generator interface.
+
+
+ Each texture generator generates a 2-D texture of the specified size and returns
+ it as two dimensional array of intensities in the range of [0, 1] - texture's values.
+
+
+
+
+
+ Generate texture.
+
+
+ Texture's width.
+ Texture's height.
+
+ Two dimensional array of texture's intensities.
+
+ Generates new texture of the specified size.
+
+
+
+
+ Reset generator.
+
+
+ Resets the generator - resets all internal variables, regenerates
+ internal random numbers, etc.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Generate texture.
+
+
+ Texture's width.
+ Texture's height.
+
+ Two dimensional array of intensities.
+
+ Generates new texture of the specified size.
+
+
+
+
+ Reset generator.
+
+
+ Regenerates internal random numbers.
+
+
+
+
+ Searching of quadrilateral/triangle corners.
+
+
+ The class searches for quadrilateral's/triangle's corners on the specified image.
+ It first collects edge points of the object and then uses
+ to find corners
+ the quadrilateral/triangle.
+
+ The class treats all black pixels as background (none-object) and
+ all none-black pixels as object.
+
+ The class processes grayscale 8 bpp and color 24/32 bpp images.
+
+ Sample usage:
+
+ // get corners of the quadrilateral
+ QuadrilateralFinder qf = new QuadrilateralFinder( );
+ List<IntPoint> corners = qf.ProcessImage( image );
+
+ // lock image to draw on it with AForge.NET's methods
+ // (or draw directly on image without locking if it is unmanaged image)
+ BitmapData data = image.LockBits( new Rectangle( 0, 0, image.Width, image.Height ),
+ ImageLockMode.ReadWrite, image.PixelFormat );
+
+ Drawing.Polygon( data, corners, Color.Red );
+ for ( int i = 0; i < corners.Count; i++ )
+ {
+ Drawing.FillRectangle( data,
+ new Rectangle( corners[i].X - 2, corners[i].Y - 2, 5, 5 ),
+ Color.FromArgb( i * 32 + 127 + 32, i * 64, i * 64 ) );
+ }
+
+ image.UnlockBits( data );
+
+
+ Source image:
+
+ Result image:
+
+
+
+
+
+
+ Find corners of quadrilateral/triangular area in the specified image.
+
+
+ Source image to search quadrilateral for.
+
+ Returns a list of points, which are corners of the quadrilateral/triangular area found
+ in the specified image. The first point in the list is the point with lowest
+ X coordinate (and with lowest Y if there are several points with the same X value).
+ Points are in clockwise order (screen coordinates system).
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Find corners of quadrilateral/triangular area in the specified image.
+
+
+ Source image data to search quadrilateral for.
+
+ Returns a list of points, which are corners of the quadrilateral/triangular area found
+ in the specified image. The first point in the list is the point with lowest
+ X coordinate (and with lowest Y if there are several points with the same X value).
+ Points are in clockwise order (screen coordinates system).
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Find corners of quadrilateral/triangular area in the specified image.
+
+
+ Source image to search quadrilateral for.
+
+ Returns a list of points, which are corners of the quadrilateral/triangular area found
+ in the specified image. The first point in the list is the point with lowest
+ X coordinate (and with lowest Y if there are several points with the same X value).
+ Points are in clockwise order (screen coordinates system).
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Interface for custom blobs' filters used for filtering blobs after
+ blob counting.
+
+
+ The interface should be implemented by classes, which perform
+ custom blobs' filtering different from default filtering implemented in
+ . See
+ for additional information.
+
+
+
+
+
+ Check specified blob and decide if should be kept or not.
+
+
+ Blob to check.
+
+ Return if the blob should be kept or
+ if it should be removed.
+
+
+
+
+ Hough line.
+
+
+ Represents line of Hough Line transformation using
+ polar coordinates.
+ See Wikipedia
+ for information on how to convert polar coordinates to Cartesian coordinates.
+
+
+ Hough Line transformation does not provide
+ information about lines start and end points, only slope and distance from image's center. Using
+ only provided information it is not possible to draw the detected line as it exactly appears on
+ the source image. But it is possible to draw a line through the entire image, which contains the
+ source line (see sample code below).
+
+
+ Sample code to draw detected Hough lines:
+
+ HoughLineTransformation lineTransform = new HoughLineTransformation( );
+ // apply Hough line transofrm
+ lineTransform.ProcessImage( sourceImage );
+ Bitmap houghLineImage = lineTransform.ToBitmap( );
+ // get lines using relative intensity
+ HoughLine[] lines = lineTransform.GetLinesByRelativeIntensity( 0.5 );
+
+ foreach ( HoughLine line in lines )
+ {
+ // get line's radius and theta values
+ int r = line.Radius;
+ double t = line.Theta;
+
+ // check if line is in lower part of the image
+ if ( r < 0 )
+ {
+ t += 180;
+ r = -r;
+ }
+
+ // convert degrees to radians
+ t = ( t / 180 ) * Math.PI;
+
+ // get image centers (all coordinate are measured relative
+ // to center)
+ int w2 = image.Width /2;
+ int h2 = image.Height / 2;
+
+ double x0 = 0, x1 = 0, y0 = 0, y1 = 0;
+
+ if ( line.Theta != 0 )
+ {
+ // none-vertical line
+ x0 = -w2; // most left point
+ x1 = w2; // most right point
+
+ // calculate corresponding y values
+ y0 = ( -Math.Cos( t ) * x0 + r ) / Math.Sin( t );
+ y1 = ( -Math.Cos( t ) * x1 + r ) / Math.Sin( t );
+ }
+ else
+ {
+ // vertical line
+ x0 = line.Radius;
+ x1 = line.Radius;
+
+ y0 = h2;
+ y1 = -h2;
+ }
+
+ // draw line on the image
+ Drawing.Line( sourceData,
+ new IntPoint( (int) x0 + w2, h2 - (int) y0 ),
+ new IntPoint( (int) x1 + w2, h2 - (int) y1 ),
+ Color.Red );
+ }
+
+
+ To clarify meaning of and values
+ of detected Hough lines, let's take a look at the below sample image and
+ corresponding values of radius and theta for the lines on the image:
+
+
+
+
+ Detected radius and theta values (color in corresponding colors):
+
+ - Theta = 90, R = 125, I = 249;
+ - Theta = 0, R = -170, I = 187 (converts to Theta = 180, R = 170);
+ - Theta = 90, R = -58, I = 163 (converts to Theta = 270, R = 58);
+ - Theta = 101, R = -101, I = 130 (converts to Theta = 281, R = 101);
+ - Theta = 0, R = 43, I = 112;
+ - Theta = 45, R = 127, I = 82.
+
+
+
+
+
+
+
+
+
+
+ Line's slope - angle between polar axis and line's radius (normal going
+ from pole to the line). Measured in degrees, [0, 180).
+
+
+
+
+ Line's distance from image center, (−∞, +∞).
+
+
+ Negative line's radius means, that the line resides in lower
+ part of the polar coordinates system. This means that value
+ should be increased by 180 degrees and radius should be made positive.
+
+
+
+
+
+ Line's absolute intensity, (0, +∞).
+
+
+ Line's absolute intensity is a measure, which equals
+ to number of pixels detected on the line. This value is bigger for longer
+ lines.
+
+ The value may not be 100% reliable to measure exact number of pixels
+ on the line. Although these value correlate a lot (which means they are very close
+ in most cases), the intensity value may slightly vary.
+
+
+
+
+
+ Line's relative intensity, (0, 1].
+
+
+ Line's relative intensity is relation of line's
+ value to maximum found intensity. For the longest line (line with highest intesity) the
+ relative intensity is set to 1. If line's relative is set 0.5, for example, this means
+ its intensity is half of maximum found intensity.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Line's slope.
+ Line's distance from image center.
+ Line's absolute intensity.
+ Line's relative intensity.
+
+
+
+
+ Compare the object with another instance of this class.
+
+
+ Object to compare with.
+
+ A signed number indicating the relative values of this instance and value: 1) greater than zero -
+ this instance is greater than value; 2) zero - this instance is equal to value;
+ 3) greater than zero - this instance is less than value.
+
+ The sort order is descending.
+
+
+ Object are compared using their intensity value.
+
+
+
+
+
+ Hough line transformation.
+
+
+ The class implements Hough line transformation, which allows to detect
+ straight lines in an image. Lines, which are found by the class, are provided in
+ polar coordinates system -
+ lines' distances from image's center and lines' slopes are provided.
+ The pole of polar coordinates system is put into processing image's center and the polar
+ axis is directed to the right from the pole. Lines' slope is measured in degrees and
+ is actually represented by angle between polar axis and line's radius (normal going
+ from pole to the line), which is measured in counter-clockwise direction.
+
+
+ Found lines may have negative radius.
+ This means, that the line resides in lower part of the polar coordinates system
+ and its value should be increased by 180 degrees and
+ radius should be made positive.
+
+
+ The class accepts binary images for processing, which are represented by 8 bpp grayscale images.
+ All black pixels (0 pixel's value) are treated as background, but pixels with different value are
+ treated as lines' pixels.
+
+ See also documentation to class for additional information
+ about Hough Lines.
+
+ Sample usage:
+
+ HoughLineTransformation lineTransform = new HoughLineTransformation( );
+ // apply Hough line transofrm
+ lineTransform.ProcessImage( sourceImage );
+ Bitmap houghLineImage = lineTransform.ToBitmap( );
+ // get lines using relative intensity
+ HoughLine[] lines = lineTransform.GetLinesByRelativeIntensity( 0.5 );
+
+ foreach ( HoughLine line in lines )
+ {
+ // ...
+ }
+
+
+ Initial image:
+
+ Hough line transformation image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process an image building Hough map.
+
+
+ Source image to process.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Process an image building Hough map.
+
+
+ Source image to process.
+ Image's rectangle to process.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Process an image building Hough map.
+
+
+ Source image data to process.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Process an image building Hough map.
+
+
+ Source image data to process.
+ Image's rectangle to process.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Process an image building Hough map.
+
+
+ Source unmanaged image to process.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Process an image building Hough map.
+
+
+ Source unmanaged image to process.
+ Image's rectangle to process.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Convert Hough map to bitmap.
+
+
+ Returns 8 bppp grayscale bitmap, which shows Hough map.
+
+ Hough transformation was not yet done by calling
+ ProcessImage() method.
+
+
+
+
+ Get specified amount of lines with highest intensity.
+
+
+ Amount of lines to get.
+
+ Returns array of most intesive lines. If there are no lines detected,
+ the returned array has zero length.
+
+
+
+
+ Get lines with relative intensity higher then specified value.
+
+
+ Minimum relative intesity of lines.
+
+ Returns array of lines. If there are no lines detected,
+ the returned array has zero length.
+
+
+
+
+ Steps per degree.
+
+
+ The value defines quality of Hough line transformation and its ability to detect
+ lines' slope precisely.
+
+ Default value is set to 1. Minimum value is 1. Maximum value is 10.
+
+
+
+
+ Minimum line's intensity in Hough map to recognize a line.
+
+
+ The value sets minimum intensity level for a line. If a value in Hough
+ map has lower intensity, then it is not treated as a line.
+
+ Default value is set to 10.
+
+
+
+
+ Radius for searching local peak value.
+
+
+ The value determines radius around a map's value, which is analyzed to determine
+ if the map's value is a local maximum in specified area.
+
+ Default value is set to 4. Minimum value is 1. Maximum value is 10.
+
+
+
+
+ Maximum found intensity in Hough map.
+
+
+ The property provides maximum found line's intensity.
+
+
+
+
+ Found lines count.
+
+
+ The property provides total number of found lines, which intensity is higher (or equal to),
+ than the requested minimum intensity.
+
+
+
+
+ Performs quadrilateral transformation of an area in the source image.
+
+
+ The class implements simple algorithm described by
+ Olivier Thill
+ for transforming quadrilateral area from a source image into rectangular image.
+ The idea of the algorithm is based on finding for each line of destination
+ rectangular image a corresponding line connecting "left" and "right" sides of
+ quadrilateral in a source image. Then the line is linearly transformed into the
+ line in destination image.
+
+ Due to simplicity of the algorithm it does not do any correction for perspective.
+
+
+ To make sure the algorithm works correctly, it is preferred if the
+ "left-top" corner of the quadrilateral (screen coordinates system) is
+ specified first in the list of quadrilateral's corners. At least
+ user need to make sure that the "left" side (side connecting first and the last
+ corner) and the "right" side (side connecting second and third corners) are
+ not horizontal.
+
+ Use to avoid the above mentioned limitations,
+ which is a more advanced quadrilateral transformation algorithms (although a bit more
+ computationally expensive).
+
+ The image processing filter accepts 8 grayscale images and 24/32 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // define quadrilateral's corners
+ List<IntPoint> corners = new List<IntPoint>( );
+ corners.Add( new IntPoint( 99, 99 ) );
+ corners.Add( new IntPoint( 156, 79 ) );
+ corners.Add( new IntPoint( 184, 126 ) );
+ corners.Add( new IntPoint( 122, 150 ) );
+ // create filter
+ SimpleQuadrilateralTransformation filter =
+ new SimpleQuadrilateralTransformation( corners, 200, 200 );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ New image width.
+
+
+
+
+ New image height.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Corners of the source quadrilateral area.
+ Width of the new transformed image.
+ Height of the new transformed image.
+
+ This constructor sets to
+ , which means that destination image will have width and
+ height as specified by user.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Corners of the source quadrilateral area.
+
+ This constructor sets to
+ , which means that destination image will have width and
+ height automatically calculated based on property.
+
+
+
+
+ Calculates new image size.
+
+
+ Source image data.
+
+ New image size - size of the destination image.
+
+ Source quadrilateral was not set.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Automatic calculation of destination image or not.
+
+
+ The property specifies how to calculate size of destination (transformed)
+ image. If the property is set to , then
+ and properties have effect and destination image's size is
+ specified by user. If the property is set to , then setting the above
+ mentioned properties does not have any effect, but destionation image's size is
+ automatically calculated from property - width and height
+ come from length of longest edges.
+
+
+ Default value is set to .
+
+
+
+
+
+ Quadrilateral's corners in source image.
+
+
+ The property specifies four corners of the quadrilateral area
+ in the source image to be transformed.
+
+ See documentation to the
+ class itself for additional information.
+
+
+
+
+
+ Width of the new transformed image.
+
+
+ The property defines width of the destination image, which gets
+ transformed quadrilateral image.
+
+ Setting the property does not have any effect, if
+ property is set to . In this case destination image's width
+ is calculated automatically based on property.
+
+
+
+
+
+ Height of the new transformed image.
+
+
+ The property defines height of the destination image, which gets
+ transformed quadrilateral image.
+
+ Setting the property does not have any effect, if
+ property is set to . In this case destination image's height
+ is calculated automatically based on property.
+
+
+
+
+
+ Specifies if bilinear interpolation should be used or not.
+
+
+ Default value is set to - interpolation
+ is used.
+
+
+
+
+
+ Texturer filter.
+
+
+ Adjust pixels’ color values using factors from the given texture. In conjunction with different type
+ of texture generators, the filter may produce different type of interesting effects.
+
+ The filter uses specified texture to adjust values using the next formula:
+ dst = src * + src * * textureValue,
+ where src is value of pixel in a source image, dst is value of pixel in a destination image and
+ textureValue is corresponding value from provided texture (see or
+ ). Using and values it is possible
+ to control the portion of source data affected by texture.
+
+
+ In most cases the and properties are set in such
+ way, that + = 1. But there is no limitations actually
+ for those values, so their sum may be as greater, as lower than 1 in order create different type of
+ effects.
+
+ The filter accepts 8 bpp grayscale and 24 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Texturer filter = new Texturer( new TextileTexture( ), 0.3, 0.7 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Generated texture.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Generated texture.
+ Filter level value (see property).
+ Preserve level value (see property).
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Texture generator.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Texture generator.
+ Filter level value (see property).
+ Preserve level value (see property).
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+ See for more information.
+
+
+
+
+ Filter level value.
+
+
+ Filtering factor determines image fraction to filter - to multiply
+ by values from the provided texture.
+
+ Default value is set to 0.5.
+
+ See class description for more details.
+
+
+
+
+
+ Preserve level value.
+
+
+ Preserving factor determines image fraction to keep from filtering.
+
+ Default value is set to 0.5.
+
+ See class description for more details.
+
+
+
+
+
+ Generated texture.
+
+
+ Two dimensional array of texture intensities.
+
+ In the case if image passed to the filter is smaller or
+ larger than the specified texture, than image's region is processed, which equals to the
+ minimum overlapping area.
+
+ The property has priority over this property - if
+ generator is specified than the static generated texture is not used.
+
+
+
+
+
+ Texture generator.
+
+
+ Generator used to generate texture.
+
+ The property has priority over the property.
+
+
+
+
+
+ Luminance and saturation linear correction.
+
+
+ The filter operates in HSL color space and provides
+ with the facility of luminance and saturation linear correction - mapping specified channels'
+ input ranges to specified output ranges.
+
+ The filter accepts 24 and 32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ HSLLinear filter = new HSLLinear( );
+ // configure the filter
+ filter.InLuminance = new Range( 0, 0.85f );
+ filter.OutSaturation = new Range( 0.25f, 1 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Luminance input range.
+
+
+ Luminance component is measured in the range of [0, 1].
+
+
+
+
+ Luminance output range.
+
+
+ Luminance component is measured in the range of [0, 1].
+
+
+
+
+ Saturation input range.
+
+
+ Saturation component is measured in the range of [0, 1].
+
+
+
+
+ Saturation output range.
+
+
+ Saturation component is measured in the range of [0, 1].
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Blur filter.
+
+
+ The filter performs convolution filter using
+ the blur kernel:
+
+
+ 1 2 3 2 1
+ 2 4 5 4 2
+ 3 5 6 5 3
+ 2 4 5 4 2
+ 1 2 3 2 1
+
+
+ For the list of supported pixel formats, see the documentation to
+ filter.
+
+ By default this filter sets property to
+ , so the alpha channel of 32 bpp and 64 bpp images is blurred as well.
+
+
+ Sample usage:
+
+ // create filter
+ Blur filter = new Blur( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Simple posterization of an image.
+
+
+ The class implements simple posterization of an image by splitting
+ each color plane into adjacent areas of the specified size. After the process
+ is done, each color plane will contain maximum of 256/PosterizationInterval levels.
+ For example, if grayscale image is posterized with posterization interval equal to 64,
+ then result image will contain maximum of 4 tones. If color image is posterized with the
+ same posterization interval, then it will contain maximum of 43=64 colors.
+ See property to get information about the way how to control
+ color used to fill posterization areas.
+
+ Posterization is a process in photograph development which converts normal photographs
+ into an image consisting of distinct, but flat, areas of different tones or colors.
+
+ The filter accepts 8 bpp grayscale and 24/32 bpp color images.
+
+ Sample usage:
+
+ // create filter
+ SimplePosterization filter = new SimplePosterization( );
+ // process image
+ filter.ApplyInPlace( sourceImage );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Specifies filling type of posterization areas.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Posterization interval, which specifies size of posterization areas.
+
+
+ The property specifies size of adjacent posterization areas
+ for each color plane. The value has direct effect on the amount of colors
+ in the result image. For example, if grayscale image is posterized with posterization
+ interval equal to 64, then result image will contain maximum of 4 tones. If color
+ image is posterized with same posterization interval, then it will contain maximum
+ of 43=64 colors.
+
+ Default value is set to 64.
+
+
+
+
+
+ Posterization filling type.
+
+
+ The property controls the color, which is used to substitute
+ colors within the same posterization interval - minimum, maximum or average value.
+
+
+ Default value is set to .
+
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Enumeration of possible types of filling posterized areas.
+
+
+
+
+ Fill area with minimum color's value.
+
+
+
+
+ Fill area with maximum color's value.
+
+
+
+
+ Fill area with average color's value.
+
+
+
+
+ Dithering using Jarvis, Judice and Ninke error diffusion.
+
+
+ The filter represents binarization filter, which is based on
+ error diffusion dithering with Jarvis-Judice-Ninke coefficients. Error is diffused
+ on 12 neighbor pixels with next coefficients:
+
+ | * | 7 | 5 |
+ | 3 | 5 | 7 | 5 | 3 |
+ | 1 | 3 | 5 | 3 | 1 |
+
+ / 48
+
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ JarvisJudiceNinkeDithering filter = new JarvisJudiceNinkeDithering( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Median cut color quantization algorithm.
+
+
+ The class implements median cut
+ color quantization algorithm.
+
+ See also class, which may simplify processing of images.
+
+ Sample usage:
+
+ // create the color quantization algorithm
+ IColorQuantizer quantizer = new MedianCutQuantizer( );
+ // process colors (taken from image for example)
+ for ( int i = 0; i < pixelsToProcess; i++ )
+ {
+ quantizer.AddColor( /* pixel color */ );
+ }
+ // get palette reduced to 16 colors
+ Color[] palette = quantizer.GetPalette( 16 );
+
+
+
+
+
+
+
+
+ Add color to the list of processed colors.
+
+
+ Color to add to the internal list.
+
+ The method adds the specified color into internal list of processed colors. The list
+ is used later by method to build reduced color table of the specified size.
+
+
+
+
+
+ Get paletter of the specified size.
+
+
+ Palette size to get.
+
+ Returns reduced palette of the specified size, which covers colors processed so far.
+
+ The method must be called after continuously calling method and
+ returns reduced color palette for colors accumulated/processed so far.
+
+
+
+
+ Clear internal state of the color quantization algorithm by clearing the list of colors
+ so far processed.
+
+
+
+
+
+ Labirinth texture.
+
+
+ The texture generator creates textures with effect of labyrinth.
+
+ The generator is based on the Perlin noise function.
+
+ Sample usage:
+
+ // create texture generator
+ LabyrinthTexture textureGenerator = new LabyrinthTexture( );
+ // generate new texture
+ float[,] texture = textureGenerator.Generate( 320, 240 );
+ // convert it to image to visualize
+ Bitmap textureImage = TextureTools.ToBitmap( texture );
+
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Generate texture.
+
+
+ Texture's width.
+ Texture's height.
+
+ Two dimensional array of intensities.
+
+ Generates new texture of the specified size.
+
+
+
+
+ Reset generator.
+
+
+ Regenerates internal random numbers.
+
+
+
+
+ Template matching algorithm's interface.
+
+
+ The interface specifies set of methods, which should be implemented by different
+ template matching algorithms - algorithms, which search for the given template in specified
+ image.
+
+
+
+
+ Process image looking for matchings with specified template.
+
+
+ Source image to process.
+ Template image to search for.
+ Rectangle in source image to search template for.
+
+ Returns array of found matchings.
+
+
+
+
+ Process image looking for matchings with specified template.
+
+
+ Source image data to process.
+ Template image to search for.
+ Rectangle in source image to search template for.
+
+ Returns array of found matchings.
+
+
+
+
+ Process image looking for matchings with specified template.
+
+
+ Unmanaged source image to process.
+ Unmanaged template image to search for.
+ Rectangle in source image to search template for.
+
+ Returns array of found matchings.
+
+
+
+
+ Replace channel of YCbCr color space.
+
+
+ Replaces specified YCbCr channel of color image with
+ specified grayscale imge.
+
+ The filter is quite useful in conjunction with filter
+ (however may be used alone in some cases). Using the filter
+ it is possible to extract one of YCbCr channel, perform some image processing with it and then
+ put it back into the original color image.
+
+ The filter accepts 24 and 32 bpp color images for processing.
+
+ Sample usage:
+
+ // create YCbCrExtractChannel filter for channel extracting
+ YCbCrExtractChannel extractFilter = new YCbCrExtractChannel(
+ YCbCr.CbIndex );
+ // extract Cb channel
+ Bitmap cbChannel = extractFilter.Apply( image );
+ // invert the channel
+ Invert invertFilter = new Invert( );
+ invertFilter.ApplyInPlace( cbChannel );
+ // put the channel back into the source image
+ YCbCrReplaceChannel replaceFilter = new YCbCrReplaceChannel(
+ YCbCr.CbIndex, cbChannel );
+ replaceFilter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ YCbCr channel to replace.
+ Channel image to use for replacement.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ YCbCr channel to replace.
+ Unmanaged channel image to use for replacement.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+ Channel image size does not match source
+ image size.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ YCbCr channel to replace.
+
+
+ Default value is set to (Y channel).
+
+ Invalid channel was specified.
+
+
+
+
+ Grayscale image to use for channel replacement.
+
+
+
+ Setting this property will clear the property -
+ only one channel image is allowed: managed or unmanaged.
+
+
+ Channel image should be 8bpp indexed image (grayscale).
+
+
+
+
+ Unmanaged grayscale image to use for channel replacement.
+
+
+
+ Setting this property will clear the property -
+ only one channel image is allowed: managed or unmanaged.
+
+
+ Channel image should be 8bpp indexed image (grayscale).
+
+
+
+
+ Adaptive Smoothing - noise removal with edges preserving.
+
+
+ The filter is aimed to perform image smoothing, but keeping sharp edges.
+ This makes it applicable to additive noise removal and smoothing objects' interiors, but
+ not applicable for spikes (salt and pepper noise) removal.
+
+ The next calculations are done for each pixel:
+
+ - weights are calculate for 9 pixels - pixel itself and 8 neighbors:
+
+ w(x, y) = exp( -1 * (Gx^2 + Gy^2) / (2 * factor^2) )
+ Gx(x, y) = (I(x + 1, y) - I(x - 1, y)) / 2
+ Gy(x, y) = (I(x, y + 1) - I(x, y - 1)) / 2
+ ,
+ where factor is a configurable value determining smoothing's quality.
+ - sum of 9 weights is calclated (weightTotal);
+ - sum of 9 weighted pixel values is calculatd (total);
+ - destination pixel is calculated as total / weightTotal.
+
+
+ Description of the filter was found in "An Edge Detection Technique Using
+ the Facet Model and Parameterized Relaxation Labeling" by Ioannis Matalas, Student Member,
+ IEEE, Ralph Benjamin, and Richard Kitney.
+
+ The filter accepts 8 bpp grayscale images and 24 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ AdaptiveSmoothing filter = new AdaptiveSmoothing( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Factor value.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Factor value.
+
+
+ Factor determining smoothing quality (see
+ documentation).
+
+ Default value is set to 3.
+
+
+
+
+
+ Blobs filtering by size.
+
+
+ The filter performs filtering of blobs by their size in the specified
+ source image - all blobs, which are smaller or bigger then specified limits, are
+ removed from the image.
+
+ The image processing filter treats all none black pixels as objects'
+ pixels and all black pixel as background.
+
+ The filter accepts 8 bpp grayscale images and 24/32
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ BlobsFiltering filter = new BlobsFiltering( );
+ // configure filter
+ filter.CoupledSizeFiltering = true;
+ filter.MinWidth = 70;
+ filter.MinHeight = 70;
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Minimum allowed width of blob.
+ Minimum allowed height of blob.
+ Maximum allowed width of blob.
+ Maximum allowed height of blob.
+
+ This constructor creates an instance of class
+ with property set to false.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Minimum allowed width of blob.
+ Minimum allowed height of blob.
+ Maximum allowed width of blob.
+ Maximum allowed height of blob.
+ Specifies if size filetering should be coupled or not.
+
+ For information about coupled filtering mode see documentation for
+ property of
+ class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Custom blobs' filtering routine to use
+ (see ).
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Specifies if size filetering should be coupled or not.
+
+
+ See documentation for property
+ of class for more information.
+
+
+
+
+ Minimum allowed width of blob.
+
+
+
+
+
+ Minimum allowed height of blob.
+
+
+
+
+
+ Maximum allowed width of blob.
+
+
+
+
+
+ Maximum allowed height of blob.
+
+
+
+
+
+ Custom blobs' filter to use.
+
+
+ See for information
+ about custom blobs' filtering routine.
+
+
+
+
+ Hit-And-Miss operator from Mathematical Morphology.
+
+
+ The hit-and-miss filter represents generalization of
+ and filters by extending flexibility of structuring element and
+ providing different modes of its work. Structuring element may contain:
+
+ - 1 - foreground;
+ - 0 - background;
+ - -1 - don't care.
+
+
+
+ Filter's mode is set by property. The list of modes and its
+ documentation may be found in enumeration.
+
+ The filter accepts 8 bpp grayscale images for processing. Note: grayscale images are treated
+ as binary with 0 value equals to black and 255 value equals to white.
+
+ Sample usage:
+
+ // define kernel to remove pixels on the right side of objects
+ // (pixel is removed, if there is white pixel on the left and
+ // black pixel on the right)
+ short[,] se = new short[,] {
+ { -1, -1, -1 },
+ { 1, 1, 0 },
+ { -1, -1, -1 }
+ };
+ // create filter
+ HitAndMiss filter = new HitAndMiss( se, HitAndMiss.Modes.Thinning );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Structuring element.
+
+ Structuring elemement for the hit-and-miss morphological operator
+ must be square matrix with odd size in the range of [3, 99].
+
+ Invalid size of structuring element.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Structuring element.
+ Operation mode.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Operation mode.
+
+
+ Mode to use for the filter. See enumeration
+ for the list of available modes and their documentation.
+
+ Default mode is set to .
+
+
+
+
+ Hit and Miss modes.
+
+
+ Bellow is a list of modes meaning depending on pixel's correspondence
+ to specified structuring element:
+
+ - - on match pixel is set to white, otherwise to black;
+ - - on match pixel is set to black, otherwise not changed.
+ - - on match pixel is set to white, otherwise not changed.
+
+
+
+
+
+
+ Hit and miss mode.
+
+
+
+
+ Thinning mode.
+
+
+
+
+ Thickening mode.
+
+
+
+
+ Homogenity edge detector.
+
+
+ The filter finds objects' edges by calculating maximum difference
+ of processing pixel with neighboring pixels in 8 direction.
+
+ Suppose 3x3 square element of the source image (x - is currently processed
+ pixel):
+
+ P1 P2 P3
+ P8 x P4
+ P7 P6 P5
+
+ The corresponding pixel of the result image equals to:
+
+ max( |x-P1|, |x-P2|, |x-P3|, |x-P4|,
+ |x-P5|, |x-P6|, |x-P7|, |x-P8| )
+
+
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ HomogenityEdgeDetector filter = new HomogenityEdgeDetector( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Gaussian sharpen filter.
+
+
+ The filter performs convolution filter using
+ the kernel, which is calculate with the help of
+ method and then converted to integer sharpening kernel. First of all the integer kernel
+ is calculated from by dividing all elements by
+ the element with the smallest value. Then the integer kernel is converted to sharpen kernel by
+ negating all kernel's elements (multiplying with -1), but the central kernel's element
+ is calculated as 2 * sum - centralElement, where sum is the sum off elements
+ in the integer kernel before negating.
+
+ For the list of supported pixel formats, see the documentation to
+ filter.
+
+ Sample usage:
+
+ // create filter with kernel size equal to 11
+ // and Gaussia sigma value equal to 4.0
+ GaussianSharpen filter = new GaussianSharpen( 4, 11 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Gaussian sigma value.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Gaussian sigma value.
+ Kernel size.
+
+
+
+
+ Gaussian sigma value, [0.5, 5.0].
+
+
+ Sigma value for Gaussian function used to calculate
+ the kernel.
+
+ Default value is set to 1.4.
+
+
+
+
+
+ Kernel size, [3, 5].
+
+
+ Size of Gaussian kernel.
+
+ Default value is set to 5.
+
+
+
+
+
+ Merge filter - get MAX of pixels in two images.
+
+
+ The merge filter takes two images (source and overlay images)
+ of the same size and pixel format and produces an image, where each pixel equals
+ to the maximum value of corresponding pixels from provided images.
+
+ The filter accepts 8 and 16 bpp grayscale images and 24, 32, 48 and 64 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Merge filter = new Merge( overlayImage );
+ // apply the filter
+ Bitmap resultImage = filter.Apply( sourceImage );
+
+
+ Source image:
+
+ Overlay image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Overlay image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged overlay image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Overlay image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Skew angle checker for scanned documents.
+
+
+ The class implements document's skew checking algorithm, which is based
+ on Hough line transformation. The algorithm
+ is based on searching for text base lines - black line of text bottoms' followed
+ by white line below.
+
+ The routine supposes that a white-background document is provided
+ with black letters. The algorithm is not supposed for any type of objects, but for
+ document images with text.
+
+ The range of angles to detect is controlled by property.
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create instance of skew checker
+ DocumentSkewChecker skewChecker = new DocumentSkewChecker( );
+ // get documents skew angle
+ double angle = skewChecker.GetSkewAngle( documentImage );
+ // create rotation filter
+ RotateBilinear rotationFilter = new RotateBilinear( -angle );
+ rotationFilter.FillColor = Color.White;
+ // rotate image applying the filter
+ Bitmap rotatedImage = rotationFilter.Apply( documentImage );
+
+
+ Initial image:
+
+ Deskewed image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Get skew angle of the provided document image.
+
+
+ Document's image to get skew angle of.
+
+ Returns document's skew angle. If the returned angle equals to -90,
+ then document skew detection has failed.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Get skew angle of the provided document image.
+
+
+ Document's image to get skew angle of.
+ Image's rectangle to process (used to exclude processing of
+ regions, which are not relevant to skew detection).
+
+ Returns document's skew angle. If the returned angle equals to -90,
+ then document skew detection has failed.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Get skew angle of the provided document image.
+
+
+ Document's image data to get skew angle of.
+
+ Returns document's skew angle. If the returned angle equals to -90,
+ then document skew detection has failed.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Get skew angle of the provided document image.
+
+
+ Document's image data to get skew angle of.
+ Image's rectangle to process (used to exclude processing of
+ regions, which are not relevant to skew detection).
+
+ Returns document's skew angle. If the returned angle equals to -90,
+ then document skew detection has failed.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Get skew angle of the provided document image.
+
+
+ Document's unmanaged image to get skew angle of.
+
+ Returns document's skew angle. If the returned angle equals to -90,
+ then document skew detection has failed.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Get skew angle of the provided document image.
+
+
+ Document's unmanaged image to get skew angle of.
+ Image's rectangle to process (used to exclude processing of
+ regions, which are not relevant to skew detection).
+
+ Returns document's skew angle. If the returned angle equals to -90,
+ then document skew detection has failed.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Steps per degree, [1, 10].
+
+
+ The value defines quality of Hough transform and its ability to detect
+ line slope precisely.
+
+ Default value is set to 1.
+
+
+
+
+
+ Maximum skew angle to detect, [0, 45] degrees.
+
+
+ The value sets maximum document's skew angle to detect.
+ Document's skew angle can be as positive (rotated counter clockwise), as negative
+ (rotated clockwise). So setting this value to 25, for example, will lead to
+ [-25, 25] degrees detection range.
+
+ Scanned documents usually have skew in the [-20, 20] degrees range.
+
+ Default value is set to 30.
+
+
+
+
+
+ Minimum angle to detect skew in degrees.
+
+
+ The property is deprecated and setting it has not any effect.
+ Use property instead.
+
+
+
+
+ Maximum angle to detect skew in degrees.
+
+
+ The property is deprecated and setting it has not any effect.
+ Use property instead.
+
+
+
+
+ Radius for searching local peak value, [1, 10].
+
+
+ The value determines radius around a map's value, which is analyzed to determine
+ if the map's value is a local maximum in specified area.
+
+ Default value is set to 4.
+
+
+
+
+ Wood texture.
+
+
+ The texture generator creates textures with effect of
+ rings on trunk's shear. The property allows to specify the
+ desired amount of wood rings.
+
+ The generator is based on the Perlin noise function.
+
+ Sample usage:
+
+ // create texture generator
+ WoodTexture textureGenerator = new WoodTexture( );
+ // generate new texture
+ float[,] texture = textureGenerator.Generate( 320, 240 );
+ // convert it to image to visualize
+ Bitmap textureImage = TextureTools.ToBitmap( texture );
+
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Wood rings amount.
+
+
+
+
+ Generate texture.
+
+
+ Texture's width.
+ Texture's height.
+
+ Two dimensional array of intensities.
+
+ Generates new texture of the specified size.
+
+
+
+
+ Reset generator.
+
+
+ Regenerates internal random numbers.
+
+
+
+
+ Wood rings amount, ≥ 3.
+
+
+ The property sets the amount of wood rings, which make effect of
+ rings on trunk's shear.
+
+ Default value is set to 12.
+
+
+
+
+ Internal memory manager used by image processing routines.
+
+
+ The memory manager supports memory allocation/deallocation
+ caching. Caching means that memory blocks may be not freed on request, but
+ kept for later reuse.
+
+
+
+
+ Allocate unmanaged memory.
+
+
+ Memory size to allocate.
+
+ Return's pointer to the allocated memory buffer.
+
+ The method allocates requested amount of memory and returns pointer to it. It may avoid allocation
+ in the case some caching scheme is uses and there is already enough allocated memory available.
+
+ There is insufficient memory to satisfy the request.
+
+
+
+
+ Free unmanaged memory.
+
+
+ Pointer to memory buffer to free.
+
+ This method may skip actual deallocation of memory and keep it for future requests,
+ if some caching scheme is used.
+
+
+
+
+ Force freeing unused memory.
+
+
+ Frees and removes from cache memory blocks, which are not used by users.
+
+ Returns number of freed memory blocks.
+
+
+
+
+ Maximum amount of memory blocks to keep in cache.
+
+
+ The value specifies the amount of memory blocks, which could be
+ cached by the memory manager.
+
+ Default value is set to 3. Maximum value is 10.
+
+
+
+
+
+ Current amount of memory blocks in cache.
+
+
+
+
+
+ Amount of busy memory blocks in cache (which were not freed yet by user).
+
+
+
+
+
+ Amount of free memory blocks in cache (which are not busy by users).
+
+
+
+
+
+ Amount of cached memory in bytes.
+
+
+
+
+
+ Maximum memory block's size in bytes, which could be cached.
+
+
+ Memory blocks, which size is greater than this value, are not cached.
+
+
+
+
+ Minimum memory block's size in bytes, which could be cached.
+
+
+ Memory blocks, which size is less than this value, are not cached.
+
+
+
+
+ Extract YCbCr channel from image.
+
+
+ The filter extracts specified YCbCr channel of color image and returns
+ it in the form of grayscale image.
+
+ The filter accepts 24 and 32 bpp color images and produces
+ 8 bpp grayscale images.
+
+ Sample usage:
+
+ // create filter
+ YCbCrExtractChannel filter = new YCbCrExtractChannel( YCbCr.CrIndex );
+ // apply the filter
+ Bitmap crChannel = filter.Apply( image );
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ YCbCr channel to extract.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ YCbCr channel to extract.
+
+
+ Default value is set to (Y channel).
+
+ Invalid channel was specified.
+
+
+
+
+ Resize image using nearest neighbor algorithm.
+
+
+ The class implements image resizing filter using nearest
+ neighbor algorithm, which does not assume any interpolation.
+
+ The filter accepts 8 and 16 bpp grayscale images and 24, 32, 48 and 64 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ ResizeNearestNeighbor filter = new ResizeNearestNeighbor( 400, 300 );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Width of the new image.
+ Height of the new image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Crop an image.
+
+
+
+ The filter crops an image providing a new image, which contains only the specified
+ rectangle of the original image.
+
+ The filter accepts 8 and 16 bpp grayscale images and 24, 32, 48 and 64 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Crop filter = new Crop( new Rectangle( 75, 75, 320, 240 ) );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Rectangle to crop.
+
+
+
+
+ Calculates new image size.
+
+
+ Source image data.
+
+ New image size - size of the destination image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Rectangle to crop.
+
+
+
+
+ Flood filling with specified color starting from specified point.
+
+
+ The filter performs image's area filling (4 directional) starting
+ from the specified point. It fills
+ the area of the pointed color, but also fills other colors, which
+ are similar to the pointed within specified tolerance.
+ The area is filled using specified fill color.
+
+
+ The filter accepts 8 bpp grayscale images and 24 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ PointedColorFloodFill filter = new PointedColorFloodFill( );
+ // configure the filter
+ filter.Tolerance = Color.FromArgb( 150, 92, 92 );
+ filter.FillColor = Color.FromArgb( 255, 255, 255 );
+ filter.StartingPoint = new IntPoint( 150, 100 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Fill color.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Flood fill tolerance.
+
+
+ The tolerance value determines which colors to fill. If the
+ value is set to 0, then only color of the pointed pixel
+ is filled. If the value is not 0, then other colors may be filled as well,
+ which are similar to the color of the pointed pixel within the specified
+ tolerance.
+
+ The tolerance value is specified as ,
+ where each component (R, G and B) represents tolerance for the corresponding
+ component of color. This allows to set different tolerances for red, green
+ and blue components.
+
+
+
+
+
+ Fill color.
+
+
+ The fill color is used to fill image's area starting from the
+ specified point.
+
+ For grayscale images the color needs to be specified with all three
+ RGB values set to the same value, (128, 128, 128) for example.
+
+ Default value is set to black.
+
+
+
+
+
+ Point to start filling from.
+
+
+ The property allows to set the starting point, where filling is
+ started from.
+
+ Default value is set to (0, 0).
+
+
+
+
+
+ Erosion operator from Mathematical Morphology with 3x3 structuring element.
+
+
+ The filter represents an optimized version of
+ filter, which is aimed for grayscale image processing with 3x3 structuring element.
+
+ See filter, which represents generic version of
+ erosion filter supporting custom structuring elements and wider range of image formats.
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+ Processing rectangle mast be at least 3x3 in size.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Flat field correction filter.
+
+
+ The goal of flat-field correction is to remove artifacts from 2-D images that
+ are caused by variations in the pixel-to-pixel sensitivity of the detector and/or by distortions
+ in the optical path. The filter requires two images for the input - source image, which represents
+ acquisition of some objects (using microscope, for example), and background image, which is taken
+ without any objects presented. The source image is corrected using the formula: src = bgMean * src / bg,
+ where src - source image's pixel value, bg - background image's pixel value, bgMean - mean
+ value of background image.
+
+ If background image is not provided, then it will be automatically generated on each filter run
+ from source image. The automatically generated background image is produced running Gaussian Blur on the
+ original image with (sigma value is set to 5, kernel size is set to 21). Before blurring the original image
+ is resized to 1/3 of its original size and then the result of blurring is resized back to the original size.
+
+
+ The class processes only grayscale (8 bpp indexed) and color (24 bpp) images.
+
+ Sample usage:
+
+ // create filter
+ FlatFieldCorrection filter = new FlatFieldCorrection( bgImage );
+ // process image
+ filter.ApplyInPlace( sourceImage );
+
+
+ Source image:
+
+ Background image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ This constructor does not set background image, which means that background
+ image will be generated on the fly on each filter run. The automatically generated background
+ image is produced running Gaussian Blur on the original image with (sigma value is set to 5,
+ kernel size is set to 21). Before blurring the original image is resized to 1/3 of its original size
+ and then the result of blurring is resized back to the original size.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Background image used for flat field correction.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+
+
+
+
+ Background image used for flat field correction.
+
+
+ The property sets the background image (without any objects), which will be used
+ for illumination correction of an image passed to the filter.
+
+ The background image must have the same size and pixel format as source image.
+ Otherwise exception will be generated when filter is applied to source image.
+
+ Setting this property will clear the property -
+ only one background image is allowed: managed or unmanaged.
+
+
+
+
+
+ Background image used for flat field correction.
+
+
+ The property sets the background image (without any objects), which will be used
+ for illumination correction of an image passed to the filter.
+
+ The background image must have the same size and pixel format as source image.
+ Otherwise exception will be generated when filter is applied to source image.
+
+ Setting this property will clear the property -
+ only one background image is allowed: managed or unmanaged.
+
+
+
+
+
+ Format translations dictionary.
+
+
+ See for more information.
+
+
+
+
+ Color filtering in HSL color space.
+
+
+ The filter operates in HSL color space and filters
+ pixels, which color is inside/outside of the specified HSL range -
+ it keeps pixels with colors inside/outside of the specified range and fills the
+ rest with specified color.
+
+ The filter accepts 24 and 32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ HSLFiltering filter = new HSLFiltering( );
+ // set color ranges to keep
+ filter.Hue = new IntRange( 335, 0 );
+ filter.Saturation = new Range( 0.6f, 1 );
+ filter.Luminance = new Range( 0.1f, 1 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+ Sample usage with saturation update only:
+
+ // create filter
+ HSLFiltering filter = new HSLFiltering( );
+ // configure the filter
+ filter.Hue = new IntRange( 340, 20 );
+ filter.UpdateLuminance = false;
+ filter.UpdateHue = false;
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Range of hue component.
+ Range of saturation component.
+ Range of luminance component.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Range of hue component, [0, 359].
+
+
+ Because of hue values are cycled, the minimum value of the hue
+ range may have bigger integer value than the maximum value, for example [330, 30].
+
+
+
+
+ Range of saturation component, [0, 1].
+
+
+
+
+ Range of luminance component, [0, 1].
+
+
+
+
+ Fill color used to fill filtered pixels.
+
+
+
+
+ Determines, if pixels should be filled inside or outside specified
+ color range.
+
+
+ Default value is set to , which means
+ the filter removes colors outside of the specified range.
+
+
+
+
+ Determines, if hue value of filtered pixels should be updated.
+
+
+ The property specifies if hue of filtered pixels should be
+ updated with value from fill color or not.
+
+ Default value is set to .
+
+
+
+
+ Determines, if saturation value of filtered pixels should be updated.
+
+
+ The property specifies if saturation of filtered pixels should be
+ updated with value from fill color or not.
+
+ Default value is set to .
+
+
+
+
+ Determines, if luminance value of filtered pixels should be updated.
+
+
+ The property specifies if luminance of filtered pixels should be
+ updated with value from fill color or not.
+
+ Default value is set to .
+
+
+
+
+ Gaussian blur filter.
+
+
+ The filter performs convolution filter using
+ the kernel, which is calculate with the help of
+ method and then converted to integer kernel by dividing all elements by the element with the
+ smallest value. Using the kernel the convolution filter is known as Gaussian blur.
+
+ Using property it is possible to configure
+ sigma value of Gaussian function.
+
+ For the list of supported pixel formats, see the documentation to
+ filter.
+
+ By default this filter sets property to
+ , so the alpha channel of 32 bpp and 64 bpp images is blurred as well.
+
+
+ Sample usage:
+
+ // create filter with kernel size equal to 11
+ // and Gaussia sigma value equal to 4.0
+ GaussianBlur filter = new GaussianBlur( 4, 11 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Gaussian sigma value.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Gaussian sigma value.
+ Kernel size.
+
+
+
+
+ Gaussian sigma value, [0.5, 5.0].
+
+
+ Sigma value for Gaussian function used to calculate
+ the kernel.
+
+ Default value is set to 1.4.
+
+
+
+
+
+ Kernel size, [3, 21].
+
+
+ Size of Gaussian kernel.
+
+ Default value is set to 5.
+
+
+
+
+
+ Simple edge detector.
+
+
+ The filter performs convolution filter using
+ the edges kernel:
+
+
+ 0 -1 0
+ -1 4 -1
+ 0 -1 0
+
+
+ For the list of supported pixel formats, see the documentation to
+ filter.
+
+ Sample usage:
+
+ // create filter
+ Edges filter = new Edges( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Base class for filters, which operate with two images of the same size and format and
+ produce new image as a result.
+
+
+ The abstract class is the base class for all filters, which can
+ be applied to an image producing new image as a result of image processing.
+
+ The base class is aimed for such type of filters, which require additional image
+ to process the source image. The additional image is set by
+ or property and must have the same size and pixel format
+ as source image. See documentation of particular inherited class for information
+ about overlay image purpose.
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Overlay image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged overlay image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Overlay image data.
+ Destination image data
+
+ Overlay image size and pixel format is checked by this base class, before
+ passing execution to inherited class.
+
+
+
+
+ Overlay image.
+
+
+
+ The property sets an overlay image, which will be used as the second image required
+ to process source image. See documentation of particular inherited class for information
+ about overlay image purpose.
+
+
+ Overlay image must have the same size and pixel format as source image.
+ Otherwise exception will be generated when filter is applied to source image.
+
+ Setting this property will clear the property -
+ only one overlay image is allowed: managed or unmanaged.
+
+
+
+
+
+ Unmanaged overlay image.
+
+
+
+ The property sets an overlay image, which will be used as the second image required
+ to process source image. See documentation of particular inherited class for information
+ about overlay image purpose.
+
+
+ Overlay image must have the same size and pixel format as source image.
+ Otherwise exception will be generated when filter is applied to source image.
+
+ Setting this property will clear the property -
+ only one overlay image is allowed: managed or unmanaged.
+
+
+
+
+
+ Otsu thresholding.
+
+
+ The class implements Otsu thresholding, which is described in
+ N. Otsu, "A threshold selection method from gray-level histograms", IEEE Trans. Systems,
+ Man and Cybernetics 9(1), pp. 62–66, 1979.
+
+ This implementation instead of minimizing the weighted within-class variance
+ does maximization of between-class variance, what gives the same result. The approach is
+ described in this presentation.
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ OtsuThreshold filter = new OtsuThreshold( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+ // check threshold value
+ byte t = filter.ThresholdValue;
+ // ...
+
+
+ Initial image:
+
+ Result image (calculated threshold is 97):
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Calculate binarization threshold for the given image.
+
+
+ Image to calculate binarization threshold for.
+ Rectangle to calculate binarization threshold for.
+
+ Returns binarization threshold.
+
+ The method is used to calculate binarization threshold only. The threshold
+ later may be applied to the image using image processing filter.
+
+ Source pixel format is not supported by the routine. It should be
+ 8 bpp grayscale (indexed) image.
+
+
+
+
+ Calculate binarization threshold for the given image.
+
+
+ Image to calculate binarization threshold for.
+ Rectangle to calculate binarization threshold for.
+
+ Returns binarization threshold.
+
+ The method is used to calculate binarization threshold only. The threshold
+ later may be applied to the image using image processing filter.
+
+ Source pixel format is not supported by the routine. It should be
+ 8 bpp grayscale (indexed) image.
+
+
+
+
+ Calculate binarization threshold for the given image.
+
+
+ Image to calculate binarization threshold for.
+ Rectangle to calculate binarization threshold for.
+
+ Returns binarization threshold.
+
+ The method is used to calculate binarization threshold only. The threshold
+ later may be applied to the image using image processing filter.
+
+ Source pixel format is not supported by the routine. It should be
+ 8 bpp grayscale (indexed) image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Threshold value.
+
+
+ The property is read only and represents the value, which
+ was automaticaly calculated using Otsu algorithm.
+
+
+
+
+ Iterative threshold search and binarization.
+
+
+
+ The algorithm works in the following way:
+
+ - select any start threshold;
+ - compute average value of Background (µB) and Object (µO) values:
+ 1) all pixels with a value that is below threshold, belong to the Background values;
+ 2) all pixels greater or equal threshold, belong to the Object values.
+
+ - calculate new thresghold: (µB + µO) / 2;
+ - if |oldThreshold - newThreshold| is less than a given manimum allowed error, then stop iteration process
+ and create the binary image with the new threshold.
+
+
+
+ For additional information see Digital Image Processing, Gonzalez/Woods. Ch.10 page:599.
+
+ The filter accepts 8 and 16 bpp grayscale images for processing.
+
+ Since the filter can be applied as to 8 bpp and to 16 bpp images,
+ the initial value of property should be set appropriately to the
+ pixel format. In the case of 8 bpp images the threshold value is in the [0, 255] range, but
+ in the case of 16 bpp images the threshold value is in the [0, 65535] range.
+
+ Sample usage:
+
+ // create filter
+ IterativeThreshold filter = new IterativeThreshold( 2, 128 );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image (calculated threshold is 102):
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Minimum allowed error, that ends the iteration process.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Minimum allowed error, that ends the iteration process.
+ Initial threshold value.
+
+
+
+
+ Calculate binarization threshold for the given image.
+
+
+ Image to calculate binarization threshold for.
+ Rectangle to calculate binarization threshold for.
+
+ Returns binarization threshold.
+
+ The method is used to calculate binarization threshold only. The threshold
+ later may be applied to the image using image processing filter.
+
+ Source pixel format is not supported by the routine. It should
+ 8 bpp grayscale (indexed) or 16 bpp grayscale image.
+
+
+
+
+ Calculate binarization threshold for the given image.
+
+
+ Image to calculate binarization threshold for.
+ Rectangle to calculate binarization threshold for.
+
+ Returns binarization threshold.
+
+ The method is used to calculate binarization threshold only. The threshold
+ later may be applied to the image using image processing filter.
+
+ Source pixel format is not supported by the routine. It should
+ 8 bpp grayscale (indexed) or 16 bpp grayscale image.
+
+
+
+
+ Calculate binarization threshold for the given image.
+
+
+ Image to calculate binarization threshold for.
+ Rectangle to calculate binarization threshold for.
+
+ Returns binarization threshold.
+
+ The method is used to calculate binarization threshold only. The threshold
+ later may be applied to the image using image processing filter.
+
+ Source pixel format is not supported by the routine. It should
+ 8 bpp grayscale (indexed) or 16 bpp grayscale image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Minimum error, value when iterative threshold search is stopped.
+
+
+ Default value is set to 0.
+
+
+
+
+ Calculate Euclidean difference between two images and threshold it.
+
+
+ The filter produces similar to , however it uses
+ Euclidean distance for finding difference between pixel values instead of Manhattan distance. Result of this
+ image processing routine may be useful in motion detection applications or finding areas of significant
+ difference.
+
+ The filter accepts 8 and 24/32color images for processing.
+
+ Sample usage:
+
+ // create filter
+ ThresholdedEuclideanDifference filter = new ThresholdedEuclideanDifference( 60 );
+ // apply the filter
+ filter.OverlayImage = backgroundImage;
+ Bitmap resultImage = filter.Apply( sourceImage );
+
+
+ Source image:
+
+ Background image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Difference threshold (see ).
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Overlay image data.
+ Destination image data
+
+
+
+
+ Difference threshold.
+
+
+ The property specifies difference threshold. If difference between pixels of processing image
+ and overlay image is greater than this value, then corresponding pixel of result image is set to white; otherwise
+ black.
+
+
+ Default value is set to 15.
+
+
+
+
+ Number of pixels which were set to white in destination image during last image processing call.
+
+
+ The property may be useful to determine amount of difference between two images which,
+ for example, may be treated as amount of motion in motion detection applications, etc.
+
+
+
+
+ Format translations dictionary.
+
+
+ See for more information.
+
+
+
+
+ Intersect filter - get MIN of pixels in two images.
+
+
+ The intersect filter takes two images (source and overlay images)
+ of the same size and pixel format and produces an image, where each pixel equals
+ to the minimum value of corresponding pixels from provided images.
+
+ The filter accepts 8 and 16 bpp grayscale images and 24, 32, 48 and 64 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Intersect filter = new Intersect( overlayImage );
+ // apply the filter
+ Bitmap resultImage = filter.Apply( sourceImage );
+
+
+ Source image:
+
+ Overlay image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Overlay image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged overlay image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Overlay image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Color dithering using Sierra error diffusion.
+
+
+ The image processing routine represents color dithering algorithm, which is based on
+ error diffusion dithering with Sierra coefficients. Error is diffused
+ on 10 neighbor pixels with next coefficients:
+
+ | * | 5 | 3 |
+ | 2 | 4 | 5 | 4 | 2 |
+ | 2 | 3 | 2 |
+
+ / 32
+
+
+ The image processing routine accepts 24/32 bpp color images for processing. As a result this routine
+ produces 4 bpp or 8 bpp indexed image, which depends on size of the specified
+ color table - 4 bpp result for
+ color tables with 16 colors or less; 8 bpp result for larger color tables.
+
+ Sample usage:
+
+ // create dithering routine (use default color table)
+ SierraColorDithering dithering = new SierraColorDithering( );
+ // apply the dithering routine
+ Bitmap newImage = dithering.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Texture tools.
+
+
+ The class represents collection of different texture tools, like
+ converting a texture to/from grayscale image.
+
+ Sample usage:
+
+ // create texture generator
+ WoodTexture textureGenerator = new WoodTexture( );
+ // generate new texture
+ float[,] texture = textureGenerator.Generate( 320, 240 );
+ // convert it to image to visualize
+ Bitmap textureImage = TextureTools.ToBitmap( texture );
+
+
+
+
+
+
+ Convert texture to grayscale bitmap.
+
+
+ Texture to convert to bitmap.
+
+ Returns bitmap of the texture.
+
+
+
+
+ Convert grayscale bitmap to texture.
+
+
+ Image to convert to texture.
+
+ Returns texture as 2D float array.
+
+ Only grayscale (8 bpp indexed images) are supported.
+
+
+
+
+ Convert grayscale bitmap to texture
+
+
+ Image data to convert to texture
+
+ Returns texture as 2D float array.
+
+ Only grayscale (8 bpp indexed images) are supported.
+
+
+
+
+ Convert grayscale bitmap to texture.
+
+
+ Image data to convert to texture.
+
+ Returns texture as 2D float array.
+
+ Only grayscale (8 bpp indexed images) are supported.
+
+
+
+
+ Textile texture.
+
+
+ The texture generator creates textures with effect of textile.
+
+ The generator is based on the Perlin noise function.
+
+ Sample usage:
+
+ // create texture generator
+ TextileTexture textureGenerator = new TextileTexture( );
+ // generate new texture
+ float[,] texture = textureGenerator.Generate( 320, 240 );
+ // convert it to image to visualize
+ Bitmap textureImage = TextureTools.ToBitmap( texture );
+
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Generate texture.
+
+
+ Texture's width.
+ Texture's height.
+
+ Two dimensional array of intensities.
+
+ Generates new texture of the specified size.
+
+
+
+
+ Reset generator.
+
+
+ Regenerates internal random numbers.
+
+
+
+
+ Blob counter based on recursion.
+
+
+ The class counts and extracts stand alone objects in
+ images using recursive version of connected components labeling
+ algorithm.
+
+ The algorithm treats all pixels with values less or equal to
+ as background, but pixels with higher values are treated as objects' pixels.
+
+ Since this algorithm is based on recursion, it is
+ required to be careful with its application to big images with big blobs,
+ because in this case recursion will require big stack size and may lead
+ to stack overflow. The recursive version may be applied (and may be even
+ faster than ) to an image with small blobs -
+ "star sky" image (or small cells, for example, etc).
+
+ For blobs' searching the class supports 8 bpp indexed grayscale images and
+ 24/32 bpp color images.
+ See documentation about for information about which
+ pixel formats are supported for extraction of blobs.
+
+ Sample usage:
+
+ // create an instance of blob counter algorithm
+ RecursiveBlobCounter bc = new RecursiveBlobCounter( );
+ // process binary image
+ bc.ProcessImage( image );
+ Rectangle[] rects = bc.GetObjectsRectangles( );
+ // process blobs
+ foreach ( Rectangle rect in rects )
+ {
+ // ...
+ }
+
+
+
+
+
+
+ Base class for different blob counting algorithms.
+
+
+ The class is abstract and serves as a base for different blob counting algorithms.
+ Classes, which inherit from this base class, require to implement
+ method, which does actual building of object's label's map.
+
+ For blobs' searcing usually all inherited classes accept binary images, which are actually
+ grayscale thresholded images. But the exact supported format should be checked in particular class,
+ inheriting from the base class. For blobs' extraction the class supports grayscale (8 bpp indexed)
+ and color images (24 and 32 bpp).
+
+ Sample usage:
+
+ // create an instance of blob counter algorithm
+ BlobCounterBase bc = new ...
+ // set filtering options
+ bc.FilterBlobs = true;
+ bc.MinWidth = 5;
+ bc.MinHeight = 5;
+ // process binary image
+ bc.ProcessImage( image );
+ Blob[] blobs = bc.GetObjects( image, false );
+ // process blobs
+ foreach ( Blob blob in blobs )
+ {
+ // ...
+ // blob.Rectangle - blob's rectangle
+ // blob.Image - blob's image
+ }
+
+
+
+
+
+
+ Objects count.
+
+
+
+
+ Objects' labels.
+
+
+
+
+ Width of processed image.
+
+
+
+
+ Height of processed image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Creates new instance of the class with
+ an empty objects map. Before using methods, which provide information about blobs
+ or extract them, the ,
+ or
+ method should be called to collect objects map.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Binary image to look for objects in.
+
+ Creates new instance of the class with
+ initialized objects map built by calling method.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Binary image data to look for objects in.
+
+ Creates new instance of the class with
+ initialized objects map built by calling method.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged binary image to look for objects in.
+
+ Creates new instance of the class with
+ initialized objects map built by calling method.
+
+
+
+
+ Build objects map.
+
+
+ Source binary image.
+
+ Processes the image and builds objects map, which is used later to extracts blobs.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Build objects map.
+
+
+ Source binary image data.
+
+ Processes the image and builds objects map, which is used later to extracts blobs.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Build object map from raw image data.
+
+
+ Source unmanaged binary image data.
+
+ Processes the image and builds objects map, which is used later to extracts blobs.
+
+ Unsupported pixel format of the source image.
+ Thrown by some inherited classes if some image property other
+ than the pixel format is not supported. See that class's documentation or the exception message for details.
+
+
+
+
+ Get objects' rectangles.
+
+
+ Returns array of objects' rectangles.
+
+ The method returns array of objects rectangles. Before calling the
+ method, the ,
+ or method should be called, which will
+ build objects map.
+
+ No image was processed before, so objects' rectangles
+ can not be collected.
+
+
+
+
+ Get objects' information.
+
+
+ Returns array of partially initialized blobs (without property initialized).
+
+ By the amount of provided information, the method is between and
+ methods. The method provides array of blobs without initialized their image.
+ Blob's image may be extracted later using
+ or method.
+
+
+
+
+ // create blob counter and process image
+ BlobCounter bc = new BlobCounter( sourceImage );
+ // specify sort order
+ bc.ObjectsOrder = ObjectsOrder.Size;
+ // get objects' information (blobs without image)
+ Blob[] blobs = bc.GetObjectInformation( );
+ // process blobs
+ foreach ( Blob blob in blobs )
+ {
+ // check blob's properties
+ if ( blob.Rectangle.Width > 50 )
+ {
+ // the blob looks interesting, let's extract it
+ bc.ExtractBlobsImage( sourceImage, blob );
+ }
+ }
+
+
+
+ No image was processed before, so objects' information
+ can not be collected.
+
+
+
+
+ Get blobs.
+
+
+ Source image to extract objects from.
+
+ Returns array of blobs.
+ Specifies size of blobs' image to extract.
+ If set to each blobs' image will have the same size as
+ the specified image. If set to each blobs' image will
+ have the size of its blob.
+
+ The method returns array of blobs. Before calling the
+ method, the ,
+ or method should be called, which will build
+ objects map.
+
+ The method supports 24/32 bpp color and 8 bpp indexed grayscale images.
+
+
+ Unsupported pixel format of the provided image.
+ No image was processed before, so objects
+ can not be collected.
+
+
+
+
+ Get blobs.
+
+
+ Source unmanaged image to extract objects from.
+ Specifies size of blobs' image to extract.
+ If set to each blobs' image will have the same size as
+ the specified image. If set to each blobs' image will
+ have the size of its blob.
+
+ Returns array of blobs.
+
+ The method returns array of blobs. Before calling the
+ method, the ,
+ or method should be called, which will build
+ objects map.
+
+ The method supports 24/32 bpp color and 8 bpp indexed grayscale images.
+
+
+ Unsupported pixel format of the provided image.
+ No image was processed before, so objects
+ can not be collected.
+
+
+
+
+ Extract blob's image.
+
+
+ Source image to extract blob's image from.
+ Blob which is required to be extracted.
+ Specifies size of blobs' image to extract.
+ If set to each blobs' image will have the same size as
+ the specified image. If set to each blobs' image will
+ have the size of its blob.
+
+ The method is used to extract image of partially initialized blob, which
+ was provided by method. Before calling the
+ method, the ,
+ or method should be called, which will build
+ objects map.
+
+ The method supports 24/32 bpp color and 8 bpp indexed grayscale images.
+
+
+ Unsupported pixel format of the provided image.
+ No image was processed before, so blob
+ can not be extracted.
+
+
+
+
+ Extract blob's image.
+
+
+ Source unmanaged image to extract blob's image from.
+ Blob which is required to be extracted.
+ Specifies size of blobs' image to extract.
+ If set to each blobs' image will have the same size as
+ the specified image. If set to each blobs' image will
+ have the size of its blob.
+
+ The method is used to extract image of partially initialized blob, which
+ was provided by method. Before calling the
+ method, the ,
+ or method should be called, which will build
+ objects map.
+
+ The method supports 24/32 bpp color and 8 bpp indexed grayscale images.
+
+
+ Unsupported pixel format of the provided image.
+ No image was processed before, so blob
+ can not be extracted.
+
+
+
+
+ Get list of points on the left and right edges of the blob.
+
+
+ Blob to collect edge points for.
+ List of points on the left edge of the blob.
+ List of points on the right edge of the blob.
+
+ The method scans each line of the blob and finds the most left and the
+ most right points for it adding them to appropriate lists. The method may be very
+ useful in conjunction with different routines from ,
+ which allow finding convex hull or quadrilateral's corners.
+
+ Both lists of points are sorted by Y coordinate - points with smaller Y
+ value go first.
+
+
+ No image was processed before, so blob
+ can not be extracted.
+
+
+
+
+ Get list of points on the top and bottom edges of the blob.
+
+
+ Blob to collect edge points for.
+ List of points on the top edge of the blob.
+ List of points on the bottom edge of the blob.
+
+ The method scans each column of the blob and finds the most top and the
+ most bottom points for it adding them to appropriate lists. The method may be very
+ useful in conjunction with different routines from ,
+ which allow finding convex hull or quadrilateral's corners.
+
+ Both lists of points are sorted by X coordinate - points with smaller X
+ value go first.
+
+
+ No image was processed before, so blob
+ can not be extracted.
+
+
+
+
+ Get list of object's edge points.
+
+
+ Blob to collect edge points for.
+
+ Returns unsorted list of blob's edge points.
+
+ The method scans each row and column of the blob and finds the
+ most top/bottom/left/right points. The method returns similar result as if results of
+ both and
+ methods were combined, but each edge point occurs only once in the list.
+
+ Edge points in the returned list are not ordered. This makes the list unusable
+ for visualization with methods, which draw polygon or poly-line. But the returned list
+ can be used with such algorithms, like convex hull search, shape analyzer, etc.
+
+
+ No image was processed before, so blob
+ can not be extracted.
+
+
+
+
+ Actual objects map building.
+
+
+ Unmanaged image to process.
+
+ By the time this method is called bitmap's pixel format is not
+ yet checked, so this should be done by the class inheriting from the base class.
+ and members are initialized
+ before the method is called, so these members may be used safely.
+
+
+
+
+ Objects count.
+
+
+ Number of objects (blobs) found by method.
+
+
+
+
+
+ Objects' labels.
+
+
+ The array of width * height size, which holds
+ labels for all objects. Background is represented with 0 value,
+ but objects are represented with labels starting from 1.
+
+
+
+
+ Objects sort order.
+
+
+ The property specifies objects' sort order, which are provided
+ by , , etc.
+
+
+
+
+
+ Specifies if blobs should be filtered.
+
+
+ If the property is equal to false, then there is no any additional
+ post processing after image was processed. If the property is set to true, then
+ blobs filtering is done right after image processing routine. If
+ is set, then custom blobs' filtering is done, which is implemented by user. Otherwise
+ blobs are filtered according to dimensions specified in ,
+ , and properties.
+
+ Default value is set to .
+
+
+
+
+ Specifies if size filetering should be coupled or not.
+
+
+ In uncoupled filtering mode, objects are filtered out in the case if
+ their width is smaller than or height is smaller than
+ . But in coupled filtering mode, objects are filtered out in
+ the case if their width is smaller than and height is
+ smaller than . In both modes the idea with filtering by objects'
+ maximum size is the same as filtering by objects' minimum size.
+
+ Default value is set to , what means uncoupled filtering by size.
+
+
+
+
+
+ Minimum allowed width of blob.
+
+
+ The property specifies minimum object's width acceptable by blob counting
+ routine and has power only when property is set to
+ and custom blobs' filter is
+ set to .
+
+ See documentation to for additional information.
+
+
+
+
+
+ Minimum allowed height of blob.
+
+
+ The property specifies minimum object's height acceptable by blob counting
+ routine and has power only when property is set to
+ and custom blobs' filter is
+ set to .
+
+ See documentation to for additional information.
+
+
+
+
+
+ Maximum allowed width of blob.
+
+
+ The property specifies maximum object's width acceptable by blob counting
+ routine and has power only when property is set to
+ and custom blobs' filter is
+ set to .
+
+ See documentation to for additional information.
+
+
+
+
+
+ Maximum allowed height of blob.
+
+
+ The property specifies maximum object's height acceptable by blob counting
+ routine and has power only when property is set to
+ and custom blobs' filter is
+ set to .
+
+ See documentation to for additional information.
+
+
+
+
+
+ Custom blobs' filter to use.
+
+
+ The property specifies custom blobs' filtering routine to use. It has
+ effect only in the case if property is set to .
+
+ When custom blobs' filtering routine is set, it has priority over default filtering done
+ with , , and .
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Creates new instance of the class with
+ an empty objects map. Before using methods, which provide information about blobs
+ or extract them, the ,
+ or
+ method should be called to collect objects map.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to look for objects in.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image data to look for objects in.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged image to look for objects in.
+
+
+
+
+ Actual objects map building.
+
+
+ Unmanaged image to process.
+
+ The method supports 8 bpp indexed grayscale images and 24/32 bpp color images.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Background threshold's value.
+
+
+ The property sets threshold value for distinguishing between background
+ pixel and objects' pixels. All pixel with values less or equal to this property are
+ treated as background, but pixels with higher values are treated as objects' pixels.
+
+ In the case of colour images a pixel is treated as objects' pixel if any of its
+ RGB values are higher than corresponding values of this threshold.
+
+ For processing grayscale image, set the property with all RGB components eqaul.
+
+ Default value is set to (0, 0, 0) - black colour.
+
+
+
+
+ Gather statistics about image in HSL color space.
+
+
+ The class is used to accumulate statistical values about images,
+ like histogram, mean, standard deviation, etc. for each HSL color channel.
+
+ The class accepts 24 and 32 bpp color images for processing.
+
+ Sample usage:
+
+ // gather statistics
+ ImageStatisticsHSL stat = new ImageStatisticsHSL( image );
+ // get saturation channel's histogram
+ ContinuousHistogram saturation = stat.Saturation;
+ // check mean value of saturation channel
+ if ( saturation.Mean > 0.5 )
+ {
+ // do further processing
+ }
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+
+ Source pixel format is not supported.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+ Mask image which specifies areas to collect statistics for.
+
+ The mask image must be a grayscale/binary (8bpp) image of the same size as the
+ specified source image, where black pixels (value 0) correspond to areas which should be excluded
+ from processing. So statistics is calculated only for pixels, which are none black in the mask image.
+
+
+ Source pixel format is not supported.
+ Mask image must be 8 bpp grayscale image.
+ Mask must have the same size as the source image to get statistics for.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+ Mask array which specifies areas to collect statistics for.
+
+ The mask array must be of the same size as the specified source image, where 0 values
+ correspond to areas which should be excluded from processing. So statistics is calculated only for pixels,
+ which have none zero corresponding value in the mask.
+
+
+ Source pixel format is not supported.
+ Mask must have the same size as the source image to get statistics for.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged image to gather statistics about.
+
+ Source pixel format is not supported.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+ Mask image which specifies areas to collect statistics for.
+
+ The mask image must be a grayscale/binary (8bpp) image of the same size as the
+ specified source image, where black pixels (value 0) correspond to areas which should be excluded
+ from processing. So statistics is calculated only for pixels, which are none black in the mask image.
+
+
+ Source pixel format is not supported.
+ Mask image must be 8 bpp grayscale image.
+ Mask must have the same size as the source image to get statistics for.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+ Mask array which specifies areas to collect statistics for.
+
+ The mask array must be of the same size as the specified source image, where 0 values
+ correspond to areas which should be excluded from processing. So statistics is calculated only for pixels,
+ which have none zero corresponding value in the mask.
+
+
+ Source pixel format is not supported.
+ Mask must have the same size as the source image to get statistics for.
+
+
+
+
+ Histogram of saturation channel.
+
+
+
+
+
+ Histogram of luminance channel.
+
+
+
+
+
+ Histogram of saturation channel excluding black pixels.
+
+
+ The property keeps statistics about saturation channel, which
+ excludes all black pixels, what affects mean, standard deviation, etc.
+
+
+
+
+
+ Histogram of luminance channel excluding black pixels.
+
+
+ The property keeps statistics about luminance channel, which
+ excludes all black pixels, what affects mean, standard deviation, etc.
+
+
+
+
+
+ Total pixels count in the processed image.
+
+
+
+
+
+ Total pixels count in the processed image excluding black pixels.
+
+
+
+
+
+ Fill holes in objects in binary image.
+
+
+ The filter allows to fill black holes in white object in a binary image.
+ It is possible to specify maximum holes' size to fill using
+ and properties.
+
+ The filter accepts binary image only, which are represented as 8 bpp images.
+
+ Sample usage:
+
+ // create and configure the filter
+ FillHoles filter = new FillHoles( );
+ filter.MaxHoleHeight = 20;
+ filter.MaxHoleWidth = 20;
+ filter.CoupledSizeFiltering = false;
+ // apply the filter
+ Bitmap result = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+
+
+
+
+ Specifies if size filetering should be coupled or not.
+
+
+ In uncoupled filtering mode, holes are filled in the case if
+ their width is smaller than or equal to or height is smaller than
+ or equal to . But in coupled filtering mode, holes are filled only in
+ the case if both width and height are smaller or equal to the corresponding value.
+
+ Default value is set to , what means coupled filtering by size.
+
+
+
+
+
+ Maximum width of a hole to fill.
+
+
+ All holes, which have width greater than this value, are kept unfilled.
+ See for additional information.
+
+ Default value is set to .
+
+
+
+
+ Maximum height of a hole to fill.
+
+
+ All holes, which have height greater than this value, are kept unfilled.
+ See for additional information.
+
+ Default value is set to .
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Move canvas to the specified point.
+
+
+
+ The filter moves canvas to the specified area filling unused empty areas with specified color.
+
+ The filter accepts 8/16 bpp grayscale images and 24/32/48/64 bpp color image
+ for processing.
+
+ Sample usage:
+
+ // create filter
+ CanvasMove filter = new CanvasMove( new IntPoint( -50, -50 ), Color.Green );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Point to move the canvas to.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Point to move the canvas.
+ RGB color to use for filling areas empty areas in color images.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Point to move the canvas.
+ Gray color to use for filling empty areas in grayscale images.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Point to move the canvas.
+ RGB color to use for filling areas empty areas in color images.
+ Gray color to use for filling empty areas in grayscale images.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ RGB fill color.
+
+
+ The color is used to fill empty areas in color images.
+
+ Default value is set to white - ARGB(255, 255, 255, 255).
+
+
+
+
+ Gray fill color.
+
+
+ The color is used to fill empty areas in grayscale images.
+
+ Default value is set to white - 255.
+
+
+
+
+ Point to move the canvas to.
+
+
+
+
+
+ Replace RGB channel of color imgae.
+
+
+ Replaces specified RGB channel of color image with
+ specified grayscale image.
+
+ The filter is quite useful in conjunction with filter
+ (however may be used alone in some cases). Using the filter
+ it is possible to extract one of RGB channel, perform some image processing with it and then
+ put it back into the original color image.
+
+ The filter accepts 24, 32, 48 and 64 bpp color images for processing.
+
+ Sample usage:
+
+ // extract red channel
+ ExtractChannel extractFilter = new ExtractChannel( RGB.R );
+ Bitmap channel = extractFilter.Apply( image );
+ // threshold channel
+ Threshold thresholdFilter = new Threshold( 230 );
+ thresholdFilter.ApplyInPlace( channel );
+ // put the channel back
+ ReplaceChannel replaceFilter = new ReplaceChannel( RGB.R, channel );
+ replaceFilter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ ARGB channel to replace.
+ Channel image to use for replacement.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ RGB channel to replace.
+ Unmanaged channel image to use for replacement.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+ Channel image size does not match source
+ image size.
+ Channel image's format does not correspond to format of the source image.
+
+ Can not replace alpha channel of none ARGB image. The
+ exception is throw, when alpha channel is requested to be replaced in RGB image.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ ARGB channel to replace.
+
+
+ Default value is set to .
+
+ Invalid channel is specified.
+
+
+
+
+ Grayscale image to use for channel replacement.
+
+
+
+ Setting this property will clear the property -
+ only one channel image is allowed: managed or unmanaged.
+
+
+ Channel image should be 8 bpp indexed or 16 bpp grayscale image.
+
+
+
+
+ Unmanaged grayscale image to use for channel replacement.
+
+
+
+ Setting this property will clear the property -
+ only one channel image is allowed: managed or unmanaged.
+
+
+ Channel image should be 8 bpp indexed or 16 bpp grayscale image.
+
+
+
+
+ Grayscale image using R-Y algorithm.
+
+
+ The class uses R-Y algorithm to convert color image
+ to grayscale. The conversion coefficients are:
+
+ - Red: 0.5;
+ - Green: 0.419;
+ - Blue: 0.081.
+
+
+
+
+
+
+
+
+
+
+ Base class for image grayscaling.
+
+
+ This class is the base class for image grayscaling. Other
+ classes should inherit from this class and specify RGB
+ coefficients used for color image conversion to grayscale.
+
+ The filter accepts 24, 32, 48 and 64 bpp color images and produces
+ 8 (if source is 24 or 32 bpp image) or 16 (if source is 48 or 64 bpp image)
+ bpp grayscale image.
+
+ Sample usage:
+
+ // create grayscale filter (BT709)
+ Grayscale filter = new Grayscale( 0.2125, 0.7154, 0.0721 );
+ // apply the filter
+ Bitmap grayImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+ Portion of red channel's value to use during conversion from RGB to grayscale.
+
+
+
+
+ Portion of green channel's value to use during conversion from RGB to grayscale.
+
+
+
+
+ Portion of blue channel's value to use during conversion from RGB to grayscale.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Red coefficient.
+ Green coefficient.
+ Blue coefficient.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Set of predefined common grayscaling algorithms, which have aldready initialized
+ grayscaling coefficients.
+
+
+
+
+ Grayscale image using BT709 algorithm.
+
+
+ The instance uses BT709 algorithm to convert color image
+ to grayscale. The conversion coefficients are:
+
+ - Red: 0.2125;
+ - Green: 0.7154;
+ - Blue: 0.0721.
+
+
+ Sample usage:
+
+ // apply the filter
+ Bitmap grayImage = Grayscale.CommonAlgorithms.BT709.Apply( image );
+
+
+
+
+
+
+ Grayscale image using R-Y algorithm.
+
+
+ The instance uses R-Y algorithm to convert color image
+ to grayscale. The conversion coefficients are:
+
+ - Red: 0.5;
+ - Green: 0.419;
+ - Blue: 0.081.
+
+
+ Sample usage:
+
+ // apply the filter
+ Bitmap grayImage = Grayscale.CommonAlgorithms.RMY.Apply( image );
+
+
+
+
+
+
+ Grayscale image using Y algorithm.
+
+
+ The instance uses Y algorithm to convert color image
+ to grayscale. The conversion coefficients are:
+
+ - Red: 0.299;
+ - Green: 0.587;
+ - Blue: 0.114.
+
+
+ Sample usage:
+
+ // apply the filter
+ Bitmap grayImage = Grayscale.CommonAlgorithms.Y.Apply( image );
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Threshold binarization with error carry.
+
+
+ The filter is similar to filter in the way,
+ that it also uses threshold value for image binarization. Unlike regular threshold
+ filter, this filter uses cumulative pixel value in comparing with threshold value.
+ If cumulative pixel value is below threshold value, then image pixel becomes black.
+ If cumulative pixel value is equal or higher than threshold value, then image pixel
+ becomes white and cumulative pixel value is decreased by 255. In the beginning of each
+ image line the cumulative value is reset to 0.
+
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ Threshold filter = new Threshold( 100 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Threshold value.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Threshold value.
+
+
+ Default value is 128.
+
+
+
+
+ Color dithering using Burkes error diffusion.
+
+
+ The image processing routine represents color dithering algorithm, which is based on
+ error diffusion dithering with Burkes coefficients. Error is diffused
+ on 7 neighbor pixels with next coefficients:
+
+ | * | 8 | 4 |
+ | 2 | 4 | 8 | 4 | 2 |
+
+ / 32
+
+
+ The image processing routine accepts 24/32 bpp color images for processing. As a result this routine
+ produces 4 bpp or 8 bpp indexed image, which depends on size of the specified
+ color table - 4 bpp result for
+ color tables with 16 colors or less; 8 bpp result for larger color tables.
+
+ Sample usage:
+
+ // create color image quantization routine
+ ColorImageQuantizer ciq = new ColorImageQuantizer( new MedianCutQuantizer( ) );
+ // create 8 colors table
+ Color[] colorTable = ciq.CalculatePalette( image, 8 );
+ // create dithering routine
+ BurkesColorDithering dithering = new BurkesColorDithering( );
+ dithering.ColorTable = colorTable;
+ // apply the dithering routine
+ Bitmap newImage = dithering.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Moravec corners detector.
+
+
+ The class implements Moravec corners detector. For information about algorithm's
+ details its description
+ should be studied.
+
+ Due to limitations of Moravec corners detector (anisotropic response, etc.) its usage is limited
+ to certain cases only.
+
+ The class processes only grayscale 8 bpp and color 24/32 bpp images.
+
+ Sample usage:
+
+ // create corner detector's instance
+ MoravecCornersDetector mcd = new MoravecCornersDetector( );
+ // process image searching for corners
+ List<IntPoint> corners = scd.ProcessImage( image );
+ // process points
+ foreach ( IntPoint corner in corners )
+ {
+ // ...
+ }
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Threshold value, which is used to filter out uninteresting points.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Threshold value, which is used to filter out uninteresting points.
+ Window size used to determine if point is interesting.
+
+
+
+
+ Process image looking for corners.
+
+
+ Source image to process.
+
+ Returns array of found corners (X-Y coordinates).
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Process image looking for corners.
+
+
+ Source image data to process.
+
+ Returns array of found corners (X-Y coordinates).
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Process image looking for corners.
+
+
+ Unmanaged source image to process.
+
+ Returns array of found corners (X-Y coordinates).
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Window size used to determine if point is interesting, [3, 15].
+
+
+ The value specifies window size, which is used for initial searching of
+ corners candidates and then for searching local maximums.
+
+ Default value is set to 3.
+
+
+ Setting value is not odd.
+
+
+
+
+ Threshold value, which is used to filter out uninteresting points.
+
+
+ The value is used to filter uninteresting points - points which have value below
+ specified threshold value are treated as not corners candidates. Increasing this value decreases
+ the amount of detected point.
+
+ Default value is set to 500.
+
+
+
+
+
+ Mirroring filter.
+
+
+ The filter mirrors image around X and/or Y axis (horizontal and vertical
+ mirroring).
+
+ The filter accepts 8 bpp grayscale images and 24 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Mirror filter = new Mirror( false, true );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Specifies if mirroring should be done for X axis.
+ Specifies if mirroring should be done for Y axis
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Specifies if mirroring should be done for X axis (horizontal mirroring).
+
+
+
+
+
+ Specifies if mirroring should be done for Y axis (vertical mirroring).
+
+
+
+
+
+ Apply filter according to the specified mask.
+
+
+ The image processing routine applies the specified to
+ a source image according to the specified mask - if a pixel/value in the specified mask image/array
+ is set to 0, then the original pixel's value is kept; otherwise the pixel is filtered using the
+ specified base filter.
+
+ Mask can be specified as .NET's managed Bitmap, as
+ UnmanagedImage or as byte array.
+ In the case if mask is specified as image, it must be 8 bpp grayscale image. In all case
+ mask size must be the same as size of the image to process.
+
+ Pixel formats accepted by this filter are specified by the .
+
+ Sample usage:
+
+ // create the filter
+ MaskedFilter maskedFilter = new MaskedFilter( new Sepia( ), maskImage );
+ // apply the filter
+ maskedFilter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Mask image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Base filter to apply to the specified source image.
+ Mask image to use.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Base filter to apply to the specified source image.
+ Unmanaged mask image to use.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Base filter to apply to the specified source image.
+ to use.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+ None of the possible mask properties were set. Need to provide mask before applying the filter.
+ Invalid size of provided mask. Its size must be the same as the size of the image to mask.
+
+
+
+
+ Base filter to apply to the source image.
+
+
+ The property specifies base filter which is applied to the specified source
+ image (to all pixels which have corresponding none 0 value in mask image/array).
+
+ The base filter must implement interface.
+
+ The base filter must never change image's pixel format. For example, if source
+ image's pixel format is 24 bpp color image, then it must stay the same after the base
+ filter is applied.
+
+ The base filter must never change size of the source image.
+
+
+ Base filter can not be set to null.
+ The specified base filter must implement IFilterInformation interface.
+ The specified filter must never change pixel format.
+
+
+
+
+ Mask image to apply.
+
+
+ The property specifies mask image to use. The image must be grayscale
+ (8 bpp format) and have the same size as the source image to process.
+
+ When the property is set, both and
+ properties are set to .
+
+
+ The mask image must be 8 bpp grayscale image.
+
+
+
+
+ Unmanaged mask image to apply.
+
+
+ The property specifies unmanaged mask image to use. The image must be grayscale
+ (8 bpp format) and have the same size as the source image to process.
+
+ When the property is set, both and
+ properties are set to .
+
+
+ The mask image must be 8 bpp grayscale image.
+
+
+
+
+ Mask to apply.
+
+
+ The property specifies mask array to use. Size of the array must
+ be the same size as the size of the source image to process - its 0th dimension
+ must be equal to image's height and its 1st dimension must be equal to width. For
+ example, for 640x480 image, the mask array must be defined as:
+
+ byte[,] mask = new byte[480, 640];
+
+
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+ The property returns format translation table from the
+ .
+
+
+
+
+
+ Jitter filter.
+
+
+ The filter moves each pixel of a source image in
+ random direction within a window of specified radius.
+
+ The filter accepts 8 bpp grayscale images and 24/32
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Jitter filter = new Jitter( 4 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Jittering radius.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Jittering radius, [1, 10]
+
+
+ Determines radius in which pixels can move.
+
+ Default value is set to 2.
+
+
+
+
+
+ Fill areas iniside of the specified region.
+
+
+
+ The filter fills areas inside of specified region using the specified color.
+
+ The filter accepts 8bpp grayscale and 24/32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ CanvasFill filter = new CanvasFill( new Rectangle(
+ 5, 5, image.Width - 10, image.Height - 10 ), Color.Red );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Region to fill.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Region to fill.
+ RGB color to use for filling areas inside of specified region in color images.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Region to fill.
+ Gray color to use for filling areas inside of specified region in grayscale images.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Region to fill.
+ RGB color to use for filling areas inside of specified region in color images.
+ Gray color to use for filling areas inside of specified region in grayscale images.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ RGB fill color.
+
+
+ The color is used to fill areas out of specified region in color images.
+
+ Default value is set to white - RGB(255, 255, 255).
+
+
+
+
+ Gray fill color.
+
+
+ The color is used to fill areas out of specified region in grayscale images.
+
+ Default value is set to white - 255.
+
+
+
+
+ Region to fill.
+
+
+ Pixels inside of the specified region will be filled with specified color.
+
+
+
+
+ Histogram equalization filter.
+
+
+ The filter does histogram equalization increasing local contrast in images. The effect
+ of histogram equalization can be better seen on images, where pixel values have close contrast values.
+ Through this adjustment, pixels intensities can be better distributed on the histogram. This allows for
+ areas of lower local contrast to gain a higher contrast without affecting the global contrast.
+
+
+ The filter accepts 8 bpp grayscale images and 24/32 bpp
+ color images for processing.
+
+ For color images the histogram equalization is applied to each color plane separately.
+
+ Sample usage:
+
+ // create filter
+ HistogramEqualization filter = new HistogramEqualization( );
+ // process image
+ filter.ApplyInPlace( sourceImage );
+
+
+ Source image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Extract RGB channel from image.
+
+
+ Extracts specified channel of color image and returns
+ it as grayscale image.
+
+ The filter accepts 24, 32, 48 and 64 bpp color images and produces
+ 8 (if source is 24 or 32 bpp image) or 16 (if source is 48 or 64 bpp image)
+ bpp grayscale image.
+
+ Sample usage:
+
+ // create filter
+ ExtractChannel filter = new ExtractChannel( RGB.G );
+ // apply the filter
+ Bitmap channelImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ ARGB channel to extract.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+ Can not extract alpha channel from none ARGB image. The
+ exception is throw, when alpha channel is requested from RGB image.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ ARGB channel to extract.
+
+
+ Default value is set to .
+
+ Invalid channel is specified.
+
+
+
+
+ Dithering using Floyd-Steinberg error diffusion.
+
+
+ The filter represents binarization filter, which is based on
+ error diffusion dithering with Floyd-Steinberg
+ coefficients. Error is diffused on 4 neighbor pixels with next coefficients:
+
+
+ | * | 7 |
+ | 3 | 5 | 1 |
+
+ / 16
+
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ FloydSteinbergDithering filter = new FloydSteinbergDithering( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Core image relatad methods.
+
+
+ All methods of this class are static and represent general routines
+ used by different image processing classes.
+
+
+
+
+ Check if specified 8 bpp image is grayscale.
+
+
+ Image to check.
+
+ Returns true if the image is grayscale or false otherwise.
+
+ The methods checks if the image is a grayscale image of 256 gradients.
+ The method first examines if the image's pixel format is
+ Format8bppIndexed
+ and then it examines its palette to check if the image is grayscale or not.
+
+
+
+
+ Create and initialize new 8 bpp grayscale image.
+
+
+ Image width.
+ Image height.
+
+ Returns the created grayscale image.
+
+ The method creates new 8 bpp grayscale image and initializes its palette.
+ Grayscale image is represented as
+ Format8bppIndexed
+ image with palette initialized to 256 gradients of gray color.
+
+
+
+
+ Set pallete of the 8 bpp indexed image to grayscale.
+
+
+ Image to initialize.
+
+ The method initializes palette of
+ Format8bppIndexed
+ image with 256 gradients of gray color.
+
+ Provided image is not 8 bpp indexed image.
+
+
+
+
+ Clone image.
+
+
+ Source image.
+ Pixel format of result image.
+
+ Returns clone of the source image with specified pixel format.
+
+ The original Bitmap.Clone()
+ does not produce the desired result - it does not create a clone with specified pixel format.
+ More of it, the original method does not create an actual clone - it does not create a copy
+ of the image. That is why this method was implemented to provide the functionality.
+
+
+
+
+ Clone image.
+
+
+ Source image.
+
+ Return clone of the source image.
+
+ The original Bitmap.Clone()
+ does not produce the desired result - it does not create an actual clone (it does not create a copy
+ of the image). That is why this method was implemented to provide the functionality.
+
+
+
+
+ Clone image.
+
+
+ Source image data.
+
+ Clones image from source image data. The message does not clone pallete in the
+ case if the source image has indexed pixel format.
+
+
+
+
+ Format an image.
+
+
+ Source image to format.
+
+ Formats the image to one of the formats, which are supported
+ by the AForge.Imaging library. The image is left untouched in the
+ case if it is already of
+ Format24bppRgb or
+ Format32bppRgb or
+ Format32bppArgb or
+ Format48bppRgb or
+ Format64bppArgb
+ format or it is grayscale, otherwise the image
+ is converted to Format24bppRgb
+ format.
+
+ The method is deprecated and method should
+ be used instead with specifying desired pixel format.
+
+
+
+
+
+ Load bitmap from file.
+
+
+ File name to load bitmap from.
+
+ Returns loaded bitmap.
+
+ The method is provided as an alternative of
+ method to solve the issues of locked file. The standard .NET's method locks the source file until
+ image's object is disposed, so the file can not be deleted or overwritten. This method workarounds the issue and
+ does not lock the source file.
+
+ Sample usage:
+
+ Bitmap image = AForge.Imaging.Image.FromFile( "test.jpg" );
+
+
+
+
+
+
+ Convert bitmap with 16 bits per plane to a bitmap with 8 bits per plane.
+
+
+ Source image to convert.
+
+ Returns new image which is a copy of the source image but with 8 bits per plane.
+
+ The routine does the next pixel format conversions:
+
+ - Format16bppGrayScale to
+ Format8bppIndexed with grayscale palette;
+ - Format48bppRgb to
+ Format24bppRgb;
+ - Format64bppArgb to
+ Format32bppArgb;
+ - Format64bppPArgb to
+ Format32bppPArgb.
+
+
+
+ Invalid pixel format of the source image.
+
+
+
+
+ Convert bitmap with 8 bits per plane to a bitmap with 16 bits per plane.
+
+
+ Source image to convert.
+
+ Returns new image which is a copy of the source image but with 16 bits per plane.
+
+ The routine does the next pixel format conversions:
+
+ - Format8bppIndexed (grayscale palette assumed) to
+ Format16bppGrayScale;
+ - Format24bppRgb to
+ Format48bppRgb;
+ - Format32bppArgb to
+ Format64bppArgb;
+ - Format32bppPArgb to
+ Format64bppPArgb.
+
+
+
+ Invalid pixel format of the source image.
+
+
+
+
+ Linear correction of YCbCr channels.
+
+
+ The filter operates in YCbCr color space and provides
+ with the facility of linear correction of its channels - mapping specified channels'
+ input ranges to specified output ranges.
+
+ The filter accepts 24 and 32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ YCbCrLinear filter = new YCbCrLinear( );
+ // configure the filter
+ filter.InCb = new Range( -0.276f, 0.163f );
+ filter.InCr = new Range( -0.202f, 0.500f );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Y component's input range.
+
+
+ Y component is measured in the range of [0, 1].
+
+
+
+
+ Cb component's input range.
+
+
+ Cb component is measured in the range of [-0.5, 0.5].
+
+
+
+
+ Cr component's input range.
+
+
+ Cr component is measured in the range of [-0.5, 0.5].
+
+
+
+
+ Y component's output range.
+
+
+ Y component is measured in the range of [0, 1].
+
+
+
+
+ Cb component's output range.
+
+
+ Cb component is measured in the range of [-0.5, 0.5].
+
+
+
+
+ Cr component's output range.
+
+
+ Cr component is measured in the range of [-0.5, 0.5].
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Resize image using bilinear interpolation algorithm.
+
+
+ The class implements image resizing filter using bilinear
+ interpolation algorithm.
+
+ The filter accepts 8 grayscale images and 24/32 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ ResizeBilinear filter = new ResizeBilinear( 400, 300 );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Width of the new image.
+ Height of the new image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Oil painting filter.
+
+
+ Processing source image the filter changes each pixels' value
+ to the value of pixel with the most frequent intensity within window of the
+ specified size. Going through the window the filters
+ finds which intensity of pixels is the most frequent. Then it updates value
+ of the pixel in the center of the window to the value with the most frequent
+ intensity. The update procedure creates the effect of oil painting.
+
+ The filter accepts 8 bpp grayscale images and 24/32
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ OilPainting filter = new OilPainting( 15 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Brush size.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Brush size, [3, 21].
+
+
+ Window size to search for most frequent pixels' intensity.
+
+ Default value is set to 5.
+
+
+
+
+ Extract normalized RGB channel from color image.
+
+
+ Extracts specified normalized RGB channel of color image and returns
+ it as grayscale image.
+
+ Normalized RGB color space is defined as:
+
+ r = R / (R + G + B ),
+ g = G / (R + G + B ),
+ b = B / (R + G + B ),
+
+ where R, G and B are components of RGB color space and
+ r, g and b are components of normalized RGB color space.
+
+
+ The filter accepts 24, 32, 48 and 64 bpp color images and produces
+ 8 (if source is 24 or 32 bpp image) or 16 (if source is 48 or 64 bpp image)
+ bpp grayscale image.
+
+ Sample usage:
+
+ // create filter
+ ExtractNormalizedRGBChannel filter = new ExtractNormalizedRGBChannel( RGB.G );
+ // apply the filter
+ Bitmap channelImage = filter.Apply( image );
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Normalized RGB channel to extract.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Normalized RGB channel to extract.
+
+
+ Default value is set to .
+
+ Invalid channel is specified.
+
+
+
+
+ Binary dilatation operator from Mathematical Morphology with 3x3 structuring element.
+
+
+ The filter represents an optimized version of
+ filter, which is aimed for binary images (containing black and white pixels) processed
+ with 3x3 structuring element. This makes this filter ideal for growing objects in binary
+ images – it puts white pixel to the destination image in the case if there is at least
+ one white neighbouring pixel in the source image.
+
+ See filter, which represents generic version of
+ dilatation filter supporting custom structuring elements and wider range of image formats.
+
+ The filter accepts 8 bpp grayscale (binary) images for processing.
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+ Processing rectangle mast be at least 3x3 in size.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Sobel edge detector.
+
+
+ The filter searches for objects' edges by applying Sobel operator.
+
+ Each pixel of the result image is calculated as approximated absolute gradient
+ magnitude for corresponding pixel of the source image:
+
+ |G| = |Gx| + |Gy] ,
+
+ where Gx and Gy are calculate utilizing Sobel convolution kernels:
+
+ Gx Gy
+ -1 0 +1 +1 +2 +1
+ -2 0 +2 0 0 0
+ -1 0 +1 -1 -2 -1
+
+ Using the above kernel the approximated magnitude for pixel x is calculate using
+ the next equation:
+
+ P1 P2 P3
+ P8 x P4
+ P7 P6 P5
+
+ |G| = |P1 + 2P2 + P3 - P7 - 2P6 - P5| +
+ |P3 + 2P4 + P5 - P1 - 2P8 - P7|
+
+
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ SobelEdgeDetector filter = new SobelEdgeDetector( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Scale intensity or not.
+
+
+ The property determines if edges' pixels intensities of the result image
+ should be scaled in the range of the lowest and the highest possible intensity
+ values.
+
+ Default value is set to .
+
+
+
+
+
+ Sharpen filter
+
+
+ The filter performs convolution filter using
+ the sharpen kernel:
+
+
+ 0 -1 0
+ -1 5 -1
+ 0 -1 0
+
+
+ For the list of supported pixel formats, see the documentation to
+ filter.
+
+ Sample usage:
+
+ // create filter
+ Sharpen filter = new Sharpen( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Sepia filter - old brown photo.
+
+
+ The filter makes an image look like an old brown photo. The main
+ idea of the algorithm:
+
+ - transform to YIQ color space;
+ - modify it;
+ - transform back to RGB.
+
+
+
+ 1) RGB -> YIQ:
+
+ Y = 0.299 * R + 0.587 * G + 0.114 * B
+ I = 0.596 * R - 0.274 * G - 0.322 * B
+ Q = 0.212 * R - 0.523 * G + 0.311 * B
+
+
+
+
+ 2) update:
+
+ I = 51
+ Q = 0
+
+
+
+
+ 3) YIQ -> RGB:
+
+ R = 1.0 * Y + 0.956 * I + 0.621 * Q
+ G = 1.0 * Y - 0.272 * I - 0.647 * Q
+ B = 1.0 * Y - 1.105 * I + 1.702 * Q
+
+
+
+ The filter accepts 24/32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Sepia filter = new Sepia( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Invert image.
+
+
+ The filter inverts colored and grayscale images.
+
+ The filter accepts 8, 16 bpp grayscale and 24, 48 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Invert filter = new Invert( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Euclidean color filtering.
+
+
+ The filter filters pixels, which color is inside/outside
+ of RGB sphere with specified center and radius - it keeps pixels with
+ colors inside/outside of the specified sphere and fills the rest with
+ specified color.
+
+ The filter accepts 24 and 32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ EuclideanColorFiltering filter = new EuclideanColorFiltering( );
+ // set center colol and radius
+ filter.CenterColor = new RGB( 215, 30, 30 );
+ filter.Radius = 100;
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ RGB sphere's center.
+ RGB sphere's radius.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ RGB sphere's radius, [0, 450].
+
+
+ Default value is 100.
+
+
+
+
+ RGB sphere's center.
+
+
+ Default value is (255, 255, 255) - white color.
+
+
+
+
+ Fill color used to fill filtered pixels.
+
+
+
+
+ Determines, if pixels should be filled inside or outside specified
+ RGB sphere.
+
+
+ Default value is set to , which means
+ the filter removes colors outside of the specified range.
+
+
+
+
+ Exhaustive template matching.
+
+
+ The class implements exhaustive template matching algorithm,
+ which performs complete scan of source image, comparing each pixel with corresponding
+ pixel of template.
+
+ The class processes only grayscale 8 bpp and color 24 bpp images.
+
+ Sample usage:
+
+ // create template matching algorithm's instance
+ ExhaustiveTemplateMatching tm = new ExhaustiveTemplateMatching( 0.9f );
+ // find all matchings with specified above similarity
+ TemplateMatch[] matchings = tm.ProcessImage( sourceImage, templateImage );
+ // highlight found matchings
+ BitmapData data = sourceImage.LockBits(
+ new Rectangle( 0, 0, sourceImage.Width, sourceImage.Height ),
+ ImageLockMode.ReadWrite, sourceImage.PixelFormat );
+ foreach ( TemplateMatch m in matchings )
+ {
+ Drawing.Rectangle( data, m.Rectangle, Color.White );
+ // do something else with matching
+ }
+ sourceImage.UnlockBits( data );
+
+
+ The class also can be used to get similarity level between two image of the same
+ size, which can be useful to get information about how different/similar are images:
+
+ // create template matching algorithm's instance
+ // use zero similarity to make sure algorithm will provide anything
+ ExhaustiveTemplateMatching tm = new ExhaustiveTemplateMatching( 0 );
+ // compare two images
+ TemplateMatch[] matchings = tm.ProcessImage( image1, image2 );
+ // check similarity level
+ if ( matchings[0].Similarity > 0.95f )
+ {
+ // do something with quite similar images
+ }
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Similarity threshold.
+
+
+
+
+ Process image looking for matchings with specified template.
+
+
+ Source image to process.
+ Template image to search for.
+
+ Returns array of found template matches. The array is sorted by similarity
+ of found matches in descending order.
+
+ The source image has incorrect pixel format.
+ Template image is bigger than source image.
+
+
+
+
+ Process image looking for matchings with specified template.
+
+
+ Source image to process.
+ Template image to search for.
+ Rectangle in source image to search template for.
+
+ Returns array of found template matches. The array is sorted by similarity
+ of found matches in descending order.
+
+ The source image has incorrect pixel format.
+ Template image is bigger than source image.
+
+
+
+
+ Process image looking for matchings with specified template.
+
+
+ Source image data to process.
+ Template image to search for.
+
+ Returns array of found template matches. The array is sorted by similarity
+ of found matches in descending order.
+
+ The source image has incorrect pixel format.
+ Template image is bigger than source image.
+
+
+
+
+ Process image looking for matchings with specified template.
+
+
+ Source image data to process.
+ Template image to search for.
+ Rectangle in source image to search template for.
+
+ Returns array of found template matches. The array is sorted by similarity
+ of found matches in descending order.
+
+ The source image has incorrect pixel format.
+ Template image is bigger than source image.
+
+
+
+
+ Process image looking for matchings with specified template.
+
+
+ Unmanaged source image to process.
+ Unmanaged template image to search for.
+
+ Returns array of found template matches. The array is sorted by similarity
+ of found matches in descending order.
+
+ The source image has incorrect pixel format.
+ Template image is bigger than source image.
+
+
+
+
+ Process image looking for matchings with specified template.
+
+
+ Unmanaged source image to process.
+ Unmanaged template image to search for.
+ Rectangle in source image to search template for.
+
+ Returns array of found template matches. The array is sorted by similarity
+ of found matches in descending order.
+
+ The source image has incorrect pixel format.
+ Template image is bigger than search zone.
+
+
+
+
+ Similarity threshold, [0..1].
+
+
+ The property sets the minimal acceptable similarity between template
+ and potential found candidate. If similarity is lower than this value,
+ then object is not treated as matching with template.
+
+
+ Default value is set to 0.9.
+
+
+
+
+
+ Block matching implementation with the exhaustive search algorithm.
+
+
+ The class implements exhaustive search block matching algorithm
+ (see documentation for for information about
+ block matching algorithms). Exhaustive search algorithm tests each possible
+ location of block within search window trying to find a match with minimal
+ difference.
+
+ Because of the exhaustive nature of the algorithm, high performance
+ should not be expected in the case if big number of reference points is provided
+ or big block size and search radius are specified. Minimizing theses values increases
+ performance. But too small block size and search radius may affect quality.
+
+ The class processes only grayscale (8 bpp indexed) and color (24 bpp) images.
+
+ Sample usage:
+
+ // collect reference points using corners detector (for example)
+ SusanCornersDetector scd = new SusanCornersDetector( 30, 18 );
+ List<IntPoint> points = scd.ProcessImage( sourceImage );
+
+ // create block matching algorithm's instance
+ ExhaustiveBlockMatching bm = new ExhaustiveBlockMatching( 8, 12 );
+ // process images searching for block matchings
+ List<BlockMatch> matches = bm.ProcessImage( sourceImage, points, searchImage );
+
+ // draw displacement vectors
+ BitmapData data = sourceImage.LockBits(
+ new Rectangle( 0, 0, sourceImage.Width, sourceImage.Height ),
+ ImageLockMode.ReadWrite, sourceImage.PixelFormat );
+
+ foreach ( BlockMatch match in matches )
+ {
+ // highlight the original point in source image
+ Drawing.FillRectangle( data,
+ new Rectangle( match.SourcePoint.X - 1, match.SourcePoint.Y - 1, 3, 3 ),
+ Color.Yellow );
+ // draw line to the point in search image
+ Drawing.Line( data, match.SourcePoint, match.MatchPoint, Color.Red );
+
+ // check similarity
+ if ( match.Similarity > 0.98f )
+ {
+ // process block with high similarity somehow special
+ }
+ }
+
+ sourceImage.UnlockBits( data );
+
+
+ Test image 1 (source):
+
+ Test image 2 (search):
+
+ Result image:
+
+
+
+
+
+
+ Block matching interface.
+
+
+ The interface specifies set of methods, which should be implemented by different
+ block matching algorithms.
+
+ Block matching algorithms work with two images - source and search image - and
+ a set of reference points. For each provided reference point, the algorithm takes
+ a block from source image (reference point is a coordinate of block's center) and finds
+ the best match for it in search image providing its coordinate (search is done within
+ search window of specified size). In other words, block matching algorithm tries to
+ find new coordinates in search image of specified reference points in source image.
+
+
+
+
+
+
+ Process images matching blocks between them.
+
+
+ Source image with reference points.
+ List of reference points to be matched.
+ Image in which the reference points will be looked for.
+
+ Returns list of found block matches.
+
+
+
+
+ Process images matching blocks between them.
+
+
+ Source image with reference points.
+ List of reference points to be matched.
+ Image in which the reference points will be looked for.
+
+ Returns list of found block matches.
+
+
+
+
+ Process images matching blocks between them.
+
+
+ Source unmanaged image with reference points.
+ List of reference points to be matched.
+ Unmanaged image in which the reference points will be looked for.
+
+ Returns list of found block matches.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Block size to search for.
+ Search radius.
+
+
+
+
+ Process images matching blocks between hem.
+
+
+ Source image with reference points.
+ List of reference points to be matched.
+ Image in which the reference points will be looked for.
+
+ Returns list of found block matches. The list is sorted by similarity
+ of found matches in descending order.
+
+ Source and search images sizes must match.
+ Source images can be grayscale (8 bpp indexed) or color (24 bpp) image only.
+ Source and search images must have same pixel format.
+
+
+
+
+ Process images matching blocks between them.
+
+
+ Source image with reference points.
+ List of reference points to be matched.
+ Image in which the reference points will be looked for.
+
+ Returns list of found block matches. The list is sorted by similarity
+ of found matches in descending order.
+
+ Source and search images sizes must match.
+ Source images can be grayscale (8 bpp indexed) or color (24 bpp) image only.
+ Source and search images must have same pixel format.
+
+
+
+
+ Process images matching blocks between them.
+
+
+ Source unmanaged image with reference points.
+ List of reference points to be matched.
+ Unmanaged image in which the reference points will be looked for.
+
+ Returns list of found block matches. The list is sorted by similarity
+ of found matches in descending order.
+
+ Source and search images sizes must match.
+ Source images can be grayscale (8 bpp indexed) or color (24 bpp) image only.
+ Source and search images must have same pixel format.
+
+
+
+
+ Search radius.
+
+
+ The value specifies the shift from reference point in all
+ four directions, used to search for the best matching block.
+
+ Default value is set to 12.
+
+
+
+
+
+ Block size to search for.
+
+
+ The value specifies block size to search for. For each provided
+ reference pointer, a square block of this size is taken from the source image
+ (reference point becomes the coordinate of block's center) and the best match
+ is searched in second image within specified search
+ radius.
+
+ Default value is set to 16.
+
+
+
+
+
+ Similarity threshold, [0..1].
+
+
+ The property sets the minimal acceptable similarity between blocks
+ in source and search images. If similarity is lower than this value,
+ then the candidate block in search image is not treated as a match for the block
+ in source image.
+
+
+ Default value is set to 0.9.
+
+
+
+
+
+ Unsupported image format exception.
+
+
+ The unsupported image format exception is thrown in the case when
+ user passes an image of certain format to an image processing routine, which does
+ not support the format. Check documentation of the image processing routine
+ to discover which formats are supported by the routine.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Message providing some additional information.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Message providing some additional information.
+ Name of the invalid parameter.
+
+
+
+
+ Invalid image properties exception.
+
+
+ The invalid image properties exception is thrown in the case when
+ user provides an image with certain properties, which are treated as invalid by
+ particular image processing routine. Another case when this exception is
+ thrown is the case when user tries to access some properties of an image (or
+ of a recently processed image by some routine), which are not valid for that image.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Message providing some additional information.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Message providing some additional information.
+ Name of the invalid parameter.
+
+
+
+
+ Complex image.
+
+
+ The class is used to keep image represented in complex numbers sutable for Fourier
+ transformations.
+
+ Sample usage:
+
+ // create complex image
+ ComplexImage complexImage = ComplexImage.FromBitmap( image );
+ // do forward Fourier transformation
+ complexImage.ForwardFourierTransform( );
+ // get complex image as bitmat
+ Bitmap fourierImage = complexImage.ToBitmap( );
+
+
+ Initial image:
+
+ Fourier image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image width.
+ Image height.
+
+ The constractor is protected, what makes it imposible to instantiate this
+ class directly. To create an instance of this class or
+ method should be used.
+
+
+
+
+ Clone the complex image.
+
+
+ Returns copy of the complex image.
+
+
+
+
+ Create complex image from grayscale bitmap.
+
+
+ Source grayscale bitmap (8 bpp indexed).
+
+ Returns an instance of complex image.
+
+ The source image has incorrect pixel format.
+ Image width and height should be power of 2.
+
+
+
+
+ Create complex image from grayscale bitmap.
+
+
+ Source image data (8 bpp indexed).
+
+ Returns an instance of complex image.
+
+ The source image has incorrect pixel format.
+ Image width and height should be power of 2.
+
+
+
+
+ Convert complex image to bitmap.
+
+
+ Returns grayscale bitmap.
+
+
+
+
+ Applies forward fast Fourier transformation to the complex image.
+
+
+
+
+
+ Applies backward fast Fourier transformation to the complex image.
+
+
+
+
+
+ Image width.
+
+
+
+
+
+ Image height.
+
+
+
+
+
+ Status of the image - Fourier transformed or not.
+
+
+
+
+
+ Complex image's data.
+
+
+ Return's 2D array of [height, width] size, which keeps image's
+ complex data.
+
+
+
+
+ RGB components.
+
+
+ The class encapsulates RGB color components.
+ PixelFormat.Format24bppRgb
+ actually means BGR format.
+
+
+
+
+
+ Index of red component.
+
+
+
+
+ Index of green component.
+
+
+
+
+ Index of blue component.
+
+
+
+
+ Index of alpha component for ARGB images.
+
+
+
+
+ Red component.
+
+
+
+
+ Green component.
+
+
+
+
+ Blue component.
+
+
+
+
+ Alpha component.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Red component.
+ Green component.
+ Blue component.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Red component.
+ Green component.
+ Blue component.
+ Alpha component.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Initialize from specified color.
+
+
+
+
+ Color value of the class.
+
+
+
+
+ HSL components.
+
+
+ The class encapsulates HSL color components.
+
+
+
+
+ Hue component.
+
+
+ Hue is measured in the range of [0, 359].
+
+
+
+
+ Saturation component.
+
+
+ Saturation is measured in the range of [0, 1].
+
+
+
+
+ Luminance value.
+
+
+ Luminance is measured in the range of [0, 1].
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Hue component.
+ Saturation component.
+ Luminance component.
+
+
+
+
+ Convert from RGB to HSL color space.
+
+
+ Source color in RGB color space.
+ Destination color in HSL color space.
+
+ See HSL and HSV Wiki
+ for information about the algorithm to convert from RGB to HSL.
+
+
+
+
+ Convert from RGB to HSL color space.
+
+
+ Source color in RGB color space.
+
+ Returns instance, which represents converted color value.
+
+
+
+
+ Convert from HSL to RGB color space.
+
+
+ Source color in HSL color space.
+ Destination color in RGB color space.
+
+
+
+
+ Convert the color to RGB color space.
+
+
+ Returns instance, which represents converted color value.
+
+
+
+
+ YCbCr components.
+
+
+ The class encapsulates YCbCr color components.
+
+
+
+
+ Index of Y component.
+
+
+
+
+ Index of Cb component.
+
+
+
+
+ Index of Cr component.
+
+
+
+
+ Y component.
+
+
+
+
+ Cb component.
+
+
+
+
+ Cr component.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Y component.
+ Cb component.
+ Cr component.
+
+
+
+
+ Convert from RGB to YCbCr color space (Rec 601-1 specification).
+
+
+ Source color in RGB color space.
+ Destination color in YCbCr color space.
+
+
+
+
+ Convert from RGB to YCbCr color space (Rec 601-1 specification).
+
+
+ Source color in RGB color space.
+
+ Returns instance, which represents converted color value.
+
+
+
+
+ Convert from YCbCr to RGB color space.
+
+
+ Source color in YCbCr color space.
+ Destination color in RGB color spacs.
+
+
+
+
+ Convert the color to RGB color space.
+
+
+ Returns instance, which represents converted color value.
+
+
+
+
+ Color dithering with a thresold matrix (ordered dithering).
+
+
+ The class implements ordered color dithering as described on
+ Wikipedia.
+ The algorithm achieves dithering by applying a threshold map on
+ the pixels displayed, causing some of the pixels to be rendered at a different color, depending on
+ how far in between the color is of available color entries.
+
+ The image processing routine accepts 24/32 bpp color images for processing. As a result this routine
+ produces 4 bpp or 8 bpp indexed image, which depends on size of the specified
+ color table - 4 bpp result for
+ color tables with 16 colors or less; 8 bpp result for larger color tables.
+
+ Sample usage:
+
+ // create color image quantization routine
+ ColorImageQuantizer ciq = new ColorImageQuantizer( new MedianCutQuantizer( ) );
+ // create 256 colors table
+ Color[] colorTable = ciq.CalculatePalette( image, 256 );
+ // create dithering routine
+ OrderedColorDithering dithering = new OrderedColorDithering( );
+ dithering.ColorTable = colorTable;
+ // apply the dithering routine
+ Bitmap newImage = dithering.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Threshold matrix (see property).
+
+
+
+
+ Perform color dithering for the specified image.
+
+
+ Source image to do color dithering for.
+
+ Returns color dithered image. See for information about format of
+ the result image.
+
+ Unsupported pixel format of the source image. It must 24 or 32 bpp color image.
+
+
+
+
+ Perform color dithering for the specified image.
+
+
+ Source image to do color dithering for.
+
+ Returns color dithered image. See for information about format of
+ the result image.
+
+ Unsupported pixel format of the source image. It must 24 or 32 bpp color image.
+
+
+
+
+ Threshold matrix - values to add source image's values.
+
+
+ The property keeps a threshold matrix, which is applied to values of a source image
+ to dither. By adding these values to the source image the algorithm produces the effect when pixels
+ of the same color in source image may have different color in the result image (which depends on pixel's
+ position). This threshold map is also known as an index matrix or Bayer matrix.
+
+ By default the property is inialized with the below matrix:
+
+ 2 18 6 22
+ 26 10 30 14
+ 8 24 4 20
+ 32 16 28 12
+
+
+
+
+
+
+
+ Color table to use for image dithering. Must contain 2-256 colors.
+
+
+ Color table size determines format of the resulting image produced by this
+ image processing routine. If color table contains 16 color or less, then result image will have
+ 4 bpp indexed pixel format. If color table contains more than 16 colors, then result image will
+ have 8 bpp indexed pixel format.
+
+ By default the property is initialized with default 16 colors, which are:
+ Black, Dark Blue, Dark Green, Dark Cyan, Dark Red, Dark Magenta, Dark Khaki, Light Gray,
+ Gray, Blue, Green, Cyan, Red, Magenta, Yellow and White.
+
+
+ Color table length must be in the [2, 256] range.
+
+
+
+
+ Use color caching during color dithering or not.
+
+
+ The property specifies if internal cache of already processed colors should be used or not.
+ For each pixel in the original image the color dithering routine does search in target color palette to find
+ the best matching color. To avoid doing the search again and again for already processed colors, the class may
+ use internal dictionary which maps colors of original image to indexes in target color palette.
+
+
+ The property provides a trade off. On one hand it may speedup color dithering routine, but on another
+ hand it increases memory usage. Also cache usage may not be efficient for very small target color tables.
+
+ Default value is set to .
+
+
+
+
+
+ Block match class keeps information about found block match. The class is
+ used with block matching algorithms implementing
+ interface.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Reference point in source image.
+ Match point in search image (point of a found match).
+ Similarity between blocks in source and search images, [0..1].
+
+
+
+
+ Reference point in source image.
+
+
+
+
+ Match point in search image (point of a found match).
+
+
+
+
+ Similarity between blocks in source and search images, [0..1].
+
+
+
+
+ Image's blob.
+
+
+ The class represents a blob - part of another images. The
+ class encapsulates the blob itself and information about its position
+ in parent image.
+
+ The class is not responsible for blob's image disposing, so it should be
+ done manually when it is required.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Blob's ID in the original image.
+ Blob's rectangle in the original image.
+
+ This constructor leaves property not initialized. The blob's
+ image may be extracted later using
+ or method.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Source blob to copy.
+
+ This copy constructor leaves property not initialized. The blob's
+ image may be extracted later using
+ or method.
+
+
+
+
+ Blob's image.
+
+
+ The property keeps blob's image. In the case if it equals to null,
+ the image may be extracted using
+ or method.
+
+
+
+
+ Blob's image size.
+
+
+ The property specifies size of the blob's image.
+ If the property is set to , the blob's image size equals to the
+ size of original image. If the property is set to , the blob's
+ image size equals to size of actual blob.
+
+
+
+
+ Blob's rectangle in the original image.
+
+
+ The property specifies position of the blob in the original image
+ and its size.
+
+
+
+
+ Blob's ID in the original image.
+
+
+
+
+ Blob's area.
+
+
+ The property equals to blob's area measured in number of pixels
+ contained by the blob.
+
+
+
+
+ Blob's fullness, [0, 1].
+
+
+ The property equals to blob's fullness, which is calculated
+ as Area / ( Width * Height ). If it equals to 1, then
+ it means that entire blob's rectangle is filled by blob's pixel (no
+ blank areas), which is true only for rectangles. If it equals to 0.5,
+ for example, then it means that only half of the bounding rectangle is filled
+ by blob's pixels.
+
+
+
+
+ Blob's center of gravity point.
+
+
+ The property keeps center of gravity point, which is calculated as
+ mean value of X and Y coordinates of blob's points.
+
+
+
+
+ Blob's mean color.
+
+
+ The property keeps mean color of pixels comprising the blob.
+
+
+
+
+ Blob color's standard deviation.
+
+
+ The property keeps standard deviation of pixels' colors comprising the blob.
+
+
+
+
+ Hough circle.
+
+
+ Represents circle of Hough transform.
+
+
+
+
+
+
+ Circle center's X coordinate.
+
+
+
+
+ Circle center's Y coordinate.
+
+
+
+
+ Circle's radius.
+
+
+
+
+ Line's absolute intensity.
+
+
+
+
+ Line's relative intensity.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Circle's X coordinate.
+ Circle's Y coordinate.
+ Circle's radius.
+ Circle's absolute intensity.
+ Circle's relative intensity.
+
+
+
+
+ Compare the object with another instance of this class.
+
+
+ Object to compare with.
+
+ A signed number indicating the relative values of this instance and value: 1) greater than zero -
+ this instance is greater than value; 2) zero - this instance is equal to value;
+ 3) greater than zero - this instance is less than value.
+
+ The sort order is descending.
+
+
+ Object are compared using their intensity value.
+
+
+
+
+
+ Hough circle transformation.
+
+
+ The class implements Hough circle transformation, which allows to detect
+ circles of specified radius in an image.
+
+ The class accepts binary images for processing, which are represented by 8 bpp grayscale images.
+ All black pixels (0 pixel's value) are treated as background, but pixels with different value are
+ treated as circles' pixels.
+
+ Sample usage:
+
+ HoughCircleTransformation circleTransform = new HoughCircleTransformation( 35 );
+ // apply Hough circle transform
+ circleTransform.ProcessImage( sourceImage );
+ Bitmap houghCirlceImage = circleTransform.ToBitmap( );
+ // get circles using relative intensity
+ HoughCircle[] circles = circleTransform.GetCirclesByRelativeIntensity( 0.5 );
+
+ foreach ( HoughCircle circle in circles )
+ {
+ // ...
+ }
+
+
+ Initial image:
+
+ Hough circle transformation image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Circles' radius to detect.
+
+
+
+
+ Process an image building Hough map.
+
+
+ Source image to process.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Process an image building Hough map.
+
+
+ Source image data to process.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Process an image building Hough map.
+
+
+ Source unmanaged image to process.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Сonvert Hough map to bitmap.
+
+
+ Returns 8 bppp grayscale bitmap, which shows Hough map.
+
+ Hough transformation was not yet done by calling
+ ProcessImage() method.
+
+
+
+
+ Get specified amount of circles with highest intensity.
+
+
+ Amount of circles to get.
+
+ Returns arrary of most intesive circles. If there are no circles detected,
+ the returned array has zero length.
+
+
+
+
+ Get circles with relative intensity higher then specified value.
+
+
+ Minimum relative intesity of circles.
+
+ Returns arrary of most intesive circles. If there are no circles detected,
+ the returned array has zero length.
+
+
+
+
+ Minimum circle's intensity in Hough map to recognize a circle.
+
+
+ The value sets minimum intensity level for a circle. If a value in Hough
+ map has lower intensity, then it is not treated as a circle.
+
+ Default value is set to 10.
+
+
+
+
+ Radius for searching local peak value.
+
+
+ The value determines radius around a map's value, which is analyzed to determine
+ if the map's value is a local maximum in specified area.
+
+ Default value is set to 4. Minimum value is 1. Maximum value is 10.
+
+
+
+
+ Maximum found intensity in Hough map.
+
+
+ The property provides maximum found circle's intensity.
+
+
+
+
+ Found circles count.
+
+
+ The property provides total number of found circles, which intensity is higher (or equal to),
+ than the requested minimum intensity.
+
+
+
+
+ Performs quadrilateral transformation using bilinear algorithm for interpolation.
+
+
+ The class is deprecated and should be used instead.
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Corners of the source quadrilateral area.
+ Width of the new transformed image.
+ Height of the new transformed image.
+
+ This constructor sets to
+ , which means that destination image will have width and
+ height as specified by user.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Corners of the source quadrilateral area.
+
+ This constructor sets to
+ , which means that destination image will have width and
+ height automatically calculated based on property.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Calculates new image size.
+
+
+ Source image data.
+
+ New image size - size of the destination image.
+
+ The specified quadrilateral's corners are outside of the given image.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Automatic calculation of destination image or not.
+
+
+ The property specifies how to calculate size of destination (transformed)
+ image. If the property is set to , then
+ and properties have effect and destination image's size is
+ specified by user. If the property is set to , then setting the above
+ mentioned properties does not have any effect, but destionation image's size is
+ automatically calculated from property - width and height
+ come from length of longest edges.
+
+
+
+
+
+ Quadrilateral's corners in source image.
+
+
+ The property specifies four corners of the quadrilateral area
+ in the source image to be transformed.
+
+
+
+
+
+ Width of the new transformed image.
+
+
+ The property defines width of the destination image, which gets
+ transformed quadrilateral image.
+
+ Setting the property does not have any effect, if
+ property is set to . In this case destination image's width
+ is calculated automatically based on property.
+
+
+
+
+
+ Height of the new transformed image.
+
+
+ The property defines height of the destination image, which gets
+ transformed quadrilateral image.
+
+ Setting the property does not have any effect, if
+ property is set to . In this case destination image's height
+ is calculated automatically based on property.
+
+
+
+
+
+ Performs backward quadrilateral transformation into an area in destination image.
+
+
+ The class implements backward quadrilateral transformation algorithm,
+ which allows to transform any rectangular image into any quadrilateral area
+ in a given destination image. The idea of the algorithm is based on homogeneous
+ transformation and its math is described by Paul Heckbert in his
+ "Projective Mappings for Image Warping" paper.
+
+
+ The image processing routines implements similar math to ,
+ but performs it in backward direction.
+
+ The image processing filter accepts 8 grayscale images and 24/32 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // define quadrilateral's corners
+ List<IntPoint> corners = new List<IntPoint>( );
+ corners.Add( new IntPoint( 99, 99 ) );
+ corners.Add( new IntPoint( 156, 79 ) );
+ corners.Add( new IntPoint( 184, 126 ) );
+ corners.Add( new IntPoint( 122, 150 ) );
+ // create filter
+ BackwardQuadrilateralTransformation filter =
+ new BackwardQuadrilateralTransformation( sourceImage, corners );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Source image:
+
+ Destination image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Source image to be transformed into specified quadrilateral
+ (see ).
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Source unmanaged image to be transformed into specified quadrilateral
+ (see ).
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Source image to be transformed into specified quadrilateral
+ (see ).
+ Quadrilateral in destination image to transform into.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Source unmanaged image to be transformed into specified quadrilateral
+ (see ).
+ Quadrilateral in destination image to transform into.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Image data to process by the filter.
+
+ Destination quadrilateral was not set.
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Source image to be transformed into specified quadrilateral.
+
+
+ The property sets the source image, which will be transformed
+ to the specified quadrilateral and put into destination image the filter is applied to.
+
+ The source image must have the same pixel format as a destination image the filter
+ is applied to. Otherwise exception will be generated when filter is applied.
+
+ Setting this property will clear the property -
+ only one source image is allowed: managed or unmanaged.
+
+
+
+
+
+ Source unmanaged image to be transformed into specified quadrilateral.
+
+
+ The property sets the source image, which will be transformed
+ to the specified quadrilateral and put into destination image the filter is applied to.
+
+ The source image must have the same pixel format as a destination image the filter
+ is applied to. Otherwise exception will be generated when filter is applied.
+
+ Setting this property will clear the property -
+ only one source image is allowed: managed or unmanaged.
+
+
+
+
+
+ Quadrilateral in destination image to transform into.
+
+
+ The property specifies 4 corners of a quadrilateral area
+ in destination image where the source image will be transformed into.
+
+
+
+
+
+ Specifies if bilinear interpolation should be used or not.
+
+
+ Default value is set to - interpolation
+ is used.
+
+
+
+
+
+ Image warp effect filter.
+
+
+ The image processing filter implements a warping filter, which
+ sets pixels in destination image to values from source image taken with specified offset
+ (see ).
+
+
+ The filter accepts 8 bpp grayscale images and 24/32
+ color images for processing.
+
+ Sample usage:
+
+ // build warp map
+ int width = image.Width;
+ int height = image.Height;
+
+ IntPoint[,] warpMap = new IntPoint[height, width];
+
+ int size = 8;
+ int maxOffset = -size + 1;
+
+ for ( int y = 0; y < height; y++ )
+ {
+ for ( int x = 0; x < width; x++ )
+ {
+ int dx = ( x / size ) * size - x;
+ int dy = ( y / size ) * size - y;
+
+ if ( dx + dy <= maxOffset )
+ {
+ dx = ( x / size + 1 ) * size - 1 - x;
+ }
+
+ warpMap[y, x] = new IntPoint( dx, dy );
+ }
+ }
+ // create filter
+ ImageWarp filter = new ImageWarp( warpMap );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Map used for warping images (see ).
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Map used for warping images.
+
+
+ The property sets displacement map used for warping images.
+ The map sets offsets of pixels in source image, which are used to set values in destination
+ image. In other words, each pixel in destination image is set to the same value
+ as pixel in source image with corresponding offset (coordinates of pixel in source image
+ are calculated as sum of destination coordinate and corresponding value from warp map).
+
+
+ The map array is accessed using [y, x] indexing, i.e.
+ first dimension in the map array corresponds to Y axis of image.
+
+ If the map is smaller or bigger than the image to process, then only minimum
+ overlapping area of the image is processed. This allows to prepare single big map and reuse
+ it for a set of images for creating similar effects.
+
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Horizontal run length smoothing algorithm.
+
+
+ The class implements horizontal run length smoothing algorithm, which
+ is described in: K.Y. Wong, R.G. Casey and F.M. Wahl, "Document analysis system,"
+ IBM J. Res. Devel., Vol. 26, NO. 6,111). 647-656, 1982.
+
+ Unlike the original description of this algorithm, this implementation must be applied
+ to inverted binary images containing document, i.e. white text on black background. So this
+ implementation fills horizontal black gaps between white pixels.
+
+ This algorithm is usually used together with ,
+ and then further analysis of white blobs.
+
+ The filter accepts 8 bpp grayscale images, which are supposed to be binary inverted documents.
+
+ Sample usage:
+
+ // create filter
+ HorizontalRunLengthSmoothing hrls = new HorizontalRunLengthSmoothing( 32 );
+ // apply the filter
+ hrls.ApplyInPlace( image );
+
+
+ Source image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Maximum gap size to fill (see ).
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Maximum gap size to fill (in pixels).
+
+
+ The property specifies maximum horizontal gap between white pixels to fill.
+ If number of black pixels between some white pixels is bigger than this value, then those
+ black pixels are left as is; otherwise the gap is filled with white pixels.
+
+
+ Default value is set to 10. Minimum value is 1. Maximum value is 1000.
+
+
+
+
+ Process gaps between objects and image borders or not.
+
+
+ The property sets if gaps between image borders and objects must be treated as
+ gaps between objects and also filled.
+
+ Default value is set to .
+
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Extract the biggest blob from image.
+
+
+ The filter locates the biggest blob in the source image and extracts it.
+ The filter also can use the source image for the biggest blob's location only, but extract it from
+ another image, which is set using property. The original image
+ usually is the source of the processed image.
+
+ The filter accepts 8 bpp grayscale images and 24/32 color images for processing as source image passed to
+ method and also for the .
+
+ Sample usage:
+
+ // create filter
+ ExtractBiggestBlob filter = new ExtractBiggestBlob( );
+ // apply the filter
+ Bitmap biggestBlobsImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to get biggest blob from.
+
+ Returns image of the biggest blob.
+
+ Unsupported pixel format of the source image.
+ Unsupported pixel format of the original image.
+ Source and original images must have the same size.
+ The source image does not contain any blobs.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to get biggest blob from.
+
+ Returns image of the biggest blob.
+
+ Unsupported pixel format of the source image.
+ Unsupported pixel format of the original image.
+ Source and original images must have the same size.
+ The source image does not contain any blobs.
+
+
+
+
+ Apply filter to an image (not implemented).
+
+
+ Image in unmanaged memory.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method is not implemented.
+
+
+
+
+ Apply filter to an image (not implemented).
+
+
+ Source image to be processed.
+ Destination image to store filter's result.
+
+ The method is not implemented.
+
+
+
+
+ Position of the extracted blob.
+
+
+ After applying the filter this property keeps position of the extracted
+ blob in the source image.
+
+
+
+
+ Format translations dictionary.
+
+
+ The dictionary defines, which pixel formats are supported for
+ source images and which pixel format will be used for resulting image.
+
+
+ See for more information.
+
+
+
+
+
+ Original image, which is the source of the processed image where the biggest blob is searched for.
+
+
+ The property may be set to . In this case the biggest blob
+ is extracted from the image, which is passed to image.
+
+
+
+
+
+ Dilatation operator from Mathematical Morphology with 3x3 structuring element.
+
+
+ The filter represents an optimized version of
+ filter, which is aimed for grayscale image processing with 3x3 structuring element.
+
+ See filter, which represents generic version of
+ dilatation filter supporting custom structuring elements and wider range of image formats.
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+ Processing rectangle mast be at least 3x3 in size.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Grayscale image using BT709 algorithm.
+
+
+ The class uses BT709 algorithm to convert color image
+ to grayscale. The conversion coefficients are:
+
+ - Red: 0.2125;
+ - Green: 0.7154;
+ - Blue: 0.0721.
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Possible object orders.
+
+
+ The enumeration defines possible sorting orders of objects, found by blob
+ counting classes.
+
+
+
+
+ Unsorted order (as it is collected by algorithm).
+
+
+
+
+ Objects are sorted by size in descending order (bigger objects go first).
+ Size is calculated as Width * Height.
+
+
+
+
+ Objects are sorted by area in descending order (bigger objects go first).
+
+
+
+
+ Objects are sorted by Y coordinate, then by X coordinate in ascending order
+ (smaller coordinates go first).
+
+
+
+
+ Objects are sorted by X coordinate, then by Y coordinate in ascending order
+ (smaller coordinates go first).
+
+
+
+
+ Blob counter - counts objects in image, which are separated by black background.
+
+
+ The class counts and extracts stand alone objects in
+ images using connected components labeling algorithm.
+
+ The algorithm treats all pixels with values less or equal to
+ as background, but pixels with higher values are treated as objects' pixels.
+
+ For blobs' searching the class supports 8 bpp indexed grayscale images and
+ 24/32 bpp color images that are at least two pixels wide. Images that are one
+ pixel wide can be processed if they are rotated first, or they can be processed
+ with .
+ See documentation about for information about which
+ pixel formats are supported for extraction of blobs.
+
+ Sample usage:
+
+ // create an instance of blob counter algorithm
+ BlobCounter bc = new BlobCounter( );
+ // process binary image
+ bc.ProcessImage( image );
+ Rectangle[] rects = bc.GetObjectsRectangles( );
+ // process blobs
+ foreach ( Rectangle rect in rects )
+ {
+ // ...
+ }
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Creates new instance of the class with
+ an empty objects map. Before using methods, which provide information about blobs
+ or extract them, the ,
+ or
+ method should be called to collect objects map.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to look for objects in.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image data to look for objects in.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged image to look for objects in.
+
+
+
+
+ Actual objects map building.
+
+
+ Unmanaged image to process.
+
+ The method supports 8 bpp indexed grayscale images and 24/32 bpp color images.
+
+ Unsupported pixel format of the source image.
+ Cannot process images that are one pixel wide. Rotate the image
+ or use .
+
+
+
+
+ Background threshold's value.
+
+
+ The property sets threshold value for distinguishing between background
+ pixel and objects' pixels. All pixel with values less or equal to this property are
+ treated as background, but pixels with higher values are treated as objects' pixels.
+
+ In the case of colour images a pixel is treated as objects' pixel if any of its
+ RGB values are higher than corresponding values of this threshold.
+
+ For processing grayscale image, set the property with all RGB components eqaul.
+
+ Default value is set to (0, 0, 0) - black colour.
+
+
+
+
+ Gather statistics about image in YCbCr color space.
+
+
+ The class is used to accumulate statistical values about images,
+ like histogram, mean, standard deviation, etc. for each YCbCr color channel.
+
+ The class accepts 24 and 32 bpp color images for processing.
+
+ Sample usage:
+
+ // gather statistics
+ ImageStatisticsYCbCr stat = new ImageStatisticsYCbCr( image );
+ // get Y channel's histogram
+ ContinuousHistogram y = stat.Y;
+ // check mean value of Y channel
+ if ( y.Mean > 0.5 )
+ {
+ // do further processing
+ }
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+
+ Source pixel format is not supported.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+ Mask image which specifies areas to collect statistics for.
+
+ The mask image must be a grayscale/binary (8bpp) image of the same size as the
+ specified source image, where black pixels (value 0) correspond to areas which should be excluded
+ from processing. So statistics is calculated only for pixels, which are none black in the mask image.
+
+
+ Source pixel format is not supported.
+ Mask image must be 8 bpp grayscale image.
+ Mask must have the same size as the source image to get statistics for.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+ Mask array which specifies areas to collect statistics for.
+
+ The mask array must be of the same size as the specified source image, where 0 values
+ correspond to areas which should be excluded from processing. So statistics is calculated only for pixels,
+ which have none zero corresponding value in the mask.
+
+
+ Source pixel format is not supported.
+ Mask must have the same size as the source image to get statistics for.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged image to gather statistics about.
+
+ Source pixel format is not supported.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+ Mask image which specifies areas to collect statistics for.
+
+ The mask image must be a grayscale/binary (8bpp) image of the same size as the
+ specified source image, where black pixels (value 0) correspond to areas which should be excluded
+ from processing. So statistics is calculated only for pixels, which are none black in the mask image.
+
+
+ Source pixel format is not supported.
+ Mask image must be 8 bpp grayscale image.
+ Mask must have the same size as the source image to get statistics for.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+ Mask array which specifies areas to collect statistics for.
+
+ The mask array must be of the same size as the specified source image, where 0 values
+ correspond to areas which should be excluded from processing. So statistics is calculated only for pixels,
+ which have none zero corresponding value in the mask.
+
+
+ Source pixel format is not supported.
+ Mask must have the same size as the source image to get statistics for.
+
+
+
+
+ Histogram of Y channel.
+
+
+
+
+
+ Histogram of Cb channel.
+
+
+
+
+
+ Histogram of Cr channel.
+
+
+
+
+
+ Histogram of Y channel excluding black pixels.
+
+
+ The property keeps statistics about Y channel, which
+ excludes all black pixels, what affects mean, standard deviation, etc.
+
+
+
+
+
+ Histogram of Cb channel excluding black pixels
+
+
+ The property keeps statistics about Cb channel, which
+ excludes all black pixels, what affects mean, standard deviation, etc.
+
+
+
+
+
+ Histogram of Cr channel excluding black pixels
+
+
+ The property keeps statistics about Cr channel, which
+ excludes all black pixels, what affects mean, standard deviation, etc.
+
+
+
+
+
+ Total pixels count in the processed image.
+
+
+
+
+
+ Total pixels count in the processed image excluding black pixels.
+
+
+
+
+
+ Color filtering in YCbCr color space.
+
+
+ The filter operates in YCbCr color space and filters
+ pixels, which color is inside/outside of the specified YCbCr range -
+ it keeps pixels with colors inside/outside of the specified range and fills the
+ rest with specified color.
+
+ The filter accepts 24 and 32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ YCbCrFiltering filter = new YCbCrFiltering( );
+ // set color ranges to keep
+ filter.Cb = new Range( -0.2f, 0.0f );
+ filter.Cr = new Range( 0.26f, 0.5f );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Range of Y component.
+ Range of Cb component.
+ Range of Cr component.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Range of Y component, [0, 1].
+
+
+
+
+
+ Range of Cb component, [-0.5, 0.5].
+
+
+
+
+
+ Range of Cr component, [-0.5, 0.5].
+
+
+
+
+
+ Fill color used to fill filtered pixels.
+
+
+
+
+ Determines, if pixels should be filled inside or outside specified
+ color range.
+
+
+ Default value is set to , which means
+ the filter removes colors outside of the specified range.
+
+
+
+
+ Determines, if Y value of filtered pixels should be updated.
+
+
+ The property specifies if Y channel of filtered pixels should be
+ updated with value from fill color or not.
+
+ Default value is set to .
+
+
+
+
+ Determines, if Cb value of filtered pixels should be updated.
+
+
+ The property specifies if Cb channel of filtered pixels should be
+ updated with value from fill color or not.
+
+ Default value is set to .
+
+
+
+
+ Determines, if Cr value of filtered pixels should be updated.
+
+
+ The property specifies if Cr channel of filtered pixels should be
+ updated with value from fill color or not.
+
+ Default value is set to .
+
+
+
+
+ Bilateral filter implementation - edge preserving smoothing and noise reduction that uses chromatic and spatial factors.
+
+
+
+ Bilateral filter conducts "selective" Gaussian smoothing of areas of same color (domains) which removes noise and contrast artifacts
+ while preserving sharp edges.
+
+ Two major parameters and define the result of the filter.
+ By changing these parameters you may achieve either only noise reduction with little change to the
+ image or get nice looking effect to the entire image.
+
+ Although the filter can use parallel processing large values
+ (greater than 25) on high resolution images may decrease speed of processing. Also on high
+ resolution images small values (less than 9) may not provide noticeable
+ results.
+
+ More details on the algorithm can be found by following this
+ link.
+
+ The filter accepts 8 bpp grayscale images and 24/32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ BilateralSmoothing filter = new BilateralSmoothing( );
+ filter.KernelSize = 7;
+ filter.SpatialFactor = 10;
+ filter.ColorFactor = 60;
+ filter.ColorPower = 0.5;
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Specifies if exception must be thrown in the case a large
+ kernel size is used which may lead
+ to significant performance issues.
+
+
+
+ Default value is set to .
+
+
+
+
+
+ Enable or not parallel processing on multi-core CPUs.
+
+
+ If the property is set to , then this image processing
+ routine will run in parallel on the systems with multiple core/CPUs. The
+ is used to make it parallel.
+
+ Default value is set to .
+
+
+
+
+
+ Size of a square for limiting surrounding pixels that take part in calculations, [3, 255].
+
+
+ The greater the value the more is the general power of the filter. Small values
+ (less than 9) on high resolution images (3000 pixels wide) do not give significant results.
+ Large values increase the number of calculations and degrade performance.
+
+ The value of this property must be an odd integer in the [3, 255] range if
+ is set to or in the [3, 25] range
+ otherwise.
+
+ Default value is set to 9.
+
+
+ The specified value is out of range (see
+ eception message for details).
+ The value of this must be an odd integer.
+
+
+
+
+ Determines smoothing power within a color domain (neighbor pixels of similar color), >= 1.
+
+
+
+ Default value is set to 10.
+
+
+
+
+
+ Exponent power, used in Spatial function calculation, >= 1.
+
+
+
+ Default value is set to 2.
+
+
+
+
+
+ Determines the variance of color for a color domain, >= 1.
+
+
+
+ Default value is set to 50.
+
+
+
+
+
+ Exponent power, used in Color function calculation, >= 1.
+
+
+
+ Default value is set to 2.
+
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Opening operator from Mathematical Morphology.
+
+
+ Opening morphology operator equals to erosion followed
+ by dilatation.
+
+ Applied to binary image, the filter may be used for removing small object keeping big objects
+ unchanged. Since erosion is used first, it removes all small objects. Then dilatation restores big
+ objects, which were not removed by erosion.
+
+ See documentation to and classes for more
+ information and list of supported pixel formats.
+
+ Sample usage:
+
+ // create filter
+ Opening filter = new Opening( );
+ // apply the filter
+ filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Initializes new instance of the class using
+ default structuring element for both and
+ classes - 3x3 structuring element with all elements equal to 1.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Structuring element.
+
+ See documentation to and
+ classes for information about structuring element constraints.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The filter accepts bitmap data as input and returns the result
+ of image processing filter as new image. The source image data are kept
+ unchanged.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+ Destination image in unmanaged memory to put result into.
+
+ The method keeps the source image unchanged and puts result of image processing
+ into destination image.
+
+ The destination image must have the same width and height as source image. Also
+ destination image must have pixel format, which is expected by particular filter (see
+ property for information about pixel format conversions).
+
+
+ Unsupported pixel format of the source image.
+ Incorrect destination pixel format.
+ Destination image has wrong width and/or height.
+
+
+
+
+ Apply filter to an image.
+
+
+ Image to apply filter to.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Image data to apply filter to.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an unmanaged image.
+
+
+ Unmanaged image to apply filter to.
+
+ The method applies the filter directly to the provided source unmanaged image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image or its part.
+
+
+ Image to apply filter to.
+ Image rectangle for processing by the filter.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image or its part.
+
+
+ Image data to apply filter to.
+ Image rectangle for processing by the filter.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an unmanaged image or its part.
+
+
+ Unmanaged image to apply filter to.
+ Image rectangle for processing by the filter.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Dilatation operator from Mathematical Morphology.
+
+
+ The filter assigns maximum value of surrounding pixels to each pixel of
+ the result image. Surrounding pixels, which should be processed, are specified by
+ structuring element: 1 - to process the neighbor, -1 - to skip it.
+
+ The filter especially useful for binary image processing, where it allows to grow
+ separate objects or join objects.
+
+ For processing image with 3x3 structuring element, there are different optimizations
+ available, like and .
+
+ The filter accepts 8 and 16 bpp grayscale images and 24 and 48 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Dilatation filter = new Dilatation( );
+ // apply the filter
+ filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Initializes new instance of the class using
+ default structuring element - 3x3 structuring element with all elements equal to 1.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Structuring element.
+
+ Structuring elemement for the dilatation morphological operator
+ must be square matrix with odd size in the range of [3, 99].
+
+ Invalid size of structuring element.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Filters' collection to apply to an image in sequence.
+
+
+ The class represents collection of filters, which need to be applied
+ to an image in sequence. Using the class user may specify set of filters, which will
+ be applied to source image one by one in the order user defines them.
+
+ The class itself does not define which pixel formats are accepted for the source
+ image and which pixel formats may be produced by the filter. Format of acceptable source
+ and possible output is defined by filters, which added to the sequence.
+
+ Sample usage:
+
+ // create filter, which is binarization sequence
+ FiltersSequence filter = new FiltersSequence(
+ new GrayscaleBT709( ),
+ new Threshold( )
+ );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Sequence of filters to apply.
+
+
+
+
+ Add new filter to the sequence.
+
+
+ Filter to add to the sequence.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ No filters were added into the filters' sequence.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The filter accepts bitmap data as input and returns the result
+ of image processing filter as new image. The source image data are kept
+ unchanged.
+
+ No filters were added into the filters' sequence.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ No filters were added into the filters' sequence.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+ Destination image in unmanaged memory to put result into.
+
+ The method keeps the source image unchanged and puts result of image processing
+ into destination image.
+
+ The destination image must have width, height and pixel format as it is expected by
+ the final filter in the sequence.
+
+
+ No filters were added into the filters' sequence.
+
+
+
+
+ Get filter at the specified index.
+
+
+ Index of filter to get.
+
+ Returns filter at specified index.
+
+
+
+
+ Contrast adjusting in RGB color space.
+
+
+ The filter operates in RGB color space and adjusts
+ pixels' contrast value by increasing RGB values of bright pixel and decreasing
+ RGB values of dark pixels (or vise versa if contrast needs to be decreased).
+ The filter is based on
+ filter and simply sets all input ranges to (, 255-) and
+ all output range to (0, 255) in the case if the factor value is positive.
+ If the factor value is negative, then all input ranges are set to
+ (0, 255 ) and all output ranges are set to
+ (-, 255_).
+
+ See documentation forr more information about the base filter.
+
+ The filter accepts 8 bpp grayscale and 24/32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ ContrastCorrection filter = new ContrastCorrection( 15 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Contrast adjusting factor.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Contrast adjusting factor, [-127, 127].
+
+
+ Factor which is used to adjust contrast. Factor values greater than
+ 0 increase contrast making light areas lighter and dark areas darker. Factor values
+ less than 0 decrease contrast - decreasing variety of contrast.
+
+ Default value is set to 10.
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Marble texture.
+
+
+ The texture generator creates textures with effect of marble.
+ The and properties allow to control the look
+ of marble texture in X/Y directions.
+
+ The generator is based on the Perlin noise function.
+
+ Sample usage:
+
+ // create texture generator
+ MarbleTexture textureGenerator = new MarbleTexture( );
+ // generate new texture
+ float[,] texture = textureGenerator.Generate( 320, 240 );
+ // convert it to image to visualize
+ Bitmap textureImage = TextureTools.ToBitmap( texture );
+
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ X period value.
+ Y period value.
+
+
+
+
+ Generate texture.
+
+
+ Texture's width.
+ Texture's height.
+
+ Two dimensional array of intensities.
+
+ Generates new texture of the specified size.
+
+
+
+
+ Reset generator.
+
+
+ Regenerates internal random numbers.
+
+
+
+
+ X period value, ≥ 2.
+
+
+ Default value is set to 5.
+
+
+
+
+ Y period value, ≥ 2.
+
+
+ Default value is set to 10.
+
+
+
+
+ Transform rectangle image into circle (to polar coordinates).
+
+
+ The image processing routine does transformation of the source image into
+ circle (polar transformation). The produced effect is similar to GIMP's "Polar Coordinates"
+ distortion filter (or its equivalent in Photoshop).
+
+
+ The filter accepts 8 bpp grayscale and 24/32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ TransformToPolar filter = new TransformToPolar( );
+ filter.OffsetAngle = 0;
+ filter.CirlceDepth = 1;
+ filter.UseOriginalImageSize = false;
+ filter.NewSize = new Size( 200, 200 );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Calculates new image size.
+
+
+ Source image data.
+
+ New image size - size of the destination image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Circularity coefficient of the mapping, [0, 1].
+
+
+ The property specifies circularity coefficient of the mapping to be done.
+ If the coefficient is set to 1, then the mapping will produce ideal circle. If the coefficient
+ is set to 0, then the mapping will occupy entire area of the destination image (circle will
+ be extended into direction of edges). Changing the property from 0 to 1 user may balance
+ circularity of the produced output.
+
+
+ Default value is set to 1.
+
+
+
+
+
+ Offset angle used to shift mapping, [-360, 360] degrees.
+
+
+ The property specifies offset angle, which can be used to shift
+ mapping in counter clockwise direction. For example, if user sets this property to 30, then
+ start of polar mapping is shifted by 30 degrees in counter clockwise direction.
+
+ Default value is set to 0.
+
+
+
+
+
+ Specifies direction of mapping.
+
+
+ The property specifies direction of mapping source image's X axis. If the
+ property is set to , the image is mapped in clockwise direction;
+ otherwise in counter clockwise direction.
+
+ Default value is set to .
+
+
+
+
+
+ Specifies if top of the source image should go to center or edge of the result image.
+
+
+ The property specifies position of the source image's top line in the destination
+ image. If the property is set to , then it goes to the center of the result image;
+ otherwise it goes to the edge.
+
+ Default value is set to .
+
+
+
+
+
+ Fill color to use for unprocessed areas.
+
+
+ The property specifies fill color, which is used to fill unprocessed areas.
+ In the case if is greater than 0, then there will be some areas on
+ the image's edge, which are not filled by the produced "circular" image, but are filled by
+ the specified color.
+
+
+ Default value is set to .
+
+
+
+
+
+ Size of destination image.
+
+
+ The property specifies size of result image produced by this image
+ processing routine in the case if property
+ is set to .
+
+ Both width and height must be in the [1, 10000] range.
+
+ Default value is set to 200 x 200.
+
+
+
+
+
+ Use source image size for destination or not.
+
+
+ The property specifies if the image processing routine should create destination
+ image of the same size as original image or of the size specified by
+ property.
+
+ Default value is set to .
+
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Transform polar image into rectangle.
+
+
+ The image processing routine is oposite transformation to the one done by
+ routine, i.e. transformation from polar image into rectangle. The produced effect is similar to GIMP's
+ "Polar Coordinates" distortion filter (or its equivalent in Photoshop).
+
+ The filter accepts 8 bpp grayscale and 24/32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ TransformFromPolar filter = new TransformFromPolar( );
+ filter.OffsetAngle = 0;
+ filter.CirlceDepth = 1;
+ filter.UseOriginalImageSize = false;
+ filter.NewSize = new Size( 360, 120 );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Calculates new image size.
+
+
+ Source image data.
+
+ New image size - size of the destination image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Circularity coefficient of the mapping, [0, 1].
+
+
+ The property specifies circularity coefficient of the mapping to be done.
+ If the coefficient is set to 1, then destination image will be produced by mapping
+ ideal circle from the source image, which is placed in source image's centre and its
+ radius equals to the minimum distance from centre to the image’s edge. If the coefficient
+ is set to 0, then the mapping will use entire area of the source image (circle will
+ be extended into direction of edges). Changing the property from 0 to 1 user may balance
+ circularity of the produced output.
+
+ Default value is set to 1.
+
+
+
+
+
+ Offset angle used to shift mapping, [-360, 360] degrees.
+
+
+ The property specifies offset angle, which can be used to shift
+ mapping in clockwise direction. For example, if user sets this property to 30, then
+ start of polar mapping is shifted by 30 degrees in clockwise direction.
+
+ Default value is set to 0.
+
+
+
+
+
+ Specifies direction of mapping.
+
+
+ The property specifies direction of mapping source image. If the
+ property is set to , the image is mapped in clockwise direction;
+ otherwise in counter clockwise direction.
+
+ Default value is set to .
+
+
+
+
+
+ Specifies if centre of the source image should to top or bottom of the result image.
+
+
+ The property specifies position of the source image's centre in the destination image.
+ If the property is set to , then it goes to the top of the result image;
+ otherwise it goes to the bottom.
+
+ Default value is set to .
+
+
+
+
+
+ Size of destination image.
+
+
+ The property specifies size of result image produced by this image
+ processing routine in the case if property
+ is set to .
+
+ Both width and height must be in the [1, 10000] range.
+
+ Default value is set to 200 x 200.
+
+
+
+
+
+ Use source image size for destination or not.
+
+
+ The property specifies if the image processing routine should create destination
+ image of the same size as original image or of the size specified by
+ property.
+
+ Default value is set to .
+
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Rotate image using bicubic interpolation.
+
+
+ The class implements image rotation filter using bicubic
+ interpolation algorithm. It uses bicubic kernel W(x) as described on
+ Wikipedia
+ (coefficient a is set to -0.5).
+
+ Rotation is performed in counterclockwise direction.
+
+ The filter accepts 8 bpp grayscale images and 24 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter - rotate for 30 degrees keeping original image size
+ RotateBicubic filter = new RotateBicubic( 30, true );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Rotation angle.
+
+ This constructor sets property
+ to .
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Rotation angle.
+ Keep image size or not.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Vertical run length smoothing algorithm.
+
+
+ The class implements vertical run length smoothing algorithm, which
+ is described in: K.Y. Wong, R.G. Casey and F.M. Wahl, "Document analysis system,"
+ IBM J. Res. Devel., Vol. 26, NO. 6,111). 647-656, 1982.
+
+ Unlike the original description of this algorithm, this implementation must be applied
+ to inverted binary images containing document, i.e. white text on black background. So this
+ implementation fills vertical black gaps between white pixels.
+
+ This algorithm is usually used together with ,
+ and then further analysis of white blobs.
+
+ The filter accepts 8 bpp grayscale images, which are supposed to be binary inverted documents.
+
+ Sample usage:
+
+ // create filter
+ VerticalRunLengthSmoothing vrls = new VerticalRunLengthSmoothing( 32 );
+ // apply the filter
+ vrls.ApplyInPlace( image );
+
+
+ Source image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Maximum gap size to fill (see ).
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Maximum gap size to fill (in pixels).
+
+
+ The property specifies maximum vertical gap between white pixels to fill.
+ If number of black pixels between some white pixels is bigger than this value, then those
+ black pixels are left as is; otherwise the gap is filled with white pixels.
+
+
+ Default value is set to 10. Minimum value is 1. Maximum value is 1000.
+
+
+
+
+ Process gaps between objects and image borders or not.
+
+
+ The property sets if gaps between image borders and objects must be treated as
+ gaps between objects and also filled.
+
+ Default value is set to .
+
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Salt and pepper noise.
+
+
+ The filter adds random salt and pepper noise - sets
+ maximum or minimum values to randomly selected pixels.
+
+ The filter accepts 8 bpp grayscale images and 24/32 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ SaltAndPepperNoise filter = new SaltAndPepperNoise( 10 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Amount of noise to generate in percents, [0, 100].
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Amount of noise to generate in percents, [0, 100].
+
+
+
+
+
+ Additive noise filter.
+
+
+ The filter adds random value to each pixel of the source image.
+ The distribution of random values can be specified by random generator.
+
+
+ The filter accepts 8 bpp grayscale images and 24 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create random generator
+ IRandomNumberGenerator generator = new UniformGenerator( new Range( -50, 50 ) );
+ // create filter
+ AdditiveNoise filter = new AdditiveNoise( generator );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Random number genertor used to add noise.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Random number genertor used to add noise.
+
+
+ Default generator is uniform generator in the range of (-10, 10).
+
+
+
+
+ Closing operator from Mathematical Morphology.
+
+
+ Closing morphology operator equals to dilatation followed
+ by erosion.
+
+ Applied to binary image, the filter may be used connect or fill objects. Since dilatation is used
+ first, it may connect/fill object areas. Then erosion restores objects. But since dilatation may connect
+ something before, erosion may not remove after that because of the formed connection.
+
+ See documentation to and classes for more
+ information and list of supported pixel formats.
+
+ Sample usage:
+
+ // create filter
+ Closing filter = new Closing( );
+ // apply the filter
+ filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Initializes new instance of the class using
+ default structuring element for both and
+ classes - 3x3 structuring element with all elements equal to 1.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Structuring element.
+
+ See documentation to and
+ classes for information about structuring element constraints.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The filter accepts bitmap data as input and returns the result
+ of image processing filter as new image. The source image data are kept
+ unchanged.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+ Destination image in unmanaged memory to put result into.
+
+ The method keeps the source image unchanged and puts result of image processing
+ into destination image.
+
+ The destination image must have the same width and height as source image. Also
+ destination image must have pixel format, which is expected by particular filter (see
+ property for information about pixel format conversions).
+
+
+ Unsupported pixel format of the source image.
+ Incorrect destination pixel format.
+ Destination image has wrong width and/or height.
+
+
+
+
+ Apply filter to an image.
+
+
+ Image to apply filter to.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Image data to apply filter to.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an unmanaged image.
+
+
+ Unmanaged image to apply filter to.
+
+ The method applies the filter directly to the provided source unmanaged image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image or its part.
+
+
+ Image to apply filter to.
+ Image rectangle for processing by the filter.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image or its part.
+
+
+ Image data to apply filter to.
+ Image rectangle for processing by the filter.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an unmanaged image or its part.
+
+
+ Unmanaged image to apply filter to.
+ Image rectangle for processing by the filter.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Hue modifier.
+
+
+ The filter operates in HSL color space and updates
+ pixels' hue values setting it to the specified value (luminance and
+ saturation are kept unchanged). The result of the filter looks like the image
+ is observed through a glass of the given color.
+
+ The filter accepts 24 and 32 bpp color images for processing.
+ Sample usage:
+
+ // create filter
+ HueModifier filter = new HueModifier( 180 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Hue value to set.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Hue value to set, [0, 359].
+
+
+ Default value is set to 0.
+
+
+
+
+ Set of Bayer patterns supported by .
+
+
+
+
+ Pattern:
+ G R
+ B G
+
+
+
+
+ Pattern:
+ B G
+ G R
+
+
+
+
+ Optimized Bayer fileter image processing routine.
+
+
+ The class implements Bayer filter
+ routine, which creates color image out of grayscale image produced by image sensor built with
+ Bayer color matrix.
+
+ This class does all the same as class. However this version is
+ optimized for some well known patterns defined in enumeration.
+ Also this class processes images with even width and height only. Image size must be at least 2x2 pixels.
+
+
+ The filter accepts 8 bpp grayscale images and produces 24 bpp RGB image.
+
+ Sample usage:
+
+ // create filter
+ BayerFilter filter = new BayerFilter( );
+ // apply the filter
+ Bitmap rgbImage = filter.Apply( image );
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Bayer pattern of source images to decode.
+
+
+ The property specifies Bayer pattern of source images to be
+ decoded into color images.
+
+ Default value is set to .
+
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Color remapping.
+
+
+ The filter allows to remap colors of the image. Unlike filter
+ the filter allow to do non-linear remapping. For each pixel of specified image the filter changes
+ its values (value of each color plane) to values, which are stored in remapping arrays by corresponding
+ indexes. For example, if pixel's RGB value equals to (32, 96, 128), the filter will change it to
+ ([32], [96], [128]).
+
+ The filter accepts 8 bpp grayscale and 24/32 bpp color images for processing.
+
+ Sample usage:
+
+ // create map
+ byte[] map = new byte[256];
+ for ( int i = 0; i < 256; i++ )
+ {
+ map[i] = (byte) Math.Min( 255, Math.Pow( 2, (double) i / 32 ) );
+ }
+ // create filter
+ ColorRemapping filter = new ColorRemapping( map, map, map );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Initializes the filter without any remapping. All
+ pixel values are mapped to the same values.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Red map.
+ Green map.
+ Blue map.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Gray map.
+
+ This constructor is supposed for grayscale images.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Remapping array for red color plane.
+
+
+ The remapping array should contain 256 remapping values. The remapping occurs
+ by changing pixel's red value r to [r].
+
+ A map should be array with 256 value.
+
+
+
+
+ Remapping array for green color plane.
+
+
+ The remapping array should contain 256 remapping values. The remapping occurs
+ by changing pixel's green value g to [g].
+
+ A map should be array with 256 value.
+
+
+
+
+ Remapping array for blue color plane.
+
+
+ The remapping array should contain 256 remapping values. The remapping occurs
+ by changing pixel's blue value b to [b].
+
+ A map should be array with 256 value.
+
+
+
+
+ Remapping array for gray color.
+
+
+ The remapping array should contain 256 remapping values. The remapping occurs
+ by changing pixel's value g to [g].
+
+ The gray map is for grayscale images only.
+
+ A map should be array with 256 value.
+
+
+
+
+ Binarization with thresholds matrix.
+
+
+ Idea of the filter is the same as idea of filter -
+ change pixel value to white, if its intensity is equal or higher than threshold value, or
+ to black otherwise. But instead of using single threshold value for all pixel, the filter
+ uses matrix of threshold values. Processing image is divided to adjacent windows of matrix
+ size each. For pixels binarization inside of each window, corresponding threshold values are
+ used from specified threshold matrix.
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create binarization matrix
+ byte[,] matrix = new byte[4, 4]
+ {
+ { 95, 233, 127, 255 },
+ { 159, 31, 191, 63 },
+ { 111, 239, 79, 207 },
+ { 175, 47, 143, 15 }
+ };
+ // create filter
+ OrderedDithering filter = new OrderedDithering( matrix );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Thresholds matrix.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Ordered dithering using Bayer matrix.
+
+
+ The filter represents filter initialized
+ with the next threshold matrix:
+
+ byte[,] matrix = new byte[4, 4]
+ {
+ { 0, 192, 48, 240 },
+ { 128, 64, 176, 112 },
+ { 32, 224, 16, 208 },
+ { 160, 96, 144, 80 }
+ };
+
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ BayerDithering filter = new BayerDithering( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Vertical intensity statistics.
+
+
+ The class provides information about vertical distribution
+ of pixel intensities, which may be used to locate objects, their centers, etc.
+
+
+ The class accepts grayscale (8 bpp indexed and 16 bpp) and color (24, 32, 48 and 64 bpp) images.
+ In the case of 32 and 64 bpp color images, the alpha channel is not processed - statistics is not
+ gathered for this channel.
+
+ Sample usage:
+
+ // collect statistics
+ VerticalIntensityStatistics vis = new VerticalIntensityStatistics( sourceImage );
+ // get gray histogram (for grayscale image)
+ Histogram histogram = vis.Gray;
+ // output some histogram's information
+ System.Diagnostics.Debug.WriteLine( "Mean = " + histogram.Mean );
+ System.Diagnostics.Debug.WriteLine( "Min = " + histogram.Min );
+ System.Diagnostics.Debug.WriteLine( "Max = " + histogram.Max );
+
+
+ Sample grayscale image with its vertical intensity histogram:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Source image data.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Source unmanaged image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Gather vertical intensity statistics for specified image.
+
+
+ Source image.
+
+
+
+
+ Histogram for red channel.
+
+
+
+
+
+ Histogram for green channel.
+
+
+
+
+
+ Histogram for blue channel.
+
+
+
+
+
+ Histogram for gray channel (intensities).
+
+
+
+
+
+ Value wich specifies if the processed image was color or grayscale.
+
+
+ If the property equals to true, then the
+ property should be used to retrieve histogram for the processed grayscale image.
+ Otherwise , and property
+ should be used to retrieve histogram for particular RGB channel of the processed
+ color image.
+
+
+
+
+ Merge two images using factors from texture.
+
+
+ The filter is similar to filter in its idea, but
+ instead of using single value for balancing amount of source's and overlay's image
+ values (see ), the filter uses texture, which determines
+ the amount to take from source image and overlay image.
+
+ The filter uses specified texture to adjust values using the next formula:
+ dst = src * textureValue + ovr * ( 1.0 - textureValue ),
+ where src is value of pixel in a source image, ovr is value of pixel in
+ overlay image, dst is value of pixel in a destination image and
+ textureValue is corresponding value from provided texture (see or
+ ).
+
+ The filter accepts 8 bpp grayscale and 24 bpp color images for processing.
+
+ Sample usage #1:
+
+ // create filter
+ TexturedMerge filter = new TexturedMerge( new TextileTexture( ) );
+ // create an overlay image to merge with
+ filter.OverlayImage = new Bitmap( image.Width, image.Height,
+ PixelFormat.Format24bppRgb );
+ // fill the overlay image with solid color
+ PointedColorFloodFill fillFilter = new PointedColorFloodFill( Color.DarkKhaki );
+ fillFilter.ApplyInPlace( filter.OverlayImage );
+ // apply the merge filter
+ filter.ApplyInPlace( image );
+
+
+ Sample usage #2:
+
+ // create filter
+ TexturedMerge filter = new TexturedMerge( new CloudsTexture( ) );
+ // create 2 images with modified Hue
+ HueModifier hm1 = new HueModifier( 50 );
+ HueModifier hm2 = new HueModifier( 200 );
+ filter.OverlayImage = hm2.Apply( image );
+ hm1.ApplyInPlace( image );
+ // apply the merge filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image #1:
+
+ Result image #2:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Generated texture.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Texture generator.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Overlay image data.
+
+
+
+
+ Format translations dictionary.
+
+
+ See for more information.
+
+
+
+
+ Generated texture.
+
+
+ Two dimensional array of texture intensities.
+
+ In the case if image passed to the filter is smaller or
+ larger than the specified texture, than image's region is processed, which equals to the
+ minimum overlapping area.
+
+ The property has priority over this property - if
+ generator is specified than the static generated texture is not used.
+
+
+
+
+
+ Texture generator.
+
+
+ Generator used to generate texture.
+
+ The property has priority over the property.
+
+
+
+
+
+ Fill areas outiside of specified region.
+
+
+
+ The filter fills areas outside of specified region using the specified color.
+
+ The filter accepts 8bpp grayscale and 24/32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ CanvasCrop filter = new CanvasCrop( new Rectangle(
+ 5, 5, image.Width - 10, image.Height - 10 ), Color.Red );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Region to keep.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Region to keep.
+ RGB color to use for filling areas outside of specified region in color images.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Region to keep.
+ Gray color to use for filling areas outside of specified region in grayscale images.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Region to keep.
+ RGB color to use for filling areas outside of specified region in color images.
+ Gray color to use for filling areas outside of specified region in grayscale images.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ RGB fill color.
+
+
+ The color is used to fill areas out of specified region in color images.
+
+ Default value is set to white - RGB(255, 255, 255).
+
+
+
+
+ Gray fill color.
+
+
+ The color is used to fill areas out of specified region in grayscale images.
+
+ Default value is set to white - 255.
+
+
+
+
+ Region to keep.
+
+
+ Pixels inside of the specified region will keep their values, but
+ pixels outside of the region will be filled with specified color.
+
+
+
+
+ Erosion operator from Mathematical Morphology.
+
+
+ The filter assigns minimum value of surrounding pixels to each pixel of
+ the result image. Surrounding pixels, which should be processed, are specified by
+ structuring element: 1 - to process the neighbor, -1 - to skip it.
+
+ The filter especially useful for binary image processing, where it removes pixels, which
+ are not surrounded by specified amount of neighbors. It gives ability to remove noisy pixels
+ (stand-alone pixels) or shrink objects.
+
+ For processing image with 3x3 structuring element, there are different optimizations
+ available, like and .
+
+ The filter accepts 8 and 16 bpp grayscale images and 24 and 48 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Erosion filter = new Erosion( );
+ // apply the filter
+ filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Initializes new instance of the class using
+ default structuring element - 3x3 structuring element with all elements equal to 1.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Structuring element.
+
+ Structuring elemement for the erosion morphological operator
+ must be square matrix with odd size in the range of [3, 99].
+
+ Invalid size of structuring element.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Bottop-hat operator from Mathematical Morphology.
+
+
+ Bottom-hat morphological operator subtracts
+ input image from the result of morphological closing on the
+ the input image.
+
+ Applied to binary image, the filter allows to get all object parts, which were
+ added by closing filter, but were not removed after that due
+ to formed connections/fillings.
+
+ The filter accepts 8 and 16 bpp grayscale images and 24 and 48 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ BottomHat filter = new BottomHat( );
+ // apply the filter
+ filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Structuring element to pass to operator.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Grayscale image using Y algorithm.
+
+
+ The class uses Y algorithm to convert color image
+ to grayscale. The conversion coefficients are:
+
+ - Red: 0.299;
+ - Green: 0.587;
+ - Blue: 0.114.
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Contrast stretching filter.
+
+
+ Contrast stretching (or as it is often called normalization) is a simple image enhancement
+ technique that attempts to improve the contrast in an image by 'stretching' the range of intensity values
+ it contains to span a desired range of values, e.g. the full range of pixel values that the image type
+ concerned allows. It differs from the more sophisticated histogram equalization
+ in that it can only apply a linear scaling function to the image pixel values.
+
+ The result of this filter may be achieved by using class, which allows to
+ get pixels' intensities histogram, and filter, which does linear correction
+ of pixel's intensities.
+
+ The filter accepts 8 bpp grayscale and 24 bpp color images.
+
+ Sample usage:
+
+ // create filter
+ ContrastStretch filter = new ContrastStretch( );
+ // process image
+ filter.ApplyInPlace( sourceImage );
+
+
+ Source image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Channels filters.
+
+
+ The filter does color channels' filtering by clearing (filling with
+ specified values) values, which are inside/outside of the specified value's
+ range. The filter allows to fill certain ranges of RGB color channels with specified
+ value.
+
+ The filter is similar to , but operates with not
+ entire pixels, but with their RGB values individually. This means that pixel itself may
+ not be filtered (will be kept), but one of its RGB values may be filtered if they are
+ inside/outside of specified range.
+
+ The filter accepts 24 and 32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ ChannelFiltering filter = new ChannelFiltering( );
+ // set channels' ranges to keep
+ filter.Red = new IntRange( 0, 255 );
+ filter.Green = new IntRange( 100, 255 );
+ filter.Blue = new IntRange( 100, 255 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Red channel's filtering range.
+ Green channel's filtering range.
+ Blue channel's filtering range.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Calculate filtering map.
+
+
+ Filtering range.
+ Fillter value.
+ Fill outside or inside the range.
+ Filtering map.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Red channel's range.
+
+
+
+
+ Red fill value.
+
+
+
+
+ Green channel's range.
+
+
+
+
+ Green fill value.
+
+
+
+
+ Blue channel's range.
+
+
+
+
+ Blue fill value.
+
+
+
+
+ Determines, if red channel should be filled inside or outside filtering range.
+
+
+ Default value is set to .
+
+
+
+
+ Determines, if green channel should be filled inside or outside filtering range.
+
+
+ Default value is set to .
+
+
+
+
+ Determines, if blue channel should be filled inside or outside filtering range.
+
+
+ Default value is set to .
+
+
+
+
+ Generic Bayer fileter image processing routine.
+
+
+ The class implements Bayer filter
+ routine, which creates color image out of grayscale image produced by image sensor built with
+ Bayer color matrix.
+
+ This Bayer filter implementation is made generic by allowing user to specify used
+ Bayer pattern. This makes it slower. For optimized version
+ of the Bayer filter see class, which implements Bayer filter
+ specifically optimized for some well known patterns.
+
+ The filter accepts 8 bpp grayscale images and produces 24 bpp RGB image.
+
+ Sample usage:
+
+ // create filter
+ BayerFilter filter = new BayerFilter( );
+ // apply the filter
+ Bitmap rgbImage = filter.Apply( image );
+
+
+ Source image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Specifies if demosaicing must be done or not.
+
+
+ The property specifies if color demosaicing must be done or not.
+ If the property is set to , then pixels of the result color image
+ are colored according to the Bayer pattern used, i.e. every pixel
+ of the source grayscale image is copied to corresponding color plane of the result image.
+ If the property is set to , then pixels of the result image
+ are set to color, which is obtained by averaging color components from the 3x3 window - pixel
+ itself plus 8 surrounding neighbors.
+
+ Default value is set to .
+
+
+
+
+
+ Specifies Bayer pattern used for decoding color image.
+
+
+ The property specifies 2x2 array of RGB color indexes, which set the
+ Bayer patter used for decoding color image.
+
+ By default the property is set to:
+
+ new int[2, 2] { { RGB.G, RGB.R }, { RGB.B, RGB.G } }
+ ,
+ which corresponds to
+
+ G R
+ B G
+
+ pattern.
+
+
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Move towards filter.
+
+
+ The result of this filter is an image, which is based on source image,
+ but updated in the way to decrease diffirence with overlay image - source image is
+ moved towards overlay image. The update equation is defined in the next way:
+ res = src + Min( Abs( ovr - src ), step ) * Sign( ovr - src ).
+
+ The bigger is step size value the more resulting
+ image will look like overlay image. For example, in the case if step size is equal
+ to 255 (or 65535 for images with 16 bits per channel), the resulting image will be
+ equal to overlay image regardless of source image's pixel values. In the case if step
+ size is set to 1, the resulting image will very little differ from the source image.
+ But, in the case if the filter is applied repeatedly to the resulting image again and
+ again, it will become equal to overlay image in maximum 255 (65535 for images with 16
+ bits per channel) iterations.
+
+ The filter accepts 8 and 16 bpp grayscale images and 24, 32, 48 and 64 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ MoveTowards filter = new MoveTowards( overlayImage, 20 );
+ // apply the filter
+ Bitmap resultImage = filter.Apply( sourceImage );
+
+
+ Source image:
+
+ Overlay image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Overlay image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Overlay image.
+ Step size.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged overlay image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged overlay image.
+ Step size.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Overlay image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Step size, [0, 65535].
+
+
+
+ The property defines the maximum amount of changes per pixel in the source image.
+
+ Default value is set to 1.
+
+
+
+
+
+ Drawing primitives.
+
+
+ The class allows to do drawing of some primitives directly on
+ locked image data or unmanaged image.
+
+ All methods of this class support drawing only on color 24/32 bpp images and
+ on grayscale 8 bpp indexed images.
+
+ When it comes to alpha blending for 24/32 bpp images, all calculations are done
+ as described on Wikipeadia
+ (see "over" operator).
+
+
+
+
+
+ Fill rectangle on the specified image.
+
+
+ Source image data to draw on.
+ Rectangle's coordinates to fill.
+ Rectangle's color.
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Fill rectangle on the specified image.
+
+
+ Source image to draw on.
+ Rectangle's coordinates to fill.
+ Rectangle's color.
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Draw rectangle on the specified image.
+
+
+ Source image data to draw on.
+ Rectangle's coordinates to draw.
+ Rectangle's color.
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Draw rectangle on the specified image.
+
+
+ Source image to draw on.
+ Rectangle's coordinates to draw.
+ Rectangle's color.
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Draw a line on the specified image.
+
+
+ Source image data to draw on.
+ The first point to connect.
+ The second point to connect.
+ Line's color.
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Draw a line on the specified image.
+
+
+ Source image to draw on.
+ The first point to connect.
+ The second point to connect.
+ Line's color.
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Draw a polygon on the specified image.
+
+
+ Source image data to draw on.
+ Points of the polygon to draw.
+ Polygon's color.
+
+ The method draws a polygon by connecting all points from the
+ first one to the last one and then connecting the last point with the first one.
+
+
+
+
+
+ Draw a polygon on the specified image.
+
+
+ Source image to draw on.
+ Points of the polygon to draw.
+ Polygon's color.
+
+ The method draws a polygon by connecting all points from the
+ first one to the last one and then connecting the last point with the first one.
+
+
+
+
+
+ Draw a polyline on the specified image.
+
+
+ Source image data to draw on.
+ Points of the polyline to draw.
+ polyline's color.
+
+ The method draws a polyline by connecting all points from the
+ first one to the last one. Unlike
+ method, this method does not connect the last point with the first one.
+
+
+
+
+
+ Draw a polyline on the specified image.
+
+
+ Source image to draw on.
+ Points of the polyline to draw.
+ polyline's color.
+
+ The method draws a polyline by connecting all points from the
+ first one to the last one. Unlike
+ method, this method does not connect the last point with the first one.
+
+
+
+
+
+ Color quantization tools.
+
+
+ The class contains methods aimed to simplify work with color quantization
+ algorithms implementing interface. Using its methods it is possible
+ to calculate reduced color palette for the specified image or reduce colors to the specified number.
+
+ Sample usage:
+
+ // instantiate the images' color quantization class
+ ColorImageQuantizer ciq = new ColorImageQuantizer( new MedianCutQuantizer( ) );
+ // get 16 color palette for a given image
+ Color[] colorTable = ciq.CalculatePalette( image, 16 );
+
+ // ... or just reduce colors in the specified image
+ Bitmap newImage = ciq.ReduceColors( image, 16 );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Color quantization algorithm to use for processing images.
+
+
+
+
+ Calculate reduced color palette for the specified image.
+
+
+ Image to calculate palette for.
+ Palette size to calculate.
+
+ Return reduced color palette for the specified image.
+
+ See for details.
+
+
+
+
+ Calculate reduced color palette for the specified image.
+
+
+ Image to calculate palette for.
+ Palette size to calculate.
+
+ Return reduced color palette for the specified image.
+
+ The method processes the specified image and feeds color value of each pixel
+ to the specified color quantization algorithm. Finally it returns color palette built by
+ that algorithm.
+
+ Unsupported format of the source image - it must 24 or 32 bpp color image.
+
+
+
+
+ Create an image with reduced number of colors.
+
+
+ Source image to process.
+ Number of colors to get in the output image, [2, 256].
+
+ Returns image with reduced number of colors.
+
+ See for details.
+
+
+
+
+ Create an image with reduced number of colors.
+
+
+ Source image to process.
+ Number of colors to get in the output image, [2, 256].
+
+ Returns image with reduced number of colors.
+
+ The method creates an image, which looks similar to the specified image, but contains
+ reduced number of colors. First, target color palette is calculated using
+ method and then a new image is created, where pixels from the given source image are substituted by
+ best matching colors from calculated color table.
+
+ The output image has 4 bpp or 8 bpp indexed pixel format depending on the target palette size -
+ 4 bpp for palette size 16 or less; 8 bpp otherwise.
+
+
+ Unsupported format of the source image - it must 24 or 32 bpp color image.
+ Invalid size of the target color palette.
+
+
+
+
+ Create an image with reduced number of colors using the specified palette.
+
+
+ Source image to process.
+ Target color palette. Must contatin 2-256 colors.
+
+ Returns image with reduced number of colors.
+
+ See for details.
+
+
+
+
+ Create an image with reduced number of colors using the specified palette.
+
+
+ Source image to process.
+ Target color palette. Must contatin 2-256 colors.
+
+ Returns image with reduced number of colors.
+
+ The method creates an image, which looks similar to the specified image, but contains
+ reduced number of colors. Is substitutes every pixel of the source image with the closest matching color
+ in the specified paletter.
+
+ The output image has 4 bpp or 8 bpp indexed pixel format depending on the target palette size -
+ 4 bpp for palette size 16 or less; 8 bpp otherwise.
+
+
+ Unsupported format of the source image - it must 24 or 32 bpp color image.
+ Invalid size of the target color palette.
+
+
+
+
+ Color quantization algorithm used by this class to build color palettes for the specified images.
+
+
+
+
+
+ Use color caching during color reduction or not.
+
+
+ The property has effect only for methods like and
+ specifies if internal cache of already processed colors should be used or not. For each pixel in the original
+ image the color reduction routine does search in target color palette to find the best matching color.
+ To avoid doing the search again and again for already processed colors, the class may use internal dictionary
+ which maps colors of original image to indexes in target color palette.
+
+
+ The property provides a trade off. On one hand it may speedup color reduction routine, but on another
+ hand it increases memory usage. Also cache usage may not be efficient for very small target color tables.
+
+ Default value is set to .
+
+
+
+
+
+ Pixellate filter.
+
+
+ The filter processes an image creating the effect of an image with larger
+ pixels - pixellated image. The effect is achieved by filling image's rectangles of the
+ specified size by the color, which is mean color value for the corresponding rectangle.
+ The size of rectangles to process is set by and
+ properties.
+
+ The filter accepts 8 bpp grayscale images and 24 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Pixellate filter = new Pixellate( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Pixel size.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Pixel width.
+ Pixel height.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Pixel width, [2, 32].
+
+
+ Default value is set to 8.
+
+
+
+
+
+
+
+ Pixel height, [2, 32].
+
+
+ Default value is set to 8.
+
+
+
+
+
+
+
+ Pixel size, [2, 32].
+
+
+ The property is used to set both and
+ simultaneously.
+
+
+
+
+ Apply mask to the specified image.
+
+
+ The filter applies mask to the specified image - keeps all pixels
+ in the image if corresponding pixels/values of the mask are not equal to 0. For all
+ 0 pixels/values in mask, corresponding pixels in the source image are set to 0.
+
+ Mask can be specified as .NET's managed Bitmap, as
+ UnmanagedImage or as byte array.
+ In the case if mask is specified as image, it must be 8 bpp grayscale image. In all case
+ mask size must be the same as size of the image to process.
+
+ The filter accepts 8/16 bpp grayscale and 24/32/48/64 bpp color images for processing.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Mask image to use.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged mask image to use.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ to use.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+ None of the possible mask properties were set. Need to provide mask before applying the filter.
+ Invalid size of provided mask. Its size must be the same as the size of the image to mask.
+
+
+
+
+ Mask image to apply.
+
+
+ The property specifies mask image to use. The image must be grayscale
+ (8 bpp format) and have the same size as the source image to process.
+
+ When the property is set, both and
+ properties are set to .
+
+
+ The mask image must be 8 bpp grayscale image.
+
+
+
+
+ Unmanaged mask image to apply.
+
+
+ The property specifies unmanaged mask image to use. The image must be grayscale
+ (8 bpp format) and have the same size as the source image to process.
+
+ When the property is set, both and
+ properties are set to .
+
+
+ The mask image must be 8 bpp grayscale image.
+
+
+
+
+ Mask to apply.
+
+
+ The property specifies mask array to use. Size of the array must
+ be the same size as the size of the source image to process - its 0th dimension
+ must be equal to image's height and its 1st dimension must be equal to width. For
+ example, for 640x480 image, the mask array must be defined as:
+
+ byte[,] mask = new byte[480, 640];
+
+
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Canny edge detector.
+
+
+ The filter searches for objects' edges by applying Canny edge detector.
+ The implementation follows
+ Bill Green's Canny edge detection tutorial.
+
+ The implemented canny edge detector has one difference with the above linked algorithm.
+ The difference is in hysteresis step, which is a bit simplified (getting faster as a result). On the
+ hysteresis step each pixel is compared with two threshold values: and
+ . If pixel's value is greater or equal to , then
+ it is kept as edge pixel. If pixel's value is greater or equal to , then
+ it is kept as edge pixel only if there is at least one neighbouring pixel (8 neighbours are checked) which
+ has value greater or equal to ; otherwise it is none edge pixel. In the case
+ if pixel's value is less than , then it is marked as none edge immediately.
+
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ CannyEdgeDetector filter = new CannyEdgeDetector( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Low threshold.
+ High threshold.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Low threshold.
+ High threshold.
+ Gaussian sigma.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Low threshold.
+
+
+ Low threshold value used for hysteresis
+ (see tutorial
+ for more information).
+
+ Default value is set to 20.
+
+
+
+
+
+ High threshold.
+
+
+ High threshold value used for hysteresis
+ (see tutorial
+ for more information).
+
+ Default value is set to 100.
+
+
+
+
+
+ Gaussian sigma.
+
+
+ Sigma value for Gaussian bluring.
+
+
+
+
+ Gaussian size.
+
+
+ Size of Gaussian kernel.
+
+
+
+
+ Linear correction of RGB channels for images, which have 16 bpp planes (16 bit gray images or 48/64 bit colour images).
+
+
+ The filter performs linear correction of RGB channels by mapping specified
+ channels' input ranges to output ranges. This version of the filter processes only images
+ with 16 bpp colour planes. See for 8 bpp version.
+
+ The filter accepts 16 bpp grayscale and 48/64 bpp colour images for processing.
+
+ Sample usage:
+
+ // create filter
+ LevelsLinear16bpp filter = new LevelsLinear16bpp( );
+ // set ranges
+ filter.InRed = new IntRange( 3000, 42000 );
+ filter.InGreen = new IntRange( 5000, 37500 );
+ filter.InBlue = new IntRange( 1000, 60000 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Calculate conversion map.
+
+
+ Input range.
+ Output range.
+ Conversion map.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Red component's input range.
+
+
+
+
+ Green component's input range.
+
+
+
+
+ Blue component's input range.
+
+
+
+
+ Gray component's input range.
+
+
+
+
+ Input range for RGB components.
+
+
+ The property allows to set red, green and blue input ranges to the same value.
+
+
+
+
+ Red component's output range.
+
+
+
+
+ Green component's output range.
+
+
+
+
+ Blue component's output range.
+
+
+
+
+ Gray component's output range.
+
+
+
+
+ Output range for RGB components.
+
+
+ The property allows to set red, green and blue output ranges to the same value.
+
+
+
+
+ Dithering using Sierra error diffusion.
+
+
+ The filter represents binarization filter, which is based on
+ error diffusion dithering with Sierra coefficients. Error is diffused
+ on 10 neighbor pixels with next coefficients:
+
+ | * | 5 | 3 |
+ | 2 | 4 | 5 | 4 | 2 |
+ | 2 | 3 | 2 |
+
+ / 32
+
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ SierraDithering filter = new SierraDithering( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Dithering using Burkes error diffusion.
+
+
+ The filter represents binarization filter, which is based on
+ error diffusion dithering with Burkes coefficients. Error is diffused
+ on 7 neighbor pixels with next coefficients:
+
+ | * | 8 | 4 |
+ | 2 | 4 | 8 | 4 | 2 |
+
+ / 32
+
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ BurkesDithering filter = new BurkesDithering( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Calculate difference between two images and threshold it.
+
+
+ The filter produces similar result as applying filter and
+ then filter - thresholded difference between two images. Result of this
+ image processing routine may be useful in motion detection applications or finding areas of significant
+ difference.
+
+ The filter accepts 8 and 24/32color images for processing.
+ In the case of color images, the image processing routine differences sum over 3 RGB channels (Manhattan distance), i.e.
+ |diffR| + |diffG| + |diffB|.
+
+
+ Sample usage:
+
+ // create filter
+ ThresholdedDifference filter = new ThresholdedDifference( 60 );
+ // apply the filter
+ filter.OverlayImage = backgroundImage;
+ Bitmap resultImage = filter.Apply( sourceImage );
+
+
+ Source image:
+
+ Background image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Difference threshold (see ).
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Overlay image data.
+ Destination image data
+
+
+
+
+ Difference threshold.
+
+
+ The property specifies difference threshold. If difference between pixels of processing image
+ and overlay image is greater than this value, then corresponding pixel of result image is set to white; otherwise
+ black.
+
+
+ Default value is set to 15.
+
+
+
+
+ Number of pixels which were set to white in destination image during last image processing call.
+
+
+ The property may be useful to determine amount of difference between two images which,
+ for example, may be treated as amount of motion in motion detection applications, etc.
+
+
+
+
+ Format translations dictionary.
+
+
+ See for more information.
+
+
+
+
+ Subtract filter - subtract pixel values of two images.
+
+
+ The subtract filter takes two images (source and overlay images)
+ of the same size and pixel format and produces an image, where each pixel equals
+ to the difference value of corresponding pixels from provided images (if difference is less
+ than minimum allowed value, 0, then it is truncated to that minimum value).
+
+ The filter accepts 8 and 16 bpp grayscale images and 24, 32, 48 and 64 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Subtract filter = new Subtract( overlayImage );
+ // apply the filter
+ Bitmap resultImage = filter.Apply( sourceImage );
+
+
+ Source image:
+
+ Overlay image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Overlay image
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged overlay image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Overlay image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Stereo anaglyph filter.
+
+
+ The image processing filter produces stereo anaglyph images which are
+ aimed to be viewed through anaglyph glasses with red filter over the left eye and
+ cyan over the right.
+
+
+
+ The stereo image is produced by combining two images of the same scene taken
+ from a bit different points. The right image must be provided to the filter using
+ property, but the left image must be provided to
+ method, which creates the anaglyph image.
+
+ The filter accepts 24 bpp color images for processing.
+
+ See enumeration for the list of supported anaglyph algorithms.
+
+ Sample usage:
+
+ // create filter
+ StereoAnaglyph filter = new StereoAnaglyph( );
+ // set right image as overlay
+ filter.Overlay = rightImage
+ // apply the filter (providing left image)
+ Bitmap resultImage = filter.Apply( leftImage );
+
+
+ Source image (left):
+
+ Overlay image (right):
+
+ Result image:
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Algorithm to use for creating anaglyph images.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data (left image).
+ Overlay image data (right image).
+
+
+
+
+ Algorithm to use for creating anaglyph images.
+
+
+ Default value is set to .
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Enumeration of algorithms for creating anaglyph images.
+
+
+ See anaglyph methods comparison for
+ descipton of different algorithms.
+
+
+
+
+
+ Creates anaglyph image using the below calculations:
+
+ - Ra=0.299*Rl+0.587*Gl+0.114*Bl;
+ - Ga=0;
+ - Ba=0.299*Rr+0.587*Gr+0.114*Br.
+
+
+
+
+
+ Creates anaglyph image using the below calculations:
+
+ - Ra=0.299*Rl+0.587*Gl+0.114*Bl;
+ - Ga=0.299*Rr+0.587*Gr+0.114*Br;
+ - Ba=0.299*Rr+0.587*Gr+0.114*Br.
+
+
+
+
+
+ Creates anaglyph image using the below calculations:
+
+ - Ra=Rl;
+ - Ga=Gr;
+ - Ba=Br.
+
+
+
+
+
+ Creates anaglyph image using the below calculations:
+
+ - Ra=0.299*Rl+0.587*Gl+0.114*Bl;
+ - Ga=Gr;
+ - Ba=Br.
+
+
+
+
+
+ Creates anaglyph image using the below calculations:
+
+ - Ra=0.7*Gl+0.3*Bl;
+ - Ga=Gr;
+ - Ba=Br.
+
+
+
+
+
diff --git a/Part 1 - Record Video/bin/Debug/AForge.Math.dll b/Part 1 - Record Video/bin/Debug/AForge.Math.dll
new file mode 100644
index 0000000..bdc5e5b
Binary files /dev/null and b/Part 1 - Record Video/bin/Debug/AForge.Math.dll differ
diff --git a/Part 1 - Record Video/bin/Debug/AForge.Math.xml b/Part 1 - Record Video/bin/Debug/AForge.Math.xml
new file mode 100644
index 0000000..2d86543
--- /dev/null
+++ b/Part 1 - Record Video/bin/Debug/AForge.Math.xml
@@ -0,0 +1,5676 @@
+
+
+
+ AForge.Math
+
+
+
+
+ Set of tool functions.
+
+
+ The class contains different utility functions.
+
+
+
+
+ Calculates power of 2.
+
+
+ Power to raise in.
+
+ Returns specified power of 2 in the case if power is in the range of
+ [0, 30]. Otherwise returns 0.
+
+
+
+
+ Checks if the specified integer is power of 2.
+
+
+ Integer number to check.
+
+ Returns true if the specified number is power of 2.
+ Otherwise returns false.
+
+
+
+
+ Get base of binary logarithm.
+
+
+ Source integer number.
+
+ Power of the number (base of binary logarithm).
+
+
+
+
+ Interface for distance metric algorithms.
+
+
+ The interface defines a set of methods implemented
+ by distance metric algorithms. These algorithms typically take a set of points and return a
+ distance measure of the x and y coordinates. In this case, the points are represented by two vectors.
+
+ Distance metric algorithms are used in many machine learning algorithms e.g K-nearest neighbor
+ and K-means clustering.
+
+ For additional details about distance metrics, documentation of the
+ particular algorithms should be studied.
+
+
+
+
+
+ Returns distance between two N-dimensional double vectors.
+
+
+ 1st point vector.
+ 2nd point vector.
+
+ Returns distance measurement determined by the given algorithm.
+
+
+
+
+ Histogram for discrete random values.
+
+
+ The class wraps histogram for discrete stochastic function, which is represented
+ by integer array, where indexes of the array are treated as values of the stochastic function,
+ but array values are treated as "probabilities" (total amount of hits).
+
+
+ Sample usage:
+
+ // create histogram
+ Histogram histogram = new Histogram( new int[10] { 0, 0, 1, 3, 6, 8, 11, 0, 0, 0 } );
+ // get mean and standard deviation values
+ Console.WriteLine( "mean = " + histogram.Mean + ", std.dev = " + histogram.StdDev );
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Values of the histogram.
+
+ Indexes of the input array are treated as values of stochastic function,
+ but array values are treated as "probabilities" (total amount of hits).
+
+
+
+
+
+ Get range around median containing specified percentage of values.
+
+
+ Values percentage around median.
+
+ Returns the range which containes specifies percentage of values.
+
+ The method calculates range of stochastic variable, which summary probability
+ comprises the specified percentage of histogram's hits.
+
+ Sample usage:
+
+ // create histogram
+ Histogram histogram = new Histogram( new int[10] { 0, 0, 1, 3, 6, 8, 11, 0, 0, 0 } );
+ // get 50% range
+ IntRange range = histogram.GetRange( 0.5 );
+ // show the range ([4, 6])
+ Console.WriteLine( "50% range = [" + range.Min + ", " + range.Max + "]" );
+
+
+
+
+
+
+ Update statistical value of the histogram.
+
+
+ The method recalculates statistical values of the histogram, like mean,
+ standard deviation, etc., in the case if histogram's values were changed directly.
+ The method should be called only in the case if histogram's values were retrieved
+ through property and updated after that.
+
+
+
+
+
+ Values of the histogram.
+
+
+ Indexes of this array are treated as values of stochastic function,
+ but array values are treated as "probabilities" (total amount of hits).
+
+
+
+
+
+ Mean value.
+
+
+ The property allows to retrieve mean value of the histogram.
+
+ Sample usage:
+
+ // create histogram
+ Histogram histogram = new Histogram( new int[10] { 0, 0, 1, 3, 6, 8, 11, 0, 0, 0 } );
+ // get mean value (= 4.862)
+ Console.WriteLine( "mean = " + histogram.Mean.ToString( "F3" ) );
+
+
+
+
+
+
+ Standard deviation.
+
+
+ The property allows to retrieve standard deviation value of the histogram.
+
+ Sample usage:
+
+ // create histogram
+ Histogram histogram = new Histogram( new int[10] { 0, 0, 1, 3, 6, 8, 11, 0, 0, 0 } );
+ // get std.dev. value (= 1.136)
+ Console.WriteLine( "std.dev. = " + histogram.StdDev.ToString( "F3" ) );
+
+
+
+
+
+
+ Median value.
+
+
+ The property allows to retrieve median value of the histogram.
+
+ Sample usage:
+
+ // create histogram
+ Histogram histogram = new Histogram( new int[10] { 0, 0, 1, 3, 6, 8, 11, 0, 0, 0 } );
+ // get median value (= 5)
+ Console.WriteLine( "median = " + histogram.Median );
+
+
+
+
+
+
+ Minimum value.
+
+
+ The property allows to retrieve minimum value of the histogram with non zero
+ hits count.
+
+ Sample usage:
+
+ // create histogram
+ Histogram histogram = new Histogram( new int[10] { 0, 0, 1, 3, 6, 8, 11, 0, 0, 0 } );
+ // get min value (= 2)
+ Console.WriteLine( "min = " + histogram.Min );
+
+
+
+
+
+
+ Maximum value.
+
+
+ The property allows to retrieve maximum value of the histogram with non zero
+ hits count.
+
+ Sample usage:
+
+ // create histogram
+ Histogram histogram = new Histogram( new int[10] { 0, 0, 1, 3, 6, 8, 11, 0, 0, 0 } );
+ // get max value (= 6)
+ Console.WriteLine( "max = " + histogram.Max );
+
+
+
+
+
+
+ Total count of values.
+
+
+ The property represents total count of values contributed to the histogram, which is
+ essentially sum of the array.
+
+ Sample usage:
+
+ // create histogram
+ Histogram histogram = new Histogram( new int[10] { 0, 0, 1, 3, 6, 8, 11, 0, 0, 0 } );
+ // get total value (= 29)
+ Console.WriteLine( "total = " + histogram.TotalCount );
+
+
+
+
+
+
+ Set of statistics functions.
+
+
+ The class represents collection of simple functions used
+ in statistics.
+
+
+
+
+ Calculate mean value.
+
+
+ Histogram array.
+
+ Returns mean value.
+
+ The input array is treated as histogram, i.e. its
+ indexes are treated as values of stochastic function, but
+ array values are treated as "probabilities" (total amount of
+ hits).
+
+ Sample usage:
+
+ // create histogram array
+ int[] histogram = new int[] { 1, 1, 2, 3, 6, 8, 11, 12, 7, 3 };
+ // calculate mean value
+ double mean = Statistics.Mean( histogram );
+ // output it (5.759)
+ Console.WriteLine( "mean = " + mean.ToString( "F3" ) );
+
+
+
+
+
+
+ Calculate standard deviation.
+
+
+ Histogram array.
+
+ Returns value of standard deviation.
+
+ The input array is treated as histogram, i.e. its
+ indexes are treated as values of stochastic function, but
+ array values are treated as "probabilities" (total amount of
+ hits).
+
+ Sample usage:
+
+ // create histogram array
+ int[] histogram = new int[] { 1, 1, 2, 3, 6, 8, 11, 12, 7, 3 };
+ // calculate standard deviation value
+ double stdDev = Statistics.StdDev( histogram );
+ // output it (1.999)
+ Console.WriteLine( "std.dev. = " + stdDev.ToString( "F3" ) );
+
+
+
+
+
+
+ Calculate standard deviation.
+
+
+ Histogram array.
+ Mean value of the histogram.
+
+ Returns value of standard deviation.
+
+ The input array is treated as histogram, i.e. its
+ indexes are treated as values of stochastic function, but
+ array values are treated as "probabilities" (total amount of
+ hits).
+
+ The method is an equevalent to the method,
+ but it relieas on the passed mean value, which is previously calculated
+ using method.
+
+
+
+
+
+ Calculate median value.
+
+
+ Histogram array.
+
+ Returns value of median.
+
+
+ The input array is treated as histogram, i.e. its
+ indexes are treated as values of stochastic function, but
+ array values are treated as "probabilities" (total amount of
+ hits).
+
+ The median value is calculated accumulating histogram's
+ values starting from the left point until the sum reaches 50% of
+ histogram's sum.
+
+ Sample usage:
+
+ // create histogram array
+ int[] histogram = new int[] { 1, 1, 2, 3, 6, 8, 11, 12, 7, 3 };
+ // calculate median value
+ int median = Statistics.Median( histogram );
+ // output it (6)
+ Console.WriteLine( "median = " + median );
+
+
+
+
+
+
+ Get range around median containing specified percentage of values.
+
+
+ Histogram array.
+ Values percentage around median.
+
+ Returns the range which containes specifies percentage
+ of values.
+
+
+ The input array is treated as histogram, i.e. its
+ indexes are treated as values of stochastic function, but
+ array values are treated as "probabilities" (total amount of
+ hits).
+
+ The method calculates range of stochastic variable, which summary probability
+ comprises the specified percentage of histogram's hits.
+
+ Sample usage:
+
+ // create histogram array
+ int[] histogram = new int[] { 1, 1, 2, 3, 6, 8, 11, 12, 7, 3 };
+ // get 75% range around median
+ IntRange range = Statistics.GetRange( histogram, 0.75 );
+ // output it ([4, 8])
+ Console.WriteLine( "range = [" + range.Min + ", " + range.Max + "]" );
+
+
+
+
+
+
+ Calculate entropy value.
+
+
+ Histogram array.
+
+ Returns entropy value of the specified histagram array.
+
+ The input array is treated as histogram, i.e. its
+ indexes are treated as values of stochastic function, but
+ array values are treated as "probabilities" (total amount of
+ hits).
+
+ Sample usage:
+
+ // create histogram array with 2 values of equal probabilities
+ int[] histogram1 = new int[2] { 3, 3 };
+ // calculate entropy
+ double entropy1 = Statistics.Entropy( histogram1 );
+ // output it (1.000)
+ Console.WriteLine( "entropy1 = " + entropy1.ToString( "F3" ) );
+
+ // create histogram array with 4 values of equal probabilities
+ int[] histogram2 = new int[4] { 1, 1, 1, 1 };
+ // calculate entropy
+ double entropy2 = Statistics.Entropy( histogram2 );
+ // output it (2.000)
+ Console.WriteLine( "entropy2 = " + entropy2.ToString( "F3" ) );
+
+ // create histogram array with 4 values of different probabilities
+ int[] histogram3 = new int[4] { 1, 2, 3, 4 };
+ // calculate entropy
+ double entropy3 = Statistics.Entropy( histogram3 );
+ // output it (1.846)
+ Console.WriteLine( "entropy3 = " + entropy3.ToString( "F3" ) );
+
+
+
+
+
+
+ Calculate mode value.
+
+
+ Histogram array.
+
+ Returns mode value of the histogram array.
+
+
+ The input array is treated as histogram, i.e. its
+ indexes are treated as values of stochastic function, but
+ array values are treated as "probabilities" (total amount of
+ hits).
+
+ Returns the minimum mode value if the specified histogram is multimodal.
+
+ Sample usage:
+
+ // create array
+ int[] values = new int[] { 1, 1, 2, 3, 6, 8, 11, 12, 7, 3 };
+ // calculate mode value
+ int mode = Statistics.Mode( values );
+ // output it (7)
+ Console.WriteLine( "mode = " + mode );
+
+
+
+
+
+
+ Gaussian random numbers generator.
+
+
+ The random number generator generates gaussian
+ random numbers with specified mean and standard deviation values.
+
+ The generator uses generator as base
+ to generate random numbers.
+
+ Sample usage:
+
+ // create instance of random generator
+ IRandomNumberGenerator generator = new GaussianGenerator( 5.0, 1.5 );
+ // generate random number
+ float randomNumber = generator.Next( );
+
+
+
+
+
+
+ Interface for random numbers generators.
+
+
+ The interface defines set of methods and properties, which should
+ be implemented by different algorithms for random numbers generatation.
+
+
+
+
+
+ Generate next random number.
+
+
+ Returns next random number.
+
+
+
+
+ Set seed of the random numbers generator.
+
+
+ Seed value.
+
+
+
+
+ Mean value of generator.
+
+
+
+
+
+ Variance value of generator.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Mean value.
+ Standard deviation value.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Mean value.
+ Standard deviation value.
+ Seed value to initialize random numbers generator.
+
+
+
+
+ Generate next random number.
+
+
+ Returns next random number.
+
+
+
+
+ Set seed of the random numbers generator.
+
+
+ Seed value.
+
+ Resets random numbers generator initializing it with
+ specified seed value.
+
+
+
+
+ Mean value of the generator.
+
+
+
+
+
+ Variance value of the generator.
+
+
+
+
+
+ Standard deviation value.
+
+
+
+
+
+ The class encapsulates 2D line segment and provides some tool methods related to lines.
+
+
+ The class provides some methods which are related to line segments:
+ distance to point, finding intersection point, etc.
+
+
+ A line segment may be converted to a .
+
+ Sample usage:
+
+ // create a segment
+ LineSegment segment = new LineSegment( new Point( 0, 0 ), new Point( 3, 4 ) );
+ // get segment's length
+ float length = segment.Length;
+
+ // get intersection point with a line
+ Point? intersection = segment.GetIntersectionWith(
+ new Line( new Point( -3, 8 ), new Point( 0, 4 ) ) );
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Segment's start point.
+ Segment's end point.
+
+ Thrown if the two points are the same.
+
+
+
+
+ Converts this to a by discarding
+ its endpoints and extending it infinitely in both directions.
+
+
+ The segment to convert to a .
+
+ Returns a that contains this .
+
+
+
+
+ Calculate Euclidean distance between a point and a finite line segment.
+
+
+ The point to calculate the distance to.
+
+ Returns the Euclidean distance between this line segment and the specified point. Unlike
+ , this returns the distance from the finite segment. (0,0) is 5 units
+ from the segment (0,5)-(0,8), but is 0 units from the line through those points.
+
+
+
+
+ Finds, provided it exists, the intersection point with the specified .
+
+
+ to find intersection with.
+
+ Returns intersection point with the specified , or , if
+ the two segments do not intersect.
+
+ If the two segments do not intersect, the method returns . If the two
+ segments share multiple points, this throws an .
+
+
+ Thrown if the segments overlap - if they have
+ multiple points in common.
+
+
+
+
+ Finds, provided it exists, the intersection point with the specified .
+
+
+ to find intersection with.
+
+ Returns intersection point with the specified , or , if
+ the line does not intersect with this segment.
+
+ If the line and the segment do not intersect, the method returns . If the line
+ and the segment share multiple points, the method throws an .
+
+
+ Thrown if this segment is a portion of
+ line.
+
+
+
+
+ Equality operator - checks if two line segments have equal parameters.
+
+
+ First line segment to check.
+ Second line segment to check.
+
+ Returns if parameters of specified
+ line segments are equal.
+
+
+
+
+ Inequality operator - checks if two lines have different parameters.
+
+
+ First line segment to check.
+ Second line segment to check.
+
+ Returns if parameters of specified
+ line segments are not equal.
+
+
+
+
+ Check if this instance of equals to the specified one.
+
+
+ Another line segment to check equalty to.
+
+ Return if objects are equal.
+
+
+
+
+ Get hash code for this instance.
+
+
+ Returns the hash code for this instance.
+
+
+
+
+ Get string representation of the class.
+
+
+ Returns string, which contains values of the like in readable form.
+
+
+
+
+ Start point of the line segment.
+
+
+
+
+ End point of the line segment.
+
+
+
+
+ Get segment's length - Euclidean distance between its and points.
+
+
+
+
+ Gaussian function.
+
+
+ The class is used to calculate 1D and 2D Gaussian functions for
+ specified (s) value:
+
+
+ 1-D: f(x) = exp( x * x / ( -2 * s * s ) ) / ( s * sqrt( 2 * PI ) )
+
+ 2-D: f(x, y) = exp( x * x + y * y / ( -2 * s * s ) ) / ( s * s * 2 * PI )
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Sigma value.
+
+
+
+
+ 1-D Gaussian function.
+
+
+ x value.
+
+ Returns function's value at point .
+
+ The function calculates 1-D Gaussian function:
+
+
+ f(x) = exp( x * x / ( -2 * s * s ) ) / ( s * sqrt( 2 * PI ) )
+
+
+
+
+
+
+ 2-D Gaussian function.
+
+
+ x value.
+ y value.
+
+ Returns function's value at point (, ).
+
+ The function calculates 2-D Gaussian function:
+
+
+ f(x, y) = exp( x * x + y * y / ( -2 * s * s ) ) / ( s * s * 2 * PI )
+
+
+
+
+
+
+ 1-D Gaussian kernel.
+
+
+ Kernel size (should be odd), [3, 101].
+
+ Returns 1-D Gaussian kernel of the specified size.
+
+ The function calculates 1-D Gaussian kernel, which is array
+ of Gaussian function's values in the [-r, r] range of x value, where
+ r=floor(/2).
+
+
+ Wrong kernel size.
+
+
+
+
+ 2-D Gaussian kernel.
+
+
+ Kernel size (should be odd), [3, 101].
+
+ Returns 2-D Gaussian kernel of specified size.
+
+ The function calculates 2-D Gaussian kernel, which is array
+ of Gaussian function's values in the [-r, r] range of x,y values, where
+ r=floor(/2).
+
+
+ Wrong kernel size.
+
+
+
+
+ Sigma value.
+
+
+ Sigma property of Gaussian function.
+
+ Default value is set to 1. Minimum allowed value is 0.00000001.
+
+
+
+
+
+ Fourier transformation.
+
+
+ The class implements one dimensional and two dimensional
+ Discrete and Fast Fourier Transformation.
+
+
+
+
+ One dimensional Discrete Fourier Transform.
+
+
+ Data to transform.
+ Transformation direction.
+
+
+
+
+ Two dimensional Discrete Fourier Transform.
+
+
+ Data to transform.
+ Transformation direction.
+
+
+
+
+ One dimensional Fast Fourier Transform.
+
+
+ Data to transform.
+ Transformation direction.
+
+ The method accepts array of 2n size
+ only, where n may vary in the [1, 14] range.
+
+ Incorrect data length.
+
+
+
+
+ Two dimensional Fast Fourier Transform.
+
+
+ Data to transform.
+ Transformation direction.
+
+ The method accepts array of 2n size
+ only in each dimension, where n may vary in the [1, 14] range. For example, 16x16 array
+ is valid, but 15x15 is not.
+
+ Incorrect data length.
+
+
+
+
+ Fourier transformation direction.
+
+
+
+
+ Forward direction of Fourier transformation.
+
+
+
+
+ Backward direction of Fourier transformation.
+
+
+
+
+ The class encapsulates 2D line and provides some tool methods related to lines.
+
+
+ The class provides some methods which are related to lines:
+ angle between lines, distance to point, finding intersection point, etc.
+
+
+ Generally, the equation of the line is y = * x +
+ . However, when is an Infinity,
+ would normally be meaningless, and it would be
+ impossible to distinguish the line x = 5 from the line x = -5. Therefore,
+ if is or
+ , the line's equation is instead
+ x = .
+
+ Sample usage:
+
+ // create a line
+ Line line = Line.FromPoints( new Point( 0, 0 ), new Point( 3, 4 ) );
+ // check if it is vertical or horizontal
+ if ( line.IsVertical || line.IsHorizontal )
+ {
+ // ...
+ }
+
+ // get intersection point with another line
+ Point intersection = line.GetIntersectionWith(
+ Line.FromPoints( new Point( 3, 0 ), new Point( 0, 4 ) ) );
+
+
+
+
+
+
+ Creates a that goes through the two specified points.
+
+
+ One point on the line.
+ Another point on the line.
+
+ Returns a representing the line between
+ and .
+
+ Thrown if the two points are the same.
+
+
+
+
+ Creates a with the specified slope and intercept.
+
+
+ The slope of the line
+ The Y-intercept of the line, unless the slope is an
+ infinity, in which case the line's equation is "x = intercept" instead.
+
+ Returns a representing the specified line.
+
+ The construction here follows the same rules as for the rest of this class.
+ Most lines are expressed as y = slope * x + intercept. Vertical lines, however, are
+ x = intercept. This is indicated by being true or by
+ returning or
+ .
+
+
+
+
+ Constructs a from a radius and an angle (in degrees).
+
+
+ The minimum distance from the line to the origin.
+ The angle of the vector from the origin to the line.
+
+ Returns a representing the specified line.
+
+ is the minimum distance from the origin
+ to the line, and is the counterclockwise rotation from
+ the positive X axis to the vector through the origin and normal to the line.
+ This means that if is in [0,180), the point on the line
+ closest to the origin is on the positive X or Y axes, or in quadrants I or II. Likewise,
+ if is in [180,360), the point on the line closest to the
+ origin is on the negative X or Y axes, or in quadrants III or IV.
+
+ Thrown if radius is negative.
+
+
+
+
+ Constructs a from a point and an angle (in degrees).
+
+
+ The minimum distance from the line to the origin.
+ The angle of the normal vector from the origin to the line.
+
+ is the counterclockwise rotation from
+ the positive X axis to the vector through the origin and normal to the line.
+ This means that if is in [0,180), the point on the line
+ closest to the origin is on the positive X or Y axes, or in quadrants I or II. Likewise,
+ if is in [180,360), the point on the line closest to the
+ origin is on the negative X or Y axes, or in quadrants III or IV.
+
+ Returns a representing the specified line.
+
+
+
+
+ Calculate minimum angle between this line and the specified line measured in [0, 90] degrees range.
+
+
+ The line to find angle between.
+
+ Returns minimum angle between lines.
+
+
+
+
+ Finds intersection point with the specified line.
+
+
+ Line to find intersection with.
+
+ Returns intersection point with the specified line, or
+ if the lines are parallel and distinct.
+
+ Thrown if the specified line is the same line as this line.
+
+
+
+
+ Finds, provided it exists, the intersection point with the specified .
+
+
+ to find intersection with.
+
+ Returns intersection point with the specified , or ,
+ if this line does not intersect with the segment.
+
+ If the line and segment do not intersect, the method returns .
+ If the line and segment share multiple points, the method throws an .
+
+
+ Thrown if is a portion
+ of this line.
+
+
+
+
+ Calculate Euclidean distance between a point and a line.
+
+
+ The point to calculate distance to.
+
+ Returns the Euclidean distance between this line and the specified point. Unlike
+ , this returns the distance from the infinite line. (0,0) is 0 units
+ from the line defined by (0,5) and (0,8), but is 5 units from the segment with those endpoints.
+
+
+
+
+ Equality operator - checks if two lines have equal parameters.
+
+
+ First line to check.
+ Second line to check.
+
+ Returns if parameters of specified
+ lines are equal.
+
+
+
+
+ Inequality operator - checks if two lines have different parameters.
+
+
+ First line to check.
+ Second line to check.
+
+ Returns if parameters of specified
+ lines are not equal.
+
+
+
+
+ Check if this instance of equals to the specified one.
+
+
+ Another line to check equalty to.
+
+ Return if objects are equal.
+
+
+
+
+ Get hash code for this instance.
+
+
+ Returns the hash code for this instance.
+
+
+
+
+ Get string representation of the class.
+
+
+ Returns string, which contains values of the like in readable form.
+
+
+
+
+ Checks if the line vertical or not.
+
+
+
+
+
+ Checks if the line horizontal or not.
+
+
+
+
+ Gets the slope of the line.
+
+
+
+
+ If not , gets the Line's Y-intercept.
+ If gets the line's X-intercept.
+
+
+
+
+ Jaccard distance metric.
+
+
+ This class represents the
+ Jaccard distance metric.
+
+ Sample usage:
+
+ // instantiate new distance class
+ JaccardDistance dist = new JaccardDistance( );
+ // create two vectors for inputs
+ double[] p = new double[] { 2.5, 3.5, 3.0, 3.5, 2.5, 3.0 };
+ double[] q = new double[] { 3.0, 3.5, 1.5, 5.0, 3.5, 3.0 };
+ // get distance between the two vectors
+ double distance = dist.GetDistance( p, q );
+
+
+
+
+
+
+ Returns distance between two N-dimensional double vectors.
+
+
+ 1st point vector.
+ 2nd point vector.
+
+ Returns Jaccard distance between two supplied vectors.
+
+ Thrown if the two vectors are of different dimensions (if specified
+ array have different length).
+
+
+
+
+ Collection of some gemetry tool methods.
+
+
+
+
+
+ Calculate angle between to vectors measured in [0, 180] degrees range.
+
+
+ Starting point of both vectors.
+ Ending point of the first vector.
+ Ending point of the second vector.
+
+ Returns angle between specified vectors measured in degrees.
+
+
+
+
+ Calculate minimum angle between two lines measured in [0, 90] degrees range.
+
+
+ A point on the first line.
+ Another point on the first line.
+ A point on the second line.
+ Another point on the second line.
+
+ Returns minimum angle between two lines.
+
+ It is preferred to use if it is required to calculate angle
+ multiple times for one of the lines.
+
+ and are the same,
+ -OR- and are the same.
+
+
+
+
+ Shape optimizer, which merges points within close distance to each other.
+
+
+ This shape optimizing algorithm checks all points of a shape
+ and merges any two points which are within specified distance
+ to each other. Two close points are replaced by a single point, which has
+ mean coordinates of the removed points.
+
+ Because of the fact that the algorithm performs points merging
+ while it goes through a shape, it may merge several points (more than 2) into a
+ single point, where distance between extreme points may be bigger
+ than the specified limit. For example, suppose
+ a case with 3 points, where 1st and 2nd points are close enough to be merged, but the
+ 3rd point is a little bit further. During merging of 1st and 2nd points, it may
+ happen that the new point with mean coordinates will get closer to the 3rd point,
+ so they will be merged also on next iteration of the algorithm.
+
+
+ For example, the below circle shape comprised of 65 points, can be optimized to 8 points
+ by setting to 28.
+
+
+
+
+
+
+
+ Interface for shape optimizing algorithms.
+
+
+ The interface defines set of methods, which should be implemented
+ by shape optimizing algorithms. These algorithms take input shape, which is defined
+ by a set of points (corners of convex hull, etc.), and remove some insignificant points from it,
+ which has little influence on the final shape's look.
+
+ The shape optimizing algorithms can be useful in conjunction with such algorithms
+ like convex hull searching, which usually may provide many hull points, where some
+ of them are insignificant and could be removed.
+
+ For additional details about shape optimizing algorithms, documentation of
+ particular algorithm should be studied.
+
+
+
+
+
+ Optimize specified shape.
+
+
+ Shape to be optimized.
+
+ Returns final optimized shape, which may have reduced amount of points.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Maximum allowed distance between points, which are
+ merged during optimization (see ).
+
+
+
+
+ Optimize specified shape.
+
+
+ Shape to be optimized.
+
+ Returns final optimized shape, which may have reduced amount of points.
+
+
+
+
+ Maximum allowed distance between points, which are merged during optimization, [0, ∞).
+
+
+ The property sets maximum allowed distance between two points of
+ a shape, which are replaced by single point with mean coordinates.
+
+ Default value is set to 10.
+
+
+
+
+ Standard random numbers generator.
+
+
+ The random number generator generates gaussian
+ random numbers with zero mean and standard deviation of one. The generator
+ implements polar form of the Box-Muller transformation.
+
+ The generator uses generator as a base
+ to generate random numbers.
+
+ Sample usage:
+
+ // create instance of random generator
+ IRandomNumberGenerator generator = new StandardGenerator( );
+ // generate random number
+ float randomNumber = generator.Next( );
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Seed value to initialize random numbers generator.
+
+
+
+
+ Generate next random number.
+
+
+ Returns next random number.
+
+
+
+
+ Set seed of the random numbers generator.
+
+
+ Seed value.
+
+ Resets random numbers generator initializing it with
+ specified seed value.
+
+
+
+
+ Mean value of the generator.
+
+
+
+
+
+ Variance value of the generator.
+
+
+
+
+
+ 3D pose estimation algorithm (coplanar case).
+
+
+ The class implements an algorithm for 3D object's pose estimation from it's
+ 2D coordinates obtained by perspective projection, when the object is described coplanar points.
+ The idea of the implemented math and algorithm is described in "Iterative Pose Estimation using
+ Coplanar Feature Points" paper written by Oberkampf, Daniel DeMenthon and Larry Davis
+ (the implementation of the algorithm is very close translation of the pseudo code given by the
+ paper, so should be easy to follow).
+
+ At this point the implementation works only with models described by 4 points, which is
+ the minimum number of points enough for 3D pose estimation.
+
+ The 4 model's point are supposed to be coplanar, i.e. supposed to reside all within
+ same planer. See for none coplanar case.
+
+ Read 3D Pose Estimation article for
+ additional information and samples.
+
+ Sample usage:
+
+ // points of real object - model
+ Vector3[] copositObject = new Vector3[4]
+ {
+ new Vector3( -56.5f, 0, 56.5f ),
+ new Vector3( 56.5f, 0, 56.5f ),
+ new Vector3( 56.5f, 0, -56.5f ),
+ new Vector3( -56.5f, 0, -56.5f ),
+ };
+ // focal length of camera used to capture the object
+ float focalLength = 640; // depends on your camera or projection system
+ // initialize CoPOSIT object
+ CoplanarPosit coposit = new CoplanarPosit( copositObject, focalLength );
+
+ // 2D points of te object - projection
+ AForge.Point[] projectedPoints = new AForge.Point[4]
+ {
+ new AForge.Point( -77, 48 ),
+ new AForge.Point( 44, 66 ),
+ new AForge.Point( 75, -36 ),
+ new AForge.Point( -61, -58 ),
+ };
+ // estimate pose
+ Matrix3x3 rotationMatrix;
+ Vector3 translationVector;
+ coposit.EstimatePose( projectedPoints,
+ out rotationMatrix, out translationVector );
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Array of vectors containing coordinates of four real model's point.
+ Effective focal length of the camera used to capture the model.
+
+ The model must have 4 points.
+
+
+
+
+ Estimate pose of a model from it's projected 2D coordinates.
+
+
+ 4 2D points of the model's projection.
+ Gets best estimation of object's rotation.
+ Gets best estimation of object's translation.
+
+ 4 points must be be given for pose estimation.
+
+ Because of the Coplanar POSIT algorithm's nature, it provides two pose estimations,
+ which are valid from the algorithm's math point of view. For each pose an error is calculated,
+ which specifies how good estimation fits to the specified real 2D coordinated. The method
+ provides the best estimation through its output parameters and
+ . This may be enough for many of the pose estimation application.
+ For those, who require checking the alternate pose estimation, it can be obtained using
+ and properties.
+ The calculated error is provided for both estimations through and
+ properties.
+
+
+
+
+
+ Best estimated pose recently found.
+
+
+ The property keeps best estimated pose found by the latest call to .
+ The same estimated pose is provided by that method also and can be accessed through this property
+ for convenience.
+
+ See also and .
+
+
+
+
+
+ Best estimated translation recently found.
+
+
+ The property keeps best estimated translation found by the latest call to .
+ The same estimated translation is provided by that method also and can be accessed through this property
+ for convenience.
+
+ See also and .
+
+
+
+
+
+ Error of the best pose estimation.
+
+
+ The property keeps error of the best pose estimation, which is calculated as average
+ error between real angles of the specified quadrilateral and angles of the quadrilateral which
+ is a projection of the best pose estimation. The error is measured degrees in (angle).
+
+
+
+
+
+ Alternate estimated pose recently found.
+
+
+ The property keeps alternate estimated pose found by the latest call to .
+
+ See also and .
+
+
+
+
+
+ Alternated estimated translation recently found.
+
+
+ The property keeps alternate estimated translation found by the latest call to .
+
+ See also and .
+
+
+
+
+
+ Error of the alternate pose estimation.
+
+
+ The property keeps error of the alternate pose estimation, which is calculated as average
+ error between real angles of the specified quadrilateral and angles of the quadrilateral which
+ is a projection of the alternate pose estimation. The error is measured in degrees (angle).
+
+
+
+
+
+ Coordinates of the model points which pose should be estimated.
+
+
+
+
+ Effective focal length of the camera used to capture the model.
+
+
+
+
+ Pearson correlation metric.
+
+
+ This class represents the
+ Pearson correlation metric.
+
+ Sample usage:
+
+ // instantiate new pearson correlation class
+ PearsonCorrelation cor = new PearsonCorrelation( );
+ // create two vectors for inputs
+ double[] p = new double[] { 2.5, 3.5, 3.0, 3.5, 2.5, 3.0 };
+ double[] q = new double[] { 3.0, 3.5, 1.5, 5.0, 3.5, 3.0 };
+ // get correlation between the two vectors
+ double correlation = cor.GetSimilarityScore( p, q );
+
+
+
+
+
+
+ Interface for similarity algorithms.
+
+
+ The interface defines a set of methods implemented
+ by similarity and correlation algorithms. These algorithms typically take a set of points and return a
+ similarity score for the two vectors.
+
+ Similarity and correlation algorithms are used in many machine learning and collaborative
+ filtering algorithms.
+
+ For additional details about similarity metrics, documentation of the
+ particular algorithms should be studied.
+
+
+
+
+
+ Returns similarity score for two N-dimensional double vectors.
+
+
+ 1st point vector.
+ 2nd point vector.
+
+ Returns similarity score determined by the given algorithm.
+
+
+
+
+ Returns the pearson correlation for two N-dimensional double vectors.
+
+
+ 1st point vector.
+ 2nd point vector.
+
+ Returns Pearson correlation between two supplied vectors.
+
+ Thrown if the two vectors are of different dimensions (if specified
+ array have different length).
+
+
+
+
+ A class for checking simple geometrical shapes.
+
+
+ The class performs checking/detection of some simple geometrical
+ shapes for provided set of points (shape's edge points). During the check
+ the class goes through the list of all provided points and checks how accurately
+ they fit into assumed shape.
+
+ All the shape checks allow some deviation of
+ points from the shape with assumed parameters. In other words it is allowed
+ that specified set of points may form a little bit distorted shape, which may be
+ still recognized. The allowed amount of distortion is controlled by two
+ properties ( and ),
+ which allow higher distortion level for bigger shapes and smaller amount of
+ distortion for smaller shapes. Checking specified set of points, the class
+ calculates mean distance between specified set of points and edge of the assumed
+ shape. If the mean distance is equal to or less than maximum allowed distance,
+ then a shape is recognized. The maximum allowed distance is calculated as:
+
+ maxDistance = max( minAcceptableDistortion, relativeDistortionLimit * ( width + height ) / 2 )
+
+ , where width and height is the size of bounding rectangle for the
+ specified points.
+
+
+ See also and properties,
+ which set acceptable errors for polygon sub type checking done by
+ method.
+
+ See the next article for details about the implemented algorithms:
+ Detecting some simple shapes in images.
+
+
+ Sample usage:
+
+ private List<IntPoint> idealCicle = new List<IntPoint>( );
+ private List<IntPoint> distorredCircle = new List<IntPoint>( );
+ System.Random rand = new System.Random( );
+
+ // generate sample circles
+ float radius = 100;
+
+ for ( int i = 0; i < 360; i += 10 )
+ {
+ float angle = (float) ( (float) i / 180 * System.Math.PI );
+
+ // add point to ideal circle
+ idealCicle.Add( new IntPoint(
+ (int) ( radius * System.Math.Cos( angle ) ),
+ (int) ( radius * System.Math.Sin( angle ) ) ) );
+
+ // add a bit distortion for distorred cirlce
+ float distorredRadius = radius + rand.Next( 7 ) - 3;
+
+ distorredCircle.Add( new IntPoint(
+ (int) ( distorredRadius * System.Math.Cos( angle ) ),
+ (int) ( distorredRadius * System.Math.Sin( angle ) ) ) );
+ }
+
+ // check shape
+ SimpleShapeChecker shapeChecker = new SimpleShapeChecker( );
+
+ if ( shapeChecker.IsCircle( idealCicle ) )
+ {
+ // ...
+ }
+
+ if ( shapeChecker.CheckShapeType( distorredCircle ) == ShapeType.Circle )
+ {
+ // ...
+ }
+
+
+
+
+
+
+ Check type of the shape formed by specified points.
+
+
+ Shape's points to check.
+
+ Returns type of the detected shape.
+
+
+
+
+ Check if the specified set of points form a circle shape.
+
+
+ Shape's points to check.
+
+ Returns if the specified set of points form a
+ circle shape or otherwise.
+
+ Circle shape must contain at least 8 points to be recognized.
+ The method returns always, of number of points in the specified
+ shape is less than 8.
+
+
+
+
+ Check if the specified set of points form a circle shape.
+
+
+ Shape's points to check.
+ Receives circle's center on successful return.
+ Receives circle's radius on successful return.
+
+ Returns if the specified set of points form a
+ circle shape or otherwise.
+
+ Circle shape must contain at least 8 points to be recognized.
+ The method returns always, of number of points in the specified
+ shape is less than 8.
+
+
+
+
+ Check if the specified set of points form a quadrilateral shape.
+
+
+ Shape's points to check.
+
+ Returns if the specified set of points form a
+ quadrilateral shape or otherwise.
+
+
+
+
+ Check if the specified set of points form a quadrilateral shape.
+
+
+ Shape's points to check.
+ List of quadrilateral corners on successful return.
+
+ Returns if the specified set of points form a
+ quadrilateral shape or otherwise.
+
+
+
+
+ Check if the specified set of points form a triangle shape.
+
+
+ Shape's points to check.
+
+ Returns if the specified set of points form a
+ triangle shape or otherwise.
+
+
+
+
+ Check if the specified set of points form a triangle shape.
+
+
+ Shape's points to check.
+ List of triangle corners on successful return.
+
+ Returns if the specified set of points form a
+ triangle shape or otherwise.
+
+
+
+
+ Check if the specified set of points form a convex polygon shape.
+
+
+ Shape's points to check.
+ List of polygon corners on successful return.
+
+ Returns if the specified set of points form a
+ convex polygon shape or otherwise.
+
+ The method is able to detect only triangles and quadrilaterals
+ for now. Check number of detected corners to resolve type of the detected polygon.
+
+
+
+
+
+ Check sub type of a convex polygon.
+
+
+ Corners of the convex polygon to check.
+
+ Return detected sub type of the specified shape.
+
+ The method check corners of a convex polygon detecting
+ its subtype. Polygon's corners are usually retrieved using
+ method, but can be any list of 3-4 points (only sub types of triangles and
+ quadrilateral are checked).
+
+ See and properties,
+ which set acceptable errors for polygon sub type checking.
+
+
+
+
+
+ Check if a shape specified by the set of points fits a convex polygon
+ specified by the set of corners.
+
+
+ Shape's points to check.
+ Corners of convex polygon to check fitting into.
+
+ Returns if the specified shape fits
+ the specified convex polygon or otherwise.
+
+ The method checks if the set of specified points form the same shape
+ as the set of provided corners.
+
+
+
+
+ Minimum value of allowed shapes' distortion.
+
+
+ The property sets minimum value for allowed shapes'
+ distortion (in pixels). See documentation to
+ class for more details about this property.
+
+ Default value is set to 0.5.
+
+
+
+
+
+ Maximum value of allowed shapes' distortion, [0, 1].
+
+
+ The property sets maximum value for allowed shapes'
+ distortion. The value is measured in [0, 1] range, which corresponds
+ to [0%, 100%] range, which means that maximum allowed shapes'
+ distortion is calculated relatively to shape's size. This results to
+ higher allowed distortion level for bigger shapes and smaller allowed
+ distortion for smaller shapers. See documentation to
+ class for more details about this property.
+
+ Default value is set to 0.03 (3%).
+
+
+
+
+
+ Maximum allowed angle error in degrees, [0, 20].
+
+
+ The value sets maximum allowed difference between two angles to
+ treat them as equal. It is used by method to
+ check for parallel lines and angles of triangles and quadrilaterals.
+ For example, if angle between two lines equals 5 degrees and this properties value
+ is set to 7, then two compared lines are treated as parallel.
+
+ Default value is set to 7.
+
+
+
+
+
+ Maximum allowed difference in sides' length (relative to shapes' size), [0, 1].
+
+
+ The values sets maximum allowed difference between two sides' length
+ to treat them as equal. The error value is set relative to shapes size and measured
+ in [0, 1] range, which corresponds to [0%, 100%] range. Absolute length error in pixels
+ is calculated as:
+
+ LengthError * ( width + height ) / 2
+
+ , where width and height is the size of bounding rectangle for the
+ specified shape.
+
+
+ Default value is set to 0.1 (10%).
+
+
+
+
+
+ Graham scan algorithm for finding convex hull.
+
+
+ The class implements
+ Graham scan algorithm for finding convex hull
+ of a given set of points.
+
+ Sample usage:
+
+ // generate some random points
+ Random rand = new Random( );
+ List<IntPoint> points = new List<IntPoint>( );
+
+ for ( int i = 0; i < 10; i++ )
+ {
+ points.Add( new IntPoint(
+ rand.Next( 200 ) - 100,
+ rand.Next( 200 ) - 100 ) );
+ }
+
+ // find the convex hull
+ IConvexHullAlgorithm hullFinder = new GrahamConvexHull( );
+ List<IntPoint> hull = hullFinder.FindHull( points );
+
+
+
+
+
+
+ Interface defining methods for algorithms, which search for convex hull of the specified points' set.
+
+
+ The interface defines a method, which should be implemented by different classes
+ performing convex hull search for specified set of points.
+
+ All algorithms, implementing this interface, should follow two rules for the found convex hull:
+
+ - the first point in the returned list is the point with lowest X coordinate (and with lowest Y if
+ there are several points with the same X value);
+ - points in the returned list are given in counter clockwise order
+ (Cartesian
+ coordinate system).
+
+
+
+
+
+
+
+ Find convex hull for the given set of points.
+
+
+ Set of points to search convex hull for.
+
+ Returns set of points, which form a convex hull for the given .
+
+
+
+
+ Find convex hull for the given set of points.
+
+
+ Set of points to search convex hull for.
+
+ Returns set of points, which form a convex hull for the given .
+ The first point in the list is the point with lowest X coordinate (and with lowest Y if there are
+ several points with the same X value). Points are provided in counter clockwise order
+ (Cartesian
+ coordinate system).
+
+
+
+
+ Euclidean distance metric.
+
+
+ This class represents the
+ Euclidean distance metric.
+
+ Sample usage:
+
+ // instantiate new distance class
+ EuclideanDistance dist = new EuclideanDistance( );
+ // create two vectors for inputs
+ double[] p = new double[] { 2.5, 3.5, 3.0, 3.5, 2.5, 3.0 };
+ double[] q = new double[] { 3.0, 3.5, 1.5, 5.0, 3.5, 3.0 };
+ // get distance between the two vectors
+ double distance = dist.GetDistance( p, q );
+
+
+
+
+
+
+ Returns distance between two N-dimensional double vectors.
+
+
+ 1st point vector.
+ 2nd point vector.
+
+ Returns Euclidean distance between two supplied vectors.
+
+ Thrown if the two vectors are of different dimensions (if specified
+ array have different length).
+
+
+
+
+ Shape optimizer, which removes points within close range to shapes' body.
+
+
+ This shape optimizing algorithm checks all points of the shape and
+ removes those of them, which are in a certain distance to a line connecting previous and
+ the next points. In other words, it goes through all adjacent edges of a shape and checks
+ what is the distance between the corner formed by these two edges and a possible edge, which
+ could be used as substitution of these edges. If the distance is equal or smaller than
+ the specified value, then the point is removed,
+ so the two edges are substituted by a single one. When optimization process is done,
+ the new shape has reduced amount of points and none of the removed points are further away
+ from the new shape than the specified limit.
+
+ The shape optimizer does not optimize shapes to less than 3 points, so optimized
+ shape always will have at least 3 points.
+
+
+ For example, the below circle shape comprised of 65 points, can be optimized to 8 points
+ by setting to 10.
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Maximum allowed distance between removed points
+ and optimized shape (see ).
+
+
+
+
+ Optimize specified shape.
+
+
+ Shape to be optimized.
+
+ Returns final optimized shape, which may have reduced amount of points.
+
+
+
+
+ Maximum allowed distance between removed points and optimized shape, [0, ∞).
+
+
+ The property sets maximum allowed distance between points removed from original
+ shape and optimized shape - none of the removed points are further away
+ from the new shape than the specified limit.
+
+
+ Default value is set to 5.
+
+
+
+
+ Shape optimizer, which removes obtuse angles (close to flat) from a shape.
+
+
+ This shape optimizing algorithm checks all adjacent edges of a shape
+ and substitutes any 2 edges with a single edge if angle between them is greater than
+ . The algorithm makes sure there are not obtuse angles in
+ a shape, which are very close to flat line.
+
+ The shape optimizer does not optimize shapes to less than 3 points, so optimized
+ shape always will have at least 3 points.
+
+
+ For example, the below circle shape comprised of 65 points, can be optimized to 10 points
+ by setting to 160.
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Maximum acceptable angle between two edges of a shape (see ).
+
+
+
+
+ Optimize specified shape.
+
+
+ Shape to be optimized.
+
+ Returns final optimized shape, which may have reduced amount of points.
+
+
+
+
+ Maximum angle between adjacent edges to keep in a shape, [140, 180].
+
+
+ The property sets maximum angle between adjacent edges, which is kept
+ during optimization. All edges, which have a greater angle between them, are substituted
+ by a single edge.
+
+ Default value is set to 160.
+
+
+
+
+ Uniform random numbers generator.
+
+
+ The random numbers generator generates uniformly
+ distributed numbers in the specified range - values
+ are greater or equal to minimum range's value and less than maximum range's
+ value.
+
+ The generator uses generator
+ to generate random numbers.
+
+ Sample usage:
+
+ // create instance of random generator
+ IRandomNumberGenerator generator = new UniformGenerator( new Range( 50, 100 ) );
+ // generate random number
+ float randomNumber = generator.Next( );
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Random numbers range.
+
+ Initializes random numbers generator with zero seed.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Random numbers range.
+ Seed value to initialize random numbers generator.
+
+
+
+
+ Generate next random number.
+
+
+ Returns next random number.
+
+
+
+
+ Set seed of the random numbers generator.
+
+
+ Seed value.
+
+ Resets random numbers generator initializing it with
+ specified seed value.
+
+
+
+
+ Mean value of the generator.
+
+
+
+
+
+ Variance value of the generator.
+
+
+
+
+
+ Random numbers range.
+
+
+ Range of random numbers to generate. Generated numbers are
+ greater or equal to minimum range's value and less than maximum range's
+ value.
+
+
+
+
+
+ Manhattan distance metric.
+
+
+ This class represents the
+ Manhattan distance metric
+ (aka City Block and Taxi Cab distance).
+
+ Sample usage:
+
+ // instantiate new distance class
+ ManhattanDistance dist = new ManhattanDistance( );
+ // create two vectors for inputs
+ double[] p = new double[] { 2.5, 3.5, 3.0, 3.5, 2.5, 3.0 };
+ double[] q = new double[] { 3.0, 3.5, 1.5, 5.0, 3.5, 3.0 };
+ // get distance between the two vectors
+ double distance = dist.GetDistance( p, q );
+
+
+
+
+
+
+ Returns distance between two N-dimensional double vectors.
+
+
+ 1st point vector.
+ 2nd point vector.
+
+ Returns Manhattan distance between two supplied vectors.
+
+ Thrown if the two vectors are of different dimensions (if specified
+ array have different length).
+
+
+
+
+ 4D Vector structure with X, Y, Z and W coordinates.
+
+
+ The structure incapsulates X, Y, Z and W coordinates of a 4D vector and
+ provides some operations with it.
+
+
+
+
+ X coordinate of the vector.
+
+
+
+
+ Y coordinate of the vector.
+
+
+
+
+ Z coordinate of the vector.
+
+
+
+
+ W coordinate of the vector.
+
+
+
+
+ Initializes a new instance of the structure.
+
+
+ X coordinate of the vector.
+ Y coordinate of the vector.
+ Z coordinate of the vector.
+ W coordinate of the vector.
+
+
+
+
+ Initializes a new instance of the structure.
+
+
+ Value, which is set to all 4 coordinates of the vector.
+
+
+
+
+ Returns a string representation of this object.
+
+
+ A string representation of this object.
+
+
+
+
+ Returns array representation of the vector.
+
+
+ Array with 4 values containing X/Y/Z/W coordinates.
+
+
+
+
+ Adds corresponding coordinates of two vectors.
+
+
+ The vector to add to.
+ The vector to add to the first vector.
+
+ Returns a vector which coordinates are equal to sum of corresponding
+ coordinates of the two specified vectors.
+
+
+
+
+ Adds corresponding coordinates of two vectors.
+
+
+ The vector to add to.
+ The vector to add to the first vector.
+
+ Returns a vector which coordinates are equal to sum of corresponding
+ coordinates of the two specified vectors.
+
+
+
+
+ Adds a value to all coordinates of the specified vector.
+
+
+ Vector to add the specified value to.
+ Value to add to all coordinates of the vector.
+
+ Returns new vector with all coordinates increased by the specified value.
+
+
+
+
+ Adds a value to all coordinates of the specified vector.
+
+
+ Vector to add the specified value to.
+ Value to add to all coordinates of the vector.
+
+ Returns new vector with all coordinates increased by the specified value.
+
+
+
+
+ Subtracts corresponding coordinates of two vectors.
+
+
+ The vector to subtract from.
+ The vector to subtract from the first vector.
+
+ Returns a vector which coordinates are equal to difference of corresponding
+ coordinates of the two specified vectors.
+
+
+
+
+ Subtracts corresponding coordinates of two vectors.
+
+
+ The vector to subtract from.
+ The vector to subtract from the first vector.
+
+ Returns a vector which coordinates are equal to difference of corresponding
+ coordinates of the two specified vectors.
+
+
+
+
+ Subtracts a value from all coordinates of the specified vector.
+
+
+ Vector to subtract the specified value from.
+ Value to subtract from all coordinates of the vector.
+
+ Returns new vector with all coordinates decreased by the specified value.
+
+
+
+
+ Subtracts a value from all coordinates of the specified vector.
+
+
+ Vector to subtract the specified value from.
+ Value to subtract from all coordinates of the vector.
+
+ Returns new vector with all coordinates decreased by the specified value.
+
+
+
+
+ Multiplies corresponding coordinates of two vectors.
+
+
+ The first vector to multiply.
+ The second vector to multiply.
+
+ Returns a vector which coordinates are equal to multiplication of corresponding
+ coordinates of the two specified vectors.
+
+
+
+
+ Multiplies corresponding coordinates of two vectors.
+
+
+ The first vector to multiply.
+ The second vector to multiply.
+
+ Returns a vector which coordinates are equal to multiplication of corresponding
+ coordinates of the two specified vectors.
+
+
+
+
+ Multiplies coordinates of the specified vector by the specified factor.
+
+
+ Vector to multiply coordinates of.
+ Factor to multiple coordinates of the specified vector by.
+
+ Returns new vector with all coordinates multiplied by the specified factor.
+
+
+
+
+ Multiplies coordinates of the specified vector by the specified factor.
+
+
+ Vector to multiply coordinates of.
+ Factor to multiple coordinates of the specified vector by.
+
+ Returns new vector with all coordinates multiplied by the specified factor.
+
+
+
+
+ Divides corresponding coordinates of two vectors.
+
+
+ The first vector to divide.
+ The second vector to devide.
+
+ Returns a vector which coordinates are equal to coordinates of the first vector divided by
+ corresponding coordinates of the second vector.
+
+
+
+
+ Divides corresponding coordinates of two vectors.
+
+
+ The first vector to divide.
+ The second vector to devide.
+
+ Returns a vector which coordinates are equal to coordinates of the first vector divided by
+ corresponding coordinates of the second vector.
+
+
+
+
+ Divides coordinates of the specified vector by the specified factor.
+
+
+ Vector to divide coordinates of.
+ Factor to divide coordinates of the specified vector by.
+
+ Returns new vector with all coordinates divided by the specified factor.
+
+
+
+
+ Divides coordinates of the specified vector by the specified factor.
+
+
+ Vector to divide coordinates of.
+ Factor to divide coordinates of the specified vector by.
+
+ Returns new vector with all coordinates divided by the specified factor.
+
+
+
+
+ Tests whether two specified vectors are equal.
+
+
+ The left-hand vector.
+ The right-hand vector.
+
+ Returns if the two vectors are equal or otherwise.
+
+
+
+
+ Tests whether two specified vectors are not equal.
+
+
+ The left-hand vector.
+ The right-hand vector.
+
+ Returns if the two vectors are not equal or otherwise.
+
+
+
+
+ Tests whether the vector equals to the specified one.
+
+
+ The vector to test equality with.
+
+ Returns if the two vectors are equal or otherwise.
+
+
+
+
+ Tests whether the vector equals to the specified object.
+
+
+ The object to test equality with.
+
+ Returns if the vector equals to the specified object or otherwise.
+
+
+
+
+ Returns the hashcode for this instance.
+
+
+ A 32-bit signed integer hash code.
+
+
+
+
+ Normalizes the vector by dividing it’s all coordinates with the vector's norm.
+
+
+ Returns the value of vectors’ norm before normalization.
+
+
+
+
+ Inverse the vector.
+
+
+ Returns a vector with all coordinates equal to 1.0 divided by the value of corresponding coordinate
+ in this vector (or equal to 0.0 if this vector has corresponding coordinate also set to 0.0).
+
+
+
+
+ Calculate absolute values of the vector.
+
+
+ Returns a vector with all coordinates equal to absolute values of this vector's coordinates.
+
+
+
+
+ Calculates dot product of two vectors.
+
+
+ First vector to use for dot product calculation.
+ Second vector to use for dot product calculation.
+
+ Returns dot product of the two specified vectors.
+
+
+
+
+ Converts the vector to a 3D vector.
+
+
+ Returns 3D vector which has X/Y/Z coordinates equal to X/Y/Z coordinates
+ of this vector divided by .
+
+
+
+
+ Returns maximum value of the vector.
+
+
+ Returns maximum value of all 4 vector's coordinates.
+
+
+
+
+ Returns minimum value of the vector.
+
+
+ Returns minimum value of all 4 vector's coordinates.
+
+
+
+
+ Returns index of the coordinate with maximum value.
+
+
+ Returns index of the coordinate, which has the maximum value - 0 for X,
+ 1 for Y, 2 for Z or 3 for W.
+
+ If there are multiple coordinates which have the same maximum value, the
+ property returns smallest index.
+
+
+
+
+
+ Returns index of the coordinate with minimum value.
+
+
+ Returns index of the coordinate, which has the minimum value - 0 for X,
+ 1 for Y, 2 for Z or 3 for W.
+
+ If there are multiple coordinates which have the same minimum value, the
+ property returns smallest index.
+
+
+
+
+
+ Returns vector's norm.
+
+
+ Returns Euclidean norm of the vector, which is a
+ square root of the sum: X2+Y2+Z2+W2.
+
+
+
+
+
+ Returns square of the vector's norm.
+
+
+ Return X2+Y2+Z2+W2, which is
+ a square of vector's norm or a dot product of this vector
+ with itself.
+
+
+
+
+ Uniform random numbers generator in the range of [0, 1).
+
+
+ The random number generator generates uniformly
+ distributed numbers in the range of [0, 1) - greater or equal to 0.0
+ and less than 1.0.
+
+ At this point the generator is based on the
+ internal .NET generator, but may be rewritten to
+ use faster generation algorithm.
+
+ Sample usage:
+
+ // create instance of random generator
+ IRandomNumberGenerator generator = new UniformOneGenerator( );
+ // generate random number
+ float randomNumber = generator.Next( );
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Initializes random numbers generator with zero seed.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Seed value to initialize random numbers generator.
+
+
+
+
+ Generate next random number.
+
+
+ Returns next random number.
+
+
+
+
+ Set seed of the random numbers generator.
+
+
+ Seed value.
+
+ Resets random numbers generator initializing it with
+ specified seed value.
+
+
+
+
+ Mean value of the generator.
+
+
+
+
+
+ Variance value of the generator.
+
+
+
+
+
+ Exponential random numbers generator.
+
+
+ The random number generator generates exponential
+ random numbers with specified rate value (lambda).
+
+ The generator uses generator as a base
+ to generate random numbers.
+
+ Sample usage:
+
+ // create instance of random generator
+ IRandomNumberGenerator generator = new ExponentialGenerator( 5 );
+ // generate random number
+ float randomNumber = generator.Next( );
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Rate value.
+
+ Rate value should be greater than zero.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Rate value (inverse mean).
+ Seed value to initialize random numbers generator.
+
+ Rate value should be greater than zero.
+
+
+
+
+ Generate next random number
+
+
+ Returns next random number.
+
+
+
+
+ Set seed of the random numbers generator.
+
+
+ Seed value.
+
+ Resets random numbers generator initializing it with
+ specified seed value.
+
+
+
+
+ Rate value (inverse mean).
+
+
+ The rate value should be positive and non zero.
+
+
+
+
+ Mean value of the generator.
+
+
+
+
+
+ Variance value of the generator.
+
+
+
+
+
+ A structure representing 4x4 matrix.
+
+
+ The structure incapsulates elements of a 4x4 matrix and
+ provides some operations with it.
+
+
+
+
+ Row 0 column 0 element of the matrix.
+
+
+
+
+ Row 0 column 1 element of the matrix.
+
+
+
+
+ Row 0 column 2 element of the matrix.
+
+
+
+
+ Row 0 column 3 element of the matrix.
+
+
+
+
+ Row 1 column 0 element of the matrix.
+
+
+
+
+ Row 1 column 1 element of the matrix.
+
+
+
+
+ Row 1 column 2 element of the matrix.
+
+
+
+
+ Row 1 column 3 element of the matrix.
+
+
+
+
+ Row 2 column 0 element of the matrix.
+
+
+
+
+ Row 2 column 1 element of the matrix.
+
+
+
+
+ Row 2 column 2 element of the matrix.
+
+
+
+
+ Row 2 column 3 element of the matrix.
+
+
+
+
+ Row 3 column 0 element of the matrix.
+
+
+
+
+ Row 3 column 1 element of the matrix.
+
+
+
+
+ Row 3 column 2 element of the matrix.
+
+
+
+
+ Row 3 column 3 element of the matrix.
+
+
+
+
+ Returns array representation of the matrix.
+
+
+ Returns array which contains all elements of the matrix in the row-major order.
+
+
+
+
+ Creates rotation matrix around Y axis.
+
+
+ Rotation angle around Y axis in radians.
+
+ Returns rotation matrix to rotate an object around Y axis.
+
+
+
+
+ Creates rotation matrix around X axis.
+
+
+ Rotation angle around X axis in radians.
+
+ Returns rotation matrix to rotate an object around X axis.
+
+
+
+
+ Creates rotation matrix around Z axis.
+
+
+ Rotation angle around Z axis in radians.
+
+ Returns rotation matrix to rotate an object around Z axis.
+
+
+
+
+ Creates rotation matrix to rotate an object around X, Y and Z axes.
+
+
+ Rotation angle around Y axis in radians.
+ Rotation angle around X axis in radians.
+ Rotation angle around Z axis in radians.
+
+ Returns rotation matrix to rotate an object around all 3 axes.
+
+
+ The routine assumes roll-pitch-yaw rotation order, when creating rotation
+ matrix, i.e. an object is first rotated around Z axis, then around X axis and finally around
+ Y axis.
+
+
+
+
+
+ Extract rotation angles from the rotation matrix.
+
+
+ Extracted rotation angle around Y axis in radians.
+ Extracted rotation angle around X axis in radians.
+ Extracted rotation angle around Z axis in radians.
+
+ The routine assumes roll-pitch-yaw rotation order when extracting rotation angle.
+ Using extracted angles with the should provide same rotation matrix.
+
+
+ The method assumes the provided matrix represent valid rotation matrix.
+
+ Sample usage:
+
+ // assume we have a rotation matrix created like this
+ float yaw = 10.0f / 180 * Math.PI;
+ float pitch = 30.0f / 180 * Math.PI;
+ float roll = 45.0f / 180 * Math.PI;
+
+ Matrix4x4 rotationMatrix = Matrix3x3.CreateFromYawPitchRoll( yaw, pitch, roll );
+ // ...
+
+ // now somewhere in the code you may want to get rotation
+ // angles back from a matrix assuming same rotation order
+ float extractedYaw;
+ float extractedPitch;
+ float extractedRoll;
+
+ rotation.ExtractYawPitchRoll( out extractedYaw, out extractedPitch, out extractedRoll );
+
+
+
+
+
+
+ Creates 4x4 tranformation matrix from 3x3 rotation matrix.
+
+
+ Source 3x3 rotation matrix.
+
+ Returns 4x4 rotation matrix.
+
+ The source 3x3 rotation matrix is copied into the top left corner of the result 4x4 matrix,
+ i.e. it represents 0th, 1st and 2nd row/column. The element is set to 1 and the rest
+ elements of 3rd row and 3rd column are set to zeros.
+
+
+
+
+ Creates translation matrix for the specified movement amount.
+
+
+ Vector which set direction and amount of movement.
+
+ Returns translation matrix.
+
+ The specified vector is copied to the 3rd column of the result matrix.
+ All diagonal elements are set to 1. The rest of matrix is initialized with zeros.
+
+
+
+
+ Creates a view matrix for the specified camera position and target point.
+
+
+ Position of camera.
+ Target point towards which camera is pointing.
+
+ Returns a view matrix.
+
+ Camera's "up" vector is supposed to be (0, 1, 0).
+
+
+
+
+ Creates a perspective projection matrix.
+
+
+ Width of the view volume at the near view plane.
+ Height of the view volume at the near view plane.
+ Distance to the near view plane.
+ Distance to the far view plane.
+
+ Return a perspective projection matrix.
+
+ Both near and far view planes' distances must be greater than zero.
+ Near plane must be closer than the far plane.
+
+
+
+
+ Creates a matrix from 4 rows specified as vectors.
+
+
+ First row of the matrix to create.
+ Second row of the matrix to create.
+ Third row of the matrix to create.
+ Fourth row of the matrix to create.
+
+ Returns a matrix from specified rows.
+
+
+
+
+ Creates a matrix from 4 columns specified as vectors.
+
+
+ First column of the matrix to create.
+ Second column of the matrix to create.
+ Third column of the matrix to create.
+ Fourth column of the matrix to create.
+
+ Returns a matrix from specified columns.
+
+
+
+
+ Creates a diagonal matrix using the specified vector as diagonal elements.
+
+
+ Vector to use for diagonal elements of the matrix.
+
+ Returns a diagonal matrix.
+
+
+
+
+ Get row of the matrix.
+
+
+ Row index to get, [0, 3].
+
+ Returns specified row of the matrix as a vector.
+
+ Invalid row index was specified.
+
+
+
+
+ Get column of the matrix.
+
+
+ Column index to get, [0, 3].
+
+ Returns specified column of the matrix as a vector.
+
+ Invalid column index was specified.
+
+
+
+
+ Multiplies two specified matrices.
+
+
+ Matrix to multiply.
+ Matrix to multiply by.
+
+ Return new matrix, which the result of multiplication of the two specified matrices.
+
+
+
+
+ Multiplies two specified matrices.
+
+
+ Matrix to multiply.
+ Matrix to multiply by.
+
+ Return new matrix, which the result of multiplication of the two specified matrices.
+
+
+
+
+ Adds corresponding components of two matrices.
+
+
+ The matrix to add to.
+ The matrix to add to the first matrix.
+
+ Returns a matrix which components are equal to sum of corresponding
+ components of the two specified matrices.
+
+
+
+
+ Adds corresponding components of two matrices.
+
+
+ The matrix to add to.
+ The matrix to add to the first matrix.
+
+ Returns a matrix which components are equal to sum of corresponding
+ components of the two specified matrices.
+
+
+
+
+ Subtracts corresponding components of two matrices.
+
+
+ The matrix to subtract from.
+ The matrix to subtract from the first matrix.
+
+ Returns a matrix which components are equal to difference of corresponding
+ components of the two specified matrices.
+
+
+
+
+ Subtracts corresponding components of two matrices.
+
+
+ The matrix to subtract from.
+ The matrix to subtract from the first matrix.
+
+ Returns a matrix which components are equal to difference of corresponding
+ components of the two specified matrices.
+
+
+
+
+ Multiplies specified matrix by the specified vector.
+
+
+ Matrix to multiply by vector.
+ Vector to multiply matrix by.
+
+ Returns new vector which is the result of multiplication of the specified matrix
+ by the specified vector.
+
+
+
+
+ Multiplies specified matrix by the specified vector.
+
+
+ Matrix to multiply by vector.
+ Vector to multiply matrix by.
+
+ Returns new vector which is the result of multiplication of the specified matrix
+ by the specified vector.
+
+
+
+
+ Tests whether two specified matrices are equal.
+
+
+ The left-hand matrix.
+ The right-hand matrix.
+
+ Returns if the two matrices are equal or otherwise.
+
+
+
+
+ Tests whether two specified matrices are not equal.
+
+
+ The left-hand matrix.
+ The right-hand matrix.
+
+ Returns if the two matrices are not equal or otherwise.
+
+
+
+
+ Tests whether the matrix equals to the specified one.
+
+
+ The matrix to test equality with.
+
+ Returns if the two matrices are equal or otherwise.
+
+
+
+
+ Tests whether the matrix equals to the specified object.
+
+
+ The object to test equality with.
+
+ Returns if the matrix equals to the specified object or otherwise.
+
+
+
+
+ Returns the hashcode for this instance.
+
+
+ A 32-bit signed integer hash code.
+
+
+
+
+ Provides an identity matrix with all diagonal elements set to 1.
+
+
+
+
+ Enumeration of some basic shape types.
+
+
+
+
+ Unknown shape type.
+
+
+
+
+ Circle shape.
+
+
+
+
+ Triangle shape.
+
+
+
+
+ Quadrilateral shape.
+
+
+
+
+ Some common sub types of some basic shapes.
+
+
+
+
+ Unrecognized sub type of a shape (generic shape which does not have
+ any specific sub type).
+
+
+
+
+ Quadrilateral with one pair of parallel sides.
+
+
+
+
+ Quadrilateral with two pairs of parallel sides.
+
+
+
+
+ Parallelogram with perpendicular adjacent sides.
+
+
+
+
+ Parallelogram with all sides equal.
+
+
+
+
+ Rectangle with all sides equal.
+
+
+
+
+ Triangle with all sides/angles equal.
+
+
+
+
+ Triangle with two sides/angles equal.
+
+
+
+
+ Triangle with a 90 degrees angle.
+
+
+
+
+ Triangle with a 90 degrees angle and other two angles are equal.
+
+
+
+
+ Set of tools for processing collection of points in 2D space.
+
+
+ The static class contains set of routines, which provide different
+ operations with collection of points in 2D space. For example, finding the
+ furthest point from a specified point or line.
+
+ Sample usage:
+
+ // create points' list
+ List<IntPoint> points = new List<IntPoint>( );
+ points.Add( new IntPoint( 10, 10 ) );
+ points.Add( new IntPoint( 20, 15 ) );
+ points.Add( new IntPoint( 15, 30 ) );
+ points.Add( new IntPoint( 40, 12 ) );
+ points.Add( new IntPoint( 30, 20 ) );
+ // get furthest point from the specified point
+ IntPoint p1 = PointsCloud.GetFurthestPoint( points, new IntPoint( 15, 15 ) );
+ Console.WriteLine( p1.X + ", " + p1.Y );
+ // get furthest point from line
+ IntPoint p2 = PointsCloud.GetFurthestPointFromLine( points,
+ new IntPoint( 50, 0 ), new IntPoint( 0, 50 ) );
+ Console.WriteLine( p2.X + ", " + p2.Y );
+
+
+
+
+
+
+ Shift cloud by adding specified value to all points in the collection.
+
+
+ Collection of points to shift their coordinates.
+ Point to shift by.
+
+
+
+
+ Get bounding rectangle of the specified list of points.
+
+
+ Collection of points to get bounding rectangle for.
+ Point comprised of smallest X and Y coordinates.
+ Point comprised of biggest X and Y coordinates.
+
+
+
+
+ Get center of gravity for the specified list of points.
+
+
+ List of points to calculate center of gravity for.
+
+ Returns center of gravity (mean X-Y values) for the specified list of points.
+
+
+
+
+ Find furthest point from the specified point.
+
+
+ Collection of points to search furthest point in.
+ The point to search furthest point from.
+
+ Returns a point, which is the furthest away from the .
+
+
+
+
+ Find two furthest points from the specified line.
+
+
+ Collection of points to search furthest points in.
+ First point forming the line.
+ Second point forming the line.
+ First found furthest point.
+ Second found furthest point (which is on the
+ opposite side from the line compared to the );
+
+ The method finds two furthest points from the specified line,
+ where one point is on one side from the line and the second point is on
+ another side from the line.
+
+
+
+
+ Find two furthest points from the specified line.
+
+
+ Collection of points to search furthest points in.
+ First point forming the line.
+ Second point forming the line.
+ First found furthest point.
+ Distance between the first found point and the given line.
+ Second found furthest point (which is on the
+ opposite side from the line compared to the );
+ Distance between the second found point and the given line.
+
+ The method finds two furthest points from the specified line,
+ where one point is on one side from the line and the second point is on
+ another side from the line.
+
+
+
+
+ Find the furthest point from the specified line.
+
+
+ Collection of points to search furthest point in.
+ First point forming the line.
+ Second point forming the line.
+
+ Returns a point, which is the furthest away from the
+ specified line.
+
+ The method finds the furthest point from the specified line.
+ Unlike the
+ method, this method find only one point, which is the furthest away from the line
+ regardless of side from the line.
+
+
+
+
+ Find the furthest point from the specified line.
+
+
+ Collection of points to search furthest points in.
+ First point forming the line.
+ Second point forming the line.
+ Distance between the furthest found point and the given line.
+
+ Returns a point, which is the furthest away from the
+ specified line.
+
+ The method finds the furthest point from the specified line.
+ Unlike the
+ method, this method find only one point, which is the furthest away from the line
+ regardless of side from the line.
+
+
+
+
+ Find corners of quadrilateral or triangular area, which contains the specified collection of points.
+
+
+ Collection of points to search quadrilateral for.
+
+ Returns a list of 3 or 4 points, which are corners of the quadrilateral or
+ triangular area filled by specified collection of point. The first point in the list
+ is the point with lowest X coordinate (and with lowest Y if there are several points
+ with the same X value). The corners are provided in counter clockwise order
+ (Cartesian
+ coordinate system).
+
+ The method makes an assumption that the specified collection of points
+ form some sort of quadrilateral/triangular area. With this assumption it tries to find corners
+ of the area.
+
+ The method does not search for bounding quadrilateral/triangular area,
+ where all specified points are inside of the found quadrilateral/triangle. Some of the
+ specified points potentially may be outside of the found quadrilateral/triangle, since the
+ method takes corners only from the specified collection of points, but does not calculate such
+ to form true bounding quadrilateral/triangle.
+
+ See property for additional information.
+
+
+
+
+
+ Relative distortion limit allowed for quadrilaterals, [0.0, 0.25].
+
+
+ The value of this property is used to calculate distortion limit used by
+ , when processing potential corners and making decision
+ if the provided points form a quadrilateral or a triangle. The distortion limit is
+ calculated as:
+
+ distrtionLimit = RelativeDistortionLimit * ( W * H ) / 2,
+
+ where W and H are width and height of the "points cloud" passed to the
+ .
+
+
+ To explain the idea behind distortion limit, let’s suppose that quadrilateral finder routine found
+ the next candidates for corners:
+ 
+ As we can see on the above picture, the shape there potentially can be a triangle, but not quadrilateral
+ (suppose that points list comes from a hand drawn picture or acquired from camera, so some
+ inaccuracy may exist). It may happen that the D point is just a distortion (noise, etc).
+ So the check what is the distance between a potential corner
+ (D in this case) and a line connecting two adjacent points (AB in this case). If the distance is smaller
+ then the distortion limit, then the point may be rejected, so the shape turns into triangle.
+
+
+ An exception is the case when both C and D points are very close to the AB line,
+ so both their distances are less than distortion limit. In this case both points will be accepted as corners -
+ the shape is just a flat quadrilateral.
+
+ Default value is set to 0.1.
+
+
+
+
+
+ 3D Vector structure with X, Y and Z coordinates.
+
+
+ The structure incapsulates X, Y and Z coordinates of a 3D vector and
+ provides some operations with it.
+
+
+
+
+ X coordinate of the vector.
+
+
+
+
+ Y coordinate of the vector.
+
+
+
+
+ Z coordinate of the vector.
+
+
+
+
+ Initializes a new instance of the structure.
+
+
+ X coordinate of the vector.
+ Y coordinate of the vector.
+ Z coordinate of the vector.
+
+
+
+
+ Initializes a new instance of the structure.
+
+
+ Value, which is set to all 3 coordinates of the vector.
+
+
+
+
+ Returns a string representation of this object.
+
+
+ A string representation of this object.
+
+
+
+
+ Returns array representation of the vector.
+
+
+ Array with 3 values containing X/Y/Z coordinates.
+
+
+
+
+ Adds corresponding coordinates of two vectors.
+
+
+ The vector to add to.
+ The vector to add to the first vector.
+
+ Returns a vector which coordinates are equal to sum of corresponding
+ coordinates of the two specified vectors.
+
+
+
+
+ Adds corresponding coordinates of two vectors.
+
+
+ The vector to add to.
+ The vector to add to the first vector.
+
+ Returns a vector which coordinates are equal to sum of corresponding
+ coordinates of the two specified vectors.
+
+
+
+
+ Adds a value to all coordinates of the specified vector.
+
+
+ Vector to add the specified value to.
+ Value to add to all coordinates of the vector.
+
+ Returns new vector with all coordinates increased by the specified value.
+
+
+
+
+ Adds a value to all coordinates of the specified vector.
+
+
+ Vector to add the specified value to.
+ Value to add to all coordinates of the vector.
+
+ Returns new vector with all coordinates increased by the specified value.
+
+
+
+
+ Subtracts corresponding coordinates of two vectors.
+
+
+ The vector to subtract from.
+ The vector to subtract from the first vector.
+
+ Returns a vector which coordinates are equal to difference of corresponding
+ coordinates of the two specified vectors.
+
+
+
+
+ Subtracts corresponding coordinates of two vectors.
+
+
+ The vector to subtract from.
+ The vector to subtract from the first vector.
+
+ Returns a vector which coordinates are equal to difference of corresponding
+ coordinates of the two specified vectors.
+
+
+
+
+ Subtracts a value from all coordinates of the specified vector.
+
+
+ Vector to subtract the specified value from.
+ Value to subtract from all coordinates of the vector.
+
+ Returns new vector with all coordinates decreased by the specified value.
+
+
+
+
+ Subtracts a value from all coordinates of the specified vector.
+
+
+ Vector to subtract the specified value from.
+ Value to subtract from all coordinates of the vector.
+
+ Returns new vector with all coordinates decreased by the specified value.
+
+
+
+
+ Multiplies corresponding coordinates of two vectors.
+
+
+ The first vector to multiply.
+ The second vector to multiply.
+
+ Returns a vector which coordinates are equal to multiplication of corresponding
+ coordinates of the two specified vectors.
+
+
+
+
+ Multiplies corresponding coordinates of two vectors.
+
+
+ The first vector to multiply.
+ The second vector to multiply.
+
+ Returns a vector which coordinates are equal to multiplication of corresponding
+ coordinates of the two specified vectors.
+
+
+
+
+ Multiplies coordinates of the specified vector by the specified factor.
+
+
+ Vector to multiply coordinates of.
+ Factor to multiple coordinates of the specified vector by.
+
+ Returns new vector with all coordinates multiplied by the specified factor.
+
+
+
+
+ Multiplies coordinates of the specified vector by the specified factor.
+
+
+ Vector to multiply coordinates of.
+ Factor to multiple coordinates of the specified vector by.
+
+ Returns new vector with all coordinates multiplied by the specified factor.
+
+
+
+
+ Divides corresponding coordinates of two vectors.
+
+
+ The first vector to divide.
+ The second vector to devide.
+
+ Returns a vector which coordinates are equal to coordinates of the first vector divided by
+ corresponding coordinates of the second vector.
+
+
+
+
+ Divides corresponding coordinates of two vectors.
+
+
+ The first vector to divide.
+ The second vector to devide.
+
+ Returns a vector which coordinates are equal to coordinates of the first vector divided by
+ corresponding coordinates of the second vector.
+
+
+
+
+ Divides coordinates of the specified vector by the specified factor.
+
+
+ Vector to divide coordinates of.
+ Factor to divide coordinates of the specified vector by.
+
+ Returns new vector with all coordinates divided by the specified factor.
+
+
+
+
+ Divides coordinates of the specified vector by the specified factor.
+
+
+ Vector to divide coordinates of.
+ Factor to divide coordinates of the specified vector by.
+
+ Returns new vector with all coordinates divided by the specified factor.
+
+
+
+
+ Tests whether two specified vectors are equal.
+
+
+ The left-hand vector.
+ The right-hand vector.
+
+ Returns if the two vectors are equal or otherwise.
+
+
+
+
+ Tests whether two specified vectors are not equal.
+
+
+ The left-hand vector.
+ The right-hand vector.
+
+ Returns if the two vectors are not equal or otherwise.
+
+
+
+
+ Tests whether the vector equals to the specified one.
+
+
+ The vector to test equality with.
+
+ Returns if the two vectors are equal or otherwise.
+
+
+
+
+ Tests whether the vector equals to the specified object.
+
+
+ The object to test equality with.
+
+ Returns if the vector equals to the specified object or otherwise.
+
+
+
+
+ Returns the hashcode for this instance.
+
+
+ A 32-bit signed integer hash code.
+
+
+
+
+ Normalizes the vector by dividing it’s all coordinates with the vector's norm.
+
+
+ Returns the value of vectors’ norm before normalization.
+
+
+
+
+ Inverse the vector.
+
+
+ Returns a vector with all coordinates equal to 1.0 divided by the value of corresponding coordinate
+ in this vector (or equal to 0.0 if this vector has corresponding coordinate also set to 0.0).
+
+
+
+
+ Calculate absolute values of the vector.
+
+
+ Returns a vector with all coordinates equal to absolute values of this vector's coordinates.
+
+
+
+
+ Calculates cross product of two vectors.
+
+
+ First vector to use for cross product calculation.
+ Second vector to use for cross product calculation.
+
+ Returns cross product of the two specified vectors.
+
+
+
+
+ Calculates dot product of two vectors.
+
+
+ First vector to use for dot product calculation.
+ Second vector to use for dot product calculation.
+
+ Returns dot product of the two specified vectors.
+
+
+
+
+ Converts the vector to a 4D vector.
+
+
+ Returns 4D vector which is an extension of the 3D vector.
+
+ The method returns a 4D vector which has X, Y and Z coordinates equal to the
+ coordinates of this 3D vector and W coordinate set to 1.0.
+
+
+
+
+
+ Returns maximum value of the vector.
+
+
+ Returns maximum value of all 3 vector's coordinates.
+
+
+
+
+ Returns minimum value of the vector.
+
+
+ Returns minimum value of all 3 vector's coordinates.
+
+
+
+
+ Returns index of the coordinate with maximum value.
+
+
+ Returns index of the coordinate, which has the maximum value - 0 for X,
+ 1 for Y or 2 for Z.
+
+ If there are multiple coordinates which have the same maximum value, the
+ property returns smallest index.
+
+
+
+
+
+ Returns index of the coordinate with minimum value.
+
+
+ Returns index of the coordinate, which has the minimum value - 0 for X,
+ 1 for Y or 2 for Z.
+
+ If there are multiple coordinates which have the same minimum value, the
+ property returns smallest index.
+
+
+
+
+
+ Returns vector's norm.
+
+
+ Returns Euclidean norm of the vector, which is a
+ square root of the sum: X2+Y2+Z2.
+
+
+
+
+
+ Returns square of the vector's norm.
+
+
+ Return X2+Y2+Z2, which is
+ a square of vector's norm or a dot product of this vector
+ with itself.
+
+
+
+
+ Cosine similarity metric.
+
+
+ This class represents the
+ Cosine Similarity metric.
+
+ Sample usage:
+
+ // instantiate new similarity class
+ CosineSimilarity sim = new CosineSimilarity( );
+ // create two vectors for inputs
+ double[] p = new double[] { 2.5, 3.5, 3.0, 3.5, 2.5, 3.0 };
+ double[] q = new double[] { 3.0, 3.5, 1.5, 5.0, 3.5, 3.0 };
+ // get similarity between the two vectors
+ double similarityScore = sim.GetSimilarityScore( p, q );
+
+
+
+
+
+
+ Returns similarity score for two N-dimensional double vectors.
+
+
+ 1st point vector.
+ 2nd point vector.
+
+ Returns Cosine similarity between two supplied vectors.
+
+ Thrown if the two vectors are of different dimensions (if specified
+ array have different length).
+
+
+
+
+ 3D pose estimation algorithm.
+
+
+ The class implements an algorithm for 3D object's pose estimation from it's
+ 2D coordinates obtained by perspective projection, when the object is described none coplanar points.
+ The idea of the implemented math and algorithm is described in "Model-Based Object Pose in 25
+ Lines of Code" paper written by Daniel F. DeMenthon and Larry S. Davis (the implementation of
+ the algorithm is almost 1 to 1 translation of the pseudo code given by the paper, so should
+ be easy to follow).
+
+ At this point the implementation works only with models described by 4 points, which is
+ the minimum number of points enough for 3D pose estimation.
+
+ The 4 model's point must not be coplanar, i.e. must not reside all within
+ same planer. See for coplanar case.
+
+ Read 3D Pose Estimation article for
+ additional information and samples.
+
+ Sample usage:
+
+ // points of real object - model
+ Vector3[] positObject = new Vector3[4]
+ {
+ new Vector3( 28, 28, -28 ),
+ new Vector3( -28, 28, -28 ),
+ new Vector3( 28, -28, -28 ),
+ new Vector3( 28, 28, 28 ),
+ };
+ // focal length of camera used to capture the object
+ float focalLength = 640; // depends on your camera or projection system
+ // initialize POSIT object
+ Posit posit = new Posit( positObject, focalLength );
+
+ // 2D points of te object - projection
+ AForge.Point[] projectedPoints = new AForge.Point[4]
+ {
+ new AForge.Point( -4, 29 ),
+ new AForge.Point( -180, 86 ),
+ new AForge.Point( -5, -102 ),
+ new AForge.Point( 76, 137 ),
+ };
+ // estimate pose
+ Matrix3x3 rotationMatrix;
+ Vector3 translationVector;
+ posit.EstimatePose( projectedPoints,
+ out rotationMatrix, out translationVector );
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Array of vectors containing coordinates of four real model's point (points
+ must not be on the same plane).
+ Effective focal length of the camera used to capture the model.
+
+ The model must have 4 points.
+
+
+
+
+ Estimate pose of a model from it's projected 2D coordinates.
+
+
+ 4 2D points of the model's projection.
+ Gets object's rotation.
+ Gets object's translation.
+
+ 4 points must be be given for pose estimation.
+
+
+
+
+ Coordinates of the model points which pose should be estimated.
+
+
+
+
+ Effective focal length of the camera used to capture the model.
+
+
+
+
+ Histogram for continuous random values.
+
+
+ The class wraps histogram for continuous stochastic function, which is represented
+ by integer array and range of the function. Values of the integer array are treated
+ as total amount of hits on the corresponding subranges, which are calculated by splitting the
+ specified range into required amount of consequent ranges.
+
+ For example, if the integer array is equal to { 1, 2, 4, 8, 16 } and the range is set
+ to [0, 1], then the histogram consists of next subranges:
+
+ - [0.0, 0.2] - 1 hit;
+ - [0.2, 0.4] - 2 hits;
+ - [0.4, 0.6] - 4 hits;
+ - [0.6, 0.8] - 8 hits;
+ - [0.8, 1.0] - 16 hits.
+
+
+
+ Sample usage:
+
+ // create histogram
+ ContinuousHistogram histogram = new ContinuousHistogram(
+ new int[] { 0, 0, 8, 4, 2, 4, 7, 1, 0 }, new Range( 0.0f, 1.0f ) );
+ // get mean and standard deviation values
+ Console.WriteLine( "mean = " + histogram.Mean + ", std.dev = " + histogram.StdDev );
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Values of the histogram.
+ Range of random values.
+
+ Values of the integer array are treated as total amount of hits on the
+ corresponding subranges, which are calculated by splitting the specified range into
+ required amount of consequent ranges (see class
+ description for more information).
+
+
+
+
+
+ Get range around median containing specified percentage of values.
+
+
+ Values percentage around median.
+
+ Returns the range which containes specifies percentage of values.
+
+ The method calculates range of stochastic variable, which summary probability
+ comprises the specified percentage of histogram's hits.
+
+ Sample usage:
+
+ // create histogram
+ ContinuousHistogram histogram = new ContinuousHistogram(
+ new int[] { 0, 0, 8, 4, 2, 4, 7, 1, 0 }, new Range( 0.0f, 1.0f ) );
+ // get 50% range
+ Range range = histogram.GetRange( 0.5f );
+ // show the range ([0.25, 0.75])
+ Console.WriteLine( "50% range = [" + range.Min + ", " + range.Max + "]" );
+
+
+
+
+
+
+ Update statistical value of the histogram.
+
+
+ The method recalculates statistical values of the histogram, like mean,
+ standard deviation, etc. The method should be called only in the case if histogram
+ values were retrieved through property and updated after that.
+
+
+
+
+
+ Values of the histogram.
+
+
+
+
+
+ Range of random values.
+
+
+
+
+
+ Mean value.
+
+
+ The property allows to retrieve mean value of the histogram.
+
+ Sample usage:
+
+ // create histogram
+ ContinuousHistogram histogram = new ContinuousHistogram(
+ new int[] { 0, 0, 8, 4, 2, 4, 7, 1, 0 }, new Range( 0.0f, 1.0f ) );
+ // get mean value (= 0.505 )
+ Console.WriteLine( "mean = " + histogram.Mean.ToString( "F3" ) );
+
+
+
+
+
+
+ Standard deviation.
+
+
+ The property allows to retrieve standard deviation value of the histogram.
+
+ Sample usage:
+
+ // create histogram
+ ContinuousHistogram histogram = new ContinuousHistogram(
+ new int[] { 0, 0, 8, 4, 2, 4, 7, 1, 0 }, new Range( 0.0f, 1.0f ) );
+ // get std.dev. value (= 0.215)
+ Console.WriteLine( "std.dev. = " + histogram.StdDev.ToString( "F3" ) );
+
+
+
+
+
+
+ Median value.
+
+
+ The property allows to retrieve median value of the histogram.
+
+ Sample usage:
+
+ // create histogram
+ ContinuousHistogram histogram = new ContinuousHistogram(
+ new int[] { 0, 0, 8, 4, 2, 4, 7, 1, 0 }, new Range( 0.0f, 1.0f ) );
+ // get median value (= 0.500)
+ Console.WriteLine( "median = " + histogram.Median.ToString( "F3" ) );
+
+
+
+
+
+
+ Minimum value.
+
+
+ The property allows to retrieve minimum value of the histogram with non zero
+ hits count.
+
+ Sample usage:
+
+ // create histogram
+ ContinuousHistogram histogram = new ContinuousHistogram(
+ new int[] { 0, 0, 8, 4, 2, 4, 7, 1, 0 }, new Range( 0.0f, 1.0f ) );
+ // get min value (= 0.250)
+ Console.WriteLine( "min = " + histogram.Min.ToString( "F3" ) );
+
+
+
+
+
+ Maximum value.
+
+
+ The property allows to retrieve maximum value of the histogram with non zero
+ hits count.
+
+ Sample usage:
+
+ // create histogram
+ ContinuousHistogram histogram = new ContinuousHistogram(
+ new int[] { 0, 0, 8, 4, 2, 4, 7, 1, 0 }, new Range( 0.0f, 1.0f ) );
+ // get max value (= 0.875)
+ Console.WriteLine( "max = " + histogram.Max.ToString( "F3" ) );
+
+
+
+
+
+
+ A structure representing 3x3 matrix.
+
+
+ The structure incapsulates elements of a 3x3 matrix and
+ provides some operations with it.
+
+
+
+
+ Row 0 column 0 element of the matrix.
+
+
+
+
+ Row 0 column 1 element of the matrix.
+
+
+
+
+ Row 0 column 2 element of the matrix.
+
+
+
+
+ Row 1 column 0 element of the matrix.
+
+
+
+
+ Row 1 column 1 element of the matrix.
+
+
+
+
+ Row 1 column 2 element of the matrix.
+
+
+
+
+ Row 2 column 0 element of the matrix.
+
+
+
+
+ Row 2 column 1 element of the matrix.
+
+
+
+
+ Row 2 column 2 element of the matrix.
+
+
+
+
+ Returns array representation of the matrix.
+
+
+ Returns array which contains all elements of the matrix in the row-major order.
+
+
+
+
+ Creates rotation matrix around Y axis.
+
+
+ Rotation angle around Y axis in radians.
+
+ Returns rotation matrix to rotate an object around Y axis.
+
+
+
+
+ Creates rotation matrix around X axis.
+
+
+ Rotation angle around X axis in radians.
+
+ Returns rotation matrix to rotate an object around X axis.
+
+
+
+
+ Creates rotation matrix around Z axis.
+
+
+ Rotation angle around Z axis in radians.
+
+ Returns rotation matrix to rotate an object around Z axis.
+
+
+
+
+ Creates rotation matrix to rotate an object around X, Y and Z axes.
+
+
+ Rotation angle around Y axis in radians.
+ Rotation angle around X axis in radians.
+ Rotation angle around Z axis in radians.
+
+ Returns rotation matrix to rotate an object around all 3 axes.
+
+
+ The routine assumes roll-pitch-yaw rotation order, when creating rotation
+ matrix, i.e. an object is first rotated around Z axis, then around X axis and finally around
+ Y axis.
+
+
+
+
+
+ Extract rotation angles from the rotation matrix.
+
+
+ Extracted rotation angle around Y axis in radians.
+ Extracted rotation angle around X axis in radians.
+ Extracted rotation angle around Z axis in radians.
+
+ The routine assumes roll-pitch-yaw rotation order when extracting rotation angle.
+ Using extracted angles with the should provide same rotation matrix.
+
+
+ The method assumes the provided matrix represent valid rotation matrix.
+
+ Sample usage:
+
+ // assume we have a rotation matrix created like this
+ float yaw = 10.0f / 180 * Math.PI;
+ float pitch = 30.0f / 180 * Math.PI;
+ float roll = 45.0f / 180 * Math.PI;
+
+ Matrix3x3 rotationMatrix = Matrix3x3.CreateFromYawPitchRoll( yaw, pitch, roll );
+ // ...
+
+ // now somewhere in the code you may want to get rotation
+ // angles back from a matrix assuming same rotation order
+ float extractedYaw;
+ float extractedPitch;
+ float extractedRoll;
+
+ rotation.ExtractYawPitchRoll( out extractedYaw, out extractedPitch, out extractedRoll );
+
+
+
+
+
+
+ Creates a matrix from 3 rows specified as vectors.
+
+
+ First row of the matrix to create.
+ Second row of the matrix to create.
+ Third row of the matrix to create.
+
+ Returns a matrix from specified rows.
+
+
+
+
+ Creates a matrix from 3 columns specified as vectors.
+
+
+ First column of the matrix to create.
+ Second column of the matrix to create.
+ Third column of the matrix to create.
+
+ Returns a matrix from specified columns.
+
+
+
+
+ Creates a diagonal matrix using the specified vector as diagonal elements.
+
+
+ Vector to use for diagonal elements of the matrix.
+
+ Returns a diagonal matrix.
+
+
+
+
+ Get row of the matrix.
+
+
+ Row index to get, [0, 2].
+
+ Returns specified row of the matrix as a vector.
+
+ Invalid row index was specified.
+
+
+
+
+ Get column of the matrix.
+
+
+ Column index to get, [0, 2].
+
+ Returns specified column of the matrix as a vector.
+
+ Invalid column index was specified.
+
+
+
+
+ Multiplies two specified matrices.
+
+
+ Matrix to multiply.
+ Matrix to multiply by.
+
+ Return new matrix, which the result of multiplication of the two specified matrices.
+
+
+
+
+ Multiplies two specified matrices.
+
+
+ Matrix to multiply.
+ Matrix to multiply by.
+
+ Return new matrix, which the result of multiplication of the two specified matrices.
+
+
+
+
+ Adds corresponding components of two matrices.
+
+
+ The matrix to add to.
+ The matrix to add to the first matrix.
+
+ Returns a matrix which components are equal to sum of corresponding
+ components of the two specified matrices.
+
+
+
+
+ Adds corresponding components of two matrices.
+
+
+ The matrix to add to.
+ The matrix to add to the first matrix.
+
+ Returns a matrix which components are equal to sum of corresponding
+ components of the two specified matrices.
+
+
+
+
+ Subtracts corresponding components of two matrices.
+
+
+ The matrix to subtract from.
+ The matrix to subtract from the first matrix.
+
+ Returns a matrix which components are equal to difference of corresponding
+ components of the two specified matrices.
+
+
+
+
+ Subtracts corresponding components of two matrices.
+
+
+ The matrix to subtract from.
+ The matrix to subtract from the first matrix.
+
+ Returns a matrix which components are equal to difference of corresponding
+ components of the two specified matrices.
+
+
+
+
+ Multiplies specified matrix by the specified vector.
+
+
+ Matrix to multiply by vector.
+ Vector to multiply matrix by.
+
+ Returns new vector which is the result of multiplication of the specified matrix
+ by the specified vector.
+
+
+
+
+ Multiplies specified matrix by the specified vector.
+
+
+ Matrix to multiply by vector.
+ Vector to multiply matrix by.
+
+ Returns new vector which is the result of multiplication of the specified matrix
+ by the specified vector.
+
+
+
+
+ Multiplies matrix by the specified factor.
+
+
+ Matrix to multiply.
+ Factor to multiple the specified matrix by.
+
+ Returns new matrix with all components equal to corresponding components of the
+ specified matrix multiples by the specified factor.
+
+
+
+
+ Multiplies matrix by the specified factor.
+
+
+ Matrix to multiply.
+ Factor to multiple the specified matrix by.
+
+ Returns new matrix with all components equal to corresponding components of the
+ specified matrix multiples by the specified factor.
+
+
+
+
+ Adds specified value to all components of the specified matrix.
+
+
+ Matrix to add value to.
+ Value to add to all components of the specified matrix.
+
+ Returns new matrix with all components equal to corresponding components of the
+ specified matrix increased by the specified value.
+
+
+
+
+ Adds specified value to all components of the specified matrix.
+
+
+ Matrix to add value to.
+ Value to add to all components of the specified matrix.
+
+ Returns new matrix with all components equal to corresponding components of the
+ specified matrix increased by the specified value.
+
+
+
+
+ Tests whether two specified matrices are equal.
+
+
+ The left-hand matrix.
+ The right-hand matrix.
+
+ Returns if the two matrices are equal or otherwise.
+
+
+
+
+ Tests whether two specified matrices are not equal.
+
+
+ The left-hand matrix.
+ The right-hand matrix.
+
+ Returns if the two matrices are not equal or otherwise.
+
+
+
+
+ Tests whether the matrix equals to the specified one.
+
+
+ The matrix to test equality with.
+
+ Returns if the two matrices are equal or otherwise.
+
+
+
+
+ Tests whether the matrix equals to the specified object.
+
+
+ The object to test equality with.
+
+ Returns if the matrix equals to the specified object or otherwise.
+
+
+
+
+ Returns the hashcode for this instance.
+
+
+ A 32-bit signed integer hash code.
+
+
+
+
+ Transpose the matrix, AT.
+
+
+ Return a matrix which equals to transposition of this matrix.
+
+
+
+
+ Multiply the matrix by its transposition, A*AT.
+
+
+ Returns a matrix which is the result of multiplying this matrix by its transposition.
+
+
+
+
+ Multiply transposition of this matrix by itself, AT*A.
+
+
+ Returns a matrix which is the result of multiplying this matrix's transposition by itself.
+
+
+
+
+ Calculate adjugate of the matrix, adj(A).
+
+
+ Returns adjugate of the matrix.
+
+
+
+
+ Calculate inverse of the matrix, A-1.
+
+
+ Returns inverse of the matrix.
+
+ Cannot calculate inverse of the matrix since it is singular.
+
+
+
+
+ Calculate pseudo inverse of the matrix, A+.
+
+
+ Returns pseudo inverse of the matrix.
+
+ The pseudo inverse of the matrix is calculate through its
+ as V*E+*UT.
+
+
+
+
+ Calculate Singular Value Decomposition (SVD) of the matrix, such as A=U*E*VT.
+
+
+ Output parameter which gets 3x3 U matrix.
+ Output parameter which gets diagonal elements of the E matrix.
+ Output parameter which gets 3x3 V matrix.
+
+ Having components U, E and V the source matrix can be reproduced using below code:
+
+ Matrix3x3 source = u * Matrix3x3.Diagonal( e ) * v.Transpose( );
+
+
+
+
+
+
+ Provides an identity matrix with all diagonal elements set to 1.
+
+
+
+
+ Calculates determinant of the matrix.
+
+
+
+
+ Perlin noise function.
+
+
+ The class implements 1-D and 2-D Perlin noise functions, which represent
+ sum of several smooth noise functions with different frequency and amplitude. The description
+ of Perlin noise function and its calculation may be found on
+ Hugo Elias's page.
+
+
+ The number of noise functions, which comprise the resulting Perlin noise function, is
+ set by property. Amplitude and frequency values for each octave
+ start from values, which are set by and
+ properties.
+
+ Sample usage (clouds effect):
+
+ // create Perlin noise function
+ PerlinNoise noise = new PerlinNoise( 8, 0.5, 1.0 / 32 );
+ // generate clouds effect
+ float[,] texture = new float[height, width];
+
+ for ( int y = 0; y < height; y++ )
+ {
+ for ( int x = 0; x < width; x++ )
+ {
+ texture[y, x] =
+ Math.Max( 0.0f, Math.Min( 1.0f,
+ (float) noise.Function2D( x, y ) * 0.5f + 0.5f
+ ) );
+ }
+ }
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Number of octaves (see property).
+ Persistence value (see property).
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Number of octaves (see property).
+ Persistence value (see property).
+ Initial frequency (see property).
+ Initial amplitude (see property).
+
+
+
+
+ 1-D Perlin noise function.
+
+
+ x value.
+
+ Returns function's value at point .
+
+
+
+
+ 2-D Perlin noise function.
+
+
+ x value.
+ y value.
+
+ Returns function's value at point (, ).
+
+
+
+
+ Ordinary noise function
+
+
+
+
+ Smoothed noise.
+
+
+
+
+ Cosine interpolation.
+
+
+
+
+ Initial frequency.
+
+
+ The property sets initial frequency of the first octave. Frequencies for
+ next octaves are calculated using the next equation:
+ frequencyi = * 2i,
+ where i = [0, ).
+
+
+ Default value is set to 1.
+
+
+
+
+
+ Initial amplitude.
+
+
+ The property sets initial amplitude of the first octave. Amplitudes for
+ next octaves are calculated using the next equation:
+ amplitudei = * i,
+ where i = [0, ).
+
+
+ Default value is set to 1.
+
+
+
+
+
+ Persistence value.
+
+
+ The property sets so called persistence value, which controls the way
+ how amplitude is calculated for each octave comprising
+ the Perlin noise function.
+
+ Default value is set to 0.65.
+
+
+
+
+
+ Number of octaves, [1, 32].
+
+
+ The property sets the number of noise functions, which sum up the resulting
+ Perlin noise function.
+
+ Default value is set to 4.
+
+
+
+
+
+ Cosine distance metric.
+
+
+ This class represents the cosine distance metric (1 - cosine similarity)
+ .
+
+
+ Sample usage:
+
+ // instantiate new distance class
+ CosineDistance dist = new CosineDistance();
+ // create two vectors for inputs
+ double[] p = new double[] { 2.5, 3.5, 3.0, 3.5, 2.5, 3.0 };
+ double[] q = new double[] { 3.0, 3.5, 1.5, 5.0, 3.5, 3.0 };
+ // get distance between the two vectors
+ double distance = dist.GetDistance( p, q );
+
+
+
+
+
+
+ Returns distance between two N-dimensional double vectors.
+
+
+ 1st point vector.
+ 2nd point vector.
+
+ Returns Cosine distance between two supplied vectors.
+
+ Thrown if the two vectors are of different dimensions (if specified
+ array have different length).
+
+
+
+
+ Complex number wrapper class.
+
+
+ The class encapsulates complex number and provides
+ set of different operators to manipulate it, lake adding, subtractio,
+ multiplication, etc.
+
+ Sample usage:
+
+ // define two complex numbers
+ Complex c1 = new Complex( 3, 9 );
+ Complex c2 = new Complex( 8, 3 );
+ // sum
+ Complex s1 = Complex.Add( c1, c2 );
+ Complex s2 = c1 + c2;
+ Complex s3 = c1 + 5;
+ // difference
+ Complex d1 = Complex.Subtract( c1, c2 );
+ Complex d2 = c1 - c2;
+ Complex d3 = c1 - 2;
+
+
+
+
+
+
+ Real part of the complex number.
+
+
+
+
+ Imaginary part of the complex number.
+
+
+
+
+ A double-precision complex number that represents zero.
+
+
+
+
+ A double-precision complex number that represents one.
+
+
+
+
+ A double-precision complex number that represents the squere root of (-1).
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Real part.
+ Imaginary part.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Source complex number.
+
+
+
+
+ Adds two complex numbers.
+
+
+ A instance.
+ A instance.
+
+ Returns new instance containing the sum of specified
+ complex numbers.
+
+
+
+
+ Adds scalar value to a complex number.
+
+
+ A instance.
+ A scalar value.
+
+ Returns new instance containing the sum of specified
+ complex number and scalar value.
+
+
+
+
+ Adds two complex numbers and puts the result into the third complex number.
+
+
+ A instance.
+ A instance.
+ A instance to hold the result.
+
+
+
+
+ Adds scalar value to a complex number and puts the result into another complex number.
+
+
+ A instance.
+ A scalar value.
+ A instance to hold the result.
+
+
+
+
+ Subtracts one complex number from another.
+
+
+ A instance to subtract from.
+ A instance to be subtracted.
+
+ Returns new instance containing the subtraction result (a - b).
+
+
+
+
+ Subtracts a scalar from a complex number.
+
+
+ A instance to subtract from.
+ A scalar value to be subtracted.
+
+ Returns new instance containing the subtraction result (a - s).
+
+
+
+
+ Subtracts a complex number from a scalar value.
+
+
+ A scalar value to subtract from.
+ A instance to be subtracted.
+
+ Returns new instance containing the subtraction result (s - a).
+
+
+
+
+ Subtracts one complex number from another and puts the result in the third complex number.
+
+
+ A instance to subtract from.
+ A instance to be subtracted.
+ A instance to hold the result.
+
+
+
+
+ Subtracts a scalar value from a complex number and puts the result into another complex number.
+
+
+ A instance to subtract from.
+ A scalar value to be subtracted.
+ A instance to hold the result.
+
+
+
+
+ Subtracts a complex number from a scalar value and puts the result into another complex number.
+
+
+ A scalar value to subtract from.
+ A instance to be subtracted.
+ A instance to hold the result.
+
+
+
+
+ Multiplies two complex numbers.
+
+
+ A instance.
+ A instance.
+
+ Returns new instance containing the result of multiplication.
+
+
+
+
+ Multiplies a complex number by a scalar value.
+
+
+ A instance.
+ A scalar value.
+
+ Returns new instance containing the result of multiplication.
+
+
+
+
+ Multiplies two complex numbers and puts the result in a third complex number.
+
+
+ A instance.
+ A instance.
+ A instance to hold the result.
+
+
+
+
+ Multiplies a complex number by a scalar value and puts the result into another complex number.
+
+
+ A instance.
+ A scalar value.
+ A instance to hold the result.
+
+
+
+
+ Divides one complex number by another complex number.
+
+
+ A instance.
+ A instance.
+
+ Returns new instance containing the result.
+
+ Can not divide by zero.
+
+
+
+
+ Divides a complex number by a scalar value.
+
+
+ A instance.
+ A scalar value.
+
+ Returns new instance containing the result.
+
+ Can not divide by zero.
+
+
+
+
+ Divides a scalar value by a complex number.
+
+
+ A scalar value.
+ A instance.
+
+ Returns new instance containing the result.
+
+ Can not divide by zero.
+
+
+
+
+ Divides one complex number by another complex number and puts the result in a third complex number.
+
+
+ A instance.
+ A instance.
+ A instance to hold the result.
+
+ Can not divide by zero.
+
+
+
+
+ Divides a complex number by a scalar value and puts the result into another complex number.
+
+
+ A instance.
+ A scalar value.
+ A instance to hold the result.
+
+ Can not divide by zero.
+
+
+
+
+ Divides a scalar value by a complex number and puts the result into another complex number.
+
+
+ A instance.
+ A scalar value.
+ A instance to hold the result.
+
+ Can not divide by zero.
+
+
+
+
+ Negates a complex number.
+
+
+ A instance.
+
+ Returns new instance containing the negated values.
+
+
+
+
+ Tests whether two complex numbers are approximately equal using default tolerance value.
+
+
+ A instance.
+ A instance.
+
+ Return if the two vectors are approximately equal or otherwise.
+
+ The default tolerance value, which is used for the test, equals to 8.8817841970012523233891E-16.
+
+
+
+
+ Tests whether two complex numbers are approximately equal given a tolerance value.
+
+
+ A instance.
+ A instance.
+ The tolerance value used to test approximate equality.
+
+ The default tolerance value, which is used for the test, equals to 8.8817841970012523233891E-16.
+
+
+
+
+ Converts the specified string to its equivalent.
+
+
+ A string representation of a complex number.
+
+ Returns new instance that represents the complex number
+ specified by the parameter.
+
+ String representation of the complex number is not correctly formatted.
+
+
+
+
+ Try to convert the specified string to its equivalent.
+
+
+ A string representation of a complex number.
+
+ instance to output the result to.
+
+ Returns boolean value that indicates if the parse was successful or not.
+
+
+
+
+ Calculates square root of a complex number.
+
+
+ A instance.
+
+ Returns new instance containing the square root of the specified
+ complex number.
+
+
+
+
+ Calculates natural (base e) logarithm of a complex number.
+
+
+ A instance.
+
+ Returns new instance containing the natural logarithm of the specified
+ complex number.
+
+
+
+
+ Calculates exponent (e raised to the specified power) of a complex number.
+
+
+ A instance.
+
+ Returns new instance containing the exponent of the specified
+ complex number.
+
+
+
+
+ Calculates Sine value of the complex number.
+
+
+ A instance.
+
+ Returns new instance containing the Sine value of the specified
+ complex number.
+
+
+
+
+ Calculates Cosine value of the complex number.
+
+
+ A instance.
+
+ Returns new instance containing the Cosine value of the specified
+ complex number.
+
+
+
+
+ Calculates Tangent value of the complex number.
+
+
+ A instance.
+
+ Returns new instance containing the Tangent value of the specified
+ complex number.
+
+
+
+
+ Returns the hashcode for this instance.
+
+
+ A 32-bit signed integer hash code.
+
+
+
+ Returns a value indicating whether this instance is equal to the specified object.
+
+
+ An object to compare to this instance.
+
+ Returns if is a and has the same values as this instance or otherwise.
+
+
+
+
+ Returns a string representation of this object.
+
+
+ A string representation of this object.
+
+
+
+
+ Tests whether two specified complex numbers are equal.
+
+
+ The left-hand complex number.
+ The right-hand complex number.
+
+ Returns if the two complex numbers are equal or otherwise.
+
+
+
+
+ Tests whether two specified complex numbers are not equal.
+
+
+ The left-hand complex number.
+ The right-hand complex number.
+
+ Returns if the two complex numbers are not equal or otherwise.
+
+
+
+
+ Negates the complex number.
+
+
+ A instance.
+
+ Returns new instance containing the negated values.
+
+
+
+
+ Adds two complex numbers.
+
+
+ A instance.
+ A instance.
+
+ Returns new instance containing the sum.
+
+
+
+
+ Adds a complex number and a scalar value.
+
+
+ A instance.
+ A scalar value.
+
+ Returns new instance containing the sum.
+
+
+
+
+ Adds a complex number and a scalar value.
+
+
+ A instance.
+ A scalar value.
+
+ Returns new instance containing the sum.
+
+
+
+
+ Subtracts one complex number from another complex number.
+
+
+ A instance.
+ A instance.
+
+ Returns new instance containing the difference.
+
+
+
+
+ Subtracts a scalar value from a complex number.
+
+
+ A instance.
+ A scalar value.
+
+ Returns new instance containing the difference.
+
+
+
+
+ Subtracts a complex number from a scalar value.
+
+
+ A scalar value.
+ A instance.
+
+ Returns new instance containing the difference.
+
+
+
+
+ Multiplies two complex numbers.
+
+
+ A instance.
+ A instance.
+
+ Returns new instance containing the result of multiplication.
+
+
+
+
+ Multiplies a complex number by a scalar value.
+
+
+ A scalar value.
+ A instance.
+
+ Returns new instance containing the result of multiplication.
+
+
+
+
+ Multiplies a complex number by a scalar value.
+
+
+ A instance.
+ A scalar value.
+
+ Returns new instance containing the result of multiplication.
+
+
+
+
+ Divides one complex number by another complex number.
+
+
+ A instance.
+ A instance.
+
+ A new Complex instance containing the result.
+ Returns new instance containing the result of division.
+
+
+
+
+ Divides a complex number by a scalar value.
+
+
+ A instance.
+ A scalar value.
+
+ Returns new instance containing the result of division.
+
+
+
+
+ Divides a scalar value by a complex number.
+
+
+ A instance.
+ A scalar value.
+
+ Returns new instance containing the result of division.
+
+
+
+
+ Converts from a single-precision real number to a complex number.
+
+
+ Single-precision real number to convert to complex number.
+
+ Returns new instance containing complex number with
+ real part initialized to the specified value.
+
+
+
+
+ Converts from a double-precision real number to a complex number.
+
+
+ Double-precision real number to convert to complex number.
+
+ Returns new instance containing complex number with
+ real part initialized to the specified value.
+
+
+
+
+ Creates an exact copy of this object.
+
+
+ Returns clone of the complex number.
+
+
+
+
+ Creates an exact copy of this object.
+
+
+ Returns clone of the complex number.
+
+
+
+
+ Populates a with the data needed to serialize the target object.
+
+
+ The to populate with data.
+ The destination (see ) for this serialization.
+
+
+
+
+ Magnitude value of the complex number.
+
+
+ Magnitude of the complex number, which equals to Sqrt( Re * Re + Im * Im ).
+
+
+
+
+ Phase value of the complex number.
+
+
+ Phase of the complex number, which equals to Atan( Im / Re ).
+
+
+
+
+ Squared magnitude value of the complex number.
+
+
+
+
+ Hamming distance metric.
+
+
+ This class represents the
+ Hamming distance metric.
+
+ Sample usage:
+
+ // instantiate new distance class
+ HammingDistance dist = new HammingDistance( );
+ // create two vectors for inputs
+ double[] p = new double[] { 2.5, 3.5, 3.0, 3.5, 2.5, 3.0 };
+ double[] q = new double[] { 3.0, 3.5, 1.5, 5.0, 3.5, 3.0 };
+ // get distance between the two vectors
+ double distance = dist.GetDistance( p, q );
+
+
+
+
+
+
+ Returns distance between two N-dimensional double vectors.
+
+
+ 1st point vector.
+ 2nd point vector.
+
+ Returns Hamming distance between two supplied vectors.
+
+ Thrown if the two vectors are of different dimensions (if specified
+ array have different length).
+
+
+
+
+ Euclidean similarity metric.
+
+
+ This class represents the
+ Euclidean Similarity metric,
+ which is calculated as 1.0 / ( 1.0 + EuclideanDistance ).
+
+ Sample usage:
+
+ // instantiate new similarity class
+ EuclideanSimilarity sim = new EuclideanSimilarity( );
+ // create two vectors for inputs
+ double[] p = new double[] { 2.5, 3.5, 3.0, 3.5, 2.5, 3.0 };
+ double[] q = new double[] { 3.0, 3.5, 1.5, 5.0, 3.5, 3.0 };
+ // get simirarity between the two vectors
+ double similarityScore = sim.GetSimilarityScore( p, q );
+
+
+
+
+
+
+ Returns similarity score for two N-dimensional double vectors.
+
+
+ 1st point vector.
+ 2nd point vector.
+
+ Returns Euclidean similarity between two supplied vectors.
+
+ Thrown if the two vectors are of different dimensions (if specified
+ array have different length).
+
+
+
+
diff --git a/Part 1 - Record Video/bin/Debug/AForge.Video.DirectShow.dll b/Part 1 - Record Video/bin/Debug/AForge.Video.DirectShow.dll
new file mode 100644
index 0000000..e3f806f
Binary files /dev/null and b/Part 1 - Record Video/bin/Debug/AForge.Video.DirectShow.dll differ
diff --git a/Part 1 - Record Video/bin/Debug/AForge.Video.DirectShow.xml b/Part 1 - Record Video/bin/Debug/AForge.Video.DirectShow.xml
new file mode 100644
index 0000000..5d62c10
--- /dev/null
+++ b/Part 1 - Record Video/bin/Debug/AForge.Video.DirectShow.xml
@@ -0,0 +1,4108 @@
+
+
+
+ AForge.Video.DirectShow
+
+
+
+
+ A strongly-typed resource class, for looking up localized strings, etc.
+
+
+
+
+ Returns the cached ResourceManager instance used by this class.
+
+
+
+
+ Overrides the current thread's CurrentUICulture property for all
+ resource lookups using this strongly typed resource class.
+
+
+
+
+ This interface is exposed by all input and output pins of DirectShow filters.
+
+
+
+
+
+ Connects the pin to another pin.
+
+
+ Other pin to connect to.
+ Type to use for the connections (optional).
+
+ Return's HRESULT error code.
+
+
+
+
+ Makes a connection to this pin and is called by a connecting pin.
+
+
+ Connecting pin.
+ Media type of the samples to be streamed.
+
+ Return's HRESULT error code.
+
+
+
+
+ Breaks the current pin connection.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Returns a pointer to the connecting pin.
+
+
+ Receives IPin interface of connected pin (if any).
+
+ Return's HRESULT error code.
+
+
+
+
+ Returns the media type of this pin's connection.
+
+
+ Pointer to an structure. If the pin is connected,
+ the media type is returned. Otherwise, the structure is initialized to a default state in which
+ all elements are 0, with the exception of lSampleSize, which is set to 1, and
+ FixedSizeSamples, which is set to true.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves information about this pin (for example, the name, owning filter, and direction).
+
+
+ structure that receives the pin information.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the direction for this pin.
+
+
+ Receives direction of the pin.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves an identifier for the pin.
+
+
+ Pin identifier.
+
+ Return's HRESULT error code.
+
+
+
+
+ Queries whether a given media type is acceptable by the pin.
+
+
+ structure that specifies the media type.
+
+ Return's HRESULT error code.
+
+
+
+
+ Provides an enumerator for this pin's preferred media types.
+
+
+ Address of a variable that receives a pointer to the IEnumMediaTypes interface.
+
+ Return's HRESULT error code.
+
+
+
+
+ Provides an array of the pins to which this pin internally connects.
+
+
+ Address of an array of IPin pointers.
+ On input, specifies the size of the array. When the method returns,
+ the value is set to the number of pointers returned in the array.
+
+ Return's HRESULT error code.
+
+
+
+
+ Notifies the pin that no additional data is expected.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Begins a flush operation.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Ends a flush operation.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Specifies that samples following this call are grouped as a segment with a given start time, stop time, and rate.
+
+
+ Start time of the segment, relative to the original source, in 100-nanosecond units.
+ End time of the segment, relative to the original source, in 100-nanosecond units.
+ Rate at which this segment should be processed, as a percentage of the original rate.
+
+ Return's HRESULT error code.
+
+
+
+
+ The interface provides methods for building a filter graph. An application can use it to add filters to
+ the graph, connect or disconnect filters, remove filters, and perform other basic operations.
+
+
+
+
+
+ Adds a filter to the graph and gives it a name.
+
+
+ Filter to add to the graph.
+ Name of the filter.
+
+ Return's HRESULT error code.
+
+
+
+
+ Removes a filter from the graph.
+
+
+ Filter to be removed from the graph.
+
+ Return's HRESULT error code.
+
+
+
+
+ Provides an enumerator for all filters in the graph.
+
+
+ Filter enumerator.
+
+ Return's HRESULT error code.
+
+
+
+
+ Finds a filter that was added with a specified name.
+
+
+ Name of filter to search for.
+ Interface of found filter.
+
+ Return's HRESULT error code.
+
+
+
+
+ Connects two pins directly (without intervening filters).
+
+
+ Output pin.
+ Input pin.
+ Media type to use for the connection.
+
+ Return's HRESULT error code.
+
+
+
+
+ Breaks the existing pin connection and reconnects it to the same pin.
+
+
+ Pin to disconnect and reconnect.
+
+ Return's HRESULT error code.
+
+
+
+
+ Disconnects a specified pin.
+
+
+ Pin to disconnect.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the reference clock to the default clock.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ The interface is exposed by source filters to set the file name and media type of the media file that they are to render.
+
+
+
+
+
+ Loads the source filter with the file.
+
+
+ The name of the file to open.
+ Media type of the file. This can be null.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the current file.
+
+
+ Name of media file.
+ Receives media type.
+
+ Return's HRESULT error code.
+
+
+
+
+ The interface controls certain video capture operations such as enumerating available
+ frame rates and image orientation.
+
+
+
+
+
+ Retrieves the capabilities of the underlying hardware.
+
+
+ Pin to query capabilities from.
+ Get capabilities of the specified pin.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the video control mode of operation.
+
+
+ The pin to set the video control mode on.
+ Value specifying a combination of the flags to set the video control mode.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the video control mode of operation.
+
+
+ The pin to retrieve the video control mode from.
+ Gets combination of flags, which specify the video control mode.
+
+ Return's HRESULT error code.
+
+
+
+
+ The method retrieves the actual frame rate, expressed as a frame duration in 100-nanosecond units.
+ USB (Universal Serial Bus) and IEEE 1394 cameras may provide lower frame rates than requested
+ because of bandwidth availability. This is only available during video streaming.
+
+
+ The pin to retrieve the frame rate from.
+ Gets frame rate in frame duration in 100-nanosecond units.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the maximum frame rate currently available based on bus bandwidth usage for connections
+ such as USB and IEEE 1394 camera devices where the maximum frame rate can be limited by bandwidth
+ availability.
+
+
+ The pin to retrieve the maximum frame rate from.
+ Index of the format to query for maximum frame rate. This index corresponds
+ to the order in which formats are enumerated by .
+ Frame image size (width and height) in pixels.
+ Gets maximum available frame rate. The frame rate is expressed as frame duration in 100-nanosecond units.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves a list of available frame rates.
+
+
+ The pin to retrieve the maximum frame rate from.
+ Index of the format to query for maximum frame rate. This index corresponds
+ to the order in which formats are enumerated by .
+ Frame image size (width and height) in pixels.
+ Number of elements in the list of frame rates.
+ Array of frame rates in 100-nanosecond units.
+
+ Return's HRESULT error code.
+
+
+
+
+ DirectShow filter categories.
+
+
+
+
+ Audio input device category.
+
+
+ Equals to CLSID_AudioInputDeviceCategory.
+
+
+
+
+ Video input device category.
+
+
+ Equals to CLSID_VideoInputDeviceCategory.
+
+
+
+
+ Video compressor category.
+
+
+ Equals to CLSID_VideoCompressorCategory.
+
+
+
+
+ Audio compressor category
+
+
+ Equals to CLSID_AudioCompressorCategory.
+
+
+
+
+ Provides the CLSID of an object that can be stored persistently in the system. Allows the object to specify which object
+ handler to use in the client process, as it is used in the default implementation of marshaling.
+
+
+
+
+ Retrieves the class identifier (CLSID) of the object.
+
+
+
+
+
+
+ The IAMCameraControl interface controls camera settings such as zoom, pan, aperture adjustment,
+ or shutter speed. To obtain this interface, query the filter that controls the camera.
+
+
+
+
+ Gets the range and default value of a specified camera property.
+
+
+ Specifies the property to query.
+ Receives the minimum value of the property.
+ Receives the maximum value of the property.
+ Receives the step size for the property.
+ Receives the default value of the property.
+ Receives a member of the CameraControlFlags enumeration, indicating whether the property is controlled automatically or manually.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets a specified property on the camera.
+
+
+ Specifies the property to set.
+ Specifies the new value of the property.
+ Specifies the desired control setting, as a member of the CameraControlFlags enumeration.
+
+ Return's HRESULT error code.
+
+
+
+
+ Gets the current setting of a camera property.
+
+
+ Specifies the property to retrieve.
+ Receives the value of the property.
+ Receives a member of the CameraControlFlags enumeration.
+ The returned value indicates whether the setting is controlled manually or automatically.
+
+ Return's HRESULT error code.
+
+
+
+
+ Capabilities of video device such as frame size and frame rate.
+
+
+
+
+ Frame size supported by video device.
+
+
+
+
+ Average frame rate of video device for corresponding frame size.
+
+
+
+
+ Maximum frame rate of video device for corresponding frame size.
+
+
+
+
+ Number of bits per pixel provided by the camera.
+
+
+
+
+ Check if the video capability equals to the specified object.
+
+
+ Object to compare with.
+
+ Returns true if both are equal are equal or false otherwise.
+
+
+
+
+ Check if two video capabilities are equal.
+
+
+ Second video capability to compare with.
+
+ Returns true if both video capabilities are equal or false otherwise.
+
+
+
+
+ Get hash code of the object.
+
+
+ Returns hash code ot the object
+
+
+
+ Equality operator.
+
+
+ First object to check.
+ Seconds object to check.
+
+ Return true if both objects are equal or false otherwise.
+
+
+
+ Inequality operator.
+
+
+ First object to check.
+ Seconds object to check.
+
+ Return true if both objects are not equal or false otherwise.
+
+
+
+ Frame rate supported by video device for corresponding frame size.
+
+
+ This field is depricated - should not be used.
+ Its value equals to .
+
+
+
+
+
+ Specifies the physical type of pin (audio or video).
+
+
+
+
+ Default value of connection type. Physically it does not exist, but just either to specify that
+ connection type should not be changed (input) or was not determined (output).
+
+
+
+
+ Specifies a tuner pin for video.
+
+
+
+
+ Specifies a composite pin for video.
+
+
+
+
+ Specifies an S-Video (Y/C video) pin.
+
+
+
+
+ Specifies an RGB pin for video.
+
+
+
+
+ Specifies a YRYBY (Y, R–Y, B–Y) pin for video.
+
+
+
+
+ Specifies a serial digital pin for video.
+
+
+
+
+ Specifies a parallel digital pin for video.
+
+
+
+
+ Specifies a SCSI (Small Computer System Interface) pin for video.
+
+
+
+
+ Specifies an AUX (auxiliary) pin for video.
+
+
+
+
+ Specifies an IEEE 1394 pin for video.
+
+
+
+
+ Specifies a USB (Universal Serial Bus) pin for video.
+
+
+
+
+ Specifies a video decoder pin.
+
+
+
+
+ Specifies a video encoder pin.
+
+
+
+
+ Specifies a SCART (Peritel) pin for video.
+
+
+
+
+ Not used.
+
+
+
+
+ Specifies a tuner pin for audio.
+
+
+
+
+ Specifies a line pin for audio.
+
+
+
+
+ Specifies a microphone pin.
+
+
+
+
+ Specifies an AES/EBU (Audio Engineering Society/European Broadcast Union) digital pin for audio.
+
+
+
+
+ Specifies an S/PDIF (Sony/Philips Digital Interface Format) digital pin for audio.
+
+
+
+
+ Specifies a SCSI pin for audio.
+
+
+
+
+ Specifies an AUX pin for audio.
+
+
+
+
+ Specifies an IEEE 1394 pin for audio.
+
+
+
+
+ Specifies a USB pin for audio.
+
+
+
+
+ Specifies an audio decoder pin.
+
+
+
+
+ This enumeration indicates a pin's direction.
+
+
+
+
+
+ Input pin.
+
+
+
+
+ Output pin.
+
+
+
+
+ The structure describes the format of a media sample.
+
+
+
+
+
+ Globally unique identifier (GUID) that specifies the major type of the media sample.
+
+
+
+
+ GUID that specifies the subtype of the media sample.
+
+
+
+
+ If true, samples are of a fixed size.
+
+
+
+
+ If true, samples are compressed using temporal (interframe) compression.
+
+
+
+
+ Size of the sample in bytes. For compressed data, the value can be zero.
+
+
+
+
+ GUID that specifies the structure used for the format block.
+
+
+
+
+ Not used.
+
+
+
+
+ Size of the format block, in bytes.
+
+
+
+
+ Pointer to the format block.
+
+
+
+
+ Destroys the instance of the class.
+
+
+
+
+
+ Dispose the object.
+
+
+
+
+
+ Dispose the object
+
+
+ Indicates if disposing was initiated manually.
+
+
+
+
+ The structure contains information about a pin.
+
+
+
+
+
+ Owning filter.
+
+
+
+
+ Direction of the pin.
+
+
+
+
+ Name of the pin.
+
+
+
+
+ Filter's name.
+
+
+
+
+ Owning graph.
+
+
+
+
+ The structure describes the bitmap and color information for a video image.
+
+
+
+
+
+ structure that specifies the source video window.
+
+
+
+
+ structure that specifies the destination video window.
+
+
+
+
+ Approximate data rate of the video stream, in bits per second.
+
+
+
+
+ Data error rate, in bit errors per second.
+
+
+
+
+ The desired average display time of the video frames, in 100-nanosecond units.
+
+
+
+
+ structure that contains color and dimension information for the video image bitmap.
+
+
+
+
+ The structure describes the bitmap and color information for a video image (v2).
+
+
+
+
+
+ structure that specifies the source video window.
+
+
+
+
+ structure that specifies the destination video window.
+
+
+
+
+ Approximate data rate of the video stream, in bits per second.
+
+
+
+
+ Data error rate, in bit errors per second.
+
+
+
+
+ The desired average display time of the video frames, in 100-nanosecond units.
+
+
+
+
+ Flags that specify how the video is interlaced.
+
+
+
+
+ Flag set to indicate that the duplication of the stream should be restricted.
+
+
+
+
+ The X dimension of picture aspect ratio.
+
+
+
+
+ The Y dimension of picture aspect ratio.
+
+
+
+
+ Reserved for future use.
+
+
+
+
+ Reserved for future use.
+
+
+
+
+ structure that contains color and dimension information for the video image bitmap.
+
+
+
+
+ The structure contains information about the dimensions and color format of a device-independent bitmap (DIB).
+
+
+
+
+
+ Specifies the number of bytes required by the structure.
+
+
+
+
+ Specifies the width of the bitmap.
+
+
+
+
+ Specifies the height of the bitmap, in pixels.
+
+
+
+
+ Specifies the number of planes for the target device. This value must be set to 1.
+
+
+
+
+ Specifies the number of bits per pixel.
+
+
+
+
+ If the bitmap is compressed, this member is a FOURCC the specifies the compression.
+
+
+
+
+ Specifies the size, in bytes, of the image.
+
+
+
+
+ Specifies the horizontal resolution, in pixels per meter, of the target device for the bitmap.
+
+
+
+
+ Specifies the vertical resolution, in pixels per meter, of the target device for the bitmap.
+
+
+
+
+ Specifies the number of color indices in the color table that are actually used by the bitmap.
+
+
+
+
+ Specifies the number of color indices that are considered important for displaying the bitmap.
+
+
+
+
+ The structure defines the coordinates of the upper-left and lower-right corners of a rectangle.
+
+
+
+
+
+ Specifies the x-coordinate of the upper-left corner of the rectangle.
+
+
+
+
+ Specifies the y-coordinate of the upper-left corner of the rectangle.
+
+
+
+
+ Specifies the x-coordinate of the lower-right corner of the rectangle.
+
+
+
+
+ Specifies the y-coordinate of the lower-right corner of the rectangle.
+
+
+
+
+ The CAUUID structure is a Counted Array of UUID or GUID types.
+
+
+
+
+
+ Size of the array pointed to by pElems.
+
+
+
+
+ Pointer to an array of UUID values, each of which specifies UUID.
+
+
+
+
+ Performs manual marshaling of pElems to retrieve an array of Guid objects.
+
+
+ A managed representation of pElems.
+
+
+
+
+ Enumeration of DirectShow event codes.
+
+
+
+
+ Specifies a filter's state or the state of the filter graph.
+
+
+
+
+ Stopped. The filter is not processing data.
+
+
+
+
+ Paused. The filter is processing data, but not rendering it.
+
+
+
+
+ Running. The filter is processing and rendering data.
+
+
+
+
+ The interface is exposed by the Sample Grabber Filter. It enables an application to retrieve
+ individual media samples as they move through the filter graph.
+
+
+
+
+
+ Specifies whether the filter should stop the graph after receiving one sample.
+
+
+ Boolean value specifying whether the filter should stop the graph after receiving one sample.
+
+ Return's HRESULT error code.
+
+
+
+
+ Specifies the media type for the connection on the Sample Grabber's input pin.
+
+
+ Specifies the required media type.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the media type for the connection on the Sample Grabber's input pin.
+
+
+ structure, which receives media type.
+
+ Return's HRESULT error code.
+
+
+
+
+ Specifies whether to copy sample data into a buffer as it goes through the filter.
+
+
+ Boolean value specifying whether to buffer sample data.
+ If true, the filter copies sample data into an internal buffer.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves a copy of the sample that the filter received most recently.
+
+
+ Pointer to the size of the buffer. If pBuffer is NULL, this parameter receives the required size.
+ Pointer to a buffer to receive a copy of the sample, or NULL.
+
+ Return's HRESULT error code.
+
+
+
+
+ Not currently implemented.
+
+
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Specifies a callback method to call on incoming samples.
+
+
+ interface containing the callback method, or NULL to cancel the callback.
+ Index specifying the callback method.
+
+ Return's HRESULT error code.
+
+
+
+
+ This interface builds capture graphs and other custom filter graphs.
+
+
+
+
+
+ Specify filter graph for the capture graph builder to use.
+
+
+ Filter graph's interface.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieve the filter graph that the builder is using.
+
+
+ Filter graph's interface.
+
+ Return's HRESULT error code.
+
+
+
+
+ Create file writing section of the filter graph.
+
+
+ GUID that represents either the media subtype of the output or the
+ class identifier (CLSID) of a multiplexer filter or file writer filter.
+ Output file name.
+ Receives the multiplexer's interface.
+ Receives the file writer's IFileSinkFilter interface. Can be NULL.
+
+ Return's HRESULT error code.
+
+
+
+
+ Searche the graph for a specified interface, starting from a specified filter.
+
+
+ GUID that specifies the search criteria.
+ GUID that specifies the major media type of an output pin, or NULL.
+ interface of the filter. The method begins searching from this filter.
+ Interface identifier (IID) of the interface to locate.
+ Receives found interface.
+
+ Return's HRESULT error code.
+
+
+
+
+ Connect an output pin on a source filter to a rendering filter, optionally through a compression filter.
+
+
+ Pin category.
+ Major-type GUID that specifies the media type of the output pin.
+ Starting filter for the connection.
+ Interface of an intermediate filter, such as a compression filter. Can be NULL.
+ Sink filter, such as a renderer or mux filter.
+
+ Return's HRESULT error code.
+
+
+
+
+ Set the start and stop times for one or more streams of captured data.
+
+
+ Pin category.
+ Major-type GUID that specifies the media type.
+ interface that specifies which filter to control.
+ Start time.
+ Stop time.
+ Value that is sent as the second parameter of the
+ EC_STREAM_CONTROL_STARTED event notification.
+ Value that is sent as the second parameter of the
+ EC_STREAM_CONTROL_STOPPED event notification.
+
+ Return's HRESULT error code.
+
+
+
+
+ Preallocate a capture file to a specified size.
+
+
+ File name to create or resize.
+ Size of the file to allocate, in bytes.
+
+ Return's HRESULT error code.
+
+
+
+
+ Copy the valid media data from a capture file.
+
+
+ Old file name.
+ New file name.
+ Boolean value that specifies whether pressing the ESC key cancels the copy operation.
+ IAMCopyCaptureFileProgress interface to display progress information, or NULL.
+
+ Return's HRESULT error code.
+
+
+
+
+
+
+
+ Interface on a filter, or to an interface on a pin.
+ Pin direction (input or output).
+ Pin category.
+ Media type.
+ Boolean value that specifies whether the pin must be unconnected.
+ Zero-based index of the pin to retrieve, from the set of matching pins.
+ Interface of the matching pin.
+
+ Return's HRESULT error code.
+
+
+
+
+ This interface provides methods that enable an application to build a filter graph.
+
+
+
+
+
+ Adds a filter to the graph and gives it a name.
+
+
+ Filter to add to the graph.
+ Name of the filter.
+
+ Return's HRESULT error code.
+
+
+
+
+ Removes a filter from the graph.
+
+
+ Filter to be removed from the graph.
+
+ Return's HRESULT error code.
+
+
+
+
+ Provides an enumerator for all filters in the graph.
+
+
+ Filter enumerator.
+
+ Return's HRESULT error code.
+
+
+
+
+ Finds a filter that was added with a specified name.
+
+
+ Name of filter to search for.
+ Interface of found filter.
+
+ Return's HRESULT error code.
+
+
+
+
+ Connects two pins directly (without intervening filters).
+
+
+ Output pin.
+ Input pin.
+ Media type to use for the connection.
+
+ Return's HRESULT error code.
+
+
+
+
+ Breaks the existing pin connection and reconnects it to the same pin.
+
+
+ Pin to disconnect and reconnect.
+
+ Return's HRESULT error code.
+
+
+
+
+ Disconnects a specified pin.
+
+
+ Pin to disconnect.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the reference clock to the default clock.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Connects two pins. If they will not connect directly, this method connects them with intervening transforms.
+
+
+ Output pin.
+ Input pin.
+
+ Return's HRESULT error code.
+
+
+
+
+ Adds a chain of filters to a specified output pin to render it.
+
+
+ Output pin.
+
+ Return's HRESULT error code.
+
+
+
+
+ Builds a filter graph that renders the specified file.
+
+
+ Specifies a string that contains file name or device moniker.
+ Reserved.
+
+ Return's HRESULT error code.
+
+
+
+
+ Adds a source filter to the filter graph for a specific file.
+
+
+ Specifies the name of the file to load.
+ Specifies a name for the source filter.
+ Variable that receives the interface of the source filter.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the file for logging actions taken when attempting to perform an operation.
+
+
+ Handle to the log file.
+
+ Return's HRESULT error code.
+
+
+
+
+ Requests that the graph builder return as soon as possible from its current task.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Queries whether the current operation should continue.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ The interface provides callback methods for the method.
+
+
+
+
+
+ Callback method that receives a pointer to the media sample.
+
+
+ Starting time of the sample, in seconds.
+ Pointer to the sample's IMediaSample interface.
+
+ Return's HRESULT error code.
+
+
+
+
+ Callback method that receives a pointer to the sample bufferю
+
+
+ Starting time of the sample, in seconds.
+ Pointer to a buffer that contains the sample data.
+ Length of the buffer pointed to by buffer, in bytes
+
+ Return's HRESULT error code.
+
+
+
+
+ Local video device selection form.
+
+
+ The form provides a standard way of selecting local video
+ device (USB web camera, capture board, etc. - anything supporting DirectShow
+ interface), which can be reused across applications. It allows selecting video
+ device, video size and snapshots size (if device supports snapshots and
+ user needs them).
+
+
+
+
+
+
+
+ Required designer variable.
+
+
+
+
+ Clean up any resources being used.
+
+ true if managed resources should be disposed; otherwise, false.
+
+
+
+ Required method for Designer support - do not modify
+ the contents of this method with the code editor.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Specifies if snapshot configuration should be done or not.
+
+
+ The property specifies if the dialog form should
+ allow configuration of snapshot sizes (if selected video source supports
+ snapshots). If the property is set to , then
+ the form will provide additional combo box enumerating supported
+ snapshot sizes. Otherwise the combo boxes will be hidden.
+
+
+ If the property is set to and selected
+ device supports snapshots, then
+ property of the configured device is set to
+ .
+
+ Default value of the property is set to .
+
+
+
+
+
+ Provides configured video device.
+
+
+ The property provides configured video device if user confirmed
+ the dialog using "OK" button. If user canceled the dialog, the property is
+ set to .
+
+
+
+
+ Moniker string of the selected video device.
+
+
+ The property allows to get moniker string of the selected device
+ on form completion or set video device which should be selected by default on
+ form loading.
+
+
+
+
+ Video frame size of the selected device.
+
+
+ The property allows to get video size of the selected device
+ on form completion or set the size to be selected by default on form loading.
+
+
+
+
+
+ Snapshot frame size of the selected device.
+
+
+ The property allows to get snapshot size of the selected device
+ on form completion or set the size to be selected by default on form loading
+ (if property is set ).
+
+
+
+
+ Video input to use with video capture card.
+
+
+ The property allows to get video input of the selected device
+ on form completion or set it to be selected by default on form loading.
+
+
+
+
+ Some miscellaneous functions.
+
+
+
+
+
+ Get filter's pin.
+
+
+ Filter to get pin of.
+ Pin's direction.
+ Pin's number.
+
+ Returns filter's pin.
+
+
+
+
+ Get filter's input pin.
+
+
+ Filter to get pin of.
+ Pin's number.
+
+ Returns filter's pin.
+
+
+
+
+ Get filter's output pin.
+
+
+ Filter to get pin of.
+ Pin's number.
+
+ Returns filter's pin.
+
+
+
+
+ The interface indicates that an object supports property pages.
+
+
+
+
+
+ Fills a counted array of GUID values where each GUID specifies the
+ CLSID of each property page that can be displayed in the property
+ sheet for this object.
+
+
+ Pointer to a CAUUID structure that must be initialized
+ and filled before returning.
+
+ Return's HRESULT error code.
+
+
+
+
+ Enumerates pins on a filter.
+
+
+
+
+
+ Retrieves a specified number of pins.
+
+
+ Number of pins to retrieve.
+ Array of size cPins that is filled with IPin pointers.
+ Receives the number of pins retrieved.
+
+ Return's HRESULT error code.
+
+
+
+
+ Skips a specified number of pins in the enumeration sequence.
+
+
+ Number of pins to skip.
+
+ Return's HRESULT error code.
+
+
+
+
+ Resets the enumeration sequence to the beginning.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Makes a copy of the enumerator with the same enumeration state.
+
+
+ Duplicate of the enumerator.
+
+ Return's HRESULT error code.
+
+
+
+
+ This interface sets the output format on certain capture and compression filters,
+ for both audio and video.
+
+
+
+
+
+ Set the output format on the pin.
+
+
+ Media type to set.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the audio or video stream's format.
+
+
+ Retrieved media type.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieve the number of format capabilities that this pin supports.
+
+
+ Variable that receives the number of format capabilities.
+ Variable that receives the size of the configuration structure in bytes.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieve a set of format capabilities.
+
+
+ Specifies the format capability to retrieve, indexed from zero.
+ Retrieved media type.
+ Byte array, which receives information about capabilities.
+
+ Return's HRESULT error code.
+
+
+
+
+ Collection of filters' information objects.
+
+
+ The class allows to enumerate DirectShow filters of specified category. For
+ a list of categories see .
+
+ Sample usage:
+
+ // enumerate video devices
+ videoDevices = new FilterInfoCollection( FilterCategory.VideoInputDevice );
+ // list devices
+ foreach ( FilterInfo device in videoDevices )
+ {
+ // ...
+ }
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Guid of DirectShow filter category. See .
+
+ Build collection of filters' information objects for the
+ specified filter category.
+
+
+
+
+ Get filter information object.
+
+
+ Index of filter information object to retrieve.
+
+ Filter information object.
+
+
+
+
+ Video source for local video capture device (for example USB webcam).
+
+
+ This video source class captures video data from local video capture device,
+ like USB web camera (or internal), frame grabber, capture board - anything which
+ supports DirectShow interface. For devices which has a shutter button or
+ support external software triggering, the class also allows to do snapshots. Both
+ video size and snapshot size can be configured.
+
+ Sample usage:
+
+ // enumerate video devices
+ videoDevices = new FilterInfoCollection( FilterCategory.VideoInputDevice );
+ // create video source
+ VideoCaptureDevice videoSource = new VideoCaptureDevice( videoDevices[0].MonikerString );
+ // set NewFrame event handler
+ videoSource.NewFrame += new NewFrameEventHandler( video_NewFrame );
+ // start the video source
+ videoSource.Start( );
+ // ...
+ // signal to stop when you no longer need capturing
+ videoSource.SignalToStop( );
+ // ...
+
+ private void video_NewFrame( object sender, NewFrameEventArgs eventArgs )
+ {
+ // get new frame
+ Bitmap bitmap = eventArgs.Frame;
+ // process the frame
+ }
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Moniker string of video capture device.
+
+
+
+
+ Start video source.
+
+
+ Starts video source and return execution to caller. Video source
+ object creates background thread and notifies about new frames with the
+ help of event.
+
+
+
+
+ Signal video source to stop its work.
+
+
+ Signals video source to stop its background thread, stop to
+ provide new frames and free resources.
+
+
+
+
+ Wait for video source has stopped.
+
+
+ Waits for source stopping after it was signalled to stop using
+ method.
+
+
+
+
+ Stop video source.
+
+
+ Stops video source aborting its thread.
+
+ Since the method aborts background thread, its usage is highly not preferred
+ and should be done only if there are no other options. The correct way of stopping camera
+ is signaling it stop and then
+ waiting for background thread's completion.
+
+
+
+
+
+ Free resource.
+
+
+
+
+
+ Display property window for the video capture device providing its configuration
+ capabilities.
+
+
+ Handle of parent window.
+
+ If you pass parent window's handle to this method, then the
+ displayed property page will become modal window and none of the controls from the
+ parent window will be accessible. In order to make it modeless it is required
+ to pass as parent window's handle.
+
+
+
+ The video source does not support configuration property page.
+
+
+
+
+ Display property page of video crossbar (Analog Video Crossbar filter).
+
+
+ Handle of parent window.
+
+ The Analog Video Crossbar filter is modeled after a general switching matrix,
+ with n inputs and m outputs. For example, a video card might have two external connectors:
+ a coaxial connector for TV, and an S-video input. These would be represented as input pins on
+ the filter. The displayed property page allows to configure the crossbar by selecting input
+ of a video card to use.
+
+ This method can be invoked only when video source is running ( is
+ ). Otherwise it generates exception.
+
+ Use method to check if running video source provides
+ crossbar configuration.
+
+
+ The video source must be running in order to display crossbar property page.
+ Crossbar configuration is not supported by currently running video source.
+
+
+
+
+ Check if running video source provides crossbar for configuration.
+
+
+ Returns if crossbar configuration is available or
+ otherwise.
+
+ The method reports if the video source provides crossbar configuration
+ using .
+
+
+
+
+
+ Simulates an external trigger.
+
+
+ The method simulates external trigger for video cameras, which support
+ providing still image snapshots. The effect is equivalent as pressing camera's shutter
+ button - a snapshot will be provided through event.
+
+ The property must be set to
+ to enable receiving snapshots.
+
+
+
+
+
+ Sets a specified property on the camera.
+
+
+ Specifies the property to set.
+ Specifies the new value of the property.
+ Specifies the desired control setting.
+
+ Returns true on sucee or false otherwise.
+
+ Video source is not specified - device moniker is not set.
+ Failed creating device object for moniker.
+ The video source does not support camera control.
+
+
+
+
+ Gets the current setting of a camera property.
+
+
+ Specifies the property to retrieve.
+ Receives the value of the property.
+ Receives the value indicating whether the setting is controlled manually or automatically
+
+ Returns true on sucee or false otherwise.
+
+ Video source is not specified - device moniker is not set.
+ Failed creating device object for moniker.
+ The video source does not support camera control.
+
+
+
+
+ Gets the range and default value of a specified camera property.
+
+
+ Specifies the property to query.
+ Receives the minimum value of the property.
+ Receives the maximum value of the property.
+ Receives the step size for the property.
+ Receives the default value of the property.
+ Receives a member of the enumeration, indicating whether the property is controlled automatically or manually.
+
+ Returns true on sucee or false otherwise.
+
+ Video source is not specified - device moniker is not set.
+ Failed creating device object for moniker.
+ The video source does not support camera control.
+
+
+
+
+ Worker thread.
+
+
+
+
+
+ Notifies clients about new frame.
+
+
+ New frame's image.
+
+
+
+
+ Notifies clients about new snapshot frame.
+
+
+ New snapshot's image.
+
+
+
+
+ Current video input of capture card.
+
+
+ The property specifies video input to use for video devices like capture cards
+ (those which provide crossbar configuration). List of available video inputs can be obtained
+ from property.
+
+ To check if the video device supports crossbar configuration, the
+ method can be used.
+
+ This property can be set as before running video device, as while running it.
+
+ By default this property is set to , which means video input
+ will not be set when running video device, but currently configured will be used. After video device
+ is started this property will be updated anyway to tell current video input.
+
+
+
+
+
+ Available inputs of the video capture card.
+
+
+ The property provides list of video inputs for devices like video capture cards.
+ Such devices usually provide several video inputs, which can be selected using crossbar.
+ If video device represented by the object of this class supports crossbar, then this property
+ will list all video inputs. However if it is a regular USB camera, for example, which does not
+ provide crossbar configuration, the property will provide zero length array.
+
+ Video input to be used can be selected using . See also
+ method, which provides crossbar configuration dialog.
+
+ It is recomended not to call this property immediately after method, since
+ device may not start yet and provide its information. It is better to call the property
+ before starting device or a bit after (but not immediately after).
+
+
+
+
+
+ Specifies if snapshots should be provided or not.
+
+
+ Some USB cameras/devices may have a shutter button, which may result into snapshot if it
+ is pressed. So the property specifies if the video source will try providing snapshots or not - it will
+ check if the camera supports providing still image snapshots. If camera supports snapshots and the property
+ is set to , then snapshots will be provided through
+ event.
+
+ Check supported sizes of snapshots using property and set the
+ desired size using property.
+
+ The property must be set before running the video source to take effect.
+
+ Default value of the property is set to .
+
+
+
+
+
+ New frame event.
+
+
+ Notifies clients about new available frame from video source.
+
+ Since video source may have multiple clients, each client is responsible for
+ making a copy (cloning) of the passed video frame, because the video source disposes its
+ own original copy after notifying of clients.
+
+
+
+
+
+ Snapshot frame event.
+
+
+ Notifies clients about new available snapshot frame - the one which comes when
+ camera's snapshot/shutter button is pressed.
+
+ See documentation to for additional information.
+
+ Since video source may have multiple clients, each client is responsible for
+ making a copy (cloning) of the passed snapshot frame, because the video source disposes its
+ own original copy after notifying of clients.
+
+
+
+
+
+
+
+ Video source error event.
+
+
+ This event is used to notify clients about any type of errors occurred in
+ video source object, for example internal exceptions.
+
+
+
+
+ Video playing finished event.
+
+
+ This event is used to notify clients that the video playing has finished.
+
+
+
+
+
+ Video source.
+
+
+ Video source is represented by moniker string of video capture device.
+
+
+
+
+ Received frames count.
+
+
+ Number of frames the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ Received bytes count.
+
+
+ Number of bytes the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ State of the video source.
+
+
+ Current state of video source object - running or not.
+
+
+
+
+ Obsolete - no longer in use
+
+
+ The property is obsolete. Use property instead.
+ Setting this property does not have any effect.
+
+
+
+
+ Obsolete - no longer in use
+
+
+ The property is obsolete. Use property instead.
+ Setting this property does not have any effect.
+
+
+
+
+ Obsolete - no longer in use.
+
+
+ The property is obsolete. Setting this property does not have any effect.
+
+
+
+
+ Video resolution to set.
+
+
+ The property allows to set one of the video resolutions supported by the camera.
+ Use property to get the list of supported video resolutions.
+
+ The property must be set before camera is started to make any effect.
+
+ Default value of the property is set to , which means default video
+ resolution is used.
+
+
+
+
+
+ Snapshot resolution to set.
+
+
+ The property allows to set one of the snapshot resolutions supported by the camera.
+ Use property to get the list of supported snapshot resolutions.
+
+ The property must be set before camera is started to make any effect.
+
+ Default value of the property is set to , which means default snapshot
+ resolution is used.
+
+
+
+
+
+ Video capabilities of the device.
+
+
+ The property provides list of device's video capabilities.
+
+ It is recomended not to call this property immediately after method, since
+ device may not start yet and provide its information. It is better to call the property
+ before starting device or a bit after (but not immediately after).
+
+
+
+
+
+ Snapshot capabilities of the device.
+
+
+ The property provides list of device's snapshot capabilities.
+
+ If the array has zero length, then it means that this device does not support making
+ snapshots.
+
+ See documentation to for additional information.
+
+ It is recomended not to call this property immediately after method, since
+ device may not start yet and provide its information. It is better to call the property
+ before starting device or a bit after (but not immediately after).
+
+
+
+
+
+
+
+ Source COM object of camera capture device.
+
+
+ The source COM object of camera capture device is exposed for the
+ case when user may need get direct access to the object for making some custom
+ configuration of camera through DirectShow interface, for example.
+
+
+ If camera is not running, the property is set to .
+
+
+
+
+
+ The interface sets properties on the video window.
+
+
+
+
+
+ Sets the video window caption.
+
+
+ Caption.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the video window caption.
+
+
+ Caption.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the window style on the video window.
+
+
+ Window style flags.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the window style on the video window.
+
+
+ Window style flags.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the extended window style on the video window.
+
+
+ Window extended style flags.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the extended window style on the video window.
+
+
+ Window extended style flags.
+
+ Return's HRESULT error code.
+
+
+
+
+ Specifies whether the video renderer automatically shows the video window when it receives video data.
+
+
+ Specifies whether the video renderer automatically shows the video window.
+
+ Return's HRESULT error code.
+
+
+
+
+ Queries whether the video renderer automatically shows the video window when it receives video data.
+
+
+ REceives window auto show flag.
+
+ Return's HRESULT error code.
+
+
+
+
+ Shows, hides, minimizes, or maximizes the video window.
+
+
+ Window state.
+
+ Return's HRESULT error code.
+
+
+
+
+ Queries whether the video window is visible, hidden, minimized, or maximized.
+
+
+ Window state.
+
+ Return's HRESULT error code.
+
+
+
+
+ Specifies whether the video window realizes its palette in the background.
+
+
+ Value that specifies whether the video renderer realizes it palette in the background.
+
+ Return's HRESULT error code.
+
+
+
+
+ Queries whether the video window realizes its palette in the background.
+
+
+ Receives state of background palette flag.
+
+ Return's HRESULT error code.
+
+
+
+
+ Shows or hides the video window.
+
+
+ Value that specifies whether to show or hide the window.
+
+ Return's HRESULT error code.
+
+
+
+
+ Queries whether the video window is visible.
+
+
+ Visibility flag.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the video window's x-coordinate.
+
+
+ Specifies the x-coordinate, in pixels.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the video window's x-coordinate.
+
+
+ x-coordinate, in pixels.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the width of the video window.
+
+
+ Specifies the width, in pixels.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the width of the video window.
+
+
+ Width, in pixels.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the video window's y-coordinate.
+
+
+ Specifies the y-coordinate, in pixels.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the video window's y-coordinate.
+
+
+ y-coordinate, in pixels.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the height of the video window.
+
+
+ Specifies the height, in pixels.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the height of the video window.
+
+
+ Height, in pixels.
+
+ Return's HRESULT error code.
+
+
+
+
+ Specifies a parent window for the video windowю
+
+
+ Specifies a handle to the parent window.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the video window's parent window, if anyю
+
+
+ Parent window's handle.
+
+ Return's HRESULT error code.
+
+
+
+
+ Specifies a window to receive mouse and keyboard messages from the video window.
+
+
+ Specifies a handle to the window.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the window that receives mouse and keyboard messages from the video window, if any.
+
+
+ Window's handle.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the color that appears around the edges of the destination rectangle.
+
+
+ Border's color.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the color that appears around the edges of the destination rectangle.
+
+
+ Specifies the border color.
+
+ Return's HRESULT error code.
+
+
+
+
+ Queries whether the video renderer is in full-screen mode.
+
+
+ Full-screen mode.
+
+ Return's HRESULT error code.
+
+
+
+
+ Enables or disables full-screen mode.
+
+
+ Boolean value that specifies whether to enable or disable full-screen mode.
+
+ Return's HRESULT error code.
+
+
+
+
+ Places the video window at the top of the Z order.
+
+
+ Value that specifies whether to give the window focus.
+
+ Return's HRESULT error code.
+
+
+
+
+ Forwards a message to the video window.
+
+
+ Handle to the window.
+ Specifies the message.
+ Message parameter.
+ Message parameter.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the position of the video windowю
+
+
+ Specifies the x-coordinate, in pixels.
+ Specifies the y-coordinate, in pixels.
+ Specifies the width, in pixels.
+ Specifies the height, in pixels.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the position of the video window.
+
+
+ x-coordinate, in pixels.
+ y-coordinate, in pixels.
+ Width, in pixels.
+ Height, in pixels.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the minimum ideal size for the video image.
+
+
+ Receives the minimum ideal width, in pixels.
+ Receives the minimum ideal height, in pixels.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the maximum ideal size for the video image.
+
+
+ Receives the maximum ideal width, in pixels.
+ Receives the maximum ideal height, in pixels.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the restored window position.
+
+
+ x-coordinate, in pixels.
+ y-coordinate, in pixels.
+ Width, in pixels.
+ Height, in pixels.
+
+ Return's HRESULT error code.
+
+
+
+
+ Hides the cursor.
+
+
+ Specifies whether to hide or display the cursor.
+
+ Return's HRESULT error code.
+
+
+
+
+ Queries whether the cursor is hidden.
+
+
+ Specifies if cursor is hidden or not.
+
+ Return's HRESULT error code.
+
+
+
+
+ The IPropertyBag interface provides an object with a property bag in
+ which the object can persistently save its properties.
+
+
+
+
+
+ Read a property from property bag.
+
+
+ Property name to read.
+ Property value.
+ Caller's error log.
+
+ Return's HRESULT error code.
+
+
+
+
+ Write property to property bag.
+
+
+ Property name to read.
+ Property value.
+
+ Return's HRESULT error code.
+
+
+
+
+ The interface provides methods for controlling the flow of data through the filter graph.
+ It includes methods for running, pausing, and stopping the graph.
+
+
+
+
+
+ This method informs the filter to transition to the new state.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ This method informs the filter to transition to the new state.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ This method informs the filter to transition to the new (running) state. Passes a time value to synchronize independent streams.
+
+
+ Time value of the reference clock. The amount to be added to the IMediaSample time stamp to determine the time at which that sample should be rendered according to the reference clock. That is, it is the reference time at which a sample with a stream time of zero should be rendered.
+
+ Return's HRESULT error code.
+
+
+
+
+ This method determines the filter's state.
+
+
+ Duration of the time-out, in milliseconds. To block indefinitely, pass INFINITE.
+ Returned state of the filter. States include stopped, paused, running, or intermediate (in the process of changing).
+
+ Return's HRESULT error code.
+
+
+
+
+ This method identifies the reference clock to which the filter should synchronize activity.
+
+
+ Pointer to the IReferenceClock interface.
+
+ Return's HRESULT error code.
+
+
+
+
+ This method retrieves the current reference clock in use by this filter.
+
+
+ Pointer to a reference clock; it will be set to the IReferenceClock interface.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ The interface provides methods for controlling the flow of data through the filter graph.
+ It includes methods for running, pausing, and stopping the graph.
+
+
+
+
+
+ Runs all the filters in the filter graph.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Pauses all filters in the filter graph.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Stops all the filters in the filter graph.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the state of the filter graph.
+
+
+ Duration of the time-out, in milliseconds, or INFINITE to specify an infinite time-out.
+ Мariable that receives a member of the FILTER_STATE enumeration.
+
+ Return's HRESULT error code.
+
+
+
+
+ Builds a filter graph that renders the specified file.
+
+
+ Name of the file to render
+
+ Return's HRESULT error code.
+
+
+
+
+ Adds a source filter to the filter graph, for a specified file.
+
+
+ Name of the file containing the source video.
+ Receives interface of filter information object.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves a collection of the filters in the filter graph.
+
+
+ Receives the IAMCollection interface.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves a collection of all the filters listed in the registry.
+
+
+ Receives the IDispatch interface of IAMCollection object.
+
+ Return's HRESULT error code.
+
+
+
+
+ Pauses the filter graph, allowing filters to queue data, and then stops the filter graph.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ This interface extends the and
+ interfaces, which contain methods for building filter graphs.
+
+
+
+
+
+ Adds a filter to the graph and gives it a name.
+
+
+ Filter to add to the graph.
+ Name of the filter.
+
+ Return's HRESULT error code.
+
+
+
+
+ Removes a filter from the graph.
+
+
+ Filter to be removed from the graph.
+
+ Return's HRESULT error code.
+
+
+
+
+ Provides an enumerator for all filters in the graph.
+
+
+ Filter enumerator.
+
+ Return's HRESULT error code.
+
+
+
+
+ Finds a filter that was added with a specified name.
+
+
+ Name of filter to search for.
+ Interface of found filter.
+
+ Return's HRESULT error code.
+
+
+
+
+ Connects two pins directly (without intervening filters).
+
+
+ Output pin.
+ Input pin.
+ Media type to use for the connection.
+
+ Return's HRESULT error code.
+
+
+
+
+ Breaks the existing pin connection and reconnects it to the same pin.
+
+
+ Pin to disconnect and reconnect.
+
+ Return's HRESULT error code.
+
+
+
+
+ Disconnects a specified pin.
+
+
+ Pin to disconnect.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the reference clock to the default clock.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Connects two pins. If they will not connect directly, this method connects them with intervening transforms.
+
+
+ Output pin.
+ Input pin.
+
+ Return's HRESULT error code.
+
+
+
+
+ Adds a chain of filters to a specified output pin to render it.
+
+
+ Output pin.
+
+ Return's HRESULT error code.
+
+
+
+
+ Builds a filter graph that renders the specified file.
+
+
+ Specifies a string that contains file name or device moniker.
+ Reserved.
+
+ Return's HRESULT error code.
+
+
+
+
+ Adds a source filter to the filter graph for a specific file.
+
+
+ Specifies the name of the file to load.
+ Specifies a name for the source filter.
+ Variable that receives the interface of the source filter.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the file for logging actions taken when attempting to perform an operation.
+
+
+ Handle to the log file.
+
+ Return's HRESULT error code.
+
+
+
+
+ Requests that the graph builder return as soon as possible from its current task.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Queries whether the current operation should continue.
+
+
+ Return's HRESULT error code.
+
+
+
+
+
+
+
+ Moniker interface.
+ Bind context interface.
+ Name for the filter.
+ Receives source filter's IBaseFilter interface.
+ The caller must release the interface.
+
+ Return's HRESULT error code.
+
+
+
+
+ Breaks the existing pin connection and reconnects it to the same pin,
+ using a specified media type.
+
+
+ Pin to disconnect and reconnect.
+ Media type to reconnect with.
+
+ Return's HRESULT error code.
+
+
+
+
+ Render an output pin, with an option to use existing renderers only.
+
+
+ Interface of the output pin.
+ Flag that specifies how to render the pin.
+ Reserved.
+
+ Return's HRESULT error code.
+
+
+
+
+ This interface is used by applications or other filters to determine
+ what filters exist in the filter graph.
+
+
+
+
+
+ Retrieves the specified number of filters in the enumeration sequence.
+
+
+ Number of filters to retrieve.
+ Array in which to place interfaces.
+ Actual number of filters placed in the array.
+
+ Return's HRESULT error code.
+
+
+
+
+ Skips a specified number of filters in the enumeration sequence.
+
+
+ Number of filters to skip.
+
+ Return's HRESULT error code.
+
+
+
+
+ Resets the enumeration sequence to the beginning.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Makes a copy of the enumerator with the same enumeration state.
+
+
+ Duplicate of the enumerator.
+
+
+ Return's HRESULT error code.
+
+
+
+
+
+ The ICreateDevEnum interface creates an enumerator for devices within a particular category,
+ such as video capture devices, audio capture devices, video compressors, and so forth.
+
+
+
+
+
+ Creates a class enumerator for a specified device category.
+
+
+ Specifies the class identifier of the device category.
+ Address of a variable that receives an IEnumMoniker interface pointer
+ Bitwise combination of zero or more flags. If zero, the method enumerates every filter in the category.
+
+ Return's HRESULT error code.
+
+
+
+
+ Some Win32 API used internally.
+
+
+
+
+
+ Supplies a pointer to an implementation of IBindCtx (a bind context object).
+ This object stores information about a particular moniker-binding operation.
+
+
+ Reserved for future use; must be zero.
+ Address of IBindCtx* pointer variable that receives the
+ interface pointer to the new bind context object.
+
+ Returns S_OK on success.
+
+
+
+
+ Converts a string into a moniker that identifies the object named by the string.
+
+
+ Pointer to the IBindCtx interface on the bind context object to be used in this binding operation.
+ Pointer to a zero-terminated wide character string containing the display name to be parsed.
+ Pointer to the number of characters of szUserName that were consumed.
+ Address of IMoniker* pointer variable that receives the interface pointer
+ to the moniker that was built from szUserName.
+
+ Returns S_OK on success.
+
+
+
+
+ Copy a block of memory.
+
+
+ Destination pointer.
+ Source pointer.
+ Memory block's length to copy.
+
+ Return's the value of dst - pointer to destination.
+
+
+
+
+ Invokes a new property frame, that is, a property sheet dialog box.
+
+
+ Parent window of property sheet dialog box.
+ Horizontal position for dialog box.
+ Vertical position for dialog box.
+ Dialog box caption.
+ Number of object pointers in ppUnk.
+ Pointer to the objects for property sheet.
+ Number of property pages in lpPageClsID.
+ Array of CLSIDs for each property page.
+ Locale identifier for property sheet locale.
+ Reserved.
+ Reserved.
+
+ Returns S_OK on success.
+
+
+
+
+ The enumeration specifies a setting on a camera.
+
+
+
+
+ Pan control.
+
+
+
+
+ Tilt control.
+
+
+
+
+ Roll control.
+
+
+
+
+ Zoom control.
+
+
+
+
+ Exposure control.
+
+
+
+
+ Iris control.
+
+
+
+
+ Focus control.
+
+
+
+
+ The enumeration defines whether a camera setting is controlled manually or automatically.
+
+
+
+
+ No control flag.
+
+
+
+
+ Auto control Flag.
+
+
+
+
+ Manual control Flag.
+
+
+
+
+ Video input of a capture board.
+
+
+ The class is used to describe video input of devices like video capture boards,
+ which usually provide several inputs.
+
+
+
+
+
+ Index of the video input.
+
+
+
+
+ Type of the video input.
+
+
+
+
+ Default video input. Used to specify that it should not be changed.
+
+
+
+
+ DirectShow filter information.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Filters's moniker string.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Filter's moniker object.
+
+
+
+
+ Compare the object with another instance of this class.
+
+
+ Object to compare with.
+
+ A signed number indicating the relative values of this instance and value.
+
+
+
+
+ Create an instance of the filter.
+
+
+ Filter's moniker string.
+
+ Returns filter's object, which implements IBaseFilter interface.
+
+ The returned filter's object should be released using Marshal.ReleaseComObject().
+
+
+
+
+ Filter name.
+
+
+
+
+ Filters's moniker string.
+
+
+
+
+
+ DirectShow class IDs.
+
+
+
+
+ System device enumerator.
+
+
+ Equals to CLSID_SystemDeviceEnum.
+
+
+
+
+ Filter graph.
+
+
+ Equals to CLSID_FilterGraph.
+
+
+
+
+ Sample grabber.
+
+
+ Equals to CLSID_SampleGrabber.
+
+
+
+
+ Capture graph builder.
+
+
+ Equals to CLSID_CaptureGraphBuilder2.
+
+
+
+
+ Async reader.
+
+
+ Equals to CLSID_AsyncReader.
+
+
+
+
+ DirectShow format types.
+
+
+
+
+
+ VideoInfo.
+
+
+ Equals to FORMAT_VideoInfo.
+
+
+
+
+ VideoInfo2.
+
+
+ Equals to FORMAT_VideoInfo2.
+
+
+
+
+ DirectShow media types.
+
+
+
+
+
+ Video.
+
+
+ Equals to MEDIATYPE_Video.
+
+
+
+
+ Interleaved. Used by Digital Video (DV).
+
+
+ Equals to MEDIATYPE_Interleaved.
+
+
+
+
+ Audio.
+
+
+ Equals to MEDIATYPE_Audio.
+
+
+
+
+ Text.
+
+
+ Equals to MEDIATYPE_Text.
+
+
+
+
+ Byte stream with no time stamps.
+
+
+ Equals to MEDIATYPE_Stream.
+
+
+
+
+ DirectShow media subtypes.
+
+
+
+
+
+ YUY2 (packed 4:2:2).
+
+
+ Equals to MEDIASUBTYPE_YUYV.
+
+
+
+
+ IYUV.
+
+
+ Equals to MEDIASUBTYPE_IYUV.
+
+
+
+
+ A DV encoding format. (FOURCC 'DVSD')
+
+
+ Equals to MEDIASUBTYPE_DVSD.
+
+
+
+
+ RGB, 1 bit per pixel (bpp), palettized.
+
+
+ Equals to MEDIASUBTYPE_RGB1.
+
+
+
+
+ RGB, 4 bpp, palettized.
+
+
+ Equals to MEDIASUBTYPE_RGB4.
+
+
+
+
+ RGB, 8 bpp.
+
+
+ Equals to MEDIASUBTYPE_RGB8.
+
+
+
+
+ RGB 565, 16 bpp.
+
+
+ Equals to MEDIASUBTYPE_RGB565.
+
+
+
+
+ RGB 555, 16 bpp.
+
+
+ Equals to MEDIASUBTYPE_RGB555.
+
+
+
+
+ RGB, 24 bpp.
+
+
+ Equals to MEDIASUBTYPE_RGB24.
+
+
+
+
+ RGB, 32 bpp, no alpha channel.
+
+
+ Equals to MEDIASUBTYPE_RGB32.
+
+
+
+
+ Data from AVI file.
+
+
+ Equals to MEDIASUBTYPE_Avi.
+
+
+
+
+ Advanced Streaming Format (ASF).
+
+
+ Equals to MEDIASUBTYPE_Asf.
+
+
+
+
+ DirectShow pin categories.
+
+
+
+
+
+ Capture pin.
+
+
+ Equals to PIN_CATEGORY_CAPTURE.
+
+
+
+
+ Still image pin.
+
+
+ Equals to PIN_CATEGORY_STILL.
+
+
+
+ Equals to LOOK_UPSTREAM_ONLY.
+
+
+ Equals to LOOK_DOWNSTREAM_ONLY.
+
+
+
+ The IReferenceClock interface provides the reference time for the filter graph.
+
+ Filters that can act as a reference clock can expose this interface. It is also exposed by the System Reference Clock.
+ The filter graph manager uses this interface to synchronize the filter graph. Applications can use this interface to
+ retrieve the current reference time, or to request notification of an elapsed time.
+
+
+
+
+ The GetTime method retrieves the current reference time.
+
+
+ Pointer to a variable that receives the current time, in 100-nanosecond units.
+
+ Return's HRESULT error code.
+
+
+
+
+ The AdviseTime method creates a one-shot advise request.
+
+
+ Base reference time, in 100-nanosecond units. See Remarks.
+ Stream offset time, in 100-nanosecond units. See Remarks.
+ Handle to an event, created by the caller.
+ Pointer to a variable that receives an identifier for the advise request.
+
+ Return's HRESULT error code.
+
+
+
+
+ The AdvisePeriodic method creates a periodic advise request.
+
+
+ Time of the first notification, in 100-nanosecond units. Must be greater than zero and less than MAX_TIME.
+ Time between notifications, in 100-nanosecond units. Must be greater than zero.
+ Handle to a semaphore, created by the caller.
+ Pointer to a variable that receives an identifier for the advise request.
+
+ Return's HRESULT error code.
+
+
+
+
+ The Unadvise method removes a pending advise request.
+
+
+ Identifier of the request to remove. Use the value returned by IReferenceClock::AdviseTime or IReferenceClock::AdvisePeriodic in the pdwAdviseToken parameter.
+
+ Return's HRESULT error code.
+
+
+
+
+ The IAMCrossbar interface routes signals from an analog or digital source to a video capture filter.
+
+
+
+
+ Retrieves the number of input and output pins on the crossbar filter.
+
+
+ Variable that receives the number of output pins.
+ Variable that receives the number of input pins.
+
+ Return's HRESULT error code.
+
+
+
+
+ Queries whether a specified input pin can be routed to a specified output pin.
+
+
+ Specifies the index of the output pin.
+ Specifies the index of input pin.
+
+ Return's HRESULT error code.
+
+
+
+
+ Routes an input pin to an output pin.
+
+
+ Specifies the index of the output pin.
+ Specifies the index of the input pin.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the input pin that is currently routed to the specified output pin.
+
+
+ Specifies the index of the output pin.
+ Variable that receives the index of the input pin, or -1 if no input pin is routed to this output pin.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves information about a specified pin.
+
+
+ Specifies the direction of the pin. Use one of the following values.
+ Specifies the index of the pin.
+ Variable that receives the index of the related pin, or –1 if no pin is related to this pin.
+ Variable that receives a member of the PhysicalConnectorType enumeration, indicating the pin's physical type.
+
+ Return's HRESULT error code.
+
+
+
+
+ The IBaseFilter interface provides methods for controlling a filter.
+ All DirectShow filters expose this interface
+
+
+
+
+
+ Returns the class identifier (CLSID) for the component object.
+
+
+ Points to the location of the CLSID on return.
+
+ Return's HRESULT error code.
+
+
+
+
+ Stops the filter.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Pauses the filter.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Runs the filter.
+
+
+ Reference time corresponding to stream time 0.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the state of the filter (running, stopped, or paused).
+
+
+ Time-out interval, in milliseconds.
+ Pointer to a variable that receives filter's state.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the reference clock for the filter or the filter graph.
+
+
+ Pointer to the clock's IReferenceClock interface, or NULL.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the current reference clock.
+
+
+ Address of a variable that receives a pointer to the clock's IReferenceClock interface.
+
+ Return's HRESULT error code.
+
+
+
+
+ Enumerates the pins on this filter.
+
+
+ Address of a variable that receives a pointer to the IEnumPins interface.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the pin with the specified identifier.
+
+
+ Pointer to a constant wide-character string that identifies the pin.
+ Address of a variable that receives a pointer to the pin's IPin interface.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves information about the filter.
+
+
+ Pointer to FilterInfo structure.
+
+ Return's HRESULT error code.
+
+
+
+
+ Notifies the filter that it has joined or left the filter graph.
+
+
+ Pointer to the Filter Graph Manager's IFilterGraph interface, or NULL
+ if the filter is leaving the graph.
+ String that specifies a name for the filter.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves a string containing vendor information.
+
+
+ Receives a string containing the vendor information.
+
+ Return's HRESULT error code.
+
+
+
+
+ The interface inherits contains methods for retrieving event notifications and for overriding the
+ filter graph's default handling of events.
+
+
+
+
+ Retrieves a handle to a manual-reset event that remains signaled while the queue contains event notifications.
+
+ Pointer to a variable that receives the event handle.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the next event notification from the event queue.
+
+
+ Variable that receives the event code.
+ Pointer to a variable that receives the first event parameter.
+ Pointer to a variable that receives the second event parameter.
+ Time-out interval, in milliseconds.
+
+ Return's HRESULT error code.
+
+
+
+
+ Waits for the filter graph to render all available data.
+
+
+ Time-out interval, in milliseconds. Pass zero to return immediately.
+ Pointer to a variable that receives an event code.
+
+ Return's HRESULT error code.
+
+
+
+
+ Cancels the Filter Graph Manager's default handling for a specified event.
+
+
+ Event code for which to cancel default handling.
+
+ Return's HRESULT error code.
+
+
+
+
+ Restores the Filter Graph Manager's default handling for a specified event.
+
+ Event code for which to restore default handling.
+
+ Return's HRESULT error code.
+
+
+
+
+ Frees resources associated with the parameters of an event.
+
+ Event code.
+ First event parameter.
+ Second event parameter.
+
+ Return's HRESULT error code.
+
+
+
+
+ Registers a window to process event notifications.
+
+
+ Handle to the window, or to stop receiving event messages.
+ Window message to be passed as the notification.
+ Value to be passed as the lParam parameter for the lMsg message.
+
+ Return's HRESULT error code.
+
+
+
+
+ Enables or disables event notifications.
+
+
+ Value indicating whether to enable or disable event notifications.
+
+ Return's HRESULT error code.
+
+
+
+
+ Determines whether event notifications are enabled.
+
+
+ Variable that receives current notification status.
+
+ Return's HRESULT error code.
+
+
+
+
+ Video source for video files.
+
+
+ The video source provides access to video files. DirectShow is used to access video
+ files.
+
+ Sample usage:
+
+ // create video source
+ FileVideoSource videoSource = new FileVideoSource( fileName );
+ // set NewFrame event handler
+ videoSource.NewFrame += new NewFrameEventHandler( video_NewFrame );
+ // start the video source
+ videoSource.Start( );
+ // ...
+ // signal to stop
+ videoSource.SignalToStop( );
+ // ...
+
+ // New frame event handler, which is invoked on each new available video frame
+ private void video_NewFrame( object sender, NewFrameEventArgs eventArgs )
+ {
+ // get new frame
+ Bitmap bitmap = eventArgs.Frame;
+ // process the frame
+ }
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Video file name.
+
+
+
+
+ Start video source.
+
+
+ Starts video source and return execution to caller. Video source
+ object creates background thread and notifies about new frames with the
+ help of event.
+
+
+
+
+ Signal video source to stop its work.
+
+
+ Signals video source to stop its background thread, stop to
+ provide new frames and free resources.
+
+
+
+
+ Wait for video source has stopped.
+
+
+ Waits for source stopping after it was signalled to stop using
+ method.
+
+
+
+
+ Stop video source.
+
+
+ Stops video source aborting its thread.
+
+ Since the method aborts background thread, its usage is highly not preferred
+ and should be done only if there are no other options. The correct way of stopping camera
+ is signaling it stop and then
+ waiting for background thread's completion.
+
+
+
+
+
+ Free resource.
+
+
+
+
+
+ Worker thread.
+
+
+
+
+
+ Notifies client about new frame.
+
+
+ New frame's image.
+
+
+
+
+ New frame event.
+
+
+ Notifies clients about new available frame from video source.
+
+ Since video source may have multiple clients, each client is responsible for
+ making a copy (cloning) of the passed video frame, because the video source disposes its
+ own original copy after notifying of clients.
+
+
+
+
+
+ Video source error event.
+
+
+ This event is used to notify clients about any type of errors occurred in
+ video source object, for example internal exceptions.
+
+
+
+
+ Video playing finished event.
+
+
+ This event is used to notify clients that the video playing has finished.
+
+
+
+
+
+ Video source.
+
+
+ Video source is represented by video file name.
+
+
+
+
+ Received frames count.
+
+
+ Number of frames the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ Received bytes count.
+
+
+ Number of bytes the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ State of the video source.
+
+
+ Current state of video source object - running or not.
+
+
+
+
+ Prevent video freezing after screen saver and workstation lock or not.
+
+
+
+ The value specifies if the class should prevent video freezing during and
+ after screen saver or workstation lock. To prevent freezing the DirectShow graph
+ should not contain Renderer filter, which is added by Render() method
+ of graph. However, in some cases it may be required to call Render() method of graph, since
+ it may add some more filters, which may be required for playing video. So, the property is
+ a trade off - it is possible to prevent video freezing skipping adding renderer filter or
+ it is possible to keep renderer filter, but video may freeze during screen saver.
+
+ The property may become obsolete in the future when approach to disable freezing
+ and adding all required filters is found.
+
+ The property should be set before calling method
+ of the class to have effect.
+
+ Default value of this property is set to false.
+
+
+
+
+
+
+ Enables/disables reference clock on the graph.
+
+
+ Disabling reference clocks causes DirectShow graph to run as fast as
+ it can process data. When enabled, it will process frames according to presentation
+ time of a video file.
+
+ The property should be set before calling method
+ of the class to have effect.
+
+ Default value of this property is set to true.
+
+
+
+
+
diff --git a/Part 1 - Record Video/bin/Debug/AForge.Video.FFMPEG.dll b/Part 1 - Record Video/bin/Debug/AForge.Video.FFMPEG.dll
new file mode 100644
index 0000000..65b58f6
Binary files /dev/null and b/Part 1 - Record Video/bin/Debug/AForge.Video.FFMPEG.dll differ
diff --git a/Part 1 - Record Video/bin/Debug/AForge.Video.FFMPEG.xml b/Part 1 - Record Video/bin/Debug/AForge.Video.FFMPEG.xml
new file mode 100644
index 0000000..e815a00
--- /dev/null
+++ b/Part 1 - Record Video/bin/Debug/AForge.Video.FFMPEG.xml
@@ -0,0 +1,5761 @@
+
+
+
+ "Video.FFMPEG"
+
+
+
+
+Stop video source.
+
+
+ Stops video source aborting its thread.
+
+ Since the method aborts background thread, its usage is highly not preferred
+and should be done only if there are no other options. The correct way of stopping camera
+is signaling it stop and then
+waiting for background thread's completion.
+
+
+
+
+
+Wait for video source has stopped.
+
+ Waits for source stopping after it was signalled to stop using
+ method.
+
+
+
+Signal video source to stop its work.
+
+ Signals video source to stop its background thread, stop to
+provide new frames and free resources.
+
+
+
+Start video source.
+
+ Starts video source and return execution to caller. Video source
+object creates background thread and notifies about new frames with the
+help of event.
+ Video source is not specified.
+
+
+
+Initializes a new instance of the class.
+
+
+
+
+Get frame interval from source or use manually specified.
+
+
+ The property specifies which frame rate to use for video playing.
+If the property is set to , then video is played
+with original frame rate, which is set in source video file. If the property is
+set to , then custom frame rate is used, which is
+calculated based on the manually specified frame interval.
+ Default value is set to .
+
+
+
+
+Frame interval.
+
+
+ The property sets the interval in milliseconds between frames. If the property is
+set to 100, then the desired frame rate will be 10 frames per second.
+
+ Setting this property to 0 leads to no delay between video frames - frames
+are read as fast as possible.
+
+
+ Setting this property has effect only when
+is set to .
+
+ Default value is set to 0.
+
+
+
+
+State of the video source.
+
+ Current state of video source object - running or not.
+
+
+
+Received bytes count.
+
+ Number of bytes the video source provided from the moment of the last
+access to the property.
+
+
+
+
+Received frames count.
+
+ Number of frames the video source provided from the moment of the last
+access to the property.
+
+
+
+
+Video source.
+
+
+ Video file name to play.
+
+
+
+
+Video playing finished event.
+
+
+ This event is used to notify clients that the video playing has finished.
+
+
+
+
+Video source error event.
+
+ This event is used to notify clients about any type of errors occurred in
+video source object, for example internal exceptions.
+
+
+
+New frame event.
+
+
+ Notifies clients about new available frame from video source.
+
+ Since video source may have multiple clients, each client is responsible for
+making a copy (cloning) of the passed video frame, because the video source disposes its
+own original copy after notifying of clients.
+
+
+
+
+
+Video source for video files.
+
+
+ The video source provides access to video files using FFmpeg library.
+
+ The class provides video only. Sound is not supported.
+
+
+ The class ignores presentation time of video frames while retrieving them from
+video file. Instead it provides video frames according to the FPS rate of the video file
+or the configured .
+
+
+ Make sure you have FFmpeg binaries (DLLs) in the output folder of your application in order
+to use this class successfully. FFmpeg binaries can be found in Externals folder provided with AForge.NET
+framework's distribution.
+
+ Sample usage:
+
+// create video source
+VideoFileSource videoSource = new VideoFileSource( fileName );
+// set NewFrame event handler
+videoSource.NewFrame += new NewFrameEventHandler( video_NewFrame );
+// start the video source
+videoSource.Start( );
+// ...
+
+// New frame event handler, which is invoked on each new available video frame
+private void video_NewFrame( object sender, NewFrameEventArgs eventArgs )
+{
+ // get new frame
+ Bitmap bitmap = eventArgs.Frame;
+ // process the frame
+}
+
+
+
+
+
+Close currently opened video file if any.
+
+
+
+
+Read next video frame of the currently opened video file.
+
+ Returns next video frame of the opened file or if end of
+file was reached. The returned video frame has 24 bpp color format.
+ Thrown if no video file was open.
+ A error occurred while reading next video frame. See exception message.
+
+
+
+Open video file with the specified name.
+
+ Video file name to open.
+ Cannot open video file with the specified name.
+ A error occurred while opening the video file. See exception message.
+
+
+
+Disposes the object and frees its resources.
+
+
+
+
+Initializes a new instance of the class.
+
+
+
+
+Object's finalizer.
+
+
+
+
+The property specifies if a video file is opened or not by this instance of the class.
+
+
+
+
+Name of codec used for encoding the opened video file.
+
+ Thrown if no video file was open.
+
+
+
+Number of video frames in the opened video file.
+
+
+
+
+ Warning: some video file formats may report different value
+from the actual number of video frames in the file (subject to fix/investigate).
+
+
+ Thrown if no video file was open.
+
+
+
+Frame rate of the opened video file.
+
+ Thrown if no video file was open.
+
+
+
+Frame height of the opened video file.
+
+ Thrown if no video file was open.
+
+
+
+Frame width of the opened video file.
+
+ Thrown if no video file was open.
+
+
+
+Class for reading video files utilizing FFmpeg library.
+
+
+ The class allows to read video files using FFmpeg library.
+
+ Make sure you have FFmpeg binaries (DLLs) in the output folder of your application in order
+to use this class successfully. FFmpeg binaries can be found in Externals folder provided with AForge.NET
+framework's distribution.
+
+ Sample usage:
+
+// create instance of video reader
+VideoFileReader reader = new VideoFileReader( );
+// open video file
+reader.Open( "test.avi" );
+// check some of its attributes
+Console.WriteLine( "width: " + reader.Width );
+Console.WriteLine( "height: " + reader.Height );
+Console.WriteLine( "fps: " + reader.FrameRate );
+Console.WriteLine( "codec: " + reader.CodecName );
+// read 100 video frames out of it
+for ( int i = 0; i < 100; i++ )
+{
+ Bitmap videoFrame = reader.ReadVideoFrame( );
+ // process the frame somehow
+ // ...
+
+ // dispose the frame when it is no longer required
+ videoFrame.Dispose( );
+}
+reader.Close( );
+
+
+
+
+ Get the AVClass for swsContext. It can be used in combination with
+ AV_OPT_SEARCH_FAKE_OBJ for examining options.
+
+ @see av_opt_find().
+
+
+
+ Convert an 8-bit paletted frame into a frame with a color depth of 24 bits.
+
+ With the palette format "ABCD", the destination frame ends up with the format "ABC".
+
+ @param src source frame buffer
+ @param dst destination frame buffer
+ @param num_pixels number of pixels to convert
+ @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src
+
+
+
+ Convert an 8-bit paletted frame into a frame with a color depth of 32 bits.
+
+ The output frame will have the same packed format as the palette.
+
+ @param src source frame buffer
+ @param dst destination frame buffer
+ @param num_pixels number of pixels to convert
+ @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src
+
+
+
+Allocate and return a clone of the vector a, that is a vector
+with the same coefficients as a.
+
+
+
+Scale all the coefficients of a so that their sum equals height.
+
+
+
+Scale all the coefficients of a by the scalar value.
+
+
+
+Allocate and return a vector with just one coefficient, with
+value 1.0.
+
+
+
+Allocate and return a vector with length coefficients, all
+with the same value c.
+
+
+
+Return a normalized Gaussian curve used to filter stuff
+quality = 3 is high quality, lower is lower quality.
+
+
+
+Allocate and return an uninitialized vector with length coefficients.
+
+
+
+@return -1 if not supported
+
+
+
+@param inv_table the yuv2rgb coefficients, normally ff_yuv2rgb_coeffs[x]
+@return -1 if not supported
+
+
+
+ Scale the image slice in srcSlice and put the resulting scaled
+ slice in the image in dst. A slice is a sequence of consecutive
+ rows in an image.
+
+ Slices have to be provided in sequential order, either in
+ top-bottom or bottom-top order. If slices are provided in
+ non-sequential order the behavior of the function is undefined.
+
+ @param c the scaling context previously created with
+ sws_getContext()
+ @param srcSlice the array containing the pointers to the planes of
+ the source slice
+ @param srcStride the array containing the strides for each plane of
+ the source image
+ @param srcSliceY the position in the source image of the slice to
+ process, that is the number (counted starting from
+ zero) in the image of the first row of the slice
+ @param srcSliceH the height of the source slice, that is the number
+ of rows in the slice
+ @param dst the array containing the pointers to the planes of
+ the destination image
+ @param dstStride the array containing the strides for each plane of
+ the destination image
+ @return the height of the output slice
+
+
+
+Free the swscaler context swsContext.
+If swsContext is NULL, then does nothing.
+
+
+
+ Initialize the swscaler context sws_context.
+
+ @return zero or positive value on success, a negative value on
+ error
+
+
+
+Allocate an empty SwsContext. This must be filled and passed to
+sws_init_context(). For filling see AVOptions, options.c and
+sws_setColorspaceDetails().
+
+
+ Allocate and return an SwsContext. You need it to perform
+ scaling/conversion operations using sws_scale().
+
+ @param srcW the width of the source image
+ @param srcH the height of the source image
+ @param srcFormat the source image format
+ @param dstW the width of the destination image
+ @param dstH the height of the destination image
+ @param dstFormat the destination image format
+ @param flags specify which algorithm and options to use for rescaling
+ @return a pointer to an allocated context, or NULL in case of error
+ @note this function is to be removed after a saner alternative is
+ written
+ @deprecated Use sws_getCachedContext() instead.
+
+
+ Check if context can be reused, otherwise reallocate a new one.
+
+ If context is NULL, just calls sws_getContext() to get a new
+ context. Otherwise, checks if the parameters are the ones already
+ saved in context. If that is the case, returns the current
+ context. Otherwise, frees context and gets a new context with
+ the new parameters.
+
+ Be warned that srcFilter and dstFilter are not checked, they
+ are assumed to remain the same.
+
+
+
+Return a positive value if pix_fmt is a supported output format, 0
+otherwise.
+
+
+
+Return a positive value if pix_fmt is a supported input format, 0
+otherwise.
+
+
+
+Return the libswscale license.
+
+
+
+Return the libswscale build-time configuration.
+
+
+
+@}
+
+@file
+@brief
+ external api for the swscale stuff
+
+Those FF_API_* defines are not part of public API.
+They may change, break or disappear at any time.
+
+Return the LIBSWSCALE_VERSION_INT constant.
+
+
+
+ Test if the given container can store a codec.
+
+ @param std_compliance standards compliance level, one of FF_COMPLIANCE_*
+
+ @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot.
+ A negative number if this information is not available.
+
+
+
+ Return a positive value if the given filename has one of the given
+ extensions, 0 otherwise.
+
+ @param extensions a comma-separated list of filename extensions
+
+
+
+ Generate an SDP for an RTP session.
+
+ @param ac array of AVFormatContexts describing the RTP streams. If the
+ array is composed by only one context, such context can contain
+ multiple AVStreams (one AVStream per RTP stream). Otherwise,
+ all the contexts in the array (an AVCodecContext per RTP stream)
+ must contain only one AVStream.
+ @param n_files number of AVCodecContexts contained in ac
+ @param buf buffer where the SDP will be stored (must be allocated by
+ the caller)
+ @param size the size of the buffer
+ @return 0 if OK, AVERROR_xxx on error
+
+
+
+ Check whether filename actually is a numbered sequence generator.
+
+ @param filename possible numbered sequence string
+ @return 1 if a valid numbered sequence string, 0 otherwise
+
+
+
+ Return in 'buf' the path with '%d' replaced by a number.
+
+ Also handles the '%0nd' format where 'n' is the total number
+ of digits and '%%'.
+
+ @param buf destination buffer
+ @param buf_size destination buffer size
+ @param path numbered sequence string
+ @param number frame number
+ @return 0 if OK, -1 on format error
+
+
+
+@deprecated use av_find_info_tag in libavutil instead.
+
+
+
+Get the current time in microseconds.
+
+
+
+ Parse datestr and return a corresponding number of microseconds.
+
+ @param datestr String representing a date or a duration.
+ See av_parse_time() for the syntax of the provided string.
+ @deprecated in favor of av_parse_time()
+
+
+
+@deprecated Deprecated in favor of av_dump_format().
+
+
+
+ Split a URL string into components.
+
+ The pointers to buffers for storing individual components may be null,
+ in order to ignore that component. Buffers for components not found are
+ set to empty strings. If the port is not found, it is set to a negative
+ value.
+
+ @param proto the buffer for the protocol
+ @param proto_size the size of the proto buffer
+ @param authorization the buffer for the authorization
+ @param authorization_size the size of the authorization buffer
+ @param hostname the buffer for the host name
+ @param hostname_size the size of the hostname buffer
+ @param port_ptr a pointer to store the port number in
+ @param path the buffer for the path
+ @param path_size the size of the path buffer
+ @param url the URL to split
+
+
+
+ Add an index entry into a sorted list. Update the entry if the list
+ already contains it.
+
+ @param timestamp timestamp in the time base of the given stream
+
+
+
+ Get the codec tag for the given codec id id.
+ If no codec tag is found returns 0.
+
+ @param tags list of supported codec_id-codec_tag pairs, as stored
+ in AVInputFormat.codec_tag and AVOutputFormat.codec_tag
+
+
+
+ Send a nice dump of a packet to the log.
+
+ @param avcl A pointer to an arbitrary struct of which the first field is a
+ pointer to an AVClass struct.
+ @param level The importance level of the message, lower values signifying
+ higher importance.
+ @param pkt packet to dump
+ @param dump_payload True if the payload must be displayed, too.
+ @param st AVStream that the packet belongs to
+
+
+
+ Send a nice dump of a packet to the specified file stream.
+
+ @param f The file stream pointer where the dump should be sent to.
+ @param pkt packet to dump
+ @param dump_payload True if the payload must be displayed, too.
+ @param st AVStream that the packet belongs to
+
+
+
+ Send a nice hexadecimal dump of a buffer to the log.
+
+ @param avcl A pointer to an arbitrary struct of which the first field is a
+ pointer to an AVClass struct.
+ @param level The importance level of the message, lower values signifying
+ higher importance.
+ @param buf buffer
+ @param size buffer size
+
+ @see av_hex_dump, av_pkt_dump2, av_pkt_dump_log2
+
+
+
+@}
+
+ @defgroup lavf_misc Utility functions
+ @ingroup libavf
+ @{
+
+ Miscelaneous utility functions related to both muxing and demuxing
+ (or neither).
+
+ Send a nice hexadecimal dump of a buffer to the specified file stream.
+
+ @param f The file stream pointer where the dump should be sent to.
+ @param buf buffer
+ @param size buffer size
+
+ @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2
+
+
+
+Get timing information for the data currently output.
+The exact meaning of "currently output" depends on the format.
+It is mostly relevant for devices that have an internal buffer and/or
+work in real time.
+@param s media file handle
+@param stream stream in the media file
+@param dts[out] DTS of the last packet output for the stream, in stream
+ time_base units
+@param wall[out] absolute time when that packet whas output,
+ in microsecond
+@return 0 if OK, AVERROR(ENOSYS) if the format does not support it
+Note: some formats or devices may not allow to measure dts and wall
+atomically.
+
+
+
+ Return the output format in the list of registered output formats
+ which best matches the provided parameters, or return NULL if
+ there is no match.
+
+ @param short_name if non-NULL checks if short_name matches with the
+ names of the registered formats
+ @param filename if non-NULL checks if filename terminates with the
+ extensions of the registered formats
+ @param mime_type if non-NULL checks if mime_type matches with the
+ MIME type of the registered formats
+
+
+
+ Write the stream trailer to an output media file and free the
+ file private data.
+
+ May only be called after a successful call to av_write_header.
+
+ @param s media file handle
+ @return 0 if OK, AVERROR_xxx on error
+
+
+
+ Write a packet to an output media file ensuring correct interleaving.
+
+ The packet must contain one audio or video frame.
+ If the packets are already correctly interleaved, the application should
+ call av_write_frame() instead as it is slightly faster. It is also important
+ to keep in mind that completely non-interleaved input will need huge amounts
+ of memory to interleave with this, so it is preferable to interleave at the
+ demuxer level.
+
+ @param s media file handle
+ @param pkt The packet containing the data to be written. Libavformat takes
+ ownership of the data and will free it when it sees fit using the packet's
+ @ref AVPacket.destruct "destruct" field. The caller must not access the data
+ after this function returns, as it may already be freed.
+ Packet's @ref AVPacket.stream_index "stream_index" field must be set to the
+ index of the corresponding stream in @ref AVFormatContext.streams
+ "s.streams".
+ It is very strongly recommended that timing information (@ref AVPacket.pts
+ "pts", @ref AVPacket.dts "dts" @ref AVPacket.duration "duration") is set to
+ correct values.
+
+ @return 0 on success, a negative AVERROR on error.
+
+
+
+ Allocate the stream private data and write the stream header to an
+ output media file.
+ @note: this sets stream time-bases, if possible to stream->codec->time_base
+ but for some formats it might also be some other time base
+
+ @param s media file handle
+ @return 0 if OK, AVERROR_xxx on error
+
+ @deprecated use avformat_write_header.
+
+
+
+@addtogroup lavf_encoding
+@{
+
+ Allocate the stream private data and write the stream header to
+ an output media file.
+
+ @param s Media file handle, must be allocated with avformat_alloc_context().
+ Its oformat field must be set to the desired output format;
+ Its pb field must be set to an already openened AVIOContext.
+ @param options An AVDictionary filled with AVFormatContext and muxer-private options.
+ On return this parameter will be destroyed and replaced with a dict containing
+ options that were not found. May be NULL.
+
+ @return 0 on success, negative AVERROR on failure.
+
+ @see av_opt_find, av_dict_set, avio_open, av_oformat_next.
+
+
+
+@deprecated pass the options to avformat_write_header directly.
+
+
+
+@deprecated this function is not supposed to be called outside of lavf
+
+
+
+@}
+
+ Add a new stream to a media file.
+
+ Can only be called in the read_header() function. If the flag
+ AVFMTCTX_NOHEADER is in the format context, then new streams
+ can be added in read_packet too.
+
+ @param s media file handle
+ @param id file-format-dependent stream ID
+
+
+
+Close an opened input AVFormatContext. Free it and all its contents
+and set *s to NULL.
+
+
+
+ @deprecated use avformat_close_input()
+ Close a media file (but not its codecs).
+
+ @param s media file handle
+
+
+
+Free a AVFormatContext allocated by av_open_input_stream.
+@param s context to free
+@deprecated use av_close_input_file()
+
+
+
+ Pause a network-based stream (e.g. RTSP stream).
+
+ Use av_read_play() to resume it.
+
+
+
+Start playing a network-based stream (e.g. RTSP stream) at the
+current position.
+
+
+
+Seek to the keyframe at timestamp.
+'timestamp' in 'stream_index'.
+@param stream_index If stream_index is (-1), a default
+stream is selected, and timestamp is automatically converted
+from AV_TIME_BASE units to the stream specific time_base.
+@param timestamp Timestamp in AVStream.time_base units
+ or, if no stream is specified, in AV_TIME_BASE units.
+@param flags flags which select direction and seeking mode
+@return >= 0 on success
+
+
+
+ Read a transport packet from a media file.
+
+ This function is obsolete and should never be used.
+ Use av_read_frame() instead.
+
+ @param s media file handle
+ @param pkt is filled
+ @return 0 if OK, AVERROR_xxx on error
+
+
+
+ Find the "best" stream in the file.
+ The best stream is determined according to various heuristics as the most
+ likely to be what the user expects.
+ If the decoder parameter is non-NULL, av_find_best_stream will find the
+ default decoder for the stream's codec; streams for which no decoder can
+ be found are ignored.
+
+ @param ic media file handle
+ @param type stream type: video, audio, subtitles, etc.
+ @param wanted_stream_nb user-requested stream number,
+ or -1 for automatic selection
+ @param related_stream try to find a stream related (eg. in the same
+ program) to this one, or -1 if none
+ @param decoder_ret if non-NULL, returns the decoder for the
+ selected stream
+ @param flags flags; none are currently defined
+ @return the non-negative stream number in case of success,
+ AVERROR_STREAM_NOT_FOUND if no stream with the requested type
+ could be found,
+ AVERROR_DECODER_NOT_FOUND if streams were found but no decoder
+ @note If av_find_best_stream returns successfully and decoder_ret is not
+ NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec.
+
+
+
+ Find the programs which belong to a given stream.
+
+ @param ic media file handle
+ @param last the last found program, the search will start after this
+ program, or from the beginning if it is NULL
+ @param s stream index
+ @return the next program which belongs to s, NULL if no program is found or
+ the last program is not among the programs of ic.
+
+
+
+ Read packets of a media file to get stream information. This
+ is useful for file formats with no headers such as MPEG. This
+ function also computes the real framerate in case of MPEG-2 repeat
+ frame mode.
+ The logical file position is not changed by this function;
+ examined packets may be buffered for later processing.
+
+ @param ic media file handle
+ @param options If non-NULL, an ic.nb_streams long array of pointers to
+ dictionaries, where i-th member contains options for
+ codec corresponding to i-th stream.
+ On return each dictionary will be filled with options that were not found.
+ @return >=0 if OK, AVERROR_xxx on error
+
+ @note this function isn't guaranteed to open all the codecs, so
+ options being non-empty at return is a perfectly normal behavior.
+
+ @todo Let the user decide somehow what information is needed so that
+ we do not waste time getting stuff the user does not need.
+
+
+
+ Read packets of a media file to get stream information. This
+ is useful for file formats with no headers such as MPEG. This
+ function also computes the real framerate in case of MPEG-2 repeat
+ frame mode.
+ The logical file position is not changed by this function;
+ examined packets may be buffered for later processing.
+
+ @param ic media file handle
+ @return >=0 if OK, AVERROR_xxx on error
+ @todo Let the user decide somehow what information is needed so that
+ we do not waste time getting stuff the user does not need.
+
+ @deprecated use avformat_find_stream_info.
+
+
+
+ Open an input stream and read the header. The codecs are not opened.
+ The stream must be closed with av_close_input_file().
+
+ @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context).
+ May be a pointer to NULL, in which case an AVFormatContext is allocated by this
+ function and written into ps.
+ Note that a user-supplied AVFormatContext will be freed on failure.
+ @param filename Name of the stream to open.
+ @param fmt If non-NULL, this parameter forces a specific input format.
+ Otherwise the format is autodetected.
+ @param options A dictionary filled with AVFormatContext and demuxer-private options.
+ On return this parameter will be destroyed and replaced with a dict containing
+ options that were not found. May be NULL.
+
+ @return 0 on success, a negative AVERROR on failure.
+
+ @note If you want to use custom IO, preallocate the format context and set its pb field.
+
+
+
+ Open a media file as input. The codecs are not opened. Only the file
+ header (if present) is read.
+
+ @param ic_ptr The opened media file handle is put here.
+ @param filename filename to open
+ @param fmt If non-NULL, force the file format to use.
+ @param buf_size optional buffer size (zero if default is OK)
+ @param ap Additional parameters needed when opening the file
+ (NULL if default).
+ @return 0 if OK, AVERROR_xxx otherwise
+
+ @deprecated use avformat_open_input instead.
+
+
+
+Allocate all the structures needed to read an input stream.
+ This does not open the needed codecs for decoding the stream[s].
+@deprecated use avformat_open_input instead.
+
+
+
+ Probe a bytestream to determine the input format. Each time a probe returns
+ with a score that is too low, the probe buffer size is increased and another
+ attempt is made. When the maximum probe size is reached, the input format
+ with the highest score is returned.
+
+ @param pb the bytestream to probe
+ @param fmt the input format is put here
+ @param filename the filename of the stream
+ @param logctx the log context
+ @param offset the offset within the bytestream to probe from
+ @param max_probe_size the maximum probe buffer size (zero for default)
+ @return 0 in case of success, a negative value corresponding to an
+ AVERROR code otherwise
+
+
+
+ Guess the file format.
+
+ @param is_opened Whether the file is already opened; determines whether
+ demuxers with or without AVFMT_NOFILE are probed.
+ @param score_ret The score of the best detection.
+
+
+
+ Guess the file format.
+
+ @param is_opened Whether the file is already opened; determines whether
+ demuxers with or without AVFMT_NOFILE are probed.
+
+
+
+@addtogroup lavf_decoding
+@{
+
+Find AVInputFormat based on the short name of the input format.
+
+
+
+ Allocate an AVFormatContext for an output format.
+ avformat_free_context() can be used to free the context and
+ everything allocated by the framework within it.
+
+ @param *ctx is set to the created format context, or to NULL in
+ case of failure
+ @param oformat format to use for allocating the context, if NULL
+ format_name and filename are used instead
+ @param format_name the name of output format to use for allocating the
+ context, if NULL filename is used instead
+ @param filename the name of the filename to use for allocating the
+ context, may be NULL
+ @return >= 0 in case of success, a negative AVERROR code in case of
+ failure
+
+
+
+@deprecated deprecated in favor of avformat_alloc_output_context2()
+
+
+
+ Add a new stream to a media file.
+
+ When demuxing, it is called by the demuxer in read_header(). If the
+ flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also
+ be called in read_packet().
+
+ When muxing, should be called by the user before avformat_write_header().
+
+ @param c If non-NULL, the AVCodecContext corresponding to the new stream
+ will be initialized to use this codec. This is needed for e.g. codec-specific
+ defaults to be set, so codec should be provided if it is known.
+
+ @return newly created stream or NULL on error.
+
+
+
+ Get the AVClass for AVFormatContext. It can be used in combination with
+ AV_OPT_SEARCH_FAKE_OBJ for examining options.
+
+ @see av_opt_find().
+
+
+
+Free an AVFormatContext and all its streams.
+@param s context to free
+
+
+
+Allocate an AVFormatContext.
+avformat_free_context() can be used to free the context and everything
+allocated by the framework within it.
+
+
+
+If f is NULL, returns the first registered output format,
+if f is non-NULL, returns the next registered output format after f
+or NULL if f is the last one.
+
+
+
+If f is NULL, returns the first registered input format,
+if f is non-NULL, returns the next registered input format after f
+or NULL if f is the last one.
+
+
+
+Undo the initialization done by avformat_network_init.
+
+
+
+ Do global initialization of network components. This is optional,
+ but recommended, since it avoids the overhead of implicitly
+ doing the setup for each session.
+
+ Calling this function will become mandatory if using network
+ protocols at some major version bump.
+
+
+
+ Initialize libavformat and register all the muxers, demuxers and
+ protocols. If you do not call this function, then you can select
+ exactly which formats you want to support.
+
+ @see av_register_input_format()
+ @see av_register_output_format()
+ @see av_register_protocol()
+
+
+
+Return the libavformat license.
+
+
+
+Return the libavformat build-time configuration.
+
+
+
+ @defgroup lavf_core Core functions
+ @ingroup libavf
+
+ Functions for querying libavformat capabilities, allocating core structures,
+ etc.
+ @{
+
+Return the LIBAVFORMAT_VERSION_INT constant.
+
+
+
+Max chunk size in bytes
+Note, not all formats support this and unpredictable things may happen if it is used when not supported.
+- encoding: Set by user via AVOptions (NO direct access)
+- decoding: unused
+
+
+
+Max chunk time in microseconds.
+Note, not all formats support this and unpredictable things may happen if it is used when not supported.
+- encoding: Set by user via AVOptions (NO direct access)
+- decoding: unused
+
+
+
+Audio preload in microseconds.
+Note, not all formats support this and unpredictable things may happen if it is used when not supported.
+- encoding: Set by user via AVOptions (NO direct access)
+- decoding: unused
+
+
+
+Transport stream id.
+This will be moved into demuxer private options. Thus no API/ABI compatibility
+
+
+
+ Custom interrupt callbacks for the I/O layer.
+
+ decoding: set by the user before avformat_open_input().
+ encoding: set by the user before avformat_write_header()
+ (mainly useful for AVFMT_NOFILE formats). The callback
+ should also be passed to avio_open2() if it's used to
+ open the file.
+
+
+
+Error recognition; higher values will detect more errors but may
+misdetect some more or less valid parts as errors.
+- encoding: unused
+- decoding: Set by user.
+
+
+
+decoding: number of frames used to probe fps
+
+
+
+Start time of the stream in real world time, in microseconds
+since the unix epoch (00:00 1st January 1970). That is, pts=0
+in the stream was captured at this real world time.
+- encoding: Set by user.
+- decoding: Unused.
+
+
+
+Remaining size available for raw_packet_buffer, in bytes.
+NOT PART OF PUBLIC API
+
+
+
+Flags to enable debugging.
+
+
+
+Maximum amount of memory in bytes to use for buffering frames
+obtained from realtime capture devices.
+
+
+
+Maximum amount of memory in bytes to use for the index of each stream.
+If the index exceeds this size, entries will be discarded as
+needed to maintain a smaller size. This can lead to slower or less
+accurate seeking (depends on demuxer).
+Demuxers for which a full in-memory index is mandatory will ignore
+this.
+muxing : unused
+demuxing: set by user
+
+
+
+decoding: maximum time (in AV_TIME_BASE units) during which the input should
+be analyzed in avformat_find_stream_info().
+
+
+
+decoding: size of data to probe; encoding: unused.
+
+
+
+@deprecated, use the 'loop' img2 demuxer private option.
+
+
+
+ number of times to loop output in formats that support it
+
+ @deprecated use the 'loop' private option in the gif muxer.
+
+
+
+use mpeg muxer private options instead
+
+
+
+Decoding: total stream bitrate in bit/s, 0 if not
+available. Never set it directly if the file_size and the
+duration are known as FFmpeg can compute it automatically.
+
+
+
+decoding: total file size, 0 if unknown
+
+
+
+Decoding: duration of the stream, in AV_TIME_BASE fractional
+seconds. Only set this value if you know none of the individual stream
+durations and also do not set any of them. This is deduced from the
+AVStream values if not set.
+
+
+
+Decoding: position of the first frame of the component, in
+AV_TIME_BASE fractional seconds. NEVER set this value directly:
+It is deduced from the AVStream values.
+
+
+
+@deprecated use 'creation_time' metadata tag instead
+
+
+
+ A list of all streams in the file. New streams are created with
+ avformat_new_stream().
+
+ decoding: streams are created by libavformat in avformat_open_input().
+ If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also
+ appear in av_read_frame().
+ encoding: streams are created by the user before avformat_write_header().
+
+
+
+Format private data. This is an AVOptions-enabled struct
+if and only if iformat/oformat.priv_class is not NULL.
+
+
+
+A class for logging and AVOptions. Set by avformat_alloc_context().
+Exports (de)muxer private options if they exist.
+
+
+
+Format I/O context.
+New fields can be added to the end with minor version bumps.
+Removal, reordering and changes to existing fields require a major
+version bump.
+sizeof(AVFormatContext) must not be used outside libav*, use
+avformat_alloc_context() to create an AVFormatContext.
+
+
+
+New fields can be added to the end with minor version bumps.
+Removal, reordering and changes to existing fields require a major
+version bump.
+sizeof(AVProgram) must not be used outside libav*.
+
+
+
+flag to indicate that probing is requested
+NOT PART OF PUBLIC API
+
+
+
+Stream Identifier
+This is the MPEG-TS stream identifier +1
+0 means unknown
+
+
+
+Number of frames that have been demuxed during av_find_stream_info()
+
+
+
+Average framerate
+
+
+
+last packet in packet_buffer for this stream when muxing.
+Used internally, NOT PART OF PUBLIC API, do not read or
+write from outside of libav*
+
+
+This buffer is only needed when packets were already buffered but
+not decoded, for example to get the codec parameters in MPEG
+streams.
+
+
+Raw packets from the demuxer, prior to parsing and decoding.
+This buffer is used for buffering packets until the codec can
+be identified, as parsing cannot be done without knowing the
+codec.
+
+
+
+Number of packets to buffer for codec probing
+NOT PART OF PUBLIC API
+
+
+
+ Timestamp corresponding to the last dts sync point.
+
+ Initialized when AVCodecParserContext.dts_sync_point >= 0 and
+ a DTS is received from the underlying container. Otherwise set to
+ AV_NOPTS_VALUE by default.
+
+
+
+sample aspect ratio (0 if unknown)
+- encoding: Set by user.
+- decoding: Set by libavformat.
+
+
+
+Decoding: duration of the stream, in stream time base.
+If a source file does not specify a duration, but does specify
+a bitrate, this value will be estimated from bitrate and file size.
+
+
+
+Decoding: pts of the first frame of the stream in presentation order, in stream time base.
+Only set this if you are absolutely 100% sure that the value you set
+it to really is the pts of the first frame.
+This may be undefined (AV_NOPTS_VALUE).
+@note The ASF header does NOT contain a correct start_time the ASF
+demuxer must NOT set this.
+
+
+
+Quality, as it has been removed from AVCodecContext and put in AVVideoFrame.
+MN: dunno if that is the right place for it
+
+
+
+This is the fundamental unit of time (in seconds) in terms
+of which frame timestamps are represented. For fixed-fps content,
+time base should be 1/framerate and timestamp increments should be 1.
+decoding: set by libavformat
+encoding: set by libavformat in av_write_header
+
+
+
+encoding: pts generation when outputting stream
+
+
+
+Real base framerate of the stream.
+This is the lowest framerate with which all timestamps can be
+represented accurately (it is the least common multiple of all
+framerates in the stream). Note, this value is just a guess!
+For example, if the time base is 1/90000 and all frames have either
+approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1.
+
+
+
+Track should be used during playback by default.
+Useful for subtitle track that should be displayed
+even when user did not explicitly ask for subtitles.
+
+Stream structure.
+New fields can be added to the end with minor version bumps.
+Removal, reordering and changes to existing fields require a major
+version bump.
+sizeof(AVStream) must not be used outside libav*.
+
+
+
+@}
+
+
+
+Pause playing - only meaningful if using a network-based format
+(RTSP).
+
+
+
+Start/resume playing - only meaningful if using a network-based format
+(RTSP).
+
+
+
+General purpose read-only value that the format can use.
+
+
+
+If extensions are defined, then no probe is done. You should
+usually not use extension format guessing because it is not
+reliable enough
+
+
+
+Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS,
+AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH,
+AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK.
+
+
+
+Get the next timestamp in stream[stream_index].time_base units.
+@return the timestamp or AV_NOPTS_VALUE if an error occurred
+
+
+
+Seek to a given timestamp relative to the frames in
+stream component stream_index.
+@param stream_index Must not be -1.
+@param flags Selects which direction should be preferred if no exact
+ match is available.
+@return >= 0 on success (but not necessarily the new offset)
+
+
+
+Close the stream. The AVFormatContext and AVStreams are not
+freed by this function
+
+
+
+Read the format header and initialize the AVFormatContext
+structure. Return 0 if OK. 'ap' if non-NULL contains
+additional parameters. Only used in raw format right
+now. 'av_new_stream' should be called to create new streams.
+
+
+
+Tell if a given file has a chance of being parsed as this format.
+The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes
+big so you do not have to check for that unless you need more.
+
+
+
+Size of private data so that it can be allocated in the wrapper.
+
+
+
+Descriptive name for the format, meant to be more human-readable
+than name. You should use the NULL_IF_CONFIG_SMALL() macro
+to define it.
+
+
+
+A comma separated list of short names for the format. New names
+may be appended with a minor bump.
+
+
+
+@}
+
+@addtogroup lavf_decoding
+@{
+
+
+ Can only be iformat or oformat, not both at the same time.
+
+ decoding: set by avformat_open_input().
+ encoding: set by the user.
+
+
+
+ Test if the given codec can be stored in this container.
+
+ @return 1 if the codec is supported, 0 if it is not.
+ A negative number if unknown.
+
+
+
+List of supported codec_id-codec_tag pairs, ordered by "better
+choice first". The arrays are all terminated by CODEC_ID_NONE.
+
+
+
+can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE,
+AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS,
+AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH
+
+
+
+Write a packet. If AVFMT_ALLOW_FLUSH is set in flags,
+pkt can be NULL in order to flush data buffered in the muxer.
+When flushing, return 0 if there still is more data to flush,
+or 1 if everything was flushed and there is no more buffered
+data.
+
+
+
+size of private data so that it can be allocated in the wrapper
+
+
+
+Descriptive name for the format, meant to be more human-readable
+than name. You should use the NULL_IF_CONFIG_SMALL() macro
+to define it.
+
+
+
+Demuxer will use avio_open, no opened file should be provided by the caller.
+@addtogroup lavf_encoding
+@{
+
+
+
+This structure contains the data a format has to probe a file.
+
+
+
+ Read data and append it to the current content of the AVPacket.
+ If pkt->size is 0 this is identical to av_get_packet.
+ Note that this uses av_grow_packet and thus involves a realloc
+ which is inefficient. Thus this function should only be used
+ when there is no reasonable way to know (an upper bound of)
+ the final size.
+
+ @param pkt packet
+ @param size amount of data to read
+ @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data
+ will not be lost even if an error occurs.
+
+
+
+@}
+
+ Allocate and read the payload of a packet and initialize its
+ fields with default values.
+
+ @param pkt packet
+ @param size desired payload size
+ @return >0 (read size) if OK, AVERROR_xxx otherwise
+
+
+
+Free all the memory allocated for an AVDictionary struct.
+
+
+
+Copy metadata from one AVDictionary struct into another.
+@param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL,
+ this function will allocate a struct for you and put it in *dst
+@param src pointer to source AVDictionary struct
+@param flags flags to use when setting metadata in *dst
+@note metadata is read using the AV_DICT_IGNORE_SUFFIX flag
+
+
+
+This function is provided for compatibility reason and currently does nothing.
+
+
+
+ Get a metadata element with matching key.
+
+ @param prev Set to the previous matching element to find the next.
+ If set to NULL the first matching element is returned.
+ @param flags Allows case as well as suffix-insensitive comparisons.
+ @return Found tag or NULL, changing key or value leads to undefined behavior.
+
+
+
+Seek to a given timestamp relative to some component stream.
+Only meaningful if using a network streaming protocol (e.g. MMS.).
+@param stream_index The stream index that the timestamp is relative to.
+ If stream_index is (-1) the timestamp should be in AV_TIME_BASE
+ units from the beginning of the presentation.
+ If a stream_index >= 0 is used and the protocol does not support
+ seeking based on component streams, the call will fail.
+@param timestamp timestamp in AVStream.time_base units
+ or if there is no stream specified then in AV_TIME_BASE units.
+@param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE
+ and AVSEEK_FLAG_ANY. The protocol may silently ignore
+ AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will
+ fail if used and not supported.
+@return >= 0 on success
+@see AVInputFormat::read_seek
+
+
+
+Pause and resume playing - only meaningful if using a network streaming
+protocol (e.g. MMS).
+@param pause 1 for pause, 0 for resume
+
+
+
+ Iterate through names of available protocols.
+ @note it is recommanded to use av_protocol_next() instead of this
+
+ @param opaque A private pointer representing current protocol.
+ It must be a pointer to NULL on first iteration and will
+ be updated by successive calls to avio_enum_protocols.
+ @param output If set to 1, iterate over output protocols,
+ otherwise over input protocols.
+
+ @return A static string containing the name of current protocol or NULL
+
+
+
+ Return the written size and a pointer to the buffer. The buffer
+ must be freed with av_free().
+ Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer.
+
+ @param s IO context
+ @param pbuffer pointer to a byte buffer
+ @return the length of the byte buffer
+
+
+
+ Open a write only memory stream.
+
+ @param s new IO context
+ @return zero if no error.
+
+
+
+ Create and initialize a AVIOContext for accessing the
+ resource indicated by url.
+ @note When the resource indicated by url has been opened in
+ read+write mode, the AVIOContext can be used only for writing.
+
+ @param s Used to return the pointer to the created AVIOContext.
+ In case of failure the pointed to value is set to NULL.
+ @param flags flags which control how the resource indicated by url
+ is to be opened
+ @param int_cb an interrupt callback to be used at the protocols level
+ @param options A dictionary filled with protocol-private options. On return
+ this parameter will be destroyed and replaced with a dict containing options
+ that were not found. May be NULL.
+ @return 0 in case of success, a negative value corresponding to an
+ AVERROR code in case of failure
+
+
+
+@name URL open modes
+The flags argument to avio_open must be one of the following
+constants, optionally ORed with other flags.
+@{
+
+@}
+
+Use non-blocking mode.
+If this flag is set, operations on the context will return
+AVERROR(EAGAIN) if they can not be performed immediately.
+If this flag is not set, operations on the context will never return
+AVERROR(EAGAIN).
+Note that this flag does not affect the opening/connecting of the
+context. Connecting a protocol will always block if necessary (e.g. on
+network protocols) but never hang (e.g. on busy devices).
+Warning: non-blocking protocols is work-in-progress; this flag may be
+silently ignored.
+
+ Create and initialize a AVIOContext for accessing the
+ resource indicated by url.
+ @note When the resource indicated by url has been opened in
+ read+write mode, the AVIOContext can be used only for writing.
+
+ @param s Used to return the pointer to the created AVIOContext.
+ In case of failure the pointed to value is set to NULL.
+ @param flags flags which control how the resource indicated by url
+ is to be opened
+ @return 0 in case of success, a negative value corresponding to an
+ AVERROR code in case of failure
+
+
+
+ @name Functions for reading from AVIOContext
+ @{
+
+ @note return 0 if EOF, so you cannot use it if EOF handling is
+ necessary
+
+
+
+Read size bytes from AVIOContext into buf.
+@return number of bytes read or AVERROR
+
+
+
+@warning currently size is limited
+
+
+feof() equivalent for AVIOContext.
+@return non zero if and only if end of file
+
+
+
+Get the filesize.
+@return filesize or AVERROR
+
+
+
+ftell() equivalent for AVIOContext.
+@return position or AVERROR.
+
+
+
+Skip given number of bytes forward
+@return new position or AVERROR.
+
+
+
+Convert an UTF-8 string to UTF-16LE and write it.
+@return number of bytes written.
+
+
+
+Write a NULL-terminated string.
+@return number of bytes written.
+
+
+
+ Allocate and initialize an AVIOContext for buffered I/O. It must be later
+ freed with av_free().
+
+ @param buffer Memory block for input/output operations via AVIOContext.
+ The buffer must be allocated with av_malloc() and friends.
+ @param buffer_size The buffer size is very important for performance.
+ For protocols with fixed blocksize it should be set to this blocksize.
+ For others a typical size is a cache page, e.g. 4kb.
+ @param write_flag Set to 1 if the buffer should be writable, 0 otherwise.
+ @param opaque An opaque pointer to user-specific data.
+ @param read_packet A function for refilling the buffer, may be NULL.
+ @param write_packet A function for writing the buffer contents, may be NULL.
+ @param seek A function for seeking to specified byte position, may be NULL.
+
+ @return Allocated AVIOContext or NULL on failure.
+
+
+
+The callback is called in blocking functions to test regulary if
+asynchronous interruption is needed. AVERROR_EXIT is returned
+in this case by the interrupted function. 'NULL' means no interrupt
+callback is given.
+@deprecated Use interrupt_callback in AVFormatContext/avio_open2
+ instead.
+
+
+
+ Return AVIO_FLAG_* access flags corresponding to the access permissions
+ of the resource in url, or a negative value corresponding to an
+ AVERROR code in case of failure. The returned access flags are
+ masked by the value in flags.
+
+ @note This function is intrinsically unsafe, in the sense that the
+ checked resource may change its existence or permission status from
+ one call to another. Thus you should not trust the returned value,
+ unless you are sure that no other processes are accessing the
+ checked resource.
+
+
+
+Return a non-zero value if the resource indicated by url
+exists, 0 otherwise.
+@deprecated Use avio_check instead.
+
+
+
+return the written or read size
+
+
+@deprecated use AVIOContext.max_packet_size directly.
+
+
+
+@deprecated Use AVIOContext.seekable field directly.
+
+
+
+@deprecated use avio_get_str instead
+
+
+
+@note unlike fgets, the EOL character is not returned and a whole
+ line is parsed. return NULL if first char read was EOF
+
+
+@}
+
+
+
+@defgroup old_url_f_funcs Old url_f* functions
+The following functions are deprecated, use the "avio_"-prefixed functions instead.
+@{
+@ingroup lavf_io
+
+
+
+@}
+
+
+
+@defgroup old_avio_funcs Old put_/get_*() functions
+The following functions are deprecated. Use the "avio_"-prefixed functions instead.
+@{
+@ingroup lavf_io
+
+
+
+@}
+
+
+
+ Register the URLProtocol protocol.
+
+ @param size the size of the URLProtocol struct referenced
+
+
+
+returns the next registered protocol after the given protocol (the first if
+NULL is given), or NULL if protocol is the last one.
+
+
+
+@defgroup old_url_funcs Old url_* functions
+The following functions are deprecated. Use the buffered API based on #AVIOContext instead.
+@{
+@ingroup lavf_io
+
+
+
+@name URL open modes
+The flags argument to url_open and cosins must be one of the following
+constants, optionally ORed with other flags.
+@{
+
+@}
+
+Use non-blocking mode.
+If this flag is set, operations on the context will return
+AVERROR(EAGAIN) if they can not be performed immediately.
+If this flag is not set, operations on the context will never return
+AVERROR(EAGAIN).
+Note that this flag does not affect the opening/connecting of the
+context. Connecting a protocol will always block if necessary (e.g. on
+network protocols) but never hang (e.g. on busy devices).
+Warning: non-blocking protocols is work-in-progress; this flag may be
+silently ignored.
+
+
+
+@deprecated This struct is to be made private. Use the higher-level
+ AVIOContext-based API instead.
+
+
+
+URL Context.
+New fields can be added to the end with minor version bumps.
+Removal, reordering and changes to existing fields require a major
+version bump.
+sizeof(URLContext) must not be used outside libav*.
+@deprecated This struct will be made private
+
+
+
+
+Close currently opened video file if any.
+
+
+
+
+Write new video frame with a specific timestamp into currently opened video file.
+
+ Bitmap to add as a new video frame.
+ Frame timestamp, total time since recording started.
+
+ The specified bitmap must be either color 24 or 32 bpp image or grayscale 8 bpp (indexed) image.
+
+ The parameter allows user to specify presentation
+time of the frame being saved. However, it is user's responsibility to make sure the value is increasing
+over time.
+
+
+ Thrown if no video file was open.
+ The provided bitmap must be 24 or 32 bpp color image or 8 bpp grayscale image.
+ Bitmap size must be of the same as video size, which was specified on opening video file.
+ A error occurred while writing new video frame. See exception message.
+
+
+
+Write new video frame into currently opened video file.
+
+ Bitmap to add as a new video frame.
+
+ The specified bitmap must be either color 24 or 32 bpp image or grayscale 8 bpp (indexed) image.
+
+ Thrown if no video file was open.
+ The provided bitmap must be 24 or 32 bpp color image or 8 bpp grayscale image.
+ Bitmap size must be of the same as video size, which was specified on opening video file.
+ A error occurred while writing new video frame. See exception message.
+
+
+
+Create video file with the specified name and attributes.
+
+ Video file name to create.
+ Frame width of the video file.
+ Frame height of the video file.
+ Frame rate of the video file.
+ Video codec to use for compression.
+ Bit rate of the video stream.
+
+ The methods creates new video file with the specified name.
+If a file with such name already exists in the file system, it will be overwritten.
+ When adding new video frames using method,
+the video frame must have width and height as specified during file opening.
+
+ The bit rate parameter represents a trade-off value between video quality
+and video file size. Higher bit rate value increase video quality and result in larger
+file size. Smaller values result in opposite – worse quality and small video files.
+
+
+ Video file resolution must be a multiple of two.
+ Invalid video codec is specified.
+ A error occurred while creating new video file. See exception message.
+ Cannot open video file with the specified name.
+
+
+
+Create video file with the specified name and attributes.
+
+ Video file name to create.
+ Frame width of the video file.
+ Frame height of the video file.
+ Frame rate of the video file.
+ Video codec to use for compression.
+
+ The methods creates new video file with the specified name.
+If a file with such name already exists in the file system, it will be overwritten.
+ When adding new video frames using method,
+the video frame must have width and height as specified during file opening.
+
+ Video file resolution must be a multiple of two.
+ Invalid video codec is specified.
+ A error occurred while creating new video file. See exception message.
+ Cannot open video file with the specified name.
+
+
+
+Create video file with the specified name and attributes.
+
+ Video file name to create.
+ Frame width of the video file.
+ Frame height of the video file.
+ Frame rate of the video file.
+
+ See documentation to the
+for more information and the list of possible exceptions.
+
+ The method opens the video file using
+codec.
+
+
+
+
+
+Create video file with the specified name and attributes.
+
+ Video file name to create.
+ Frame width of the video file.
+ Frame height of the video file.
+
+ See documentation to the
+for more information and the list of possible exceptions.
+
+ The method opens the video file using
+codec and 25 fps frame rate.
+
+
+
+
+
+Disposes the object and frees its resources.
+
+
+
+
+Initializes a new instance of the class.
+
+
+
+
+Object's finalizer.
+
+
+
+
+The property specifies if a video file is opened or not by this instance of the class.
+
+
+
+
+Codec to use for the video file.
+
+ Thrown if no video file was open.
+
+
+
+Bit rate of the video stream.
+
+ Thrown if no video file was open.
+
+
+
+Frame rate of the opened video file.
+
+ Thrown if no video file was open.
+
+
+
+Frame height of the opened video file.
+
+ Thrown if no video file was open.
+
+
+
+Frame width of the opened video file.
+
+ Thrown if no video file was open.
+
+
+
+Class for writing video files utilizing FFmpeg library.
+
+
+ The class allows to write video files using FFmpeg library.
+
+ Make sure you have FFmpeg binaries (DLLs) in the output folder of your application in order
+to use this class successfully. FFmpeg binaries can be found in Externals folder provided with AForge.NET
+framework's distribution.
+
+ Sample usage:
+
+int width = 320;
+int height = 240;
+
+// create instance of video writer
+VideoFileWriter writer = new VideoFileWriter( );
+// create new video file
+writer.Open( "test.avi", width, height, 25, VideoCodec.MPEG4 );
+// create a bitmap to save into the video file
+Bitmap image = new Bitmap( width, height, PixelFormat.Format24bppRgb );
+// write 1000 video frames
+for ( int i = 0; i < 1000; i++ )
+{
+ image.SetPixel( i % width, i % height, Color.Red );
+ writer.WriteVideoFrame( image );
+}
+writer.Close( );
+
+
+
+
+ Get the AVClass for AVFrame. It can be used in combination with
+ AV_OPT_SEARCH_FAKE_OBJ for examining options.
+
+ @see av_opt_find().
+
+
+
+ Get the AVClass for AVCodecContext. It can be used in combination with
+ AV_OPT_SEARCH_FAKE_OBJ for examining options.
+
+ @see av_opt_find().
+
+
+
+ Register a user provided lock manager supporting the operations
+ specified by AVLockOp. mutex points to a (void *) where the
+ lockmgr should store/get a pointer to a user allocated mutex. It's
+ NULL upon AV_LOCK_CREATE and != NULL for all other ops.
+
+ @param cb User defined callback. Note: FFmpeg may invoke calls to this
+ callback during the call to av_lockmgr_register().
+ Thus, the application must be prepared to handle that.
+ If cb is set to NULL the lockmgr will be unregistered.
+ Also note that during unregistration the previously registered
+ lockmgr callback may also be invoked.
+
+
+
+Lock operation used by lockmgr
+
+
+
+If hwaccel is NULL, returns the first registered hardware accelerator,
+if hwaccel is non-NULL, returns the next registered hardware accelerator
+after hwaccel, or NULL if hwaccel is the last one.
+
+
+
+Register the hardware accelerator hwaccel.
+
+
+
+Log a generic warning message asking for a sample. This function is
+intended to be used internally by FFmpeg (libavcodec, libavformat, etc.)
+only, and would normally not be used by applications.
+@param[in] avc a pointer to an arbitrary struct of which the first field is
+a pointer to an AVClass struct
+@param[in] msg string containing an optional message, or NULL if no message
+
+
+
+Log a generic warning message about a missing feature. This function is
+intended to be used internally by FFmpeg (libavcodec, libavformat, etc.)
+only, and would normally not be used by applications.
+@param[in] avc a pointer to an arbitrary struct of which the first field is
+a pointer to an AVClass struct
+@param[in] feature string containing the name of the missing feature
+@param[in] want_sample indicates if samples are wanted which exhibit this feature.
+If want_sample is non-zero, additional verbage will be added to the log
+message which tells the user how to report samples to the development
+mailing list.
+
+
+
+ Encode extradata length to a buffer. Used by xiph codecs.
+
+ @param s buffer to write to; must be at least (v/255+1) bytes long
+ @param v size of extradata in bytes
+ @return number of bytes written to the buffer.
+
+
+
+Pad image.
+
+
+
+Crop image top and left side.
+
+
+
+Copy image src to dst. Wraps av_picture_data_copy() above.
+
+
+
+ Same behaviour av_fast_malloc but the buffer has additional
+ FF_INPUT_PADDING_SIZE at the end which will will always be 0.
+
+ In addition the whole buffer will initially and after resizes
+ be 0-initialized so that no uninitialized data will ever appear.
+
+
+
+ Allocate a buffer, reusing the given one if large enough.
+
+ Contrary to av_fast_realloc the current buffer contents might not be
+ preserved and on error the old buffer is freed, thus no special
+ handling to avoid memleaks is necessary.
+
+ @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer
+ @param size size of the buffer *ptr points to
+ @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and
+ *size 0 if an error occurred.
+
+
+
+ Reallocate the given block if it is not large enough, otherwise do nothing.
+
+ @see av_realloc
+
+
+
+Previous frame byte position.
+
+
+
+Byte position of currently parsed frame in stream.
+
+
+
+ Position of the packet in file.
+
+ Analogous to cur_frame_pts/dts
+
+
+
+ Presentation delay of current frame in units of AVCodecContext.time_base.
+
+ Set to INT_MIN when dts_sync_point unused. Otherwise, it must
+ contain valid non-negative timestamp delta (presentation time of a frame
+ must not lie in the past).
+
+ This delay represents the difference between decoding and presentation
+ time of the frame.
+
+ For example, this corresponds to H.264 dpb_output_delay.
+
+
+
+ Offset of the current timestamp against last timestamp sync point in
+ units of AVCodecContext.time_base.
+
+ Set to INT_MIN when dts_sync_point unused. Otherwise, it must
+ contain a valid timestamp offset.
+
+ Note that the timestamp of sync point has usually a nonzero
+ dts_ref_dts_delta, which refers to the previous sync point. Offset of
+ the next frame after timestamp sync point will be usually 1.
+
+ For example, this corresponds to H.264 cpb_removal_delay.
+
+
+
+ Time difference in stream time base units from the pts of this
+ packet to the point at which the output from the decoder has converged
+ independent from the availability of previous frames. That is, the
+ frames are virtually identical no matter if decoding started from
+ the very first frame or from this keyframe.
+ Is AV_NOPTS_VALUE if unknown.
+ This field is not the display duration of the current frame.
+ This field has no meaning if the packet does not have AV_PKT_FLAG_KEY
+ set.
+
+ The purpose of this field is to allow seeking in streams that have no
+ keyframes in the conventional sense. It corresponds to the
+ recovery point SEI in H.264 and match_time_delta in NUT. It is also
+ essential for some types of subtitle streams to ensure that all
+ subtitles are correctly displayed after seeking.
+
+
+
+Set by parser to 1 for key frames and 0 for non-key frames.
+It is initialized to -1, so if the parser doesn't set this flag,
+old-style fallback using AV_PICTURE_TYPE_I picture type as key frames
+will be used.
+
+
+
+Set if the parser has a valid file offset
+
+
+ This field is used for proper frame duration computation in lavf.
+ It signals, how much longer the frame duration of the current frame
+ is compared to normal frame duration.
+
+ frame_duration = (1 + repeat_pict) * time_base
+
+ It is used by codecs like H.264 to display telecined material.
+
+
+
+@deprecated Use av_get_bytes_per_sample() instead.
+
+
+
+ Return codec bits per sample.
+
+ @param[in] codec_id the codec
+ @return Number of bits per sample or zero if unknown for the given codec.
+
+
+
+ Return a single letter to describe the given picture type pict_type.
+
+ @param[in] pict_type the picture type
+ @return A single character representing the picture type.
+ @deprecated Use av_get_picture_type_char() instead.
+
+
+
+Flush buffers, should be called when seeking or when switching to a different stream.
+
+
+
+ Register all the codecs, parsers and bitstream filters which were enabled at
+ configuration time. If you do not call this function you can select exactly
+ which formats you want to support, by using the individual registration
+ functions.
+
+ @see avcodec_register
+ @see av_register_codec_parser
+ @see av_register_bitstream_filter
+
+
+
+ Encode a video frame from pict into buf.
+ The input picture should be
+ stored using a specific format, namely avctx.pix_fmt.
+
+ @param avctx the codec context
+ @param[out] buf the output buffer for the bitstream of encoded frame
+ @param[in] buf_size the size of the output buffer in bytes
+ @param[in] pict the input picture to encode
+ @return On error a negative value is returned, on success zero or the number
+ of bytes used from the output buffer.
+
+
+
+ Fill audio frame data and linesize.
+ AVFrame extended_data channel pointers are allocated if necessary for
+ planar audio.
+
+ @param frame the AVFrame
+ frame->nb_samples must be set prior to calling the
+ function. This function fills in frame->data,
+ frame->extended_data, frame->linesize[0].
+ @param nb_channels channel count
+ @param sample_fmt sample format
+ @param buf buffer to use for frame data
+ @param buf_size size of buffer
+ @param align plane size sample alignment
+ @return 0 on success, negative error code on failure
+
+
+
+ Encode a frame of audio.
+
+ Takes input samples from frame and writes the next output packet, if
+ available, to avpkt. The output packet does not necessarily contain data for
+ the most recent frame, as encoders can delay, split, and combine input frames
+ internally as needed.
+
+ @param avctx codec context
+ @param avpkt output AVPacket.
+ The user can supply an output buffer by setting
+ avpkt->data and avpkt->size prior to calling the
+ function, but if the size of the user-provided data is not
+ large enough, encoding will fail. All other AVPacket fields
+ will be reset by the encoder using av_init_packet(). If
+ avpkt->data is NULL, the encoder will allocate it.
+ The encoder will set avpkt->size to the size of the
+ output packet.
+ @param[in] frame AVFrame containing the raw audio data to be encoded.
+ May be NULL when flushing an encoder that has the
+ CODEC_CAP_DELAY capability set.
+ There are 2 codec capabilities that affect the allowed
+ values of frame->nb_samples.
+ If CODEC_CAP_SMALL_LAST_FRAME is set, then only the final
+ frame may be smaller than avctx->frame_size, and all other
+ frames must be equal to avctx->frame_size.
+ If CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame
+ can have any number of samples.
+ If neither is set, frame->nb_samples must be equal to
+ avctx->frame_size for all frames.
+ @param[out] got_packet_ptr This field is set to 1 by libavcodec if the
+ output packet is non-empty, and to 0 if it is
+ empty. If the function returns an error, the
+ packet can be assumed to be invalid, and the
+ value of got_packet_ptr is undefined and should
+ not be used.
+ @return 0 on success, negative error code on failure
+
+
+
+ Encode an audio frame from samples into buf.
+
+ @deprecated Use avcodec_encode_audio2 instead.
+
+ @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large.
+ However, for codecs with avctx->frame_size equal to 0 (e.g. PCM) the user
+ will know how much space is needed because it depends on the value passed
+ in buf_size as described below. In that case a lower value can be used.
+
+ @param avctx the codec context
+ @param[out] buf the output buffer
+ @param[in] buf_size the output buffer size
+ @param[in] samples the input buffer containing the samples
+ The number of samples read from this buffer is frame_size*channels,
+ both of which are defined in avctx.
+ For codecs which have avctx->frame_size equal to 0 (e.g. PCM) the number of
+ samples read from samples is equal to:
+ buf_size * 8 / (avctx->channels * av_get_bits_per_sample(avctx->codec_id))
+ This also implies that av_get_bits_per_sample() must not return 0 for these
+ codecs.
+ @return On error a negative value is returned, on success zero or the number
+ of bytes used to encode the data read from the input buffer.
+
+
+
+ Free all allocated data in the given subtitle struct.
+
+ @param sub AVSubtitle to free.
+
+
+
+ * Decode a subtitle message.
+ * Return a negative value on error, otherwise return the number of bytes used.
+ * If no subtitle could be decompressed, got_sub_ptr is zero.
+ * Otherwise, the subtitle is stored in *sub.
+ * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for
+ * simplicity, because the performance difference is expect to be negligible
+ * and reusing a get_buffer written for video codecs would probably perform badly
+ * due to a potentially very different allocation pattern.
+ *
+ * @param avctx the codec context
+ * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored, must be
+ freed with avsubtitle_free if *got_sub_ptr is set.
+ * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero.
+ * @param[in] avpkt The input AVPacket containing the input buffer.
+
+
+
+ Decode the audio frame of size avpkt->size from avpkt->data into frame.
+
+ Some decoders may support multiple frames in a single AVPacket. Such
+ decoders would then just decode the first frame. In this case,
+ avcodec_decode_audio4 has to be called again with an AVPacket containing
+ the remaining data in order to decode the second frame, etc...
+ Even if no frames are returned, the packet needs to be fed to the decoder
+ with remaining data until it is completely consumed or an error occurs.
+
+ @warning The input buffer, avpkt->data must be FF_INPUT_BUFFER_PADDING_SIZE
+ larger than the actual read bytes because some optimized bitstream
+ readers read 32 or 64 bits at once and could read over the end.
+
+ @note You might have to align the input buffer. The alignment requirements
+ depend on the CPU and the decoder.
+
+ @param avctx the codec context
+ @param[out] frame The AVFrame in which to store decoded audio samples.
+ Decoders request a buffer of a particular size by setting
+ AVFrame.nb_samples prior to calling get_buffer(). The
+ decoder may, however, only utilize part of the buffer by
+ setting AVFrame.nb_samples to a smaller value in the
+ output frame.
+ @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is
+ non-zero.
+ @param[in] avpkt The input AVPacket containing the input buffer.
+ At least avpkt->data and avpkt->size should be set. Some
+ decoders might also require additional fields to be set.
+ @return A negative error code is returned if an error occurred during
+ decoding, otherwise the number of bytes consumed from the input
+ AVPacket is returned.
+
+
+
+ Wrapper function which calls avcodec_decode_audio4.
+
+ @deprecated Use avcodec_decode_audio4 instead.
+
+ Decode the audio frame of size avpkt->size from avpkt->data into samples.
+ Some decoders may support multiple frames in a single AVPacket, such
+ decoders would then just decode the first frame. In this case,
+ avcodec_decode_audio3 has to be called again with an AVPacket that contains
+ the remaining data in order to decode the second frame etc.
+ If no frame
+ could be outputted, frame_size_ptr is zero. Otherwise, it is the
+ decompressed frame size in bytes.
+
+ @warning You must set frame_size_ptr to the allocated size of the
+ output buffer before calling avcodec_decode_audio3().
+
+ @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than
+ the actual read bytes because some optimized bitstream readers read 32 or 64
+ bits at once and could read over the end.
+
+ @warning The end of the input buffer avpkt->data should be set to 0 to ensure that
+ no overreading happens for damaged MPEG streams.
+
+ @warning You must not provide a custom get_buffer() when using
+ avcodec_decode_audio3(). Doing so will override it with
+ avcodec_default_get_buffer. Use avcodec_decode_audio4() instead,
+ which does allow the application to provide a custom get_buffer().
+
+ @note You might have to align the input buffer avpkt->data and output buffer
+ samples. The alignment requirements depend on the CPU: On some CPUs it isn't
+ necessary at all, on others it won't work at all if not aligned and on others
+ it will work but it will have an impact on performance.
+
+ In practice, avpkt->data should have 4 byte alignment at minimum and
+ samples should be 16 byte aligned unless the CPU doesn't need it
+ (AltiVec and SSE do).
+
+ @note Codecs which have the CODEC_CAP_DELAY capability set have a delay
+ between input and output, these need to be fed with avpkt->data=NULL,
+ avpkt->size=0 at the end to return the remaining frames.
+
+ @param avctx the codec context
+ @param[out] samples the output buffer, sample type in avctx->sample_fmt
+ If the sample format is planar, each channel plane will
+ be the same size, with no padding between channels.
+ @param[in,out] frame_size_ptr the output buffer size in bytes
+ @param[in] avpkt The input AVPacket containing the input buffer.
+ You can create such packet with av_init_packet() and by then setting
+ data and size, some decoders might in addition need other fields.
+ All decoders are designed to use the least fields possible though.
+ @return On error a negative value is returned, otherwise the number of bytes
+ used or zero if no frame data was decompressed (used) from the input AVPacket.
+
+
+
+@deprecated Set s->thread_count before calling avcodec_open2() instead of calling this.
+
+
+
+ Modify width and height values so that they will result in a memory
+ buffer that is acceptable for the codec if you also ensure that all
+ line sizes are a multiple of the respective linesize_align[i].
+
+ May only be used if a codec with CODEC_CAP_DR1 has been opened.
+ If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased
+ according to avcodec_get_edge_width() before.
+
+
+
+ Modify width and height values so that they will result in a memory
+ buffer that is acceptable for the codec if you do not use any horizontal
+ padding.
+
+ May only be used if a codec with CODEC_CAP_DR1 has been opened.
+ If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased
+ according to avcodec_get_edge_width() before.
+
+
+
+ Return the amount of padding in pixels which the get_buffer callback must
+ provide around the edge of the image for codecs which do not have the
+ CODEC_FLAG_EMU_EDGE flag.
+
+ @return Required padding in pixels.
+
+
+
+ Allocate an AVFrame and set its fields to default values. The resulting
+ struct can be deallocated by simply calling av_free().
+
+ @return An AVFrame filled with default values or NULL on failure.
+ @see avcodec_get_frame_defaults
+
+
+
+ Set the fields of the given AVFrame to default values.
+
+ @param pic The AVFrame of which the fields should be set to default values.
+
+
+
+ Copy the settings of the source AVCodecContext into the destination
+ AVCodecContext. The resulting destination codec context will be
+ unopened, i.e. you are required to call avcodec_open2() before you
+ can use this AVCodecContext to decode/encode video/audio data.
+
+ @param dest target codec context, should be initialized with
+ avcodec_alloc_context3(), but otherwise uninitialized
+ @param src source codec context
+ @return AVERROR() on error (e.g. memory allocation error), 0 on success
+
+
+
+ Allocate an AVCodecContext and set its fields to default values. The
+ resulting struct can be deallocated by simply calling av_free().
+
+ @param codec if non-NULL, allocate private data and initialize defaults
+ for the given codec. It is illegal to then call avcodec_open2()
+ with a different codec.
+
+ @return An AVCodecContext filled with default values or NULL on failure.
+ @see avcodec_get_context_defaults
+
+
+
+THIS FUNCTION IS NOT YET PART OF THE PUBLIC API!
+ * we WILL change its arguments and name a few times!
+
+
+ Allocate an AVCodecContext and set its fields to default values. The
+ resulting struct can be deallocated by simply calling av_free().
+
+ @return An AVCodecContext filled with default values or NULL on failure.
+ @see avcodec_get_context_defaults
+
+ @deprecated use avcodec_alloc_context3()
+
+
+
+ Set the fields of the given AVCodecContext to default values corresponding
+ to the given codec (defaults may be codec-dependent).
+
+ Do not call this function if a non-NULL codec has been passed
+ to avcodec_alloc_context3() that allocated this AVCodecContext.
+ If codec is non-NULL, it is illegal to call avcodec_open2() with a
+ different codec on this AVCodecContext.
+
+
+
+THIS FUNCTION IS NOT YET PART OF THE PUBLIC API!
+ * we WILL change its arguments and name a few times!
+
+
+ Set the fields of the given AVCodecContext to default values.
+
+ @param s The AVCodecContext of which the fields should be set to default values.
+ @deprecated use avcodec_get_context_defaults3
+
+
+
+ Return a name for the specified profile, if available.
+
+ @param codec the codec that is searched for the given profile
+ @param profile the profile value for which a name is requested
+ @return A name for the profile if found, NULL otherwise.
+
+
+
+ Find a registered decoder with the specified name.
+
+ @param name name of the requested decoder
+ @return A decoder if one was found, NULL otherwise.
+
+
+
+ Find a registered decoder with a matching codec ID.
+
+ @param id CodecID of the requested decoder
+ @return A decoder if one was found, NULL otherwise.
+
+
+
+ Find a registered encoder with the specified name.
+
+ @param name name of the requested encoder
+ @return An encoder if one was found, NULL otherwise.
+
+
+
+ Find a registered encoder with a matching codec ID.
+
+ @param id CodecID of the requested encoder
+ @return An encoder if one was found, NULL otherwise.
+
+
+
+ Register the codec codec and initialize libavcodec.
+
+ @warning either this function or avcodec_register_all() must be called
+ before any other libavcodec functions.
+
+ @see avcodec_register_all()
+
+
+
+@deprecated this function is called automatically from avcodec_register()
+and avcodec_register_all(), there is no need to call it manually
+
+
+
+Return the libavcodec license.
+
+
+
+Return the libavcodec build-time configuration.
+
+
+
+Return the LIBAVCODEC_VERSION_INT constant.
+
+
+
+If c is NULL, returns the first registered codec,
+if c is non-NULL, returns the next registered codec after c,
+or NULL if c is the last one.
+
+
+
+Tell if an image really has transparent alpha values.
+@return ored mask of FF_ALPHA_xxx constants
+
+
+
+ Compute what kind of losses will occur when converting from one specific
+ pixel format to another.
+ When converting from one pixel format to another, information loss may occur.
+ For example, when converting from RGB24 to GRAY, the color information will
+ be lost. Similarly, other losses occur when converting from some formats to
+ other formats. These losses can involve loss of chroma, but also loss of
+ resolution, loss of color depth, loss due to the color space conversion, loss
+ of the alpha bits or loss due to color quantization.
+ avcodec_get_fix_fmt_loss() informs you about the various types of losses
+ which will occur when converting from one pixel format to another.
+
+ @param[in] dst_pix_fmt destination pixel format
+ @param[in] src_pix_fmt source pixel format
+ @param[in] has_alpha Whether the source pixel format alpha channel is used.
+ @return Combination of flags informing you what kind of losses will occur
+ (maximum loss for an invalid dst_pix_fmt).
+
+
+
+ Put a string representing the codec tag codec_tag in buf.
+
+ @param buf_size size in bytes of buf
+ @return the length of the string that would have been generated if
+ enough space had been available, excluding the trailing null
+
+
+
+Return a value representing the fourCC code associated to the
+pixel format pix_fmt, or 0 if no associated fourCC code can be
+found.
+
+
+
+ Return the short name for a pixel format.
+
+ \see av_get_pix_fmt(), av_get_pix_fmt_string().
+ @deprecated Deprecated in favor of av_get_pix_fmt_name().
+
+
+
+Get the name of a codec.
+@return a static string identifying the codec; never NULL
+
+
+
+ Calculate the size in bytes that a picture of the given width and height
+ would occupy if stored in the given picture format.
+ Note that this returns the size of a compact representation as generated
+ by avpicture_layout(), which can be smaller than the size required for e.g.
+ avpicture_fill().
+
+ @param pix_fmt the given picture format
+ @param width the width of the image
+ @param height the height of the image
+ @return Image data size in bytes or -1 on error (e.g. too large dimensions).
+
+
+
+ Copy pixel data from an AVPicture into a buffer.
+ The data is stored compactly, without any gaps for alignment or padding
+ which may be applied by avpicture_fill().
+
+ @see avpicture_get_size()
+
+ @param[in] src AVPicture containing image data
+ @param[in] pix_fmt The format in which the picture data is stored.
+ @param[in] width the width of the image in pixels.
+ @param[in] height the height of the image in pixels.
+ @param[out] dest A buffer into which picture data will be copied.
+ @param[in] dest_size The size of 'dest'.
+ @return The number of bytes written to dest, or a negative value (error code) on error.
+
+
+
+ Fill in the AVPicture fields.
+ The fields of the given AVPicture are filled in by using the 'ptr' address
+ which points to the image data buffer. Depending on the specified picture
+ format, one or multiple image data pointers and line sizes will be set.
+ If a planar format is specified, several pointers will be set pointing to
+ the different picture planes and the line sizes of the different planes
+ will be stored in the lines_sizes array.
+ Call with ptr == NULL to get the required size for the ptr buffer.
+
+ To allocate the buffer and fill in the AVPicture fields in one call,
+ use avpicture_alloc().
+
+ @param picture AVPicture whose fields are to be filled in
+ @param ptr Buffer which will contain or contains the actual image data
+ @param pix_fmt The format in which the picture data is stored.
+ @param width the width of the image in pixels
+ @param height the height of the image in pixels
+ @return size of the image data in bytes
+
+
+
+ Free a picture previously allocated by avpicture_alloc().
+ The data buffer used by the AVPicture is freed, but the AVPicture structure
+ itself is not.
+
+ @param picture the AVPicture to be freed
+
+
+
+ Allocate memory for a picture. Call avpicture_free() to free it.
+
+ @see avpicture_fill()
+
+ @param picture the picture to be filled in
+ @param pix_fmt the format of the picture
+ @param width the width of the picture
+ @param height the height of the picture
+ @return zero if successful, a negative value if not
+
+
+
+ Compensate samplerate/timestamp drift. The compensation is done by changing
+ the resampler parameters, so no audible clicks or similar distortions occur
+ @param compensation_distance distance in output samples over which the compensation should be performed
+ @param sample_delta number of output samples which should be output less
+
+ example: av_resample_compensate(c, 10, 500)
+ here instead of 510 samples only 500 samples would be output
+
+ note, due to rounding the actual compensation might be slightly different,
+ especially if the compensation_distance is large and the in_rate used during init is small
+
+
+
+Resample an array of samples using a previously configured context.
+@param src an array of unconsumed samples
+@param consumed the number of samples of src which have been consumed are returned here
+@param src_size the number of unconsumed samples available
+@param dst_size the amount of space in samples available in dst
+@param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context.
+@return the number of samples written in dst or -1 if an error occurred
+
+
+
+ * Initialize an audio resampler.
+ * Note, if either rate is not an integer then simply scale both rates up so they are.
+ * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq
+ * @param log2_phase_count log2 of the number of entries in the polyphase filterbank
+ * @param linear If 1 then the used FIR filter will be linearly interpolated
+ between the 2 closest, if 0 the closest will be used
+ * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate
+
+
+
+ Free resample context.
+
+ @param s a non-NULL pointer to a resample context previously
+ created with av_audio_resample_init()
+
+
+
+ * Initialize audio resampling context.
+ *
+ * @param output_channels number of output channels
+ * @param input_channels number of input channels
+ * @param output_rate output sample rate
+ * @param input_rate input sample rate
+ * @param sample_fmt_out requested output sample format
+ * @param sample_fmt_in input sample format
+ * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency
+ * @param log2_phase_count log2 of the number of entries in the polyphase filterbank
+ * @param linear if 1 then the used FIR filter will be linearly interpolated
+ between the 2 closest, if 0 the closest will be used
+ * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate
+ * @return allocated ReSampleContext, NULL if error occurred
+
+
+
+ Get side information from packet.
+
+ @param pkt packet
+ @param type desired side information type
+ @param size pointer for side information size to store (optional)
+ @return pointer to data if present or NULL otherwise
+
+
+
+ Allocate new information of a packet.
+
+ @param pkt packet
+ @param type side information type
+ @param size side information size
+ @return pointer to fresh allocated data or NULL otherwise
+
+
+
+ Free a packet.
+
+ @param pkt packet to free
+
+
+
+@warning This is a hack - the packet memory allocation stuff is broken. The
+packet is allocated if it was not really allocated.
+
+
+
+ Increase packet size, correctly zeroing padding
+
+ @param pkt packet
+ @param grow_by number of bytes by which to increase the size of the packet
+
+
+
+ Reduce packet size, correctly zeroing padding
+
+ @param pkt packet
+ @param size new size
+
+
+
+ Allocate the payload of a packet and initialize its fields with
+ default values.
+
+ @param pkt packet
+ @param size wanted payload size
+ @return 0 if OK, AVERROR_xxx otherwise
+
+
+
+ Initialize optional fields of a packet with default values.
+
+ @param pkt packet
+
+
+
+Default packet destructor.
+
+
+
+@deprecated use NULL instead
+
+
+
+0 terminated ASS/SSA compatible event line.
+The pressentation of this is unaffected by the other values in this
+struct.
+
+
+
+data+linesize for the bitmap of this subtitle.
+can be set for text/ass as well once they where rendered
+
+
+
+Formatted text, the ass field must be set by the decoder and is
+authoritative. pict and text fields may contain approximations.
+
+
+
+Plain text, the text field must be set by the decoder and is
+authoritative. ass and pict fields may contain approximations.
+
+
+
+four components are given, that's all.
+the last component is alpha
+
+
+
+ Size of HW accelerator private data.
+
+ Private data is allocated with av_mallocz() before
+ AVCodecContext.get_buffer() and deallocated after
+ AVCodecContext.release_buffer().
+
+
+
+ Called at the end of each frame or field picture.
+
+ The whole picture is parsed at this point and can now be sent
+ to the hardware accelerator. This function is mandatory.
+
+ @param avctx the codec context
+ @return zero if successful, a negative value otherwise
+
+
+
+ Callback for each slice.
+
+ Meaningful slice information (codec specific) is guaranteed to
+ be parsed at this point. This function is mandatory.
+
+ @param avctx the codec context
+ @param buf the slice data buffer base
+ @param buf_size the size of the slice in bytes
+ @return zero if successful, a negative value otherwise
+
+
+
+ Called at the beginning of each frame or field picture.
+
+ Meaningful frame information (codec specific) is guaranteed to
+ be parsed at this point. This function is mandatory.
+
+ Note that buf can be NULL along with buf_size set to 0.
+ Otherwise, this means the whole frame is available at this point.
+
+ @param avctx the codec context
+ @param buf the frame data buffer base
+ @param buf_size the size of the frame in bytes
+ @return zero if successful, a negative value otherwise
+
+
+
+Hardware accelerated codec capabilities.
+see FF_HWACCEL_CODEC_CAP_*
+
+
+
+ Codec implemented by the hardware accelerator.
+
+ See CODEC_ID_xxx
+
+
+Forced video codec_id.
+Demuxing: Set by user.
+
+
+Forced audio codec_id.
+Demuxing: Set by user.
+
+
+Forced subtitle codec_id.
+Demuxing: Set by user.
+
+
+@}
+
+
+Guess the codec ID based upon muxer and filename.
+
+
+ Get the CodecID for the given codec tag tag.
+ If no codec id is found returns CODEC_ID_NONE.
+
+ @param tags list of supported codec_id-codec_tag pairs, as stored
+ in AVInputFormat.codec_tag and AVOutputFormat.codec_tag
+
+
+
+Name of the hardware accelerated codec.
+The name is globally unique among encoders and among decoders (but an
+encoder and a decoder can share the same name).
+
+
+
+ Encode data to an AVPacket.
+
+ @param avctx codec context
+ @param avpkt output AVPacket (may contain a user-provided buffer)
+ @param[in] frame AVFrame containing the raw data to be encoded
+ @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a
+ non-empty packet was returned in avpkt.
+ @return 0 on success, negative error code on failure
+
+
+
+Initialize codec static data, called from avcodec_register().
+
+
+
+@}
+Private codec-specific defaults.
+
+
+
+ Copy necessary context variables from a previous thread context to the current one.
+ If not defined, the next thread will start automatically; otherwise, the codec
+ must call ff_thread_finish_setup().
+
+ dst and src will (rarely) point to the same context, in which case memcpy should be skipped.
+
+
+
+@name Frame-level threading support functions
+@{
+
+If defined, called on thread contexts when they are created.
+If the codec allocates writable tables in init(), re-allocate them here.
+priv_data will be set to a copy of the original.
+
+
+
+Descriptive name for the codec, meant to be more human readable than name.
+You should use the NULL_IF_CONFIG_SMALL() macro to define it.
+
+
+
+Flush buffers.
+Will be called when seeking
+
+
+
+Codec capabilities.
+see CODEC_CAP_*
+
+
+
+Name of the codec implementation.
+The name is globally unique among encoders and among decoders (but an
+encoder and a decoder can share the same name).
+This is the primary way to find a codec from the user perspective.
+
+
+
+AVCodec.
+
+
+
+AVProfile.
+
+
+
+Current statistics for PTS correction.
+- decoding: maintained and used by libavcodec, not intended to be used by user apps
+- encoding: unused
+
+
+
+Field order
+ * - encoding: set by libavcodec
+ * - decoding: Set by libavcodec
+
+
+
+ Private context used for internal data.
+
+ Unlike priv_data, this is not codec-specific. It is used in general
+ libavcodec functions.
+
+
+
+Error recognition; may misdetect some more or less valid parts as errors.
+- encoding: unused
+- decoding: Set by user.
+
+
+
+Type of service that the audio stream conveys.
+- encoding: Set by user.
+- decoding: Set by libavcodec.
+
+
+
+VBV delay coded in the last frame (in periods of a 27 MHz clock).
+Used for compliant TS muxing.
+- encoding: Set by libavcodec.
+- decoding: unused.
+
+
+
+Set by the client if its custom get_buffer() callback can be called
+from another thread, which allows faster multithreaded decoding.
+draw_horiz_band() will be called from other threads regardless of this setting.
+Ignored if the default get_buffer() is used.
+- encoding: Set by user.
+- decoding: Set by user.
+
+
+
+Which multithreading methods are in use by the codec.
+- encoding: Set by libavcodec.
+- decoding: Set by libavcodec.
+
+
+
+ Which multithreading methods to use.
+ Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread,
+ so clients which cannot provide future frames should not use it.
+
+ - encoding: Set by user, otherwise the default is used.
+ - decoding: Set by user, otherwise the default is used.
+
+
+
+ Whether this is a copy of the context which had init() called on it.
+ This is used by multithreading - shared tables and picture pointers
+ should be freed from the original context only.
+ - encoding: Set by libavcodec.
+ - decoding: Set by libavcodec.
+
+ @deprecated this field has been moved to an internal context
+
+
+
+Current packet as passed into the decoder, to avoid having
+to pass the packet into every function. Currently only valid
+inside lavc and get/release_buffer callbacks.
+- decoding: set by avcodec_decode_*, read by get_buffer() for setting pkt_pts
+- encoding: unused
+
+
+
+Header containing style information for text subtitles.
+For SUBTITLE_ASS subtitle type, it should contain the whole ASS
+[Script Info] and [V4+ Styles] section, plus the [Events] line and
+the Format line following. It shouldn't include any Dialogue line.
+- encoding: Set/allocated/freed by user (before avcodec_open2())
+- decoding: Set/allocated/freed by libavcodec (by avcodec_open2())
+
+
+
+Number of slices.
+Indicates number of picture subdivisions. Used for parallelized
+decoding.
+- encoding: Set by user
+- decoding: unused
+
+
+
+Number of passes to use for Cholesky factorization during LPC analysis
+- encoding: Set by user
+- decoding: unused
+
+
+
+Constant rate factor maximum
+With CRF encoding mode and VBV restrictions enabled, prevents quality from being worse
+than crf_max, even if doing so would violate VBV restrictions.
+- encoding: Set by user.
+- decoding: unused
+
+
+
+RC lookahead
+Number of frames for frametype and ratecontrol lookahead
+- encoding: Set by user
+- decoding: unused
+
+
+
+PSY trellis
+Strength of psychovisual optimization
+- encoding: Set by user
+- decoding: unused
+
+
+
+PSY RD
+Strength of psychovisual optimization
+- encoding: Set by user
+- decoding: unused
+
+
+
+AQ strength
+Reduces blocking and blurring in flat and textured areas.
+- encoding: Set by user
+- decoding: unused
+
+
+
+AQ mode
+0: Disabled
+1: Variance AQ (complexity mask)
+2: Auto-variance AQ (experimental)
+- encoding: Set by user
+- decoding: unused
+
+
+
+explicit P-frame weighted prediction analysis method
+0: off
+1: fast blind weighting (one reference duplicate with -1 offset)
+2: smart weighting (full fade detection analysis)
+- encoding: Set by user.
+- decoding: unused
+
+
+
+MPEG vs JPEG YUV range.
+- encoding: Set by user
+- decoding: Set by libavcodec
+
+
+
+YUV colorspace type.
+- encoding: Set by user
+- decoding: Set by libavcodec
+
+
+
+Color Transfer Characteristic.
+- encoding: Set by user
+- decoding: Set by libavcodec
+
+
+
+Chromaticity coordinates of the source primaries.
+- encoding: Set by user
+- decoding: Set by libavcodec
+
+
+
+Hardware accelerator context.
+For some hardware accelerators, a global context needs to be
+provided by the user. In that case, this holds display-dependent
+data FFmpeg cannot instantiate itself. Please refer to the
+FFmpeg HW accelerator documentation to know how to fill this
+is. e.g. for VA API, this is a struct vaapi_context.
+- encoding: unused
+- decoding: Set by user
+
+
+
+ For some codecs, the time base is closer to the field rate than the frame rate.
+ Most notably, H.264 and MPEG-2 specify time_base as half of frame duration
+ if no telecine is used ...
+
+ Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2.
+
+
+
+Hardware accelerator in use
+- encoding: unused.
+- decoding: Set by libavcodec
+
+
+AVHWAccel.
+
+
+
+Request decoder to use this channel layout if it can (0 for default)
+- encoding: unused
+- decoding: Set by user.
+
+
+
+Audio channel layout.
+- encoding: set by user.
+- decoding: set by user, may be overwritten by libavcodec.
+
+
+
+Bits per sample/pixel of internal libavcodec pixel/sample format.
+- encoding: set by user.
+- decoding: set by libavcodec.
+
+
+
+opaque 64bit number (generally a PTS) that will be reordered and
+output in AVFrame.reordered_opaque
+@deprecated in favor of pkt_pts
+- encoding: unused
+- decoding: Set by user.
+
+
+
+Percentage of dynamic range compression to be applied by the decoder.
+The default value is 1.0, corresponding to full compression.
+- encoding: unused
+- decoding: Set by user.
+@deprecated use AC3 decoder private option instead.
+
+
+
+Decoder should decode to this many channels if it can (0 for default)
+- encoding: unused
+- decoding: Set by user.
+@deprecated Deprecated in favor of request_channel_layout.
+
+
+
+@}
+
+GOP timecode frame start number
+- encoding: Set by user, in non drop frame format
+- decoding: Set by libavcodec (timecode in the 25 bits format, -1 if unset)
+
+
+
+- encoding: Set by user.
+- decoding: unused
+
+
+
+- encoding: Set by user.
+- decoding: unused
+
+
+
+search method for selecting prediction order
+- encoding: Set by user.
+- decoding: unused
+
+
+
+@name FLAC options
+@deprecated Use FLAC encoder private options instead.
+@{
+
+LPC coefficient precision - used by FLAC encoder
+- encoding: Set by user.
+- decoding: unused
+
+
+
+- encoding: Set by user.
+- decoding: unused
+
+
+
+- encoding: Set by user.
+- decoding: unused
+
+
+
+- encoding: Set by user.
+- decoding: unused
+
+
+
+Adjust sensitivity of b_frame_strategy 1.
+- encoding: Set by user.
+- decoding: unused
+
+
+
+
+ Note: Value depends upon the compare function used for fullpel ME.
+ - encoding: Set by user.
+ - decoding: unused
+
+
+
+Multiplied by qscale for each frame and added to scene_change_score.
+- encoding: Set by user.
+- decoding: unused
+
+
+
+Audio cutoff bandwidth (0 means "automatic")
+- encoding: Set by user.
+- decoding: unused
+
+
+
+direct MV prediction mode - 0 (none), 1 (spatial), 2 (temporal), 3 (auto)
+- encoding: Set by user.
+- decoding: unused
+
+
+
+macroblock subpartition sizes to consider - p8x8, p4x4, b8x8, i8x8, i4x4
+- encoding: Set by user.
+- decoding: unused
+
+
+
+in-loop deblocking filter beta parameter
+beta is in the range -6...6
+- encoding: Set by user.
+- decoding: unused
+
+
+
+in-loop deblocking filter alphac0 parameter
+alpha is in the range -6...6
+- encoding: Set by user.
+- decoding: unused
+
+
+
+Reduce fluctuations in qp (before curve compression).
+- encoding: Set by user.
+- decoding: unused
+
+
+
+trellis RD quantization
+- encoding: Set by user.
+- decoding: unused
+
+
+
+Influence how often B-frames are used.
+- encoding: Set by user.
+- decoding: unused
+
+
+
+chroma qp offset from luma
+- encoding: Set by user.
+- decoding: unused
+
+
+
+number of reference frames
+- encoding: Set by user.
+- decoding: Set by lavc.
+
+
+
+minimum GOP size
+- encoding: Set by user.
+- decoding: unused
+
+
+
+constant quantization parameter rate control method
+- encoding: Set by user.
+- decoding: unused
+ @deprecated use 'cqp' libx264 private option
+
+
+
+constant rate factor - quality-based VBR - values ~correspond to qps
+- encoding: Set by user.
+- decoding: unused
+ @deprecated use 'crf' libx264 private option
+
+
+
+
+ - encoding: Set by user.
+ - decoding: unused
+
+
+
+
+ - encoding: Set by user.
+ - decoding: unused
+
+
+
+
+ - encoding: unused
+ - decoding: Set by user.
+
+
+
+ - encoding: unused
+ - decoding: Set by user.
+
+
+
+ - encoding: unused
+ - decoding: Set by user.
+
+
+
+
+ - encoding: Set by user.
+ - decoding: unused
+
+
+
+maximum MB lagrange multipler
+- encoding: Set by user.
+- decoding: unused
+
+
+
+minimum MB lagrange multipler
+- encoding: Set by user.
+- decoding: unused
+
+
+
+Border processing masking, raises the quantizer for mbs on the borders
+of the picture.
+- encoding: Set by user.
+- decoding: unused
+
+
+
+frame skip comparison function
+- encoding: Set by user.
+- decoding: unused
+
+
+
+frame skip exponent
+- encoding: Set by user.
+- decoding: unused
+
+
+
+frame skip factor
+- encoding: Set by user.
+- decoding: unused
+
+
+
+frame skip threshold
+- encoding: Set by user.
+- decoding: unused
+
+
+
+Bitstream width / height, may be different from width/height if lowres enabled.
+- encoding: unused
+- decoding: Set by user before init if known. Codec should override / dynamically change if needed.
+
+
+
+low resolution decoding, 1-> 1/2 size, 2->1/4 size
+- encoding: unused
+- decoding: Set by user.
+
+
+
+level
+- encoding: Set by user.
+- decoding: Set by libavcodec.
+
+
+
+profile
+- encoding: Set by user.
+- decoding: Set by libavcodec.
+
+
+
+Number of macroblock rows at the bottom which are skipped.
+- encoding: unused
+- decoding: Set by user.
+
+
+
+Number of macroblock rows at the top which are skipped.
+- encoding: unused
+- decoding: Set by user.
+
+
+
+noise vs. sse weight for the nsse comparsion function
+- encoding: Set by user.
+- decoding: unused
+
+
+
+precision of the intra DC coefficient - 8
+- encoding: Set by user.
+- decoding: unused
+
+
+
+Macroblock threshold below which the user specified macroblock types will be used.
+- encoding: Set by user.
+- decoding: unused
+
+
+
+ Motion estimation threshold below which no motion estimation is
+ performed, but instead the user specified motion vectors are used.
+
+ - encoding: Set by user.
+ - decoding: unused
+
+
+
+thread opaque
+Can be used by execute() to store some per AVCodecContext stuff.
+- encoding: set by execute()
+- decoding: set by execute()
+
+
+
+The codec may call this to execute several independent things.
+It will return only after finishing all tasks.
+The user may replace this with some multithreaded implementation,
+the default implementation will execute the parts serially.
+@param count the number of things to execute
+- encoding: Set by libavcodec, user can override.
+- decoding: Set by libavcodec, user can override.
+
+
+
+thread count
+is used to decide how many independent tasks should be passed to execute()
+- encoding: Set by user.
+- decoding: Set by user.
+
+
+
+quantizer noise shaping
+- encoding: Set by user.
+- decoding: unused
+
+
+
+MP3 antialias algorithm, see FF_AA_* below.
+- encoding: unused
+- decoding: Set by user.
+
+
+
+Simulates errors in the bitstream to test error concealment.
+- encoding: Set by user.
+- decoding: unused
+
+
+
+CODEC_FLAG2_*
+- encoding: Set by user.
+- decoding: Set by user.
+
+
+
+
+ - encoding: Set by user.
+ - decoding: unused
+
+
+
+Number of bits which should be loaded into the rc buffer before decoding starts.
+- encoding: Set by user.
+- decoding: unused
+
+
+
+Called at the beginning of a frame to get cr buffer for it.
+Buffer type (size, hints) must be the same. libavcodec won't check it.
+libavcodec will pass previous buffer in pic, function should return
+same buffer or new buffer with old frame "painted" into it.
+If pic.data[0] == NULL must behave like get_buffer().
+if CODEC_CAP_DR1 is not set then reget_buffer() must call
+avcodec_default_reget_buffer() instead of providing buffers allocated by
+some other means.
+- encoding: unused
+- decoding: Set by libavcodec, user can override.
+
+
+
+noise reduction strength
+- encoding: Set by user.
+- decoding: unused
+
+
+
+palette control structure
+- encoding: ??? (no palette-enabled encoder yet)
+- decoding: Set by user.
+
+
+ AVPaletteControl
+ This structure defines a method for communicating palette changes
+ between and demuxer and a decoder.
+
+ @deprecated Use AVPacket to send palette changes instead.
+ This is totally broken.
+
+
+
+maximum Lagrange multipler
+- encoding: Set by user.
+- decoding: unused
+
+
+
+minimum Lagrange multipler
+- encoding: Set by user.
+- decoding: unused
+
+
+
+scene change detection threshold
+0 is default, larger means fewer detected scene changes.
+- encoding: Set by user.
+- decoding: unused
+
+
+
+custom inter quantization matrix
+- encoding: Set by user, can be NULL.
+- decoding: Set by libavcodec.
+
+
+
+custom intra quantization matrix
+- encoding: Set by user, can be NULL.
+- decoding: Set by libavcodec.
+
+
+
+macroblock decision mode
+- encoding: Set by user.
+- decoding: unused
+
+
+
+XVideo Motion Acceleration
+- encoding: forbidden
+- decoding: set by decoder
+
+
+
+slice flags
+- encoding: unused
+- decoding: Set by user.
+
+
+
+context model
+- encoding: Set by user.
+- decoding: unused
+
+
+
+coder type
+- encoding: Set by user.
+- decoding: unused
+
+
+
+Global quality for codecs which cannot change it per frame.
+This should be proportional to MPEG-1/2/4 qscale.
+- encoding: Set by user.
+- decoding: unused
+
+
+
+internal_buffers
+Don't touch, used by libavcodec default_get_buffer().
+@deprecated this field was moved to an internal context
+
+
+
+internal_buffer count
+Don't touch, used by libavcodec default_get_buffer().
+@deprecated this field was moved to an internal context
+
+
+
+color table ID
+- encoding: unused
+- decoding: Which clrtable should be used for 8bit RGB images.
+ Tables have to be stored somewhere. FIXME
+
+
+
+inter quantizer bias
+- encoding: Set by user.
+- decoding: unused
+
+
+
+intra quantizer bias
+- encoding: Set by user.
+- decoding: unused
+
+
+
+ maximum motion estimation search range in subpel units
+ If 0 then no limit.
+
+ - encoding: Set by user.
+ - decoding: unused
+
+
+
+ DTG active format information (additional aspect ratio
+ information only used in DVB MPEG-2 transport streams)
+ 0 if not set.
+
+ - encoding: unused
+ - decoding: Set by decoder.
+
+
+
+subpel ME quality
+- encoding: Set by user.
+- decoding: unused
+
+
+
+motion estimation prepass comparison function
+- encoding: Set by user.
+- decoding: unused
+
+
+
+prepass for motion estimation
+- encoding: Set by user.
+- decoding: unused
+
+
+
+amount of previous MV predictors (2a+1 x 2a+1 square)
+- encoding: Set by user.
+- decoding: unused
+
+
+
+interlaced DCT comparison function
+- encoding: Set by user.
+- decoding: unused
+
+
+
+macroblock comparison function (not supported yet)
+- encoding: Set by user.
+- decoding: unused
+
+
+
+subpixel motion estimation comparison function
+- encoding: Set by user.
+- decoding: unused
+
+
+
+motion estimation comparison function
+- encoding: Set by user.
+- decoding: unused
+
+
+
+debug
+- encoding: Set by user.
+- decoding: Set by user.
+
+
+
+debug
+- encoding: Set by user.
+- decoding: Set by user.
+
+
+
+the picture in the bitstream
+- encoding: Set by libavcodec.
+- decoding: Set by libavcodec.
+
+
+
+sample aspect ratio (0 if unknown)
+That is the width of a pixel divided by the height of the pixel.
+Numerator and denominator must be relatively prime and smaller than 256 for some video standards.
+- encoding: Set by user.
+- decoding: Set by libavcodec.
+
+
+
+prediction method (needed for huffyuv)
+- encoding: Set by user.
+- decoding: unused
+
+
+
+bits per sample/pixel from the demuxer (needed for huffyuv).
+- encoding: Set by libavcodec.
+- decoding: Set by user.
+
+
+
+ dsp_mask could be add used to disable unwanted CPU features
+ CPU features (i.e. MMX, SSE. ...)
+
+ With the FORCE flag you may instead enable given CPU features.
+ (Dangerous: Usable in case of misdetection, improper usage however will
+ result into program crash.)
+
+
+
+error concealment flags
+- encoding: unused
+- decoding: Set by user.
+
+
+
+slice offsets in the frame in bytes
+- encoding: Set/allocated by libavcodec.
+- decoding: Set/allocated by user (or NULL).
+
+
+
+slice count
+- encoding: Set by libavcodec.
+- decoding: Set by user (or 0).
+
+
+
+IDCT algorithm, see FF_IDCT_* below.
+- encoding: Set by user.
+- decoding: Set by user.
+
+
+
+darkness masking (0-> disabled)
+- encoding: Set by user.
+- decoding: unused
+
+
+
+p block masking (0-> disabled)
+- encoding: Set by user.
+- decoding: unused
+
+
+
+spatial complexity masking (0-> disabled)
+- encoding: Set by user.
+- decoding: unused
+
+
+
+temporary complexity masking (0-> disabled)
+- encoding: Set by user.
+- decoding: unused
+
+
+
+luminance masking (0-> disabled)
+- encoding: Set by user.
+- decoding: unused
+
+
+
+DCT algorithm, see FF_DCT_* below
+- encoding: Set by user.
+- decoding: unused
+
+
+
+initial complexity for pass1 ratecontrol
+- encoding: Set by user.
+- decoding: unused
+
+
+
+qscale offset between P and I-frames
+- encoding: Set by user.
+- decoding: unused
+
+
+
+decoder bitstream buffer size
+- encoding: Set by user.
+- decoding: unused
+
+
+
+minimum bitrate
+- encoding: Set by user.
+- decoding: unused
+
+
+
+maximum bitrate
+- encoding: Set by user.
+- decoding: unused
+
+
+
+rate control equation
+- encoding: Set by user
+- decoding: unused
+
+
+
+ratecontrol override, see RcOverride
+- encoding: Allocated/set/freed by user.
+- decoding: unused
+
+
+
+ratecontrol qmin qmax limiting method
+0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax.
+- encoding: Set by user.
+- decoding: unused
+
+
+
+pass2 encoding statistics input buffer
+Concatenated stuff from stats_out of pass1 should be placed here.
+- encoding: Allocated/set/freed by user.
+- decoding: unused
+
+
+
+pass1 encoding statistics output buffer
+- encoding: Set by libavcodec.
+- decoding: unused
+
+
+
+0-> h263 quant 1-> mpeg quant
+- encoding: Set by user.
+- decoding: unused
+
+
+
+If true, only parsing is done. The frame data is returned.
+Only MPEG audio decoders support this now.
+- encoding: unused
+- decoding: Set by user
+
+
+
+number of bytes per packet if constant and known or 0
+Used by some WAV based audio codecs.
+
+
+
+Size of the frame reordering buffer in the decoder.
+For MPEG-2 it is 1 IPB or 0 low delay IP.
+- encoding: Set by libavcodec.
+- decoding: Set by libavcodec.
+
+
+
+Called to release buffers which were allocated with get_buffer.
+A released buffer can be reused in get_buffer().
+pic.data[*] must be set to NULL.
+May be called from a different thread if frame multithreading is used,
+but not by more than one thread at once, so does not need to be reentrant.
+- encoding: unused
+- decoding: Set by libavcodec, user can override.
+
+
+
+ Called at the beginning of each frame to get a buffer for it.
+
+ The function will set AVFrame.data[], AVFrame.linesize[].
+ AVFrame.extended_data[] must also be set, but it should be the same as
+ AVFrame.data[] except for planar audio with more channels than can fit
+ in AVFrame.data[]. In that case, AVFrame.data[] shall still contain as
+ many data pointers as it can hold.
+
+ if CODEC_CAP_DR1 is not set then get_buffer() must call
+ avcodec_default_get_buffer() instead of providing buffers allocated by
+ some other means.
+
+ AVFrame.data[] should be 32- or 16-byte-aligned unless the CPU doesn't
+ need it. avcodec_default_get_buffer() aligns the output buffer properly,
+ but if get_buffer() is overridden then alignment considerations should
+ be taken into account.
+
+ @see avcodec_default_get_buffer()
+
+ Video:
+
+ If pic.reference is set then the frame will be read later by libavcodec.
+ avcodec_align_dimensions2() should be used to find the required width and
+ height, as they normally need to be rounded up to the next multiple of 16.
+
+ If frame multithreading is used and thread_safe_callbacks is set,
+ it may be called from a different thread, but not from more than one at
+ once. Does not need to be reentrant.
+
+ @see release_buffer(), reget_buffer()
+ @see avcodec_align_dimensions2()
+
+ Audio:
+
+ Decoders request a buffer of a particular size by setting
+ AVFrame.nb_samples prior to calling get_buffer(). The decoder may,
+ however, utilize only part of the buffer by setting AVFrame.nb_samples
+ to a smaller value in the output frame.
+
+ Decoders cannot use the buffer after returning from
+ avcodec_decode_audio4(), so they will not call release_buffer(), as it
+ is assumed to be released immediately upon return.
+
+ As a convenience, av_samples_get_buffer_size() and
+ av_samples_fill_arrays() in libavutil may be used by custom get_buffer()
+ functions to find the required data size and to fill data pointers and
+ linesize. In AVFrame.linesize, only linesize[0] may be set for audio
+ since all planes must be the same size.
+
+ @see av_samples_get_buffer_size(), av_samples_fill_arrays()
+
+ - encoding: unused
+ - decoding: Set by libavcodec, user can override.
+
+
+
+Error recognition; higher values will detect more errors but may
+misdetect some more or less valid parts as errors.
+- encoding: unused
+- decoding: Set by user.
+
+
+
+qscale offset between IP and B-frames
+- encoding: Set by user.
+- decoding: unused
+
+
+
+strictly follow the standard (MPEG4, ...).
+- encoding: Set by user.
+- decoding: Set by user.
+Setting this to STRICT or higher means the encoder and decoder will
+generally do stupid things, whereas setting it to unofficial or lower
+will mean the encoder might produce output that is not supported by all
+spec-compliant decoders. Decoders don't differentiate between normal,
+unofficial and experimental (that is, they always try to decode things
+when they can) unless they are explicitly asked to behave stupidly
+(=strictly conform to the specs)
+
+
+
+chroma single coeff elimination threshold
+- encoding: Set by user.
+- decoding: unused
+
+
+
+luma single coefficient elimination threshold
+- encoding: Set by user.
+- decoding: unused
+
+
+
+Work around bugs in encoders which sometimes cannot be detected automatically.
+- encoding: Set by user
+- decoding: Set by user
+
+
+
+Private data of the user, can be used to carry app specific stuff.
+- encoding: Set by user.
+- decoding: Set by user.
+
+
+
+number of bits used for the previously encoded frame
+- encoding: Set by libavcodec.
+- decoding: unused
+
+
+
+obsolete FIXME remove
+
+
+maximum number of B-frames between non-B-frames
+Note: The output will be delayed by max_b_frames+1 relative to the input.
+- encoding: Set by user.
+- decoding: unused
+
+
+
+maximum quantizer difference between frames
+- encoding: Set by user.
+- decoding: unused
+
+
+
+maximum quantizer
+- encoding: Set by user.
+- decoding: unused
+
+
+
+minimum quantizer
+- encoding: Set by user.
+- decoding: unused
+
+
+
+Encoding: Number of frames delay there will be from the encoder input to
+ the decoder output. (we assume the decoder matches the spec)
+Decoding: Number of frames delay in addition to what a standard decoder
+ as specified in the spec would produce.
+- encoding: Set by libavcodec.
+- decoding: Set by libavcodec.
+
+
+
+Samples per packet, initialized when calling 'init'.
+
+
+
+If non NULL, 'draw_horiz_band' is called by the libavcodec
+decoder to draw a horizontal band. It improves cache usage. Not
+all codecs can do that. You must check the codec capabilities
+beforehand.
+When multithreading is used, it may be called from multiple threads
+at the same time; threads might draw different parts of the same AVFrame,
+or multiple AVFrames, and there is no guarantee that slices will be drawn
+in order.
+The function is also used by hardware acceleration APIs.
+It is called at least once during frame decoding to pass
+the data needed for hardware render.
+In that mode instead of pixel data, AVFrame points to
+a structure specific to the acceleration API. The application
+reads the structure and can change some fields to indicate progress
+or mark state.
+- encoding: unused
+- decoding: Set by user.
+@param height the height of the slice
+@param y the y position of the slice
+@param type 1->top field, 2->bottom field, 3->frame
+@param offset offset into the AVFrame.data from which the slice should be read
+
+
+
+Pixel format, see PIX_FMT_xxx.
+May be set by the demuxer if known from headers.
+May be overriden by the decoder if it knows better.
+- encoding: Set by user.
+- decoding: Set by user if known, overridden by libavcodec if known
+
+
+callback to negotiate the pixelFormat
+@param fmt is the list of formats which are supported by the codec,
+it is terminated by -1 as 0 is a valid format, the formats are ordered by quality.
+The first is always the native one.
+@return the chosen format
+- encoding: unused
+- decoding: Set by user, if not set the native format will be chosen.
+
+
+ Supported pixel format.
+
+ Only hardware accelerated formats are supported here.
+
+
+
+the number of pictures in a group of pictures, or 0 for intra_only
+- encoding: Set by user.
+- decoding: unused
+
+
+
+picture width / height.
+- encoding: MUST be set by user.
+- decoding: Set by libavcodec.
+Note: For compatibility it is possible to set this instead of
+coded_width/height before decoding.
+
+
+
+This is the fundamental unit of time (in seconds) in terms
+of which frame timestamps are represented. For fixed-fps content,
+timebase should be 1/framerate and timestamp increments should be
+identically 1.
+- encoding: MUST be set by user.
+- decoding: Set by libavcodec.
+
+
+
+some codecs need / can use extradata like Huffman tables.
+mjpeg: Huffman tables
+rv10: additional flags
+mpeg4: global headers (they can be in the bitstream or here)
+The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger
+than extradata_size to avoid prolems if it is read with the bitstream reader.
+The bytewise contents of extradata must not depend on the architecture or CPU endianness.
+- encoding: Set/allocated/freed by libavcodec.
+- decoding: Set/allocated/freed by user.
+
+
+
+Motion estimation algorithm used for video coding.
+1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex),
+8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific]
+- encoding: MUST be set by user.
+- decoding: unused
+
+
+
+Some codecs need additional format info. It is stored here.
+If any muxer uses this then ALL demuxers/parsers AND encoders for the
+specific codec MUST set it correctly otherwise stream copy breaks.
+In general use of this field by muxers is not recommended.
+- encoding: Set by libavcodec.
+- decoding: Set by libavcodec. (FIXME: Is this OK?)
+
+
+
+CODEC_FLAG_*.
+- encoding: Set by user.
+- decoding: Set by user.
+
+
+
+number of bits the bitstream is allowed to diverge from the reference.
+ the reference can be CBR (for CBR pass1) or VBR (for pass2)
+- encoding: Set by user; unused for constant quantizer encoding.
+- decoding: unused
+
+
+
+the average bitrate
+- encoding: Set by user; unused for constant quantizer encoding.
+- decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream.
+
+
+
+information on struct for av_log
+- set by avcodec_alloc_context3
+
+
+
+reordered pos from the last AVPacket that has been input into the decoder
+Code outside libavcodec should access this field using:
+ av_opt_ptr(avcodec_get_frame_class(), frame, "pkt_pos");
+- encoding: unused
+- decoding: Read by user.
+
+
+
+frame timestamp estimated using various heuristics, in stream time base
+Code outside libavcodec should access this field using:
+ av_opt_ptr(avcodec_get_frame_class(), frame, "best_effort_timestamp");
+- encoding: unused
+- decoding: set by libavcodec, read by user.
+
+
+
+format of the frame, -1 if unknown or unset
+Values correspond to enum PixelFormat for video frames,
+enum AVSampleFormat for audio)
+- encoding: unused
+- decoding: Read by user.
+
+
+
+width and height of the video frame
+- encoding: unused
+- decoding: Read by user.
+
+
+
+sample aspect ratio for the video frame, 0/1 if unknown\unspecified
+- encoding: unused
+- decoding: Read by user.
+
+
+
+ pointers to the data planes/channels.
+
+ For video, this should simply point to data[].
+
+ For planar audio, each channel has a separate data pointer, and
+ linesize[0] contains the size of each channel buffer.
+ For packed audio, there is just one data pointer, and linesize[0]
+ contains the total size of the buffer for all channels.
+
+ Note: Both data and extended_data will always be set by get_buffer(),
+ but for planar audio with more channels that can fit in data,
+ extended_data must be used by the decoder in order to access all
+ channels.
+
+ encoding: unused
+ decoding: set by AVCodecContext.get_buffer()
+
+
+
+number of audio samples (per channel) described by this frame
+- encoding: unused
+- decoding: Set by libavcodec
+
+
+
+used by multithreading to store frame-specific info
+- encoding: Set by libavcodec.
+- decoding: Set by libavcodec.
+
+
+
+the AVCodecContext which ff_thread_get_buffer() was last called on
+- encoding: Set by libavcodec.
+- decoding: Set by libavcodec.
+
+
+main external API structure.
+New fields can be added to the end with minor version bumps.
+Removal, reordering and changes to existing fields require a major
+version bump.
+Please use AVOptions (av_opt* / av_set/get*()) to access these fields from user
+applications.
+sizeof(AVCodecContext) must not be used outside libav*.
+
+
+
+dts from the last AVPacket that has been input into the decoder
+- encoding: unused
+- decoding: Read by user.
+
+
+
+reordered pts from the last AVPacket that has been input into the decoder
+- encoding: unused
+- decoding: Read by user.
+
+
+
+hardware accelerator private data (FFmpeg-allocated)
+- encoding: unused
+- decoding: Set by libavcodec
+
+
+
+reordered opaque 64bit (generally an integer or a double precision float
+PTS but can be anything).
+The user sets AVCodecContext.reordered_opaque to represent the input at
+that time,
+the decoder reorders values as needed and sets AVFrame.reordered_opaque
+to exactly one of the values provided by the user through AVCodecContext.reordered_opaque
+@deprecated in favor of pkt_pts
+- encoding: unused
+- decoding: Read by user.
+
+
+
+motion reference frame index
+the order in which these are stored can depend on the codec.
+- encoding: Set by user.
+- decoding: Set by libavcodec.
+
+
+
+DCT coefficients
+- encoding: unused
+- decoding: Set by libavcodec.
+
+
+
+codec suggestion on buffer type if != 0
+- encoding: unused
+- decoding: Set by libavcodec. (before get_buffer() call)).
+
+
+
+Tell user application that palette has changed from previous frame.
+- encoding: ??? (no palette-enabled encoder yet)
+- decoding: Set by libavcodec. (default 0).
+
+
+
+Pan scan.
+- encoding: Set by user.
+- decoding: Set by libavcodec.
+
+
+
+If the content is interlaced, is top field displayed first.
+- encoding: Set by user.
+- decoding: Set by libavcodec.
+
+
+
+The content of the picture is interlaced.
+- encoding: Set by user.
+- decoding: Set by libavcodec. (default 0)
+
+
+
+When decoding, this signals how much the picture must be delayed.
+extra_delay = repeat_pict / (2*fps)
+- encoding: unused
+- decoding: Set by libavcodec.
+
+
+
+for some private data of the user
+- encoding: unused
+- decoding: Set by user.
+
+
+
+log2 of the size of the block which a single vector in motion_val represents:
+(4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2)
+- encoding: unused
+- decoding: Set by libavcodec.
+
+
+
+macroblock type table
+mb_type_base + mb_width + 2
+- encoding: Set by user.
+- decoding: Set by libavcodec.
+
+
+
+mbskip_table[mb]>=1 if MB didn't change
+stride= mb_width = (width+15)>>4
+- encoding: unused
+- decoding: Set by libavcodec.
+
+
+
+QP store stride
+- encoding: unused
+- decoding: Set by libavcodec.
+
+
+
+QP table
+- encoding: unused
+- decoding: Set by libavcodec.
+
+
+
+is this picture used as reference
+The values for this are the same as the MpegEncContext.picture_structure
+variable, that is 1->top field, 2->bottom field, 3->frame/both fields.
+Set to 4 for delayed, non-reference frames.
+- encoding: unused
+- decoding: Set by libavcodec. (before get_buffer() call)).
+
+
+
+@deprecated unused
+
+
+
+quality (between 1 (good) and FF_LAMBDA_MAX (bad))
+- encoding: Set by libavcodec. for coded_picture (and set by user for input).
+- decoding: Set by libavcodec.
+
+
+
+picture number in display order
+- encoding: set by
+- decoding: Set by libavcodec.
+
+
+
+picture number in bitstream order
+- encoding: set by
+- decoding: Set by libavcodec.
+
+
+
+presentation timestamp in time_base units (time when frame should be shown to user)
+If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed.
+- encoding: MUST be set by user.
+- decoding: Set by libavcodec.
+
+
+
+1 -> keyframe, 0-> not
+- encoding: Set by libavcodec.
+- decoding: Set by libavcodec.
+
+
+
+pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer.
+This isn't used by libavcodec unless the default get/release_buffer() is used.
+- encoding:
+- decoding:
+
+
+
+ Size, in bytes, of the data for each picture/channel plane.
+
+ For audio, only linesize[0] may be set. For planar audio, each channel
+ plane must be the same size.
+
+ - encoding: Set by user (video only)
+ - decoding: set by AVCodecContext.get_buffer()
+
+
+
+pointer to the picture/channel planes.
+This might be different from the first allocated byte
+- encoding: Set by user
+- decoding: set by AVCodecContext.get_buffer()
+
+
+
+Audio Video Frame.
+New fields can be added to the end of AVFRAME with minor version
+bumps. Similarly fields that are marked as to be only accessed by
+av_opt_ptr() can be reordered. This allows 2 forks to add fields
+without breaking compatibility with each other.
+Removal, reordering and changes in the remaining cases require
+a major version bump.
+sizeof(AVFrame) must not be used outside libavcodec.
+
+
+
+ Time difference in AVStream->time_base units from the pts of this
+ packet to the point at which the output from the decoder has converged
+ independent from the availability of previous frames. That is, the
+ frames are virtually identical no matter if decoding started from
+ the very first frame or from this keyframe.
+ Is AV_NOPTS_VALUE if unknown.
+ This field is not the display duration of the current packet.
+ This field has no meaning if the packet does not have AV_PKT_FLAG_KEY
+ set.
+
+ The purpose of this field is to allow seeking in streams that have no
+ keyframes in the conventional sense. It corresponds to the
+ recovery point SEI in H.264 and match_time_delta in NUT. It is also
+ essential for some types of subtitle streams to ensure that all
+ subtitles are correctly displayed after seeking.
+
+
+
+Duration of this packet in AVStream->time_base units, 0 if unknown.
+Equals next_pts - this_pts in presentation order.
+
+
+
+A combination of AV_PKT_FLAG values
+
+
+
+Decompression timestamp in AVStream->time_base units; the time at which
+the packet is decompressed.
+Can be AV_NOPTS_VALUE if it is not stored in the file.
+
+
+
+Presentation timestamp in AVStream->time_base units; the time at which
+the decompressed packet will be presented to the user.
+Can be AV_NOPTS_VALUE if it is not stored in the file.
+pts MUST be larger or equal to dts as presentation cannot happen before
+decompression, unless one wants to view hex dumps. Some formats misuse
+the terms dts and pts/cts to mean something different. Such timestamps
+must be converted to true pts/dts before they are stored in AVPacket.
+
+
+
+position of the top left corner in 1/16 pel for up to 3 fields/frames
+- encoding: Set by user.
+- decoding: Set by libavcodec.
+
+
+
+width and height in 1/16 pel
+- encoding: Set by user.
+- decoding: Set by libavcodec.
+
+
+
+id
+- encoding: Set by user.
+- decoding: Set by libavcodec.
+
+
+
+The parent program guarantees that the input for B-frames containing
+streams is not written to for at least s->max_b_frames+1 frames, if
+this is not set the input will be copied.
+
+@defgroup deprecated_flags Deprecated codec flags
+Use corresponding private codec options instead.
+@{
+
+@}
+
+Codec uses get_buffer() for allocating buffers and supports custom allocators.
+If not set, it might not use get_buffer() at all or use operations that
+assume the buffer was allocated by avcodec_default_get_buffer.
+
+ Encoder or decoder requires flushing with NULL input at the end in order to
+ give the complete and correct output.
+
+ NOTE: If this flag is not set, the codec is guaranteed to never be fed with
+ with NULL data. The user can still send NULL data to the public encode
+ or decode function, but libavcodec will not pass it along to the codec
+ unless this flag is set.
+
+ Decoders:
+ The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL,
+ avpkt->size=0 at the end to get the delayed data until the decoder no longer
+ returns frames.
+
+ Encoders:
+ The encoder needs to be fed with NULL data at the end of encoding until the
+ encoder no longer returns data.
+
+ NOTE: For encoders implementing the AVCodec.encode2() function, setting this
+ flag also means that the encoder must set the pts and duration for
+ each output packet. If this flag is not set, the pts and duration will
+ be determined by libavcodec from the input frame.
+
+Codec can be fed a final frame with a smaller size.
+This can be used to prevent truncation of the last audio samples.
+
+Codec can export data for HW decoding (VDPAU).
+
+Codec can output multiple frames per AVPacket
+Normally demuxers return one frame at a time, demuxers which do not do
+are connected to a parser to split what they return into proper frames.
+This flag is reserved to the very rare category of codecs which have a
+bitstream that cannot be split into frames without timeconsuming
+operations like full decoding. Demuxers carring such bitstreams thus
+may return multiple frames in a packet. This has many disadvantages like
+prohibiting stream copy in many cases thus it should only be considered
+as a last resort.
+
+Codec is experimental and is thus avoided in favor of non experimental
+encoders
+
+Codec should fill in channel configuration and samplerate instead of container
+
+Codec is able to deal with negative linesizes
+
+Codec supports frame-level multithreading.
+
+Codec supports slice-based (or partition-based) multithreading.
+
+Codec supports changed parameters at any point.
+
+Codec supports avctx->thread_count == 0 (auto).
+
+Audio encoder supports receiving a different number of samples in each call.
+
+Codec is lossless.
+
+Pan Scan area.
+This specifies the area which should be displayed.
+Note there may be multiple such areas for one frame.
+
+
+
+LPC analysis type
+
+
+Determine which LPC analysis algorithm to use.
+- encoding: Set by user
+- decoding: unused
+
+
+
+X X 3 4 X X are luma samples,
+ 1 2 1-6 are possible chroma positions
+X X 5 6 X 0 is undefined/unknown position
+
+
+This defines the location of chroma samples.
+- encoding: Set by user
+- decoding: Set by libavcodec
+
+
+
+Return default channel layout for a given number of channels.
+
+
+
+Return the number of channels in the channel layout.
+
+
+
+@file
+audio conversion routines
+
+@addtogroup lavu_audio
+@{
+
+@defgroup channel_masks Audio channel masks
+@{
+
+Channel mask value used for AVCodecContext.request_channel_layout
+ to indicate that the user requests the channel order of the decoder output
+ to be the native codec channel order.
+@}
+@defgroup channel_mask_c Audio channel convenience macros
+@{
+
+@}
+
+ * Return a channel layout id that matches name, 0 if no match.
+ * name can be one or several of the following notations,
+ * separated by '+' or '|':
+ * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0,
+ * 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix);
+ * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC,
+ * SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR);
+ * - a number of channels, in decimal, optionnally followed by 'c', yielding
+ * the default channel layout for that number of channels (@see
+ * av_get_default_channel_layout);
+ * - a channel layout mask, in hexadecimal starting with "0x" (see the
+ * AV_CH_* macros).
+ + Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7"
+
+
+
+Free all the memory allocated for an AVDictionary struct
+and all keys and values.
+
+
+
+Copy entries from one AVDictionary struct into another.
+@param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL,
+ this function will allocate a struct for you and put it in *dst
+@param src pointer to source AVDictionary struct
+@param flags flags to use when setting entries in *dst
+@note metadata is read using the AV_DICT_IGNORE_SUFFIX flag
+
+
+
+ Get a dictionary entry with matching key.
+
+ @param prev Set to the previous matching element to find the next.
+ If set to NULL the first matching element is returned.
+ @param flags Allows case as well as suffix-insensitive comparisons.
+ @return Found entry or NULL, changing key or value leads to undefined behavior.
+
+
+
+Disables cpu detection and forces the specified flags.
+
+
+
+Return the flags which specify extensions supported by the CPU.
+
+
+
+ Fill channel data pointers and linesize for samples with sample
+ format sample_fmt.
+
+ The pointers array is filled with the pointers to the samples data:
+ for planar, set the start point of each channel's data within the buffer,
+ for packed, set the start point of the entire buffer only.
+
+ The linesize array is filled with the aligned size of each channel's data
+ buffer for planar layout, or the aligned size of the buffer for all channels
+ for packed layout.
+
+ @param[out] audio_data array to be filled with the pointer for each channel
+ @param[out] linesize calculated linesize
+ @param buf the pointer to a buffer containing the samples
+ @param nb_channels the number of channels
+ @param nb_samples the number of samples in a single channel
+ @param sample_fmt the sample format
+ @param align buffer size alignment (1 = no alignment required)
+ @return 0 on success or a negative error code on failure
+
+
+
+ Get the required buffer size for the given audio parameters.
+
+ @param[out] linesize calculated linesize, may be NULL
+ @param nb_channels the number of channels
+ @param nb_samples the number of samples in a single channel
+ @param sample_fmt the sample format
+ @return required buffer size, or negative error code on failure
+
+
+
+ Check if the sample format is planar.
+
+ @param sample_fmt the sample format to inspect
+ @return 1 if the sample format is planar, 0 if it is interleaved
+
+
+
+ Return number of bytes per sample.
+
+ @param sample_fmt the sample format
+ @return number of bytes per sample or zero if unknown for the given
+ sample format
+
+
+
+@deprecated Use av_get_bytes_per_sample() instead.
+
+
+
+ Generate a string corresponding to the sample format with
+ sample_fmt, or a header if sample_fmt is negative.
+
+ @param buf the buffer where to write the string
+ @param buf_size the size of buf
+ @param sample_fmt the number of the sample format to print the
+ corresponding info string, or a negative value to print the
+ corresponding header.
+ @return the pointer to the filled buffer or NULL if sample_fmt is
+ unknown or in case of other errors
+
+
+
+Return the name of sample_fmt, or NULL if sample_fmt is not
+recognized.
+
+
+
+@}
+@}
+
+all in native-endian format
+
+
+Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE
+on error.
+
+
+audio sample format
+- encoding: Set by user.
+- decoding: Set by libavcodec.
+
+
+desired sample format
+- encoding: Not used.
+- decoding: Set by user.
+Decoder will decode to this format if it can.
+
+
+
+Return x default pointer in case p is NULL.
+
+
+
+av_dlog macros
+Useful to print debug messages that shouldn't get compiled in normally.
+
+Skip repeated messages, this requires the user app to use av_log() instead of
+(f)printf as the 2 would otherwise interfere and lead to
+"Last message repeated x times" messages below (f)printf messages with some
+bad luck.
+Also to receive the last, "last repeated" line if any, the user app must
+call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end
+
+
+
+Format a line of log the same way as the default callback.
+@param line buffer to receive the formated line
+@param line_size size of the buffer
+@param print_prefix used to store whether the prefix must be printed;
+ must point to a persistent integer initially set to 1
+
+
+
+Something went really wrong and we will crash now.
+
+Something went wrong and recovery is not possible.
+For example, no header was found for a format which depends
+on headers or an illegal combination of parameters is used.
+
+Something went wrong and cannot losslessly be recovered.
+However, not all future data is affected.
+
+Something somehow does not look correct. This may or may not
+lead to problems. An example would be the use of '-vstrict -2'.
+
+Stuff which is only useful for libav* developers.
+
+ Send the specified message to the log if the level is less than or equal
+ to the current av_log_level. By default, all logging messages are sent to
+ stderr. This behavior can be altered by setting a different av_vlog callback
+ function.
+
+ @param avcl A pointer to an arbitrary struct of which the first field is a
+ pointer to an AVClass struct.
+ @param level The importance level of the message, lower values signifying
+ higher importance.
+ @param fmt The format string (printf-compatible) that specifies how
+ subsequent arguments are converted to output.
+ @see av_vlog
+
+
+
+ Return an AVClass corresponding to next potential
+ AVOptions-enabled child.
+
+ The difference between child_next and this is that
+ child_next iterates over _already existing_ objects, while
+ child_class_next iterates over _all possible_ children.
+
+
+
+Return next AVOptions-enabled child or NULL
+
+
+
+Offset in the structure where a pointer to the parent context for loging is stored.
+for example a decoder that uses eval.c could pass its AVCodecContext to eval as such
+parent context. And a av_log() implementation could then display the parent context
+can be NULL of course
+
+
+
+Offset in the structure where log_level_offset is stored.
+0 means there is no such variable
+
+
+
+LIBAVUTIL_VERSION with which this structure was created.
+This is used to allow fields to be added without requiring major
+version bumps everywhere.
+
+
+
+ a pointer to the first option specified in the class if any or NULL
+
+ @see av_set_default_options()
+
+
+
+A pointer to a function which returns the name of a context
+instance ctx associated with the class.
+
+
+
+The name of the class; usually it is the same name as the
+context structure type to which the AVClass is associated.
+
+
+
+ Compare 2 integers modulo mod.
+ That is we compare integers a and b for which only the least
+ significant log2(mod) bits are known.
+
+ @param mod must be a power of 2
+ @return a negative value if a is smaller than b
+ a positive value if a is greater than b
+ 0 if a equals b
+
+
+
+Compare 2 timestamps each in its own timebases.
+The result of the function is undefined if one of the timestamps
+is outside the int64_t range when represented in the others timebase.
+@return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position
+
+
+
+Rescale a 64-bit integer by 2 rational numbers.
+
+
+
+Rescale a 64-bit integer with specified rounding.
+A simple a*b/c isn't possible as it can overflow.
+
+
+
+Rescale a 64-bit integer with rounding to nearest.
+A simple a*b/c isn't possible as it can overflow.
+
+
+
+@}
+
+@addtogroup lavu_math
+@{
+
+
+
+Find the nearest value in q_list to q.
+@param q_list an array of rationals terminated by {0, 0}
+@return the index of the nearest value found in the array
+
+
+
+@return 1 if q1 is nearer to q than q2, -1 if q2 is nearer
+than q1, 0 if they have the same distance.
+
+
+
+ Convert a double precision floating point number to a rational.
+ inf is expressed as {1,0} or {-1,0} depending on the sign.
+
+ @param d double to convert
+ @param max the maximum allowed numerator and denominator
+ @return (AVRational) d
+
+
+
+Subtract one rational from another.
+@param b first rational
+@param c second rational
+@return b-c
+
+
+
+Add two rationals.
+@param b first rational
+@param c second rational
+@return b+c
+
+
+
+Divide one rational by another.
+@param b first rational
+@param c second rational
+@return b/c
+
+
+
+Multiply two rationals.
+@param b first rational
+@param c second rational
+@return b*c
+
+
+
+Convert rational to double.
+@param a rational to convert
+@return (double) a
+
+
+
+Set the maximum size that may me allocated in one block.
+
+
+
+Multiply two size_t values checking for overflow.
+@return 0 if success, AVERROR(EINVAL) if overflow.
+
+
+
+ Add an element to a dynamic array.
+
+ @param tab_ptr Pointer to the array.
+ @param nb_ptr Pointer to the number of elements in the array.
+ @param elem Element to be added.
+
+
+
+Free a memory block which has been allocated with av_malloc(z)() or
+av_realloc() and set the pointer pointing to it to NULL.
+@param ptr Pointer to the pointer to the memory block which should
+be freed.
+@see av_free()
+
+
+
+Duplicate the string s.
+@param s string to be duplicated
+@return Pointer to a newly allocated string containing a
+copy of s or NULL if the string cannot be allocated.
+
+
+
+Allocate a block of nmemb * size bytes with alignment suitable for all
+memory accesses (including vectors if available on the CPU) and
+zero all the bytes of the block.
+The allocation will fail if nmemb * size is greater than or equal
+to INT_MAX.
+@param nmemb
+@param size
+@return Pointer to the allocated block, NULL if it cannot be allocated.
+
+
+
+Allocate a block of size bytes with alignment suitable for all
+memory accesses (including vectors if available on the CPU) and
+zero all the bytes of the block.
+@param size Size in bytes for the memory block to be allocated.
+@return Pointer to the allocated block, NULL if it cannot be allocated.
+@see av_malloc()
+
+
+
+Free a memory block which has been allocated with av_malloc(z)() or
+av_realloc().
+@param ptr Pointer to the memory block which should be freed.
+@note ptr = NULL is explicitly allowed.
+@note It is recommended that you use av_freep() instead.
+@see av_freep()
+
+
+
+Allocate or reallocate a block of memory.
+This function does the same thing as av_realloc, except:
+- It takes two arguments and checks the result of the multiplication for
+ integer overflow.
+- It frees the input block in case of failure, thus avoiding the memory
+ leak with the classic "buf = realloc(buf); if (!buf) return -1;".
+
+
+
+Allocate or reallocate a block of memory.
+If ptr is NULL and size > 0, allocate a new block. If
+size is zero, free the memory block pointed to by ptr.
+@param ptr Pointer to a memory block already allocated with
+av_malloc(z)() or av_realloc() or NULL.
+@param size Size in bytes for the memory block to be allocated or
+reallocated.
+@return Pointer to a newly reallocated block or NULL if the block
+cannot be reallocated or the function is used to free the memory block.
+@see av_fast_realloc()
+
+
+
+@}
+
+@addtogroup lavu_mem
+@{
+
+Allocate a block of size bytes with alignment suitable for all
+memory accesses (including vectors if available on the CPU).
+@param size Size in bytes for the memory block to be allocated.
+@return Pointer to the allocated block, NULL if the block cannot
+be allocated.
+@see av_mallocz()
+
+
+
+ Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
+
+ @param val Output value, must be an lvalue of type uint32_t.
+ @param GET_BYTE Expression reading one byte from the input.
+ Evaluated up to 7 times (4 for the currently
+ assigned Unicode range). With a memory buffer
+ input, this could be *ptr++.
+ @param ERROR Expression to be evaluated on invalid input,
+ typically a goto statement.
+
+ Convert a UTF-16 character (2 or 4 bytes) to its 32-bit UCS-4 encoded form.
+
+ @param val Output value, must be an lvalue of type uint32_t.
+ @param GET_16BIT Expression returning two bytes of UTF-16 data converted
+ to native byte order. Evaluated one or two times.
+ @param ERROR Expression to be evaluated on invalid input,
+ typically a goto statement.
+
+@def PUT_UTF8(val, tmp, PUT_BYTE)
+Convert a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long).
+@param val is an input-only argument and should be of type uint32_t. It holds
+a UCS-4 encoded Unicode character that is to be converted to UTF-8. If
+val is given as a function it is executed only once.
+@param tmp is a temporary variable and should be of type uint8_t. It
+represents an intermediate value during conversion that is to be
+output by PUT_BYTE.
+@param PUT_BYTE writes the converted UTF-8 bytes to any proper destination.
+It could be a function or a statement, and uses tmp as the input byte.
+For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be
+executed up to 4 times for values in the valid UTF-8 range and up to
+7 times in the general case, depending on the length of the converted
+Unicode character.
+
+@def PUT_UTF16(val, tmp, PUT_16BIT)
+Convert a 32-bit Unicode character to its UTF-16 encoded form (2 or 4 bytes).
+@param val is an input-only argument and should be of type uint32_t. It holds
+a UCS-4 encoded Unicode character that is to be converted to UTF-16. If
+val is given as a function it is executed only once.
+@param tmp is a temporary variable and should be of type uint16_t. It
+represents an intermediate value during conversion that is to be
+output by PUT_16BIT.
+@param PUT_16BIT writes the converted UTF-16 data to any proper destination
+in desired endianness. It could be a function or a statement, and uses tmp
+as the input byte. For example, PUT_BYTE could be "*output++ = tmp;"
+PUT_BYTE will be executed 1 or 2 times depending on input character.
+
+@file
+memory handling functions
+
+@file
+Macro definitions for various function/variable attributes
+
+@file
+error code definitions
+
+ @addtogroup lavu_error
+
+ @{
+
+This is semantically identical to AVERROR_BUG
+it has been introduced in Libav after our AVERROR_BUG and with a modified value.
+
+ Put a description of the AVERROR code errnum in errbuf.
+ In case of failure the global variable errno is set to indicate the
+ error. Even in case of failure av_strerror() will print a generic
+ error message indicating the errnum provided to errbuf.
+
+ @param errnum error code to describe
+ @param errbuf buffer to which description is written
+ @param errbuf_size the size in bytes of errbuf
+ @return 0 on success, a negative value if a description for errnum
+ cannot be found
+
+
+
+Count number of bits set to one in x
+@param x value to count bits of
+@return the number of bits set to one in x
+
+
+
+Count number of bits set to one in x
+@param x value to count bits of
+@return the number of bits set to one in x
+
+
+
+Compute ceil(log2(x)).
+ * @param x value used to compute ceil(log2(x))
+ * @return computed ceiling of log2(x)
+
+
+
+Clip a float value into the amin-amax range.
+@param a value to clip
+@param amin minimum value of the clip range
+@param amax maximum value of the clip range
+@return clipped value
+
+
+
+Clip a signed integer to an unsigned power of two range.
+@param a value to clip
+@param p bit position to clip at
+@return clipped value
+
+
+
+Clip a signed 64-bit integer value into the -2147483648,2147483647 range.
+@param a value to clip
+@return clipped value
+
+
+
+Clip a signed integer value into the -32768,32767 range.
+@param a value to clip
+@return clipped value
+
+
+
+Clip a signed integer value into the 0-65535 range.
+@param a value to clip
+@return clipped value
+
+
+
+Clip a signed integer value into the -128,127 range.
+@param a value to clip
+@return clipped value
+
+
+
+Clip a signed integer value into the 0-255 range.
+@param a value to clip
+@return clipped value
+
+
+
+@file
+common internal and external API header
+
+Clip a signed integer value into the amin-amax range.
+@param a value to clip
+@param amin minimum value of the clip range
+@param amax maximum value of the clip range
+@return clipped value
+
+
+
+@file
+Macro definitions for various function/variable attributes
+
+Disable warnings about deprecated features
+This is useful for sections of code kept for backward compatibility and
+scheduled for removal.
+
+Mark a variable as used and prevent the compiler from optimizing it
+away. This is useful for variables accessed only from inline
+assembler without the compiler being aware.
+
+
+
+@}
+
+@file
+common internal and external API header
+
+
+
+ Return a single letter to describe the given picture type
+ pict_type.
+
+ @param[in] pict_type the picture type @return a single character
+ representing the picture type, '?' if pict_type is unknown
+
+
+
+ @defgroup lavu_const Constants
+ @{
+
+ @defgroup lavu_enc Encoding specific
+
+ @note those definition should move to avcodec
+ @{
+
+ @}
+ @defgroup lavu_time Timestamp specific
+
+ FFmpeg internal timebase and timestamp definitions
+
+ @{
+
+ @brief Undefined timestamp value
+
+ Usually reported by demuxer that work on containers that do not provide
+ either pts or dts.
+
+Internal time base represented as integer
+
+Internal time base represented as fractional value
+
+ @}
+ @}
+ @defgroup lavu_picture Image related
+
+ AVPicture types, pixel formats and basic image planes manipulation.
+
+ @{
+
+
+Picture type of the frame, see ?_TYPE below.
+- encoding: Set by libavcodec. for coded_picture (and set by user for input).
+- decoding: Set by libavcodec.
+
+
+
+Return a string describing the media_type enum, NULL if media_type
+is unknown.
+
+
+
+@}
+
+@addtogroup lavu_media Media Type
+@brief Media Type
+
+
+ Type of codec implemented by the hardware accelerator.
+
+ See AVMEDIA_TYPE_xxx
+
+
+Get the type of the given codec.
+
+
+
+Return the libavutil license.
+
+
+
+Return the libavutil build-time configuration.
+
+
+
+@file
+external API header
+
+ @mainpage
+
+ @section libav_intro Introduction
+
+ This document describe the usage of the different libraries
+ provided by FFmpeg.
+
+ @li @ref libavc "libavcodec" encoding/decoding library
+ @li @subpage libavfilter graph based frame editing library
+ @li @ref libavf "libavformat" I/O and muxing/demuxing library
+ @li @ref lavd "libavdevice" special devices muxing/demuxing library
+ @li @ref lavu "libavutil" common utility library
+ @li @subpage libpostproc post processing library
+ @li @subpage libswscale color conversion and scaling library
+
+
+ @defgroup lavu Common utility functions
+
+ @brief
+ libavutil contains the code shared across all the other FFmpeg
+ libraries
+
+ @note In order to use the functions provided by avutil you must include
+ the specific header.
+
+ @{
+
+ @defgroup lavu_crypto Crypto and Hashing
+
+ @{
+ @}
+
+ @defgroup lavu_math Maths
+ @{
+
+ @}
+
+ @defgroup lavu_string String Manipulation
+
+ @{
+
+ @}
+
+ @defgroup lavu_mem Memory Management
+
+ @{
+
+ @}
+
+ @defgroup lavu_data Data Structures
+ @{
+
+ @}
+
+ @defgroup lavu_audio Audio related
+
+ @{
+
+ @}
+
+ @defgroup lavu_error Error Codes
+
+ @{
+
+ @}
+
+ @defgroup lavu_misc Other
+
+ @{
+
+ @defgroup lavu_internal Internal
+
+ Not exported functions, for internal usage only
+
+ @{
+
+ @}
+
+ @defgroup preproc_misc Preprocessor String Macros
+
+ String manipulation macros
+
+ @{
+
+@}
+
+ @defgroup version_utils Library Version Macros
+
+ Useful to check and match library version in order to maintain
+ backward compatibility.
+
+ @{
+
+ @}
+
+ @defgroup lavu_ver Version and Build diagnostics
+
+ Macros and function useful to check at compiletime and at runtime
+ which version of libavutil is in use.
+
+ @{
+
+ @}
+
+ @defgroup depr_guards Deprecation guards
+ Those FF_API_* defines are not part of public API.
+ They may change, break or disappear at any time.
+
+ They are used mostly internally to mark code that will be removed
+ on the next major version.
+
+ @{
+
+@}
+
+@addtogroup lavu_ver
+@{
+
+Return the LIBAVUTIL_VERSION_INT constant.
+
+
+
+
+Enumeration of some video codecs from FFmpeg library, which are available for writing video files.
+
+
+
+
+Raw (uncompressed) video.
+
+
+
+
+MPEG-2 part 2.
+
+
+
+
+Flash Video (FLV) / Sorenson Spark / Sorenson H.263.
+
+
+
+
+H.263+ / H.263-1998 / H.263 version 2.
+
+
+
+
+MPEG-4 part 2 Microsoft variant version 3.
+
+
+
+
+MPEG-4 part 2 Microsoft variant version 2.
+
+
+
+
+Windows Media Video 8.
+
+
+
+
+Windows Media Video 7.
+
+
+
+
+MPEG-4 part 2.
+
+
+
+
+Default video codec, which FFmpeg library selects for the specified file format.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Part 1 - Record Video/bin/Debug/AForge.Video.Kinect.dll b/Part 1 - Record Video/bin/Debug/AForge.Video.Kinect.dll
new file mode 100644
index 0000000..350e553
Binary files /dev/null and b/Part 1 - Record Video/bin/Debug/AForge.Video.Kinect.dll differ
diff --git a/Part 1 - Record Video/bin/Debug/AForge.Video.Kinect.xml b/Part 1 - Record Video/bin/Debug/AForge.Video.Kinect.xml
new file mode 100644
index 0000000..a7b31d6
--- /dev/null
+++ b/Part 1 - Record Video/bin/Debug/AForge.Video.Kinect.xml
@@ -0,0 +1,604 @@
+
+
+
+ AForge.Video.Kinect
+
+
+
+
+ Kinect's LED color options.
+
+
+
+
+ The LED is off.
+
+
+
+
+ The LED is on and has green color.
+
+
+
+
+ The LED is on and has red color.
+
+
+
+
+ The LED is on and has yellow color.
+
+
+
+
+ The LED is blinking with green color.
+
+
+
+
+ The LED is blinking from red to yellow color.
+
+
+
+
+ Kinect's resolutions of video and depth cameras.
+
+
+
+
+ Low resolution.
+
+
+
+
+ Medium resolution.
+
+
+
+
+ Hight resolution.
+
+
+
+
+ Video source for Microsoft Kinect's depth sensor.
+
+
+ The video source captures depth data from Microsoft Kinect
+ depth sensor, which is aimed originally as a gaming device for XBox 360 platform.
+
+ Prior to using the class, make sure you've installed Kinect's drivers
+ as described on Open Kinect
+ project's page.
+
+ In order to run correctly the class requires freenect.dll library
+ to be put into solution's output folder. This can be found within the AForge.NET framework's
+ distribution in Externals folder.
+
+ Sample usage:
+
+ // create video source
+ KinectDepthCamera videoSource = new KinectDepthCamera( 0 );
+ // set NewFrame event handler
+ videoSource.NewFrame += new NewFrameEventHandler( video_NewFrame );
+ // start the video source
+ videoSource.Start( );
+ // ...
+
+ private void video_NewFrame( object sender, NewFrameEventArgs eventArgs )
+ {
+ // get new frame
+ Bitmap bitmap = eventArgs.Frame;
+ // process the frame
+ }
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Kinect's device ID (index) to connect to.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Kinect's device ID (index) to connect to.
+ Resolution of depth sensor to set.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Kinect's device ID (index) to connect to.
+ Resolution of depth sensor to set.
+ Provide original depth image or colored depth map
+ (see property).
+
+
+
+
+ Start video source.
+
+
+ Starts video source and returns execution to caller. Video camera will be started
+ and will provide new video frames through the event.
+
+ The specified resolution is not supported for the selected
+ mode of the Kinect depth sensor.
+ Could not connect to Kinect's depth sensor.
+ Another connection to the specified depth sensor is already running.
+
+
+
+
+ Signal video source to stop its work.
+
+
+ Calling this method is equivalent to calling
+ for Kinect video camera.
+
+
+
+
+ Wait for video source has stopped.
+
+
+ Calling this method is equivalent to calling
+ for Kinect video camera.
+
+
+
+
+ Stop video source.
+
+
+ The method stop the video source, so it no longer provides new video frames
+ and does not consume any resources.
+
+
+
+
+
+ New frame event.
+
+
+ Notifies clients about new available frames from the video source.
+
+ Since video source may have multiple clients, each client is responsible for
+ making a copy (cloning) of the passed video frame, because the video source disposes its
+ own original copy after notifying of clients.
+
+
+
+
+
+ Video source error event.
+
+
+ This event is used to notify clients about any type of errors occurred in
+ video source object, for example internal exceptions.
+
+
+
+
+ Video playing finished event.
+
+
+ This event is used to notify clients that the video playing has finished.
+
+
+
+
+
+ Provide original depth image or colored depth map.
+
+
+ The property specifies if the video source should provide original data
+ provided by Kinect's depth sensor or provide colored depth map. If the property is set to
+ , then the video source will provide 16 bpp grayscale images, where
+ 11 least significant bits represent data provided by the sensor. If the property is
+ set to , then the video source will provide 24 bpp color images,
+ which represents depth map. In this case depth is encoded by color gradient:
+ white->red->yellow->green->cyan->blue->black. So colors which are closer to white represent
+ objects which are closer to the Kinect sensor, but colors which are closer to black represent
+ objects which are further away from Kinect.
+
+ The property must be set before running the video source to take effect.
+
+ Default value is set to .
+
+
+
+
+
+ Resolution of depth sensor to set.
+
+
+ The property must be set before running the video source to take effect.
+
+ Default value of the property is set to .
+
+
+
+
+
+ A string identifying the video source.
+
+
+
+
+
+ State of the video source.
+
+
+ Current state of video source object - running or not.
+
+
+
+
+ Received bytes count.
+
+
+ Number of bytes the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ Received frames count.
+
+
+ Number of frames the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ The class provides access to Microsoft's Xbox Kinect
+ controller.
+
+
+ The class allows to manipulate Kinec device by changing its LED color, setting motor's
+ tilt value and accessing its camera. See and
+ classes, which provide access to actual video.
+
+
+
+ In order to run correctly the class requires freenect.dll library
+ to be put into solution's output folder. This can be found within the AForge.NET framework's
+ distribution in Externals folder.
+
+ Sample usage:
+
+ // get Kinect device
+ Kinect kinectDevice = Kinect.GetDevice( 0 );
+ // change LED color
+ kinectDevice.LedColor = LedColorOption.Yellow;
+ // set motor tilt angle to -10 degrees
+ kinectDevice.SetMotorTilt( -10 );
+ // get video camera
+ KinectVideoCamera videoCamera = kinectDevice.GetVideoCamera( );
+
+ // see example for video camera also
+
+
+
+
+
+
+ Get initialized instance of the Kinect device.
+
+
+ ID of the Kinect device to get instance of, [0, ),
+
+ Returns initialized Kinect device. Use method
+ when the device is no longer required.
+
+ There is no Kinect device with specified ID connected to the system.
+ Failed connecting to the Kinect device specified ID.
+
+
+
+
+ Object finalizer/destructor makes sure unmanaged resource are freed if user did not call .
+
+
+
+
+ Dispose device freeing all associated unmanaged resources.
+
+
+
+
+ Set color of Kinect's LED.
+
+
+ LED color to set.
+
+ Some error occurred with the device. Check error message.
+
+
+
+
+ Set motor's tilt value.
+
+
+ Tilt value to set, [-31, 30] degrees.
+
+ Motor tilt has to be in the [-31, 31] range.
+ Some error occurred with the device. Check error message.
+
+
+
+
+ Get accelerometer values for 3 axes.
+
+
+ X axis value on the accelerometer.
+ Y axis value on the accelerometer.
+ Z axis value on the accelerometer.
+
+ Units of all 3 values are m/s2. The g value used
+ for calculations is taken as 9.80665 m/s2.
+
+
+
+
+ Get Kinect's video camera.
+
+
+ Returns Kinect's video camera.
+
+ The method simply creates instance of the class
+ by calling its appropriate constructor. Use method
+ to start the video then.
+
+
+
+
+ Get Kinect's depth camera.
+
+
+ Returns Kinect's depth camera.
+
+ The method simply creates instance of the class
+ by calling its appropriate constructor. Use method
+ to start the video then.
+
+
+
+
+ ID of the opened Kinect device.
+
+
+
+
+
+ Number of Kinect devices available in the system.
+
+
+
+
+ Enumeration of video camera modes for the .
+
+
+
+
+ 24 bit per pixel RGB mode.
+
+
+
+
+ 8 bit per pixel Bayer mode.
+
+
+
+
+ 8 bit per pixel Infra Red mode.
+
+
+
+
+ Video source for Microsoft Kinect's video camera.
+
+
+ The video source captures video data from Microsoft Kinect
+ video camera, which is aimed originally as a gaming device for XBox 360 platform.
+
+ Prior to using the class, make sure you've installed Kinect's drivers
+ as described on Open Kinect
+ project's page.
+
+ In order to run correctly the class requires freenect.dll library
+ to be put into solution's output folder. This can be found within the AForge.NET framework's
+ distribution in Externals folder.
+
+ Sample usage:
+
+ // create video source
+ KinectVideoCamera videoSource = new KinectVideoCamera( 0 );
+ // set NewFrame event handler
+ videoSource.NewFrame += new NewFrameEventHandler( video_NewFrame );
+ // start the video source
+ videoSource.Start( );
+ // ...
+
+ private void video_NewFrame( object sender, NewFrameEventArgs eventArgs )
+ {
+ // get new frame
+ Bitmap bitmap = eventArgs.Frame;
+ // process the frame
+ }
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Kinect's device ID (index) to connect to.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Kinect's device ID (index) to connect to.
+ Resolution of video camera to set.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Kinect's device ID (index) to connect to.
+ Resolution of video camera to set.
+ Sets video camera mode.
+
+
+
+
+ Start video source.
+
+
+ Starts video source and returns execution to caller. Video camera will be started
+ and will provide new video frames through the event.
+
+ The specified resolution is not supported for the selected
+ mode of the Kinect video camera.
+ Could not connect to Kinect's video camera.
+ Another connection to the specified video camera is already running.
+
+
+
+
+ Signal video source to stop its work.
+
+
+ Calling this method is equivalent to calling
+ for Kinect video camera.
+
+
+
+
+ Wait for video source has stopped.
+
+
+ Calling this method is equivalent to calling
+ for Kinect video camera.
+
+
+
+
+ Stop video source.
+
+
+ The method stops the video source, so it no longer provides new video frames
+ and does not consume any resources.
+
+
+
+
+
+ New frame event.
+
+
+ Notifies clients about new available frames from the video source.
+
+ Since video source may have multiple clients, each client is responsible for
+ making a copy (cloning) of the passed video frame, because the video source disposes its
+ own original copy after notifying of clients.
+
+
+
+
+
+ Video source error event.
+
+
+ This event is used to notify clients about any type of errors occurred in
+ video source object, for example internal exceptions.
+
+
+
+
+ Video playing finished event.
+
+
+ This event is used to notify clients that the video playing has finished.
+
+
+
+
+
+ Specifies video mode for the camera.
+
+
+
+ The property must be set before running the video source to take effect.
+
+ Default value of the property is set to .
+
+
+
+
+
+ Resolution of video camera to set.
+
+
+ The property must be set before running the video source to take effect.
+
+ Default value of the property is set to .
+
+
+
+
+
+ A string identifying the video source.
+
+
+
+
+
+ State of the video source.
+
+
+ Current state of video source object - running or not.
+
+
+
+
+ Received bytes count.
+
+
+ Number of bytes the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ Received frames count.
+
+
+ Number of frames the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
diff --git a/Part 1 - Record Video/bin/Debug/AForge.Video.VFW.dll b/Part 1 - Record Video/bin/Debug/AForge.Video.VFW.dll
new file mode 100644
index 0000000..fa8884a
Binary files /dev/null and b/Part 1 - Record Video/bin/Debug/AForge.Video.VFW.dll differ
diff --git a/Part 1 - Record Video/bin/Debug/AForge.Video.VFW.xml b/Part 1 - Record Video/bin/Debug/AForge.Video.VFW.xml
new file mode 100644
index 0000000..b1364fb
--- /dev/null
+++ b/Part 1 - Record Video/bin/Debug/AForge.Video.VFW.xml
@@ -0,0 +1,1098 @@
+
+
+
+ AForge.Video.VFW
+
+
+
+
+ AVI files writing using Video for Windows interface.
+
+
+ The class allows to write AVI files using Video for Windows API.
+
+ Sample usage:
+
+ // instantiate AVI writer, use WMV3 codec
+ AVIWriter writer = new AVIWriter( "wmv3" );
+ // create new AVI file and open it
+ writer.Open( "test.avi", 320, 240 );
+ // create frame image
+ Bitmap image = new Bitmap( 320, 240 );
+
+ for ( int i = 0; i < 240; i++ )
+ {
+ // update image
+ image.SetPixel( i, i, Color.Red );
+ // add the image as a new frame of video file
+ writer.AddFrame( image );
+ }
+ writer.Close( );
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Initializes Video for Windows library.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Codec to use for compression.
+
+ Initializes Video for Windows library.
+
+
+
+
+ Destroys the instance of the class.
+
+
+
+
+
+ Dispose the object.
+
+
+ Frees unmanaged resources used by the object. The object becomes unusable
+ after that.
+
+
+
+
+ Dispose the object.
+
+
+ Indicates if disposing was initiated manually.
+
+
+
+
+ Create new AVI file and open it for writing.
+
+
+ AVI file name to create.
+ Video width.
+ Video height.
+
+ The method opens (creates) a video files, configure video codec and prepares
+ the stream for saving video frames with a help of method.
+
+ Failed opening the specified file.
+ A error occurred while creating new video file. See exception message.
+ Insufficient memory for internal buffer.
+ Video file resolution must be a multiple of two.
+
+
+
+
+ Close video file.
+
+
+
+
+
+ Add new frame to the AVI file.
+
+
+ New frame image.
+
+ The method adds new video frame to an opened video file. The width and heights
+ of the frame should be the same as it was specified in method
+ (see and properties).
+
+ Thrown if no video file was open.
+ Bitmap size must be of the same as video size, which was specified on opening video file.
+ A error occurred while writing new video frame. See exception message.
+
+
+
+
+ Width of video frames.
+
+
+ The property specifies the width of video frames, which are acceptable
+ by method for saving, which is set in
+ method.
+
+
+
+
+ Height of video frames.
+
+
+ The property specifies the height of video frames, which are acceptable
+ by method for saving, which is set in
+ method.
+
+
+
+
+ Current position in video stream.
+
+
+ The property tell current position in video stream, which actually equals
+ to the amount of frames added using method.
+
+
+
+
+ Desired playing frame rate.
+
+
+ The property sets the video frame rate, which should be use during playing
+ of the video to be saved.
+
+ The property should be set befor opening new file to take effect.
+
+ Default frame rate is set to 25.
+
+
+
+
+ Codec used for video compression.
+
+
+ The property sets the FOURCC code of video compression codec, which needs to
+ be used for video encoding.
+
+ The property should be set befor opening new file to take effect.
+
+ Default video codec is set "DIB ", which means no compression.
+
+
+
+
+ Compression video quality.
+
+
+ The property sets video quality used by codec in order to balance compression rate
+ and image quality. The quality is measured usually in the [0, 100] range.
+
+ The property should be set befor opening new file to take effect.
+
+ Default value is set to -1 - default compression quality of the codec.
+
+
+
+
+ AVI files reading using Video for Windows.
+
+
+ The class allows to read AVI files using Video for Windows API.
+
+ Sample usage:
+
+ // instantiate AVI reader
+ AVIReader reader = new AVIReader( );
+ // open video file
+ reader.Open( "test.avi" );
+ // read the video file
+ while ( reader.Position - reader.Start < reader.Length )
+ {
+ // get next frame
+ Bitmap image = reader.GetNextFrame( );
+ // .. process the frame somehow or display it
+ }
+ reader.Close( );
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Initializes Video for Windows library.
+
+
+
+
+ Destroys the instance of the class.
+
+
+
+
+
+ Dispose the object.
+
+
+ Frees unmanaged resources used by the object. The object becomes unusable
+ after that.
+
+
+
+
+ Dispose the object.
+
+
+ Indicates if disposing was initiated manually.
+
+
+
+
+ Open AVI file.
+
+
+ AVI file name to open.
+
+ The method opens a video file and prepares the stream and decoder for
+ reading video frames with the help of method.
+
+
+ Failed opening the specified file.
+ A error occurred while opening the video file. See exception message.
+
+
+
+
+
+ Close video file.
+
+
+
+
+
+ Get next frame of opened video stream.
+
+
+ Returns next frame as a bitmap.
+
+ The method reads and returns the next video frame in the opened video stream
+ at the position, which is set in property.
+
+ Thrown if no video file was open.
+ A error occurred while reading next video frame. See exception message.
+
+
+
+
+ Width of video frames.
+
+
+ The property specifies the width of video frames within the opened video
+ file.
+
+
+
+
+ Height of video frames.
+
+
+ The property specifies the height of video frames within the opened video
+ file.
+
+
+
+
+ Current position in video stream.
+
+
+ Setting position outside of video range, will lead to reseting position to the start.
+
+
+
+
+ Starting position of video stream.
+
+
+
+
+
+ Video stream length.
+
+
+
+
+
+ Desired playing frame rate.
+
+
+ The property specifies the frame rate, which should be used to play the opened video
+ file.
+
+
+
+
+ Codec used for video compression.
+
+
+ The property tells about which codec was used to encode the opened video file.
+
+
+
+
+ AVI file video source.
+
+
+ The video source reads AVI files using Video for Windows.
+
+ Sample usage:
+
+ // create AVI file video source
+ AVIFileVideoSource source = new AVIFileVideoSource( "some file" );
+ // set event handlers
+ source.NewFrame += new NewFrameEventHandler( video_NewFrame );
+ // start the video source
+ source.Start( );
+ // ...
+ // signal to stop
+ source.SignalToStop( );
+
+ // New frame event handler, which is invoked on each new available video frame
+ private void video_NewFrame( object sender, NewFrameEventArgs eventArgs )
+ {
+ // get new frame
+ Bitmap bitmap = eventArgs.Frame;
+ // process the frame
+ }
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Video file name.
+
+
+
+
+ Start video source.
+
+
+ Starts video source and return execution to caller. Video source
+ object creates background thread and notifies about new frames with the
+ help of event.
+
+ Video source is not specified.
+
+
+
+
+ Signal video source to stop its work.
+
+
+ Signals video source to stop its background thread, stop to
+ provide new frames and free resources.
+
+
+
+
+ Wait for video source has stopped.
+
+
+ Waits for source stopping after it was signalled to stop using
+ method.
+
+
+
+
+ Stop video source.
+
+
+ Stops video source aborting its thread.
+
+ Since the method aborts background thread, its usage is highly not preferred
+ and should be done only if there are no other options. The correct way of stopping camera
+ is signaling it stop and then
+ waiting for background thread's completion.
+
+
+
+
+
+ Free resource.
+
+
+
+
+
+ Worker thread.
+
+
+
+
+
+ New frame event.
+
+
+ Notifies clients about new available frame from video source.
+
+ Since video source may have multiple clients, each client is responsible for
+ making a copy (cloning) of the passed video frame, because the video source disposes its
+ own original copy after notifying of clients.
+
+
+
+
+
+ Video source error event.
+
+
+ This event is used to notify clients about any type of errors occurred in
+ video source object, for example internal exceptions.
+
+
+
+
+ Video playing finished event.
+
+
+ This event is used to notify clients that the video playing has finished.
+
+
+
+
+
+ Frame interval.
+
+
+ The property sets the interval in milliseconds between frames. If the property is
+ set to 100, then the desired frame rate will be 10 frames per second.
+
+ Setting this property to 0 leads to no delay between video frames - frames
+ are read as fast as possible.
+
+ Default value is set to 0.
+
+
+
+
+
+ Get frame interval from source or use manually specified.
+
+
+ The property specifies which frame rate to use for video playing.
+ If the property is set to , then video is played
+ with original frame rate, which is set in source AVI file. If the property is
+ set to , then custom frame rate is used, which is
+ calculated based on the manually specified frame interval.
+
+ Default value is set to .
+
+
+
+
+
+ Video source.
+
+
+ Video file name to play.
+
+
+
+
+ Received frames count.
+
+
+ Number of frames the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ Received bytes count.
+
+
+ Number of bytes the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ State of the video source.
+
+
+ Current state of video source object - running or not.
+
+
+
+
+ Windows API functions and structures.
+
+
+ The class provides Video for Windows and some other Win32 functions and structurs.
+
+
+
+
+ Copy a block of memory.
+
+
+ Destination pointer.
+ Source pointer.
+ Memory block's length to copy.
+
+ Return's the value of dst - pointer to destination.
+
+
+
+
+ Initialize the AVIFile library.
+
+
+
+
+
+ Exit the AVIFile library.
+
+
+
+
+ Open an AVI file.
+
+
+ Opened AVI file interface.
+ AVI file name.
+ Opening mode (see ).
+ Handler to use (null to use default).
+
+ Returns zero on success or error code otherwise.
+
+
+
+
+ Release an open AVI stream.
+
+
+ Open AVI file interface.
+
+ Returns the reference count of the file.
+
+
+
+
+ Get stream interface that is associated with a specified AVI file
+
+
+ Handler to an open AVI file.
+ Stream interface.
+ Stream type to open.
+ Count of the stream type. Identifies which occurrence of the specified stream type to access.
+
+
+
+
+
+
+ Create a new stream in an existing file and creates an interface to the new stream.
+
+
+ Handler to an open AVI file.
+ Stream interface.
+ Pointer to a structure containing information about the new stream.
+
+ Returns zero if successful or an error otherwise.
+
+
+
+
+ Release an open AVI stream.
+
+
+ Handle to an open stream.
+
+ Returns the current reference count of the stream.
+
+
+
+
+ Set the format of a stream at the specified position.
+
+
+ Handle to an open stream.
+ Position in the stream to receive the format.
+ Pointer to a structure containing the new format.
+ Size, in bytes, of the block of memory referenced by format.
+
+ Returns zero if successful or an error otherwise.
+
+
+
+
+ Get the starting sample number for the stream.
+
+
+ Handle to an open stream.
+
+ Returns the number if successful or – 1 otherwise.
+
+
+
+
+ Get the length of the stream.
+
+
+ Handle to an open stream.
+
+ Returns the stream's length, in samples, if successful or -1 otherwise.
+
+
+
+
+ Obtain stream header information.
+
+
+ Handle to an open stream.
+ Pointer to a structure to contain the stream information.
+ Size, in bytes, of the structure used for streamInfo.
+
+ Returns zero if successful or an error otherwise.
+
+
+
+
+ Prepare to decompress video frames from the specified video stream
+
+
+ Pointer to the video stream used as the video source.
+ Pointer to a structure that defines the desired video format. Specify NULL to use a default format.
+
+ Returns an object that can be used with the function.
+
+
+
+
+ Prepare to decompress video frames from the specified video stream.
+
+
+ Pointer to the video stream used as the video source.
+ Pointer to a structure that defines the desired video format. Specify NULL to use a default format.
+
+ Returns a GetFrame object that can be used with the function.
+
+
+
+
+ Releases resources used to decompress video frames.
+
+
+ Handle returned from the function.
+
+ Returns zero if successful or an error otherwise.
+
+
+
+
+ Return the address of a decompressed video frame.
+
+
+ Pointer to a GetFrame object.
+ Position, in samples, within the stream of the desired frame.
+
+ Returns a pointer to the frame data if successful or NULL otherwise.
+
+
+
+
+ Write data to a stream.
+
+
+ Handle to an open stream.
+ First sample to write.
+ Number of samples to write.
+ Pointer to a buffer containing the data to write.
+ Size of the buffer referenced by buffer.
+ Flag associated with this data.
+ Pointer to a buffer that receives the number of samples written. This can be set to NULL.
+ Pointer to a buffer that receives the number of bytes written. This can be set to NULL.
+
+ Returns zero if successful or an error otherwise.
+
+
+
+
+ Retrieve the save options for a file and returns them in a buffer.
+
+
+ Handle to the parent window for the Compression Options dialog box.
+ Flags for displaying the Compression Options dialog box.
+ Number of streams that have their options set by the dialog box.
+ Pointer to an array of stream interface pointers.
+ Pointer to an array of pointers to AVICOMPRESSOPTIONS structures.
+
+ Returns TRUE if the user pressed OK, FALSE for CANCEL, or an error otherwise.
+
+
+
+
+ Free the resources allocated by the AVISaveOptions function.
+
+
+ Count of the AVICOMPRESSOPTIONS structures referenced in options.
+ Pointer to an array of pointers to AVICOMPRESSOPTIONS structures.
+
+ Returns 0.
+
+
+
+
+ Create a compressed stream from an uncompressed stream and a
+ compression filter, and returns the address of a pointer to
+ the compressed stream.
+
+
+ Pointer to a buffer that receives the compressed stream pointer.
+ Pointer to the stream to be compressed.
+ Pointer to a structure that identifies the type of compression to use and the options to apply.
+ Pointer to a class identifier used to create the stream.
+
+ Returns 0 if successful or an error otherwise.
+
+
+
+
+ .NET replacement of mmioFOURCC macros. Converts four characters to code.
+
+
+ Four characters string.
+
+ Returns the code created from provided characters.
+
+
+
+
+ Inverse to . Converts code to fout characters string.
+
+
+ Code to convert.
+
+ Returns four characters string.
+
+
+
+
+ Version of for one stream only.
+
+
+ Stream to configure.
+ Stream options.
+
+ Returns TRUE if the user pressed OK, FALSE for CANCEL, or an error otherwise.
+
+
+
+
+ Structure to define the coordinates of the upper-left and
+ lower-right corners of a rectangle.
+
+
+
+
+
+ x-coordinate of the upper-left corner of the rectangle.
+
+
+
+
+
+ y-coordinate of the upper-left corner of the rectangle.
+
+
+
+
+
+ x-coordinate of the bottom-right corner of the rectangle.
+
+
+
+
+
+ y-coordinate of the bottom-right corner of the rectangle.
+
+
+
+
+
+ Structure, which contains information for a single stream .
+
+
+
+
+
+ Four-character code indicating the stream type.
+
+
+
+
+
+ Four-character code of the compressor handler that will compress this video stream when it is saved.
+
+
+
+
+
+ Applicable flags for the stream.
+
+
+
+
+
+ Capability flags; currently unused.
+
+
+
+
+
+ Priority of the stream.
+
+
+
+
+
+ Language of the stream.
+
+
+
+
+
+ Time scale applicable for the stream.
+
+
+ Dividing rate by scale gives the playback rate in number of samples per second.
+
+
+
+
+ Rate in an integer format.
+
+
+
+
+
+ Sample number of the first frame of the AVI file.
+
+
+
+
+
+ Length of this stream.
+
+
+ The units are defined by rate and scale.
+
+
+
+
+ Audio skew. This member specifies how much to skew the audio data ahead of the video frames in interleaved files.
+
+
+
+
+
+ Recommended buffer size, in bytes, for the stream.
+
+
+
+
+
+ Quality indicator of the video data in the stream.
+
+
+ Quality is represented as a number between 0 and 10,000.
+
+
+
+
+ Size, in bytes, of a single data sample.
+
+
+
+
+
+ Dimensions of the video destination rectangle.
+
+
+
+
+
+ Number of times the stream has been edited.
+
+
+
+
+
+ Number of times the stream format has changed.
+
+
+
+
+
+ Description of the stream.
+
+
+
+
+
+ Structure, which contains information about the dimensions and color format of a DIB.
+
+
+
+
+
+ Specifies the number of bytes required by the structure.
+
+
+
+
+
+ Specifies the width of the bitmap, in pixels.
+
+
+
+
+
+ Specifies the height of the bitmap, in pixels.
+
+
+ If height is positive, the bitmap is a bottom-up DIB and its origin is
+ the lower-left corner. If height is negative, the bitmap is a top-down DIB and its
+ origin is the upper-left corner.
+
+
+
+
+ Specifies the number of planes for the target device. This value must be set to 1.
+
+
+
+
+
+ Specifies the number of bits-per-pixel.
+
+
+
+
+
+ Specifies the type of compression for a compressed bottom-up bitmap (top-down DIBs cannot be compressed).
+
+
+
+
+
+ Specifies the size, in bytes, of the image.
+
+
+
+
+
+ Specifies the horizontal resolution, in pixels-per-meter, of the target device for the bitmap.
+
+
+
+
+
+ Specifies the vertical resolution, in pixels-per-meter, of the target device for the bitmap.
+
+
+
+
+
+ Specifies the number of color indexes in the color table that are actually used by the bitmap.
+
+
+
+
+
+ Specifies the number of color indexes that are required for displaying the bitmap.
+
+
+
+
+
+ Structure, which contains information about a stream and how it is compressed and saved.
+
+
+
+
+
+ Four-character code indicating the stream type.
+
+
+
+
+
+ Four-character code for the compressor handler that will compress this video stream when it is saved.
+
+
+
+
+
+ Maximum period between video key frames.
+
+
+
+
+
+ Quality value passed to a video compressor.
+
+
+
+
+
+ Video compressor data rate.
+
+
+
+
+
+ Flags used for compression.
+
+
+
+
+
+ Pointer to a structure defining the data format.
+
+
+
+
+
+ Size, in bytes, of the data referenced by format.
+
+
+
+
+
+ Video-compressor-specific data; used internally.
+
+
+
+
+
+ Size, in bytes, of the data referenced by parameters.
+
+
+
+
+ Interleave factor for interspersing stream data with data from the first stream.
+
+
+
+
+
+ File access modes.
+
+
+
+
+
diff --git a/Part 1 - Record Video/bin/Debug/AForge.Video.Ximea.dll b/Part 1 - Record Video/bin/Debug/AForge.Video.Ximea.dll
new file mode 100644
index 0000000..0376a67
Binary files /dev/null and b/Part 1 - Record Video/bin/Debug/AForge.Video.Ximea.dll differ
diff --git a/Part 1 - Record Video/bin/Debug/AForge.Video.Ximea.xml b/Part 1 - Record Video/bin/Debug/AForge.Video.Ximea.xml
new file mode 100644
index 0000000..688d30f
--- /dev/null
+++ b/Part 1 - Record Video/bin/Debug/AForge.Video.Ximea.xml
@@ -0,0 +1,1122 @@
+
+
+
+ AForge.Video.Ximea
+
+
+
+
+ XIMEA camera's LED state options.
+
+
+
+
+ Blink if link is ok (led 1), heartbeat mode (led 2).
+
+
+
+
+ Blink led if trigger detected.
+
+
+
+
+ Blink led if external signal detected.
+
+
+
+
+ Blink led during data streaming.
+
+
+
+
+ Blink led during sensor integration time.
+
+
+
+
+ Blink if device busy/not busy.
+
+
+
+
+ Blink led if link is OK.
+
+
+
+
+ Turn off LED.
+
+
+
+
+ Turn on LED.
+
+
+
+
+ Enumeration of image formats supported by XIMEA cameras.
+
+
+
+
+ 8 bits per pixel.
+
+
+
+
+ 16 bits per pixel.
+
+
+
+
+ RGB data format.
+
+
+
+
+ RGBA data format.
+
+
+
+
+ XIMEA camera's GPI port modes.
+
+
+
+
+ Input is off.
+
+
+
+
+ Trigger input.
+
+
+
+
+ External signal input.
+
+
+
+
+ Set of available configuration options for XIMEA cameras.
+
+
+ The class defines list of parameters, which are available
+ to set/get using corresponding methods of and
+ classes.
+
+
+
+
+ Get camera model name. Type string.
+
+
+
+
+ Get device serial number in decimal format. Type string, integer, float
+
+
+
+
+ Returns device type (1394, USB2.0, CURRERA…..). Type string.
+
+
+
+
+ Set/Get exposure time in microseconds. Type integer.
+
+
+
+
+ Get longest possible exposure to be set on camera in microseconds. Type integer.
+
+
+
+
+ Get shortest possible exposure to be set on camera in microseconds. Type integer.
+
+
+
+
+ Set/Get camera gain in dB. Type float.
+
+
+
+
+ Get highest possible camera gain in dB. Type float.
+
+
+
+
+ Get lowest possible camera gain in dB. Type float.
+
+
+
+
+ Set/Get width of the image provided by the camera (in pixels). Type integer.
+
+
+
+
+ Get maximal image width provided by the camera (in pixels). Type integer.
+
+
+
+
+ Get minimum image width provided by the camera (in pixels). Type integer.
+
+
+
+
+ Set/Get height of the image provided by the camera (in pixels). Type integer.
+
+
+
+
+ Get maximal image height provided by the camera (in pixels). Type integer.
+
+
+
+
+ Get minimum image height provided by the camera (in pixels). Type integer.
+
+
+
+
+ Set/Get image resolution by binning or skipping. Type integer.
+
+
+
+
+ Get highest value for binning or skipping. Type integer.
+
+
+
+
+ Get lowest value for binning or skipping. Type integer.
+
+
+
+
+ Get frames per second. Type float.
+
+
+
+
+ Get highest possible framerate for current camera settings. Type float.
+
+
+
+
+ Get lowest framerate for current camera settings. Type float.
+
+
+
+
+ Set/Get horizontal offset from the origin to the area of interest (in pixels). Type integer.
+
+
+
+
+ Get maximum horizontal offset from the origin to the area of interest (in pixels). Type integer.
+
+
+
+
+ Get minimum horizontal offset from the origin to the area of interest (in pixels). Type integer.
+
+
+
+
+ Set/Get vertical offset from the origin to the area of interest (in pixels). Type integer.
+
+
+
+
+ Get maximum vertical offset from the origin to the area of interest (in pixels). Type integer.
+
+
+
+
+ Get minimal vertical offset from the origin to the area of interest (in pixels). Type integer.
+
+
+
+
+ Set/Get white balance blue coefficient. Type float.
+
+
+
+
+ Set/Get white balance red coefficient. Type float.
+
+
+
+
+ Set/Get white balance green coefficient. Type float.
+
+
+
+
+ Set/Get sharpness strenght. Type float.
+
+
+
+
+ Set/Get luminosity gamma value. Type float. By default 1.0.
+
+
+
+
+ Set/Get chromaticity gamma value. Type float. By default 0.
+
+
+
+
+ Set default color correction matrx.
+
+
+
+
+ Set/Get image format provided by the camera. Type integer. Use
+ enumeraton for possible values.
+
+
+
+
+ Set/Get camera's trigger mode. Type integer. Use
+ enumeration for possible values.
+
+
+
+
+ Generates an internal trigger. must be set to .
+ Type integer.
+
+
+
+
+ Calculates white balance. Takes white balance from image center (should be white/grey object
+ in the center of scene). Type integer.
+
+
+
+
+ Enable/disable automatic white balance. Type integer. By default 0.
+
+
+ Set 0 to disable automatic white balance or 1 to enable.
+
+
+
+
+ Enable/disable bad pixels correction. Type integer. By default 0.
+
+
+ Set 0 to disable bad pixels correction or 1 to enable.
+
+
+
+
+ Set/Get acquisition buffer size in bytes. Type integer. By default 53248000.
+
+
+ Defines acquisition buffer size in bytes. This buffer contains images'
+ data from sensor. This parameter can be set only when acquisition is stopped.
+
+ See for additional information.
+
+
+
+
+
+ Set/Get maximum number of images to store in queue. Type integer. By default 4.
+
+
+
+
+
+ See also for additional information.
+
+
+
+
+
+ Set of configuration options to configure Automatic Exposure/Gain (AEAG) parameters.
+
+
+
+
+ Enable/disable automatic exposure/gain control. Type integer. By default 0.
+
+
+ Set 0 to disable automatic exposure/gain control or 1 to enable.
+
+
+
+
+ Set/Get maximum limit of exposure in AEAG procedure. Type integer. By default 100. Units - ms.
+
+
+
+
+ Set/Get maximum limit of gain in AEAG procedure. Type float. Default depends on camera type. Units - dB.
+
+
+
+
+ Set/Get exposure priority, [0, 1]. Type float. By default 0.8.
+
+
+ Setting the value to 0.5, for example, set exposure priority to 50%
+ and gain priority to 50%.
+
+
+
+
+ Set/Get average intensity of output signal AEAG should achieve (in %). Type float. By default 40.
+
+
+
+
+ Set of configuration options to configure camera's LEDs. Currently supported only for Currera-R cameras.
+
+
+
+
+ Selects camera LED to be used. Type integer.
+
+
+
+
+ Get highest LED number on camera. Type integer.
+
+
+
+
+ Get lowest LED number on camera. Type integer.
+
+
+
+
+ Set/Get LED functionality. Select LED by using parameter.
+ Use enumeration for possible parameter values. Type integer.
+
+
+
+
+ Set of configuration options to configure GPO (General Purpose Output) ports.
+
+
+
+
+ Select camera GPO port. Type integer.
+
+
+
+
+ Get highest GPO port number on camera. Type integer.
+
+
+
+
+ Get lowest GPO port number on camera. Type integer
+
+
+
+
+ Set/Get GPO port functionality. Select port by using parameter.
+ Use enumeration to set mode. Type integer.
+
+
+
+
+ Set of configuration options to access/configure GPI (General Purpose Input) ports.
+
+
+
+
+ Select camera GPI port. Type integer.
+
+
+
+
+ Get highest GPI port number on camera. Type integer.
+
+
+
+
+ Get lowest GPI port number on camera. Type integer
+
+
+
+
+ Set/Get GPI port functionality. Select port by using parameter.
+ Use enumeration to set mode. Type integer.
+
+
+
+
+ Get current GPI level. Type integer.
+
+
+
+
+ Set of configuration options to configure camera's LUT - Look-Up-Table.
+ Currently available only for Currera-R cameras.
+
+
+
+
+ Enable/Disable LUT. Type integer. Default 0.
+
+
+ Set 0 to disable LUT - sensor pixels are transferred directly.
+ Set 1 to enable LUT - sensor pixels are mapped through LUT.
+
+
+
+
+ Set/Get the index (offset) of the coefficient to access in the LUT. Type integer.
+
+
+
+
+ Get lowest LUT index (offset) of the coefficient to access in the LUT. Type integer.
+
+
+
+
+ Get highest LUT index (offset) of the coefficient to access in the LUT. Type integer.
+
+
+
+
+ Set/Get value in the LUT. Index of the value must be selected using
+ parameter. Type integer.
+
+
+
+
+ Get highest value to be set in LUT. Type integer.
+
+
+
+
+ Get lowest value to be set in LUT. Type integer.
+
+
+
+
+ Set of configuration options to access elements of Color Correction Matrix.
+
+
+
+
+
+ Set/Get color correction matrix element [0][0]. Type float. By default 1.0.
+
+
+
+
+ Set/Get color correction matrix element [0][1]. Type float. By default 0.0.
+
+
+
+
+ Set/Get color correction matrix element [0][2]. Type float. By default 0.0.
+
+
+
+
+ Set/Get color correction matrix element [0][3]. Type float. By default 0.0.
+
+
+
+
+ Set/Get color correction matrix element [1][0]. Type float. By default 0.0.
+
+
+
+
+ Set/Get color correction matrix element [1][1]. Type float. By default 1.0.
+
+
+
+
+ Set/Get color correction matrix element [1][2]. Type float. By default 0.0.
+
+
+
+
+ Set/Get color correction matrix element [1][3]. Type float. By default 0.0.
+
+
+
+
+ Set/Get color correction matrix element [2][0]. Type float. By default 0.0.
+
+
+
+
+ Set/Get color correction matrix element [2][1]. Type float. By default 0.0.
+
+
+
+
+ Set/Get color correction matrix element [2][2]. Type float. By default 1.0.
+
+
+
+
+ Set/Get color correction matrix element [2][3]. Type float. By default 0.0.
+
+
+
+
+ Set/Get color correction matrix element [3][0]. Type float. By default 0.0.
+
+
+
+
+ Set/Get color correction matrix element [3][1]. Type float. By default 0.0.
+
+
+
+
+ Set/Get color correction matrix element [3][2]. Type float. By default 0.0.
+
+
+
+
+ Set/Get color correction matrix element [3][3]. Type float. By default 1.0.
+
+
+
+
+ XIMEA camera's GPO port modes.
+
+
+
+
+ Output off.
+
+
+
+
+ Logical level.
+
+
+
+
+ High during exposure (integration) time + readout time + data transfer time.
+
+
+
+
+ Low during exposure (integration) time + readout time + data trasnfer time.
+
+
+
+
+ High during exposure(integration) time.
+
+
+
+
+ Low during exposure(integration) time.
+
+
+
+
+ The class provides access to XIMEA cameras.
+
+
+ The class allows to perform image acquisition from XIMEA cameras.
+ It wraps XIMEA'a xiAPI, which means that users of this class will also require m3api.dll and a correct
+ TM file for the camera model connected to the system (both are provided with XIMEA API software package).
+
+ Sample usage:
+
+ XimeaCamera camera = new XimeaCamera( );
+
+ // open camera and start data acquisition
+ camera.Open( 0 );
+ camera.StartAcquisition( );
+
+ // set exposure time to 10 milliseconds
+ camera.SetParam( CameraParameter.Exposure, 10 * 1000 );
+
+ // get image from the camera
+ Bitmap bitmap = camera.GetImage( );
+ // process the image
+ // ...
+
+ // dispose the image when it is no longer needed
+ bitmap.Dispose( );
+
+ // stop data acquisition and close the camera
+ camera.StopAcquisition( );
+ camera.Close( );
+
+
+
+
+
+
+
+
+ Open XIMEA camera.
+
+
+ Camera ID to open.
+
+ Opens the specified XIMEA camera preparing it for starting video acquisition
+ which is done using method. The
+ property can be used at any time to find if a camera was opened or not.
+
+ An error occurred while communicating with a camera. See error
+ message for additional information.
+
+
+
+
+ Close opened camera (if any) and release allocated resources.
+
+
+ The method also calls method if it was not
+ done by user.
+
+ An error occurred while communicating with a camera. See error
+ message for additional information.
+
+
+
+
+ Begin camera's work cycle and start data acquisition from it.
+
+
+ The property can be used at any time to find if the
+ acquisition was started or not.
+
+ An error occurred while communicating with a camera. See error
+ message for additional information.
+ No camera was opened, so can not access its methods.
+
+
+
+
+ End camera's work cycle and stops data acquisition.
+
+
+ An error occurred while communicating with a camera. See error
+ message for additional information.
+ No camera was opened, so can not access its methods.
+
+
+
+
+ Set camera's parameter.
+
+
+ Parameter name.
+ Integer parameter value.
+
+ The method allows to control different camera's parameters, like exposure time, gain value, etc.
+ See class for the list of some possible configuration parameters. See
+ XIMEA documentation for the complete list of supported parameters.
+
+
+ An error occurred while communicating with a camera. See error
+ message for additional information.
+ No camera was opened, so can not access its methods.
+
+
+
+
+ Set camera's parameter.
+
+
+ Parameter name.
+ Float parameter value.
+
+ The method allows to control different camera's parameters, like exposure time, gain value, etc.
+ See class for the list of some possible configuration parameters. See
+ XIMEA documentation for the complete list of supported parameters.
+
+
+ An error occurred while communicating with a camera. See error
+ message for additional information.
+ No camera was opened, so can not access its methods.
+
+
+
+
+ Get camera's parameter as integer value.
+
+
+ Parameter name to get from camera.
+
+ Returns integer value of the requested parameter.
+
+ See class for the list of some possible configuration parameters. See
+ XIMEA documentation for the complete list of supported parameters.
+
+ An error occurred while communicating with a camera. See error
+ message for additional information.
+ No camera was opened, so can not access its methods.
+
+
+
+
+ Get camera's parameter as float value.
+
+
+ Parameter name to get from camera.
+
+ Returns float value of the requested parameter.
+
+ See class for the list of some possible configuration parameters. See
+ XIMEA documentation for the complete list of supported parameters.
+
+ An error occurred while communicating with a camera. See error
+ message for additional information.
+ No camera was opened, so can not access its methods.
+
+
+
+
+ Get camera's parameter as string value.
+
+
+ Parameter name to get from camera.
+
+ Returns string value of the requested parameter.
+
+ See class for the list of some possible configuration parameters. See
+ XIMEA documentation for the complete list of supported parameters.
+
+ An error occurred while communicating with a camera. See error
+ message for additional information.
+ No camera was opened, so can not access its methods.
+
+
+
+
+ Get image from the opened XIMEA camera.
+
+
+ Returns image retrieved from the camera.
+
+ The method calls method specifying 5000 as the timeout
+ value.
+
+
+
+
+ Get image from the opened XIMEA camera.
+
+
+ Maximum time to wait in milliseconds till image becomes available.
+
+ Returns image retrieved from the camera.
+
+ The method calls method specifying
+ the makeCopy parameter.
+
+
+
+
+ Get image from the opened XIMEA camera.
+
+
+ Maximum time to wait in milliseconds till image becomes available.
+ Make a copy of the camera's image or not.
+
+ Returns image retrieved from the camera.
+
+ If the is set to , then the method
+ creates a managed copy of the camera's image, so the managed image stays valid even when the camera
+ is closed. However, setting this parameter to creates a managed image which is
+ just a wrapper around camera's unmanaged image. So if camera is closed and its resources are freed, the
+ managed image becomes no longer valid and accessing it will generate an exception.
+
+ An error occurred while communicating with a camera. See error
+ message for additional information.
+ No camera was opened, so can not access its methods.
+ Time out value reached - no image is available within specified time value.
+
+
+
+
+ Get number of XIMEA camera connected to the system.
+
+
+
+
+ Specifies if camera's data acquisition is currently active for the opened camera (if any).
+
+
+
+
+ Specifies if a camera is currently opened by the instance of the class.
+
+
+
+
+ ID of the the recently opened XIMEA camera.
+
+
+
+
+ Enumeration of camera's trigger modes.
+
+
+
+
+ Camera works in free run mode.
+
+
+
+
+ External trigger (rising edge).
+
+
+
+
+ External trigger (falling edge).
+
+
+
+
+ Software (manual) trigger.
+
+
+
+
+ The class provides continues access to XIMEA cameras.
+
+
+ The video source class is aimed to provide continues access to XIMEA camera, when
+ images are continuosly acquired from camera and provided throw the event.
+ It just creates a background thread and gets new images from XIMEA camera
+ keeping the specified time interval between image acquisition.
+ Essentially it is a wrapper class around providing interface.
+
+ Sample usage:
+
+ // create video source for the XIMEA camera with ID 0
+ XimeaVideoSource videoSource = new XimeaVideoSource( 0 );
+ // set event handlers
+ videoSource.NewFrame += new NewFrameEventHandler( video_NewFrame );
+ // start the video source
+ videoSource.Start( );
+
+ // set exposure time to 10 milliseconds
+ videoSource.SetParam( CameraParameter.Exposure, 10 * 1000 );
+
+ // ...
+
+ // New frame event handler, which is invoked on each new available video frame
+ private void video_NewFrame( object sender, NewFrameEventArgs eventArgs )
+ {
+ // get new frame
+ Bitmap bitmap = eventArgs.Frame;
+ // process the frame
+ }
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ XIMEA camera ID (index) to connect to.
+
+
+
+
+ Start video source.
+
+
+ Starts video source and returns execution to caller. Video camera will be started
+ and will provide new video frames through the event.
+
+ There is no XIMEA camera with specified ID connected to the system.
+ An error occurred while communicating with a camera. See error
+ message for additional information.
+
+
+
+
+ Signal video source to stop its work.
+
+
+
+
+
+
+
+ Wait for video source has stopped.
+
+
+
+
+
+
+
+ Stop video source.
+
+
+ The method stops the video source, so it no longer provides new video frames
+ and does not consume any resources.
+
+
+
+
+
+ Set camera's parameter.
+
+
+ Parameter name.
+ Integer parameter value.
+
+ The call is redirected to .
+
+
+
+
+ Set camera's parameter.
+
+
+ Parameter name.
+ Float parameter value.
+
+ The call is redirected to .
+
+
+
+
+ Get camera's parameter as integer value.
+
+
+ Parameter name to get from camera.
+
+ Returns integer value of the requested parameter.
+
+ The call is redirected to .
+
+
+
+
+ Get camera's parameter as float value.
+
+
+ Parameter name to get from camera.
+
+ Returns float value of the requested parameter.
+
+ The call is redirected to .
+
+
+
+
+ Get camera's parameter as string value.
+
+
+ Parameter name to get from camera.
+
+ Returns string value of the requested parameter.
+
+ The call is redirected to .
+
+
+
+
+ New frame event.
+
+
+ Notifies clients about new available frames from the video source.
+
+ Since video source may have multiple clients, each client is responsible for
+ making a copy (cloning) of the passed video frame, because the video source disposes its
+ own original copy after notifying of clients.
+
+
+
+
+
+ Video source error event.
+
+
+ This event is used to notify clients about any type of errors occurred in
+ video source object, for example internal exceptions.
+
+
+
+
+ Video playing finished event.
+
+
+ This event is used to notify clients that the video playing has finished.
+
+
+
+
+
+ A string identifying the video source.
+
+
+
+
+
+ State of the video source.
+
+
+ Current state of video source object - running or not.
+
+
+
+
+ Received bytes count.
+
+
+ Number of bytes the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ Received frames count.
+
+
+ Number of frames the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ Time interval between frames.
+
+
+ The property sets the interval in milliseconds between getting new frames from the camera.
+ If the property is set to 100, then the desired frame rate should be about 10 frames per second.
+
+ Setting this property to 0 leads to no delay between video frames - frames
+ are read as fast as possible.
+
+ Default value is set to 200.
+
+
+
+
+
diff --git a/Part 1 - Record Video/bin/Debug/AForge.Video.dll b/Part 1 - Record Video/bin/Debug/AForge.Video.dll
new file mode 100644
index 0000000..dc67243
Binary files /dev/null and b/Part 1 - Record Video/bin/Debug/AForge.Video.dll differ
diff --git a/Part 1 - Record Video/bin/Debug/AForge.Video.xml b/Part 1 - Record Video/bin/Debug/AForge.Video.xml
new file mode 100644
index 0000000..bde9a52
--- /dev/null
+++ b/Part 1 - Record Video/bin/Debug/AForge.Video.xml
@@ -0,0 +1,1190 @@
+
+
+
+ AForge.Video
+
+
+
+
+ Proxy video source for asynchronous processing of another nested video source.
+
+
+ The class represents a simple proxy, which wraps the specified
+ with the aim of asynchronous processing of received video frames. The class intercepts
+ event from the nested video source and fires it to clients from its own thread, which is different from the thread
+ used by nested video source for video acquisition. This allows clients to perform processing of video frames
+ without blocking video acquisition thread, which continue to run and acquire next video frame while current is still
+ processed.
+
+ For example, let’s suppose that it takes 100 ms for the nested video source to acquire single frame, so the original
+ frame rate is 10 frames per second. Also let’s assume that we have an image processing routine, which also takes
+ 100 ms to process a single frame. If the acquisition and processing are done sequentially, then resulting
+ frame rate will drop to 5 frames per second. However, if doing both in parallel, then there is a good chance to
+ keep resulting frame rate equal (or close) to the original frame rate.
+
+ The class provides a bonus side effect - easer debugging of image processing routines, which are put into
+ event handler. In many cases video source classes fire their
+ event from a try/catch block, which makes it very hard to spot error made in user's code - the catch block simply
+ hides exception raised in user’s code. The does not have any try/catch blocks around
+ firing of event, so always user gets exception in the case it comes from his code. At the same time
+ nested video source is not affected by the user's exception, since it runs in different thread.
+
+ Sample usage:
+
+ // usage of AsyncVideoSource is the same as usage of any
+ // other video source class, so code change is very little
+
+ // create nested video source, for example JPEGStream
+ JPEGStream stream = new JPEGStream( "some url" );
+ // create async video source
+ AsyncVideoSource asyncSource = new AsyncVideoSource( stream );
+ // set NewFrame event handler
+ asyncSource.NewFrame += new NewFrameEventHandler( video_NewFrame );
+ // start the video source
+ asyncSource.Start( );
+ // ...
+
+ private void video_NewFrame( object sender, NewFrameEventArgs eventArgs )
+ {
+ // get new frame
+ Bitmap bitmap = eventArgs.Frame;
+ // process the frame
+ }
+
+
+
+
+
+
+ Video source interface.
+
+
+ The interface describes common methods for different type of video sources.
+
+
+
+
+ Start video source.
+
+
+ Starts video source and return execution to caller. Video source
+ object creates background thread and notifies about new frames with the
+ help of event.
+
+
+
+
+ Signal video source to stop its work.
+
+
+ Signals video source to stop its background thread, stop to
+ provide new frames and free resources.
+
+
+
+
+ Wait for video source has stopped.
+
+
+ Waits for video source stopping after it was signalled to stop using
+ method.
+
+
+
+
+ Stop video source.
+
+
+ Stops video source aborting its thread.
+
+
+
+
+ New frame event.
+
+
+ This event is used to notify clients about new available video frame.
+
+ Since video source may have multiple clients, each client is responsible for
+ making a copy (cloning) of the passed video frame, but video source is responsible for
+ disposing its own original copy after notifying of clients.
+
+
+
+
+
+ Video source error event.
+
+
+ This event is used to notify clients about any type of errors occurred in
+ video source object, for example internal exceptions.
+
+
+
+
+ Video playing finished event.
+
+
+ This event is used to notify clients that the video playing has finished.
+
+
+
+
+
+ Video source.
+
+
+ The meaning of the property depends on particular video source.
+ Depending on video source it may be a file name, URL or any other string
+ describing the video source.
+
+
+
+
+ Received frames count.
+
+
+ Number of frames the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ Received bytes count.
+
+
+ Number of bytes the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ State of the video source.
+
+
+ Current state of video source object - running or not.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Nested video source which is the target for asynchronous processing.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Nested video source which is the target for asynchronous processing.
+ Specifies if the object should skip frames from the nested video source
+ in the case if it is still busy processing the previous video frame.
+
+
+
+
+ Start video source.
+
+
+ Starts the nested video source and returns execution to caller. This object creates
+ an extra thread which is used to fire events, so the image processing could be
+ done on another thread without blocking video acquisition thread.
+
+
+
+
+ Signal video source to stop its work.
+
+
+ Signals video source to stop its background thread, stop to
+ provide new frames and free resources.
+
+
+
+
+ Wait for video source has stopped.
+
+
+ Waits for video source stopping after it was signalled to stop using
+ method.
+
+
+
+
+ Stop video source.
+
+
+ Stops nested video source by calling its method.
+ See documentation of the particular video source for additional details.
+
+
+
+
+ New frame event.
+
+
+ Notifies clients about new available frame from video source.
+
+ This event is fired from a different thread other than the video acquisition thread created
+ by . This allows nested video frame to continue acquisition of the next
+ video frame while clients perform processing of the current video frame.
+
+ Since video source may have multiple clients, each client is responsible for
+ making a copy (cloning) of the passed video frame, because the video source disposes its
+ own original copy after notifying of clients.
+
+
+
+
+
+ Video source error event.
+
+
+ This event is used to notify clients about any type of errors occurred in
+ video source object, for example internal exceptions.
+
+ Unlike event, this event is simply redirected to the corresponding
+ event of the , so it is fired from the thread of the nested video source.
+
+
+
+
+
+ Video playing finished event.
+
+
+ This event is used to notify clients that the video playing has finished.
+
+ Unlike event, this event is simply redirected to the corresponding
+ event of the , so it is fired from the thread of the nested video source.
+
+
+
+
+
+ Nested video source which is the target for asynchronous processing.
+
+
+ The property is set through the class constructor.
+
+ All calls to this object are actually redirected to the nested video source. The only
+ exception is the event, which is handled differently. This object gets
+ event from the nested class and then fires another
+ event, but from a different thread.
+
+
+
+
+
+ Specifies if the object should skip frames from the nested video source when it is busy.
+
+
+ Specifies if the object should skip frames from the nested video source
+ in the case if it is still busy processing the previous video frame in its own thread.
+
+ Default value is set to .
+
+
+
+
+ Video source string.
+
+
+ The property is redirected to the corresponding property of ,
+ so check its documentation to find what it means.
+
+
+
+
+ Received frames count.
+
+
+ Number of frames the nested video source received from
+ the moment of the last access to the property.
+
+
+
+
+
+ Received bytes count.
+
+
+ Number of bytes the nested video source received from
+ the moment of the last access to the property.
+
+
+
+
+ Processed frames count.
+
+
+ The property keeps the number of processed video frames since the last access to this property.
+
+
+ The value of this property equals to in most cases if the
+ property is set to - every received frame gets processed
+ sooner or later. However, if the property is set to ,
+ then value of this property may be lower than the value of the property, which
+ means that nested video source performs acquisition faster than client perform processing of the received frame
+ and some frame are skipped from processing.
+
+
+
+
+
+ State of the video source.
+
+
+ Current state of the video source object - running or not.
+
+
+
+
+ Screen capture video source.
+
+
+ The video source constantly captures the desktop screen.
+
+ Sample usage:
+
+ // get entire desktop area size
+ Rectangle screenArea = Rectangle.Empty;
+ foreach ( System.Windows.Forms.Screen screen in
+ System.Windows.Forms.Screen.AllScreens )
+ {
+ screenArea = Rectangle.Union( screenArea, screen.Bounds );
+ }
+
+ // create screen capture video source
+ ScreenCaptureStream stream = new ScreenCaptureStream( screenArea );
+
+ // set NewFrame event handler
+ stream.NewFrame += new NewFrameEventHandler( video_NewFrame );
+
+ // start the video source
+ stream.Start( );
+
+ // ...
+ // signal to stop
+ stream.SignalToStop( );
+ // ...
+
+ private void video_NewFrame( object sender, NewFrameEventArgs eventArgs )
+ {
+ // get new frame
+ Bitmap bitmap = eventArgs.Frame;
+ // process the frame
+ }
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Screen's rectangle to capture (the rectangle may cover multiple displays).
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Screen's rectangle to capture (the rectangle may cover multiple displays).
+ Time interval between making screen shots, ms.
+
+
+
+
+ Start video source.
+
+
+ Starts video source and return execution to caller. Video source
+ object creates background thread and notifies about new frames with the
+ help of event.
+
+ Video source is not specified.
+
+
+
+
+ Signal video source to stop its work.
+
+
+ Signals video source to stop its background thread, stop to
+ provide new frames and free resources.
+
+
+
+
+ Wait for video source has stopped.
+
+
+ Waits for source stopping after it was signalled to stop using
+ method.
+
+
+
+
+ Stop video source.
+
+
+ Stops video source aborting its thread.
+
+ Since the method aborts background thread, its usage is highly not preferred
+ and should be done only if there are no other options. The correct way of stopping camera
+ is signaling it stop and then
+ waiting for background thread's completion.
+
+
+
+
+
+ Free resource.
+
+
+
+
+
+ New frame event.
+
+
+ Notifies clients about new available frame from video source.
+
+ Since video source may have multiple clients, each client is responsible for
+ making a copy (cloning) of the passed video frame, because the video source disposes its
+ own original copy after notifying of clients.
+
+
+
+
+
+ Video source error event.
+
+
+ This event is used to notify clients about any type of errors occurred in
+ video source object, for example internal exceptions.
+
+
+
+
+ Video playing finished event.
+
+
+ This event is used to notify clients that the video playing has finished.
+
+
+
+
+
+ Video source.
+
+
+
+
+
+ Gets or sets the screen capture region.
+
+
+ This property specifies which region (rectangle) of the screen to capture. It may cover multiple displays
+ if those are available in the system.
+
+ The property must be set before starting video source to have any effect.
+
+
+
+
+
+ Time interval between making screen shots, ms.
+
+
+ The property specifies time interval in milliseconds between consequent screen captures.
+ Expected frame rate of the stream should be approximately 1000/FrameInteval.
+
+ If the property is set to 0, then the stream will capture screen as fast as the system allows.
+
+ Default value is set to 100.
+
+
+
+
+
+ Received frames count.
+
+
+ Number of frames the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ Received bytes count.
+
+
+ The property is not implemented for this video source and always returns 0.
+
+
+
+
+
+ State of the video source.
+
+
+ Current state of video source object - running or not.
+
+
+
+
+ MJPEG video source.
+
+
+ The video source downloads JPEG images from the specified URL, which represents
+ MJPEG stream.
+
+ Sample usage:
+
+ // create MJPEG video source
+ MJPEGStream stream = new MJPEGStream( "some url" );
+ // set event handlers
+ stream.NewFrame += new NewFrameEventHandler( video_NewFrame );
+ // start the video source
+ stream.Start( );
+ // ...
+
+
+ Some cameras produce HTTP header, which does not conform strictly to
+ standard, what leads to .NET exception. To avoid this exception the useUnsafeHeaderParsing
+ configuration option of httpWebRequest should be set, what may be done using application
+ configuration file.
+
+ <configuration>
+ <system.net>
+ <settings>
+ <httpWebRequest useUnsafeHeaderParsing="true" />
+ </settings>
+ </system.net>
+ </configuration>
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ URL, which provides MJPEG stream.
+
+
+
+
+ Start video source.
+
+
+ Starts video source and return execution to caller. Video source
+ object creates background thread and notifies about new frames with the
+ help of event.
+
+ Video source is not specified.
+
+
+
+
+ Signal video source to stop its work.
+
+
+ Signals video source to stop its background thread, stop to
+ provide new frames and free resources.
+
+
+
+
+ Wait for video source has stopped.
+
+
+ Waits for source stopping after it was signalled to stop using
+ method.
+
+
+
+
+ Stop video source.
+
+
+ Stops video source aborting its thread.
+
+ Since the method aborts background thread, its usage is highly not preferred
+ and should be done only if there are no other options. The correct way of stopping camera
+ is signaling it stop and then
+ waiting for background thread's completion.
+
+
+
+
+
+ Free resource.
+
+
+
+
+
+ New frame event.
+
+
+ Notifies clients about new available frame from video source.
+
+ Since video source may have multiple clients, each client is responsible for
+ making a copy (cloning) of the passed video frame, because the video source disposes its
+ own original copy after notifying of clients.
+
+
+
+
+
+ Video source error event.
+
+
+ This event is used to notify clients about any type of errors occurred in
+ video source object, for example internal exceptions.
+
+
+
+
+ Video playing finished event.
+
+
+ This event is used to notify clients that the video playing has finished.
+
+
+
+
+
+ Use or not separate connection group.
+
+
+ The property indicates to open web request in separate connection group.
+
+
+
+
+ Video source.
+
+
+ URL, which provides MJPEG stream.
+
+
+
+
+ Login value.
+
+
+ Login required to access video source.
+
+
+
+
+ Password value.
+
+
+ Password required to access video source.
+
+
+
+
+ Gets or sets proxy information for the request.
+
+
+ The local computer or application config file may specify that a default
+ proxy to be used. If the Proxy property is specified, then the proxy settings from the Proxy
+ property overridea the local computer or application config file and the instance will use
+ the proxy settings specified. If no proxy is specified in a config file
+ and the Proxy property is unspecified, the request uses the proxy settings
+ inherited from Internet Explorer on the local computer. If there are no proxy settings
+ in Internet Explorer, the request is sent directly to the server.
+
+
+
+
+
+ User agent to specify in HTTP request header.
+
+
+ Some IP cameras check what is the requesting user agent and depending
+ on it they provide video in different formats or do not provide it at all. The property
+ sets the value of user agent string, which is sent to camera in request header.
+
+
+ Default value is set to "Mozilla/5.0". If the value is set to ,
+ the user agent string is not sent in request header.
+
+
+
+
+
+ Received frames count.
+
+
+ Number of frames the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ Received bytes count.
+
+
+ Number of bytes the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ Request timeout value.
+
+
+ The property sets timeout value in milliseconds for web requests.
+ Default value is 10000 milliseconds.
+
+
+
+
+ State of the video source.
+
+
+ Current state of video source object - running or not.
+
+
+
+
+ Force using of basic authentication when connecting to the video source.
+
+
+ For some IP cameras (TrendNET IP cameras, for example) using standard .NET's authentication via credentials
+ does not seem to be working (seems like camera does not request for authentication, but expects corresponding headers to be
+ present on connection request). So this property allows to force basic authentication by adding required HTTP headers when
+ request is sent.
+
+ Default value is set to .
+
+
+
+
+
+ Video related exception.
+
+
+ The exception is thrown in the case of some video related issues, like
+ failure of initializing codec, compression, etc.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Exception's message.
+
+
+
+
+ Delegate for new frame event handler.
+
+
+ Sender object.
+ Event arguments.
+
+
+
+
+ Delegate for video source error event handler.
+
+
+ Sender object.
+ Event arguments.
+
+
+
+
+ Delegate for playing finished event handler.
+
+
+ Sender object.
+ Reason of finishing video playing.
+
+
+
+
+ Reason of finishing video playing.
+
+
+ When video source class fire the event, they
+ need to specify reason of finishing video playing. For example, it may be end of stream reached.
+
+
+
+
+ Video playing has finished because it end was reached.
+
+
+
+
+ Video playing has finished because it was stopped by user.
+
+
+
+
+ Video playing has finished because the device was lost (unplugged).
+
+
+
+
+ Video playing has finished because of some error happened the video source (camera, stream, file, etc.).
+ A error reporting event usually is fired to provide error information.
+
+
+
+
+ Arguments for new frame event from video source.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ New frame.
+
+
+
+
+ New frame from video source.
+
+
+
+
+
+ Arguments for video source error event from video source.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Error description.
+
+
+
+
+ Video source error description.
+
+
+
+
+
+ JPEG video source.
+
+
+ The video source constantly downloads JPEG files from the specified URL.
+
+ Sample usage:
+
+ // create JPEG video source
+ JPEGStream stream = new JPEGStream( "some url" );
+ // set NewFrame event handler
+ stream.NewFrame += new NewFrameEventHandler( video_NewFrame );
+ // start the video source
+ stream.Start( );
+ // ...
+ // signal to stop
+ stream.SignalToStop( );
+ // ...
+
+ private void video_NewFrame( object sender, NewFrameEventArgs eventArgs )
+ {
+ // get new frame
+ Bitmap bitmap = eventArgs.Frame;
+ // process the frame
+ }
+
+
+ Some cameras produce HTTP header, which does not conform strictly to
+ standard, what leads to .NET exception. To avoid this exception the useUnsafeHeaderParsing
+ configuration option of httpWebRequest should be set, what may be done using application
+ configuration file.
+
+ <configuration>
+ <system.net>
+ <settings>
+ <httpWebRequest useUnsafeHeaderParsing="true" />
+ </settings>
+ </system.net>
+ </configuration>
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ URL, which provides JPEG files.
+
+
+
+
+ Start video source.
+
+
+ Starts video source and return execution to caller. Video source
+ object creates background thread and notifies about new frames with the
+ help of event.
+
+ Video source is not specified.
+
+
+
+
+ Signal video source to stop its work.
+
+
+ Signals video source to stop its background thread, stop to
+ provide new frames and free resources.
+
+
+
+
+ Wait for video source has stopped.
+
+
+ Waits for source stopping after it was signalled to stop using
+ method.
+
+
+
+
+ Stop video source.
+
+
+ Stops video source aborting its thread.
+
+ Since the method aborts background thread, its usage is highly not preferred
+ and should be done only if there are no other options. The correct way of stopping camera
+ is signaling it stop and then
+ waiting for background thread's completion.
+
+
+
+
+
+ Free resource.
+
+
+
+
+
+ New frame event.
+
+
+ Notifies clients about new available frame from video source.
+
+ Since video source may have multiple clients, each client is responsible for
+ making a copy (cloning) of the passed video frame, because the video source disposes its
+ own original copy after notifying of clients.
+
+
+
+
+
+ Video source error event.
+
+
+ This event is used to notify clients about any type of errors occurred in
+ video source object, for example internal exceptions.
+
+
+
+
+ Video playing finished event.
+
+
+ This event is used to notify clients that the video playing has finished.
+
+
+
+
+
+ Use or not separate connection group.
+
+
+ The property indicates to open web request in separate connection group.
+
+
+
+
+ Use or not caching.
+
+
+ If the property is set to true, then a fake random parameter will be added
+ to URL to prevent caching. It's required for clients, who are behind proxy server.
+
+
+
+
+ Frame interval.
+
+
+ The property sets the interval in milliseconds betwen frames. If the property is
+ set to 100, then the desired frame rate will be 10 frames per second. Default value is 0 -
+ get new frames as fast as possible.
+
+
+
+
+ Video source.
+
+
+ URL, which provides JPEG files.
+
+
+
+
+ Login value.
+
+
+ Login required to access video source.
+
+
+
+
+ Password value.
+
+
+ Password required to access video source.
+
+
+
+
+ Gets or sets proxy information for the request.
+
+
+ The local computer or application config file may specify that a default
+ proxy to be used. If the Proxy property is specified, then the proxy settings from the Proxy
+ property overridea the local computer or application config file and the instance will use
+ the proxy settings specified. If no proxy is specified in a config file
+ and the Proxy property is unspecified, the request uses the proxy settings
+ inherited from Internet Explorer on the local computer. If there are no proxy settings
+ in Internet Explorer, the request is sent directly to the server.
+
+
+
+
+
+ Received frames count.
+
+
+ Number of frames the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ Received bytes count.
+
+
+ Number of bytes the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ Request timeout value.
+
+
+ The property sets timeout value in milliseconds for web requests.
+
+ Default value is set 10000 milliseconds.
+
+
+
+
+ State of the video source.
+
+
+ Current state of video source object - running or not.
+
+
+
+
+ Force using of basic authentication when connecting to the video source.
+
+
+ For some IP cameras (TrendNET IP cameras, for example) using standard .NET's authentication via credentials
+ does not seem to be working (seems like camera does not request for authentication, but expects corresponding headers to be
+ present on connection request). So this property allows to force basic authentication by adding required HTTP headers when
+ request is sent.
+
+ Default value is set to .
+
+
+
+
+
+ Some internal utilities for handling arrays.
+
+
+
+
+
+ Check if the array contains needle at specified position.
+
+
+ Source array to check for needle.
+ Needle we are searching for.
+ Start index in source array.
+
+ Returns true if the source array contains the needle at
+ the specified index. Otherwise it returns false.
+
+
+
+
+ Find subarray in the source array.
+
+
+ Source array to search for needle.
+ Needle we are searching for.
+ Start index in source array.
+ Number of bytes in source array, where the needle is searched for.
+
+ Returns starting position of the needle if it was found or -1 otherwise.
+
+
+
+
diff --git a/Part 1 - Record Video/bin/Debug/AForge.dll b/Part 1 - Record Video/bin/Debug/AForge.dll
new file mode 100644
index 0000000..311cfe5
Binary files /dev/null and b/Part 1 - Record Video/bin/Debug/AForge.dll differ
diff --git a/Part 1 - Record Video/bin/Debug/AForge.xml b/Part 1 - Record Video/bin/Debug/AForge.xml
new file mode 100644
index 0000000..4413847
--- /dev/null
+++ b/Part 1 - Record Video/bin/Debug/AForge.xml
@@ -0,0 +1,1795 @@
+
+
+
+ AForge
+
+
+
+
+ Event arguments holding a buffer sent or received during some communication process.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Message being transfered during communication process.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Buffer containing the message being transferred during communication process.
+ Starting index of the message within the buffer.
+ Length of the message within the buffer.
+
+
+
+
+ Get the transfered message.
+
+
+ Returns copy of the transfered message.
+
+
+
+
+ Get the transferred message as string.
+
+
+ Returns string encoding the transferred message.
+
+
+
+
+ Length of the transfered message.
+
+
+
+
+ Structure for representing a pair of coordinates of integer type.
+
+
+ The structure is used to store a pair of integer coordinates.
+
+ Sample usage:
+
+ // assigning coordinates in the constructor
+ IntPoint p1 = new IntPoint( 10, 20 );
+ // creating a point and assigning coordinates later
+ IntPoint p2;
+ p2.X = 30;
+ p2.Y = 40;
+ // calculating distance between two points
+ float distance = p1.DistanceTo( p2 );
+
+
+
+
+
+
+ X coordinate.
+
+
+
+
+
+ Y coordinate.
+
+
+
+
+
+ Initializes a new instance of the structure.
+
+
+ X axis coordinate.
+ Y axis coordinate.
+
+
+
+
+ Calculate Euclidean distance between two points.
+
+
+ Point to calculate distance to.
+
+ Returns Euclidean distance between this point and
+ points.
+
+
+
+
+ Calculate squared Euclidean distance between two points.
+
+
+ Point to calculate distance to.
+
+ Returns squared Euclidean distance between this point and
+ points.
+
+
+
+
+ Addition operator - adds values of two points.
+
+
+ First point for addition.
+ Second point for addition.
+
+ Returns new point which coordinates equal to sum of corresponding
+ coordinates of specified points.
+
+
+
+
+ Addition operator - adds values of two points.
+
+
+ First point for addition.
+ Second point for addition.
+
+ Returns new point which coordinates equal to sum of corresponding
+ coordinates of specified points.
+
+
+
+
+ Subtraction operator - subtracts values of two points.
+
+
+ Point to subtract from.
+ Point to subtract.
+
+ Returns new point which coordinates equal to difference of corresponding
+ coordinates of specified points.
+
+
+
+
+ Subtraction operator - subtracts values of two points.
+
+
+ Point to subtract from.
+ Point to subtract.
+
+ Returns new point which coordinates equal to difference of corresponding
+ coordinates of specified points.
+
+
+
+
+ Addition operator - adds scalar to the specified point.
+
+
+ Point to increase coordinates of.
+ Value to add to coordinates of the specified point.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point increased by specified value.
+
+
+
+
+ Addition operator - adds scalar to the specified point.
+
+
+ Point to increase coordinates of.
+ Value to add to coordinates of the specified point.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point increased by specified value.
+
+
+
+
+ Subtraction operator - subtracts scalar from the specified point.
+
+
+ Point to decrease coordinates of.
+ Value to subtract from coordinates of the specified point.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point decreased by specified value.
+
+
+
+
+ Subtraction operator - subtracts scalar from the specified point.
+
+
+ Point to decrease coordinates of.
+ Value to subtract from coordinates of the specified point.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point decreased by specified value.
+
+
+
+
+ Multiplication operator - multiplies coordinates of the specified point by scalar value.
+
+
+ Point to multiply coordinates of.
+ Multiplication factor.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point multiplied by specified value.
+
+
+
+
+ Multiplication operator - multiplies coordinates of the specified point by scalar value.
+
+
+ Point to multiply coordinates of.
+ Multiplication factor.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point multiplied by specified value.
+
+
+
+
+ Division operator - divides coordinates of the specified point by scalar value.
+
+
+ Point to divide coordinates of.
+ Division factor.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point divided by specified value.
+
+
+
+
+ Division operator - divides coordinates of the specified point by scalar value.
+
+
+ Point to divide coordinates of.
+ Division factor.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point divided by specified value.
+
+
+
+
+ Equality operator - checks if two points have equal coordinates.
+
+
+ First point to check.
+ Second point to check.
+
+ Returns if coordinates of specified
+ points are equal.
+
+
+
+
+ Inequality operator - checks if two points have different coordinates.
+
+
+ First point to check.
+ Second point to check.
+
+ Returns if coordinates of specified
+ points are not equal.
+
+
+
+
+ Check if this instance of equal to the specified one.
+
+
+ Another point to check equalty to.
+
+ Return if objects are equal.
+
+
+
+
+ Get hash code for this instance.
+
+
+ Returns the hash code for this instance.
+
+
+
+
+ Implicit conversion to .
+
+
+ Integer point to convert to single precision point.
+
+ Returns new single precision point which coordinates are implicitly converted
+ to floats from coordinates of the specified integer point.
+
+
+
+
+ Implicit conversion to .
+
+
+ Integer point to convert to double precision point.
+
+ Returns new double precision point which coordinates are implicitly converted
+ to doubles from coordinates of the specified integer point.
+
+
+
+
+ Get string representation of the class.
+
+
+ Returns string, which contains values of the point in readable form.
+
+
+
+
+ Calculate Euclidean norm of the vector comprised of the point's
+ coordinates - distance from (0, 0) in other words.
+
+
+ Returns point's distance from (0, 0) point.
+
+
+
+
+ Evaluator of expressions written in reverse polish notation.
+
+
+ The class evaluates expressions writen in reverse postfix polish notation.
+
+ The list of supported functuins is:
+
+ - Arithmetic functions: +, -, *, /;
+ - sin - sine;
+ - cos - cosine;
+ - ln - natural logarithm;
+ - exp - exponent;
+ - sqrt - square root.
+
+
+ Arguments for these functions could be as usual constants, written as numbers, as variables,
+ writen as $<var_number> ($2, for example). The variable number is zero based index
+ of variables array.
+
+ Sample usage:
+
+ // expression written in polish notation
+ string expression = "2 $0 / 3 $1 * +";
+ // variables for the expression
+ double[] vars = new double[] { 3, 4 };
+ // expression evaluation
+ double result = PolishExpression.Evaluate( expression, vars );
+
+
+
+
+
+
+ Evaluates specified expression.
+
+
+ Expression written in postfix polish notation.
+ Variables for the expression.
+
+ Evaluated value of the expression.
+
+ Unsupported function is used in the expression.
+ Incorrect postfix polish expression.
+
+
+
+
+ Represents a double range with minimum and maximum values.
+
+
+
+ The class represents a double range with inclusive limits -
+ both minimum and maximum values of the range are included into it.
+ Mathematical notation of such range is [min, max].
+
+ Sample usage:
+
+ // create [0.25, 1.5] range
+ DoubleRange range1 = new DoubleRange( 0.25, 1.5 );
+ // create [1.00, 2.25] range
+ DoubleRange range2 = new DoubleRange( 1.00, 2.25 );
+ // check if values is inside of the first range
+ if ( range1.IsInside( 0.75 ) )
+ {
+ // ...
+ }
+ // check if the second range is inside of the first range
+ if ( range1.IsInside( range2 ) )
+ {
+ // ...
+ }
+ // check if two ranges overlap
+ if ( range1.IsOverlapping( range2 ) )
+ {
+ // ...
+ }
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Minimum value of the range.
+ Maximum value of the range.
+
+
+
+
+ Check if the specified value is inside of the range.
+
+
+ Value to check.
+
+ True if the specified value is inside of the range or
+ false otherwise.
+
+
+
+
+ Check if the specified range is inside of the range.
+
+
+ Range to check.
+
+ True if the specified range is inside of the range or
+ false otherwise.
+
+
+
+
+ Check if the specified range overlaps with the range.
+
+
+ Range to check for overlapping.
+
+ True if the specified range overlaps with the range or
+ false otherwise.
+
+
+
+
+ Convert the signle precision range to integer range.
+
+
+ Specifies if inner integer range must be returned or outer range.
+
+ Returns integer version of the range.
+
+ If is set to , then the
+ returned integer range will always fit inside of the current single precision range.
+ If it is set to , then current single precision range will always
+ fit into the returned integer range.
+
+
+
+
+ Equality operator - checks if two ranges have equal min/max values.
+
+
+ First range to check.
+ Second range to check.
+
+ Returns if min/max values of specified
+ ranges are equal.
+
+
+
+
+ Inequality operator - checks if two ranges have different min/max values.
+
+
+ First range to check.
+ Second range to check.
+
+ Returns if min/max values of specified
+ ranges are not equal.
+
+
+
+
+ Check if this instance of equal to the specified one.
+
+
+ Another range to check equalty to.
+
+ Return if objects are equal.
+
+
+
+
+ Get hash code for this instance.
+
+
+ Returns the hash code for this instance.
+
+
+
+
+ Get string representation of the class.
+
+
+ Returns string, which contains min/max values of the range in readable form.
+
+
+
+
+ Minimum value of the range.
+
+
+ The property represents minimum value (left side limit) or the range -
+ [min, max].
+
+
+
+
+ Maximum value of the range.
+
+
+ The property represents maximum value (right side limit) or the range -
+ [min, max].
+
+
+
+
+ Length of the range (deffirence between maximum and minimum values).
+
+
+
+
+ A delegate which is used by events notifying abount sent/received message.
+
+
+ Event sender.
+ Event arguments containing details about the transferred message.
+
+
+
+
+ Structure for representing a pair of coordinates of float type.
+
+
+ The structure is used to store a pair of floating point
+ coordinates with single precision.
+
+ Sample usage:
+
+ // assigning coordinates in the constructor
+ Point p1 = new Point( 10, 20 );
+ // creating a point and assigning coordinates later
+ Point p2;
+ p2.X = 30;
+ p2.Y = 40;
+ // calculating distance between two points
+ float distance = p1.DistanceTo( p2 );
+
+
+
+
+
+
+ X coordinate.
+
+
+
+
+
+ Y coordinate.
+
+
+
+
+
+ Initializes a new instance of the structure.
+
+
+ X axis coordinate.
+ Y axis coordinate.
+
+
+
+
+ Calculate Euclidean distance between two points.
+
+
+ Point to calculate distance to.
+
+ Returns Euclidean distance between this point and
+ points.
+
+
+
+
+ Calculate squared Euclidean distance between two points.
+
+
+ Point to calculate distance to.
+
+ Returns squared Euclidean distance between this point and
+ points.
+
+
+
+
+ Addition operator - adds values of two points.
+
+
+ First point for addition.
+ Second point for addition.
+
+ Returns new point which coordinates equal to sum of corresponding
+ coordinates of specified points.
+
+
+
+
+ Addition operator - adds values of two points.
+
+
+ First point for addition.
+ Second point for addition.
+
+ Returns new point which coordinates equal to sum of corresponding
+ coordinates of specified points.
+
+
+
+
+ Subtraction operator - subtracts values of two points.
+
+
+ Point to subtract from.
+ Point to subtract.
+
+ Returns new point which coordinates equal to difference of corresponding
+ coordinates of specified points.
+
+
+
+
+ Subtraction operator - subtracts values of two points.
+
+
+ Point to subtract from.
+ Point to subtract.
+
+ Returns new point which coordinates equal to difference of corresponding
+ coordinates of specified points.
+
+
+
+
+ Addition operator - adds scalar to the specified point.
+
+
+ Point to increase coordinates of.
+ Value to add to coordinates of the specified point.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point increased by specified value.
+
+
+
+
+ Addition operator - adds scalar to the specified point.
+
+
+ Point to increase coordinates of.
+ Value to add to coordinates of the specified point.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point increased by specified value.
+
+
+
+
+ Subtraction operator - subtracts scalar from the specified point.
+
+
+ Point to decrease coordinates of.
+ Value to subtract from coordinates of the specified point.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point decreased by specified value.
+
+
+
+
+ Subtraction operator - subtracts scalar from the specified point.
+
+
+ Point to decrease coordinates of.
+ Value to subtract from coordinates of the specified point.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point decreased by specified value.
+
+
+
+
+ Multiplication operator - multiplies coordinates of the specified point by scalar value.
+
+
+ Point to multiply coordinates of.
+ Multiplication factor.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point multiplied by specified value.
+
+
+
+
+ Multiplication operator - multiplies coordinates of the specified point by scalar value.
+
+
+ Point to multiply coordinates of.
+ Multiplication factor.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point multiplied by specified value.
+
+
+
+
+ Division operator - divides coordinates of the specified point by scalar value.
+
+
+ Point to divide coordinates of.
+ Division factor.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point divided by specified value.
+
+
+
+
+ Division operator - divides coordinates of the specified point by scalar value.
+
+
+ Point to divide coordinates of.
+ Division factor.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point divided by specified value.
+
+
+
+
+ Equality operator - checks if two points have equal coordinates.
+
+
+ First point to check.
+ Second point to check.
+
+ Returns if coordinates of specified
+ points are equal.
+
+
+
+
+ Inequality operator - checks if two points have different coordinates.
+
+
+ First point to check.
+ Second point to check.
+
+ Returns if coordinates of specified
+ points are not equal.
+
+
+
+
+ Check if this instance of equal to the specified one.
+
+
+ Another point to check equalty to.
+
+ Return if objects are equal.
+
+
+
+
+ Get hash code for this instance.
+
+
+ Returns the hash code for this instance.
+
+
+
+
+ Explicit conversion to .
+
+
+ Single precision point to convert to integer point.
+
+ Returns new integer point which coordinates are explicitly converted
+ to integers from coordinates of the specified single precision point by
+ casting float values to integers value.
+
+
+
+
+ Implicit conversion to .
+
+
+ Single precision point to convert to double precision point.
+
+ Returns new double precision point which coordinates are implicitly converted
+ to doubles from coordinates of the specified single precision point.
+
+
+
+
+ Rounds the single precision point.
+
+
+ Returns new integer point, which coordinates equal to whole numbers
+ nearest to the corresponding coordinates of the single precision point.
+
+
+
+
+ Get string representation of the class.
+
+
+ Returns string, which contains values of the point in readable form.
+
+
+
+
+ Calculate Euclidean norm of the vector comprised of the point's
+ coordinates - distance from (0, 0) in other words.
+
+
+ Returns point's distance from (0, 0) point.
+
+
+
+
+ Represents an integer range with minimum and maximum values.
+
+
+
+ The class represents an integer range with inclusive limits -
+ both minimum and maximum values of the range are included into it.
+ Mathematical notation of such range is [min, max].
+
+ Sample usage:
+
+ // create [1, 10] range
+ IntRange range1 = new IntRange( 1, 10 );
+ // create [5, 15] range
+ IntRange range2 = new IntRange( 5, 15 );
+ // check if values is inside of the first range
+ if ( range1.IsInside( 7 ) )
+ {
+ // ...
+ }
+ // check if the second range is inside of the first range
+ if ( range1.IsInside( range2 ) )
+ {
+ // ...
+ }
+ // check if two ranges overlap
+ if ( range1.IsOverlapping( range2 ) )
+ {
+ // ...
+ }
+
+
+
+
+
+
+ Initializes a new instance of the structure.
+
+
+ Minimum value of the range.
+ Maximum value of the range.
+
+
+
+
+ Check if the specified value is inside of the range.
+
+
+ Value to check.
+
+ True if the specified value is inside of the range or
+ false otherwise.
+
+
+
+
+ Check if the specified range is inside of the range.
+
+
+ Range to check.
+
+ True if the specified range is inside of the range or
+ false otherwise.
+
+
+
+
+ Check if the specified range overlaps with the range.
+
+
+ Range to check for overlapping.
+
+ True if the specified range overlaps with the range or
+ false otherwise.
+
+
+
+
+ Implicit conversion to .
+
+
+ Integer range to convert to single precision range.
+
+ Returns new single precision range which min/max values are implicitly converted
+ to floats from min/max values of the specified integer range.
+
+
+
+
+ Equality operator - checks if two ranges have equal min/max values.
+
+
+ First range to check.
+ Second range to check.
+
+ Returns if min/max values of specified
+ ranges are equal.
+
+
+
+
+ Inequality operator - checks if two ranges have different min/max values.
+
+
+ First range to check.
+ Second range to check.
+
+ Returns if min/max values of specified
+ ranges are not equal.
+
+
+
+
+ Check if this instance of equal to the specified one.
+
+
+ Another range to check equalty to.
+
+ Return if objects are equal.
+
+
+
+
+ Get hash code for this instance.
+
+
+ Returns the hash code for this instance.
+
+
+
+
+ Get string representation of the class.
+
+
+ Returns string, which contains min/max values of the range in readable form.
+
+
+
+
+ Minimum value of the range.
+
+
+ The property represents minimum value (left side limit) or the range -
+ [min, max].
+
+
+
+
+ Maximum value of the range.
+
+
+ The property represents maximum value (right side limit) or the range -
+ [min, max].
+
+
+
+
+ Length of the range (deffirence between maximum and minimum values).
+
+
+
+
+ Thread safe version of the class.
+
+
+ The class inherits the and overrides
+ its random numbers generation methods providing thread safety by guarding call
+ to the base class with a lock. See documentation to for
+ additional information about the base class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ See for more information.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ A number used to calculate a starting value for the pseudo-random number sequence.
+ If a negative number is specified, the absolute value of the number is used.
+
+
+ See for more information.
+
+
+
+
+ Returns a nonnegative random number.
+
+
+ Returns a 32-bit signed integer greater than or equal to zero and less than
+ .
+
+ See for more information.
+
+
+
+
+ Returns a nonnegative random number less than the specified maximum.
+
+
+ The exclusive upper bound of the random number to be generated.
+ must be greater than or equal to zero.
+
+ Returns a 32-bit signed integer greater than or equal to zero, and less than ;
+ that is, the range of return values ordinarily includes zero but not .
+
+ See for more information.
+
+
+
+
+ Returns a random number within a specified range.
+
+
+ The inclusive lower bound of the random number returned.
+ The exclusive upper bound of the random number returned.
+ must be greater than or equal to .
+
+ Returns a 32-bit signed integer greater than or equal to and less
+ than ; that is, the range of return values includes
+ but not .
+
+ See for more information.
+
+
+
+
+ Fills the elements of a specified array of bytes with random numbers.
+
+
+ An array of bytes to contain random numbers.
+
+ See for more information.
+
+
+
+
+ Returns a random number between 0.0 and 1.0.
+
+
+ Returns a double-precision floating point number greater than or equal to 0.0, and less than 1.0.
+
+ See for more information.
+
+
+
+
+ Represents a range with minimum and maximum values, which are single precision numbers (floats).
+
+
+
+ The class represents a single precision range with inclusive limits -
+ both minimum and maximum values of the range are included into it.
+ Mathematical notation of such range is [min, max].
+
+ Sample usage:
+
+ // create [0.25, 1.5] range
+ Range range1 = new Range( 0.25f, 1.5f );
+ // create [1.00, 2.25] range
+ Range range2 = new Range( 1.00f, 2.25f );
+ // check if values is inside of the first range
+ if ( range1.IsInside( 0.75f ) )
+ {
+ // ...
+ }
+ // check if the second range is inside of the first range
+ if ( range1.IsInside( range2 ) )
+ {
+ // ...
+ }
+ // check if two ranges overlap
+ if ( range1.IsOverlapping( range2 ) )
+ {
+ // ...
+ }
+
+
+
+
+
+
+ Initializes a new instance of the structure.
+
+
+ Minimum value of the range.
+ Maximum value of the range.
+
+
+
+
+ Check if the specified value is inside of the range.
+
+
+ Value to check.
+
+ True if the specified value is inside of the range or
+ false otherwise.
+
+
+
+
+ Check if the specified range is inside of the range.
+
+
+ Range to check.
+
+ True if the specified range is inside of the range or
+ false otherwise.
+
+
+
+
+ Check if the specified range overlaps with the range.
+
+
+ Range to check for overlapping.
+
+ True if the specified range overlaps with the range or
+ false otherwise.
+
+
+
+
+ Convert the signle precision range to integer range.
+
+
+ Specifies if inner integer range must be returned or outer range.
+
+ Returns integer version of the range.
+
+ If is set to , then the
+ returned integer range will always fit inside of the current single precision range.
+ If it is set to , then current single precision range will always
+ fit into the returned integer range.
+
+
+
+
+ Equality operator - checks if two ranges have equal min/max values.
+
+
+ First range to check.
+ Second range to check.
+
+ Returns if min/max values of specified
+ ranges are equal.
+
+
+
+
+ Inequality operator - checks if two ranges have different min/max values.
+
+
+ First range to check.
+ Second range to check.
+
+ Returns if min/max values of specified
+ ranges are not equal.
+
+
+
+
+ Check if this instance of equal to the specified one.
+
+
+ Another range to check equalty to.
+
+ Return if objects are equal.
+
+
+
+
+ Get hash code for this instance.
+
+
+ Returns the hash code for this instance.
+
+
+
+
+ Get string representation of the class.
+
+
+ Returns string, which contains min/max values of the range in readable form.
+
+
+
+
+ Minimum value of the range.
+
+
+ The property represents minimum value (left side limit) or the range -
+ [min, max].
+
+
+
+
+ Maximum value of the range.
+
+
+ The property represents maximum value (right side limit) or the range -
+ [min, max].
+
+
+
+
+ Length of the range (deffirence between maximum and minimum values).
+
+
+
+
+ The class provides support for parallel computations, paralleling loop's iterations.
+
+
+ The class allows to parallel loop's iteration computing them in separate threads,
+ what allows their simultaneous execution on multiple CPUs/cores.
+
+
+
+
+
+ Executes a for-loop in which iterations may run in parallel.
+
+
+ Loop's start index.
+ Loop's stop index.
+ Loop's body.
+
+ The method is used to parallel for-loop running its iterations in
+ different threads. The start and stop parameters define loop's
+ starting and ending loop's indexes. The number of iterations is equal to stop - start.
+
+
+ Sample usage:
+
+ Parallel.For( 0, 20, delegate( int i )
+ // which is equivalent to
+ // for ( int i = 0; i < 20; i++ )
+ {
+ System.Diagnostics.Debug.WriteLine( "Iteration: " + i );
+ // ...
+ } );
+
+
+
+
+
+
+ Number of threads used for parallel computations.
+
+
+ The property sets how many worker threads are created for paralleling
+ loops' computations.
+
+ By default the property is set to number of CPU's in the system
+ (see ).
+
+
+
+
+
+ Delegate defining for-loop's body.
+
+
+ Loop's index.
+
+
+
+
+ Set of systems tools.
+
+
+ The class is a container of different system tools, which are used
+ across the framework. Some of these tools are platform specific, so their
+ implementation is different on different platform, like .NET and Mono.
+
+
+
+
+
+ Copy block of unmanaged memory.
+
+
+ Destination pointer.
+ Source pointer.
+ Memory block's length to copy.
+
+ Return's value of - pointer to destination.
+
+ This function is required because of the fact that .NET does
+ not provide any way to copy unmanaged blocks, but provides only methods to
+ copy from unmanaged memory to managed memory and vise versa.
+
+
+
+
+ Copy block of unmanaged memory.
+
+
+ Destination pointer.
+ Source pointer.
+ Memory block's length to copy.
+
+ Return's value of - pointer to destination.
+
+ This function is required because of the fact that .NET does
+ not provide any way to copy unmanaged blocks, but provides only methods to
+ copy from unmanaged memory to managed memory and vise versa.
+
+
+
+
+ Fill memory region with specified value.
+
+
+ Destination pointer.
+ Filler byte's value.
+ Memory block's length to fill.
+
+ Return's value of - pointer to destination.
+
+
+
+
+ Fill memory region with specified value.
+
+
+ Destination pointer.
+ Filler byte's value.
+ Memory block's length to fill.
+
+ Return's value of - pointer to destination.
+
+
+
+
+ Connection failed exception.
+
+
+ The exception is thrown in the case if connection to device
+ has failed.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Exception's message.
+
+
+
+
+ Connection lost exception.
+
+
+ The exception is thrown in the case if connection to device
+ is lost. When the exception is caught, user may need to reconnect to the device.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Exception's message.
+
+
+
+
+ Not connected exception.
+
+
+ The exception is thrown in the case if connection to device
+ is not established, but user requests for its services.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Exception's message.
+
+
+
+
+ Device busy exception.
+
+
+ The exception is thrown in the case if access to certain device
+ is not available due to the fact that it is currently busy handling other request/connection.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Exception's message.
+
+
+
+
+ Device error exception.
+
+
+ The exception is thrown in the case if some error happens with a device, which
+ may need to be reported to user.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Exception's message.
+
+
+
+
+ Structure for representing a pair of coordinates of double type.
+
+
+ The structure is used to store a pair of floating point
+ coordinates with double precision.
+
+ Sample usage:
+
+ // assigning coordinates in the constructor
+ DoublePoint p1 = new DoublePoint( 10, 20 );
+ // creating a point and assigning coordinates later
+ DoublePoint p2;
+ p2.X = 30;
+ p2.Y = 40;
+ // calculating distance between two points
+ double distance = p1.DistanceTo( p2 );
+
+
+
+
+
+
+ X coordinate.
+
+
+
+
+
+ Y coordinate.
+
+
+
+
+
+ Initializes a new instance of the structure.
+
+
+ X axis coordinate.
+ Y axis coordinate.
+
+
+
+
+ Calculate Euclidean distance between two points.
+
+
+ Point to calculate distance to.
+
+ Returns Euclidean distance between this point and
+ points.
+
+
+
+
+ Calculate squared Euclidean distance between two points.
+
+
+ Point to calculate distance to.
+
+ Returns squared Euclidean distance between this point and
+ points.
+
+
+
+
+ Addition operator - adds values of two points.
+
+
+ First point for addition.
+ Second point for addition.
+
+ Returns new point which coordinates equal to sum of corresponding
+ coordinates of specified points.
+
+
+
+
+ Addition operator - adds values of two points.
+
+
+ First point for addition.
+ Second point for addition.
+
+ Returns new point which coordinates equal to sum of corresponding
+ coordinates of specified points.
+
+
+
+
+ Subtraction operator - subtracts values of two points.
+
+
+ Point to subtract from.
+ Point to subtract.
+
+ Returns new point which coordinates equal to difference of corresponding
+ coordinates of specified points.
+
+
+
+
+ Subtraction operator - subtracts values of two points.
+
+
+ Point to subtract from.
+ Point to subtract.
+
+ Returns new point which coordinates equal to difference of corresponding
+ coordinates of specified points.
+
+
+
+
+ Addition operator - adds scalar to the specified point.
+
+
+ Point to increase coordinates of.
+ Value to add to coordinates of the specified point.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point increased by specified value.
+
+
+
+
+ Addition operator - adds scalar to the specified point.
+
+
+ Point to increase coordinates of.
+ Value to add to coordinates of the specified point.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point increased by specified value.
+
+
+
+
+ Subtraction operator - subtracts scalar from the specified point.
+
+
+ Point to decrease coordinates of.
+ Value to subtract from coordinates of the specified point.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point decreased by specified value.
+
+
+
+
+ Subtraction operator - subtracts scalar from the specified point.
+
+
+ Point to decrease coordinates of.
+ Value to subtract from coordinates of the specified point.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point decreased by specified value.
+
+
+
+
+ Multiplication operator - multiplies coordinates of the specified point by scalar value.
+
+
+ Point to multiply coordinates of.
+ Multiplication factor.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point multiplied by specified value.
+
+
+
+
+ Multiplication operator - multiplies coordinates of the specified point by scalar value.
+
+
+ Point to multiply coordinates of.
+ Multiplication factor.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point multiplied by specified value.
+
+
+
+
+ Division operator - divides coordinates of the specified point by scalar value.
+
+
+ Point to divide coordinates of.
+ Division factor.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point divided by specified value.
+
+
+
+
+ Division operator - divides coordinates of the specified point by scalar value.
+
+
+ Point to divide coordinates of.
+ Division factor.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point divided by specified value.
+
+
+
+
+ Equality operator - checks if two points have equal coordinates.
+
+
+ First point to check.
+ Second point to check.
+
+ Returns if coordinates of specified
+ points are equal.
+
+
+
+
+ Inequality operator - checks if two points have different coordinates.
+
+
+ First point to check.
+ Second point to check.
+
+ Returns if coordinates of specified
+ points are not equal.
+
+
+
+
+ Check if this instance of equal to the specified one.
+
+
+ Another point to check equalty to.
+
+ Return if objects are equal.
+
+
+
+
+ Get hash code for this instance.
+
+
+ Returns the hash code for this instance.
+
+
+
+
+ Explicit conversion to .
+
+
+ Double precision point to convert to integer point.
+
+ Returns new integer point which coordinates are explicitly converted
+ to integers from coordinates of the specified double precision point by
+ casting double values to integers value.
+
+
+
+
+ Explicit conversion to .
+
+
+ Double precision point to convert to single precision point.
+
+ Returns new single precision point which coordinates are explicitly converted
+ to floats from coordinates of the specified double precision point by
+ casting double values to float value.
+
+
+
+
+ Rounds the double precision point.
+
+
+ Returns new integer point, which coordinates equal to whole numbers
+ nearest to the corresponding coordinates of the double precision point.
+
+
+
+
+ Get string representation of the class.
+
+
+ Returns string, which contains values of the point in readable form.
+
+
+
+
+ Calculate Euclidean norm of the vector comprised of the point's
+ coordinates - distance from (0, 0) in other words.
+
+
+ Returns point's distance from (0, 0) point.
+
+
+
+
diff --git a/Part 1 - Record Video/bin/Debug/HCI Assignment 1.exe b/Part 1 - Record Video/bin/Debug/HCI Assignment 1.exe
new file mode 100644
index 0000000..b1c35e7
Binary files /dev/null and b/Part 1 - Record Video/bin/Debug/HCI Assignment 1.exe differ
diff --git a/Part 1 - Record Video/bin/Debug/HCI Assignment 1.exe.CodeAnalysisLog.xml b/Part 1 - Record Video/bin/Debug/HCI Assignment 1.exe.CodeAnalysisLog.xml
new file mode 100644
index 0000000..cf79e4e
--- /dev/null
+++ b/Part 1 - Record Video/bin/Debug/HCI Assignment 1.exe.CodeAnalysisLog.xml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 'RecordVideo' contains field 'RecordVideo.saveVideo' that is of IDisposable type: 'AVIWriter'. Change the Dispose method on 'RecordVideo' to call Dispose or Close on this field.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Disposable fields should be disposed
+ If a type that implements IDisposable owns fields that also implement IDisposable, the encapsulating type's Dispose() implementation should call Dispose() on each disposable field.
+ {0} contains field {1} that is of IDisposable type: {2}. Change the Dispose method on {0} to call Dispose or Close on this field.
+
+ http://msdn.microsoft.com/library/ms182328.aspx
+ [none]
+ Warning
+
+
+
+
+ Category
+ Certainty
+ Collapse All
+ Check Id
+ Error
+ error(s)
+ Expand All
+ Help
+ Line
+ message(s)
+ [Location not stored in Pdb]
+ Project
+ Resolution
+ Rule
+ Rule File
+ Rule Description
+ Source
+ Status
+ Target
+ Warning
+ warning(s)
+ Code Analysis Report
+
+
diff --git a/Part 1 - Record Video/bin/Debug/HCI Assignment 1.exe.config b/Part 1 - Record Video/bin/Debug/HCI Assignment 1.exe.config
new file mode 100644
index 0000000..9c05822
--- /dev/null
+++ b/Part 1 - Record Video/bin/Debug/HCI Assignment 1.exe.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Part 1 - Record Video/bin/Debug/HCI Assignment 1.exe.lastcodeanalysissucceeded b/Part 1 - Record Video/bin/Debug/HCI Assignment 1.exe.lastcodeanalysissucceeded
new file mode 100644
index 0000000..e69de29
diff --git a/Part 1 - Record Video/bin/Debug/HCI Assignment 1.pdb b/Part 1 - Record Video/bin/Debug/HCI Assignment 1.pdb
new file mode 100644
index 0000000..1cd8a34
Binary files /dev/null and b/Part 1 - Record Video/bin/Debug/HCI Assignment 1.pdb differ
diff --git a/Part 1 - Record Video/bin/Debug/HCI Assignment 1.vshost.exe b/Part 1 - Record Video/bin/Debug/HCI Assignment 1.vshost.exe
new file mode 100644
index 0000000..666c0af
Binary files /dev/null and b/Part 1 - Record Video/bin/Debug/HCI Assignment 1.vshost.exe differ
diff --git a/Part 1 - Record Video/bin/Debug/HCI Assignment 1.vshost.exe.config b/Part 1 - Record Video/bin/Debug/HCI Assignment 1.vshost.exe.config
new file mode 100644
index 0000000..9c05822
--- /dev/null
+++ b/Part 1 - Record Video/bin/Debug/HCI Assignment 1.vshost.exe.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Part 1 - Record Video/bin/Debug/HCI Assignment 1.vshost.exe.manifest b/Part 1 - Record Video/bin/Debug/HCI Assignment 1.vshost.exe.manifest
new file mode 100644
index 0000000..061c9ca
--- /dev/null
+++ b/Part 1 - Record Video/bin/Debug/HCI Assignment 1.vshost.exe.manifest
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Part 1 - Record Video/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/Part 1 - Record Video/obj/Debug/DesignTimeResolveAssemblyReferences.cache
new file mode 100644
index 0000000..0bde688
Binary files /dev/null and b/Part 1 - Record Video/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ
diff --git a/Part 1 - Record Video/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/Part 1 - Record Video/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..601339e
Binary files /dev/null and b/Part 1 - Record Video/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/Part 1 - Record Video/obj/Debug/HCI Assignment 1.csproj.FileListAbsolute.txt b/Part 1 - Record Video/obj/Debug/HCI Assignment 1.csproj.FileListAbsolute.txt
new file mode 100644
index 0000000..180835d
--- /dev/null
+++ b/Part 1 - Record Video/obj/Debug/HCI Assignment 1.csproj.FileListAbsolute.txt
@@ -0,0 +1,28 @@
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\HCI Assignment 1.exe.config
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\HCI Assignment 1.exe
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\HCI Assignment 1.pdb
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\HCI Assignment 1.exe.CodeAnalysisLog.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\HCI Assignment 1.exe.lastcodeanalysissucceeded
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Video.DirectShow.dll
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Video.dll
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Video.FFMPEG.dll
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Video.Kinect.dll
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Video.VFW.dll
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Video.Ximea.dll
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.dll
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Imaging.dll
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Math.dll
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Video.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Video.DirectShow.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Video.FFMPEG.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Video.Kinect.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Video.VFW.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Video.Ximea.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Imaging.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Math.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\obj\Debug\HCI_Assignment_1.RecordVideo.resources
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\obj\Debug\HCI_Assignment_1.Properties.Resources.resources
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\obj\Debug\HCI Assignment 1.csproj.GenerateResource.Cache
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\obj\Debug\HCI Assignment 1.exe
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\obj\Debug\HCI Assignment 1.pdb
diff --git a/Part 1 - Record Video/obj/Debug/HCI Assignment 1.csproj.GenerateResource.Cache b/Part 1 - Record Video/obj/Debug/HCI Assignment 1.csproj.GenerateResource.Cache
new file mode 100644
index 0000000..d19efef
Binary files /dev/null and b/Part 1 - Record Video/obj/Debug/HCI Assignment 1.csproj.GenerateResource.Cache differ
diff --git a/Part 1 - Record Video/obj/Debug/HCI Assignment 1.exe b/Part 1 - Record Video/obj/Debug/HCI Assignment 1.exe
new file mode 100644
index 0000000..b1c35e7
Binary files /dev/null and b/Part 1 - Record Video/obj/Debug/HCI Assignment 1.exe differ
diff --git a/Part 1 - Record Video/obj/Debug/HCI Assignment 1.pdb b/Part 1 - Record Video/obj/Debug/HCI Assignment 1.pdb
new file mode 100644
index 0000000..1cd8a34
Binary files /dev/null and b/Part 1 - Record Video/obj/Debug/HCI Assignment 1.pdb differ
diff --git a/Part 1 - Record Video/obj/Debug/HCI_Assignment_1.Properties.Resources.resources b/Part 1 - Record Video/obj/Debug/HCI_Assignment_1.Properties.Resources.resources
new file mode 100644
index 0000000..6c05a97
Binary files /dev/null and b/Part 1 - Record Video/obj/Debug/HCI_Assignment_1.Properties.Resources.resources differ
diff --git a/Part 1 - Record Video/obj/Debug/HCI_Assignment_1.RecordVideo.resources b/Part 1 - Record Video/obj/Debug/HCI_Assignment_1.RecordVideo.resources
new file mode 100644
index 0000000..6c05a97
Binary files /dev/null and b/Part 1 - Record Video/obj/Debug/HCI_Assignment_1.RecordVideo.resources differ
diff --git a/Part 1 - Record Video/obj/Debug/Part 1 - Record a Video.csproj.FileListAbsolute.txt b/Part 1 - Record Video/obj/Debug/Part 1 - Record a Video.csproj.FileListAbsolute.txt
new file mode 100644
index 0000000..5ab8185
--- /dev/null
+++ b/Part 1 - Record Video/obj/Debug/Part 1 - Record a Video.csproj.FileListAbsolute.txt
@@ -0,0 +1,55 @@
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\HCI Assignment 1.exe.config
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\HCI Assignment 1.exe
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\HCI Assignment 1.pdb
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Video.DirectShow.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Video.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Video.FFMPEG.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Video.Kinect.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Video.VFW.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Video.Ximea.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Imaging.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Math.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Video.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Video.DirectShow.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Video.FFMPEG.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Video.Kinect.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Video.VFW.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Video.Ximea.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Imaging.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\bin\Debug\AForge.Math.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\obj\Debug\HCI_Assignment_1.RecordVideo.resources
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\obj\Debug\HCI_Assignment_1.Properties.Resources.resources
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\obj\Debug\Part 1 - Record a Video.csproj.GenerateResource.Cache
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\obj\Debug\HCI Assignment 1.exe
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 1\obj\Debug\HCI Assignment 1.pdb
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\bin\Debug\HCI Assignment 1.exe.config
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\bin\Debug\HCI Assignment 1.exe
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\bin\Debug\HCI Assignment 1.pdb
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\bin\Debug\AForge.Video.DirectShow.dll
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\bin\Debug\AForge.Video.dll
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\bin\Debug\AForge.Video.FFMPEG.dll
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\bin\Debug\AForge.Video.Kinect.dll
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\bin\Debug\AForge.Video.VFW.dll
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\bin\Debug\AForge.Video.Ximea.dll
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\bin\Debug\AForge.dll
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\bin\Debug\AForge.Imaging.dll
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\bin\Debug\AForge.Math.dll
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\bin\Debug\AForge.Video.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\bin\Debug\AForge.Video.DirectShow.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\bin\Debug\AForge.Video.FFMPEG.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\bin\Debug\AForge.Video.Kinect.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\bin\Debug\AForge.Video.VFW.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\bin\Debug\AForge.Video.Ximea.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\bin\Debug\AForge.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\bin\Debug\AForge.Imaging.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\bin\Debug\AForge.Math.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\obj\Debug\HCI_Assignment_1.RecordVideo.resources
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\obj\Debug\HCI_Assignment_1.Properties.Resources.resources
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\obj\Debug\Part 1 - Record a Video.csproj.GenerateResource.Cache
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\obj\Debug\HCI Assignment 1.exe
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\obj\Debug\HCI Assignment 1.pdb
+C:\Users\muham\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\bin\Debug\HCI Assignment 1.exe.config
+C:\Users\muham\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\obj\Debug\HCI Assignment 1.exe
+C:\Users\muham\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 1 - Record Video\obj\Debug\HCI Assignment 1.pdb
diff --git a/Part 1 - Record Video/obj/Debug/Part 1 - Record a Video.csproj.GenerateResource.Cache b/Part 1 - Record Video/obj/Debug/Part 1 - Record a Video.csproj.GenerateResource.Cache
new file mode 100644
index 0000000..7332ea1
Binary files /dev/null and b/Part 1 - Record Video/obj/Debug/Part 1 - Record a Video.csproj.GenerateResource.Cache differ
diff --git a/Part 1 - Record Video/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs b/Part 1 - Record Video/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
new file mode 100644
index 0000000..e69de29
diff --git a/Part 1 - Record Video/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs b/Part 1 - Record Video/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
new file mode 100644
index 0000000..e69de29
diff --git a/Part 1 - Record Video/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs b/Part 1 - Record Video/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
new file mode 100644
index 0000000..e69de29
diff --git a/Part 1 - Record Video/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache b/Part 1 - Record Video/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache
new file mode 100644
index 0000000..0bde688
Binary files /dev/null and b/Part 1 - Record Video/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache differ
diff --git a/Part 1 - Record Video/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/Part 1 - Record Video/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..1d89c3b
Binary files /dev/null and b/Part 1 - Record Video/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/Part 1 - Record Video/obj/x86/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs b/Part 1 - Record Video/obj/x86/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
new file mode 100644
index 0000000..e69de29
diff --git a/Part 1 - Record Video/obj/x86/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs b/Part 1 - Record Video/obj/x86/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
new file mode 100644
index 0000000..e69de29
diff --git a/Part 1 - Record Video/obj/x86/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs b/Part 1 - Record Video/obj/x86/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
new file mode 100644
index 0000000..e69de29
diff --git a/Part 2 - Take a Snapshot/App.config b/Part 2 - Take a Snapshot/App.config
new file mode 100644
index 0000000..9c05822
--- /dev/null
+++ b/Part 2 - Take a Snapshot/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Part 2 - Take a Snapshot/GetFrame.Designer.cs b/Part 2 - Take a Snapshot/GetFrame.Designer.cs
new file mode 100644
index 0000000..cbe5f58
--- /dev/null
+++ b/Part 2 - Take a Snapshot/GetFrame.Designer.cs
@@ -0,0 +1,128 @@
+namespace HCI_Assignment_2
+{
+ partial class GetFrame
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.label1 = new System.Windows.Forms.Label();
+ this.getImage = new System.Windows.Forms.Button();
+ this.textBox1 = new System.Windows.Forms.TextBox();
+ this.label2 = new System.Windows.Forms.Label();
+ this.button1 = new System.Windows.Forms.Button();
+ this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
+ this.label3 = new System.Windows.Forms.Label();
+ this.SuspendLayout();
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(185, 47);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(47, 13);
+ this.label1.TabIndex = 1;
+ this.label1.Text = "seconds";
+ //
+ // getImage
+ //
+ this.getImage.Location = new System.Drawing.Point(238, 42);
+ this.getImage.Name = "getImage";
+ this.getImage.Size = new System.Drawing.Size(75, 23);
+ this.getImage.TabIndex = 2;
+ this.getImage.Text = "Get Image";
+ this.getImage.UseVisualStyleBackColor = true;
+ this.getImage.Click += new System.EventHandler(this.getImage_Click);
+ //
+ // textBox1
+ //
+ this.textBox1.Location = new System.Drawing.Point(12, 44);
+ this.textBox1.Name = "textBox1";
+ this.textBox1.Size = new System.Drawing.Size(167, 20);
+ this.textBox1.TabIndex = 3;
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(12, 71);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(0, 13);
+ this.label2.TabIndex = 4;
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(12, 12);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(102, 23);
+ this.button1.TabIndex = 5;
+ this.button1.Text = "Select Video File";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // openFileDialog1
+ //
+ this.openFileDialog1.FileName = "openFileDialog1";
+ //
+ // label3
+ //
+ this.label3.AutoSize = true;
+ this.label3.Location = new System.Drawing.Point(120, 17);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(0, 13);
+ this.label3.TabIndex = 6;
+ //
+ // GetFrame
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(326, 92);
+ this.Controls.Add(this.label3);
+ this.Controls.Add(this.button1);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.textBox1);
+ this.Controls.Add(this.getImage);
+ this.Controls.Add(this.label1);
+ this.MaximizeBox = false;
+ this.MaximumSize = new System.Drawing.Size(342, 131);
+ this.MinimumSize = new System.Drawing.Size(342, 131);
+ this.Name = "GetFrame";
+ this.Text = "Snapshot Video";
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Button getImage;
+ private System.Windows.Forms.TextBox textBox1;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.Button button1;
+ private System.Windows.Forms.OpenFileDialog openFileDialog1;
+ private System.Windows.Forms.Label label3;
+ }
+}
+
diff --git a/Part 2 - Take a Snapshot/GetFrame.cs b/Part 2 - Take a Snapshot/GetFrame.cs
new file mode 100644
index 0000000..5ed2057
--- /dev/null
+++ b/Part 2 - Take a Snapshot/GetFrame.cs
@@ -0,0 +1,90 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using AForge.Video;
+using AForge.Video.DirectShow;
+using AForge.Video.FFMPEG;
+using AForge.Video.Kinect;
+using AForge.Video.VFW;
+using HCI_Assignment_2;
+
+namespace HCI_Assignment_2
+{
+ public partial class GetFrame : Form
+ {
+ private string videoFilePath = null;
+ AVIReader savedVideo;
+
+ public GetFrame()
+ {
+ InitializeComponent();
+ }
+
+ private void getImage_Click(object sender, EventArgs e)
+ {
+ string inputText = this.textBox1.Text;
+ if (inputText == "")
+ inputText = "0";
+
+ savedVideo = new AVIReader();
+ if (videoFilePath != null)
+ {
+ savedVideo.Open(videoFilePath);
+ if (Int32.Parse(inputText) * savedVideo.FrameRate <= (savedVideo.Length) )
+ {
+ savedVideo.Position = Int32.Parse(inputText) * (int)savedVideo.FrameRate;
+ Bitmap frame = savedVideo.GetNextFrame();
+
+ //Form picture = new Snapshot(frame);
+ //picture.Show(this);
+
+ frame.Save("snapshot.jpg");
+ label2.Text = "Image Captured!";
+
+ }
+ else
+ label2.Text = "Video is not long enough!!!";
+ }
+ else
+ label3.Text = "Select an .avi File first!";
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ openFileDialog1.Title = "Select an .avi Video File!";
+ openFileDialog1.FileName = "";
+ openFileDialog1.Filter = "*.avi|*.avi";
+ openFileDialog1.Multiselect = false;
+ openFileDialog1.ShowDialog();
+ if (openFileDialog1.FileName != "")
+ {
+ videoFilePath = openFileDialog1.FileName;
+ label3.Text = "File is Selected!";
+ }
+ }
+
+ }
+}
+
+
+
+//float frameRate = savedVideo.FrameRate;
+//int len = savedVideo.Length;
+
+//for (float i = savedVideo.Start; i != savedVideo.Length; i = i + 1)
+//{
+// Bitmap frame = savedVideo.GetNextFrame();
+// if (i == Int32.Parse(inputText) * frameRate)
+// {
+// string position = savedVideo.Position.ToString();
+// frame.Save("snapshot.jpg");
+// label2.Text = "Image Saved!";
+// return;
+// }
+//}
\ No newline at end of file
diff --git a/Part 2 - Take a Snapshot/GetFrame.resx b/Part 2 - Take a Snapshot/GetFrame.resx
new file mode 100644
index 0000000..808406c
--- /dev/null
+++ b/Part 2 - Take a Snapshot/GetFrame.resx
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 16, 14
+
+
\ No newline at end of file
diff --git a/Part 2 - Take a Snapshot/Part 2 - Take a Snapshot.csproj b/Part 2 - Take a Snapshot/Part 2 - Take a Snapshot.csproj
new file mode 100644
index 0000000..6019787
--- /dev/null
+++ b/Part 2 - Take a Snapshot/Part 2 - Take a Snapshot.csproj
@@ -0,0 +1,116 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {8B5A42D2-662F-429B-8CDA-3D01BC55B213}
+ WinExe
+ Properties
+ HCI_Assignment_2
+ HCI Assignment 2
+ v4.5.1
+ 512
+ true
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ E:\University\ANAS 6\Human Computer Interaction\AForge.NET Framework-2.2.5\Release\AForge.Video.dll
+
+
+ E:\University\ANAS 6\Human Computer Interaction\AForge.NET Framework-2.2.5\Release\AForge.Video.DirectShow.dll
+
+
+ E:\University\ANAS 6\Human Computer Interaction\AForge.NET Framework-2.2.5\Release\AForge.Video.FFMPEG.dll
+
+
+ E:\University\ANAS 6\Human Computer Interaction\AForge.NET Framework-2.2.5\Release\AForge.Video.Kinect.dll
+
+
+ E:\University\ANAS 6\Human Computer Interaction\AForge.NET Framework-2.2.5\Release\AForge.Video.VFW.dll
+
+
+ E:\University\ANAS 6\Human Computer Interaction\AForge.NET Framework-2.2.5\Release\AForge.Video.Ximea.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Form
+
+
+ GetFrame.cs
+
+
+
+
+ Form
+
+
+ Snapshot.cs
+
+
+ GetFrame.cs
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+
+ True
+ Resources.resx
+
+
+ Snapshot.cs
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ True
+ Settings.settings
+ True
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Part 2 - Take a Snapshot/Program.cs b/Part 2 - Take a Snapshot/Program.cs
new file mode 100644
index 0000000..0be1cea
--- /dev/null
+++ b/Part 2 - Take a Snapshot/Program.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HCI_Assignment_2
+{
+ static class Program
+ {
+ ///
+ /// The main entry point for the application.
+ ///
+ [STAThread]
+ static void Main()
+ {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new GetFrame());
+ }
+ }
+}
diff --git a/Part 2 - Take a Snapshot/Properties/AssemblyInfo.cs b/Part 2 - Take a Snapshot/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..244f4d3
--- /dev/null
+++ b/Part 2 - Take a Snapshot/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HCI Assignment 2")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HCI Assignment 2")]
+[assembly: AssemblyCopyright("Copyright © 2016")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("6281751f-9239-4d51-9e45-522d9aee41ae")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Part 2 - Take a Snapshot/Properties/Resources.Designer.cs b/Part 2 - Take a Snapshot/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..f9a3afe
--- /dev/null
+++ b/Part 2 - Take a Snapshot/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace HCI_Assignment_2.Properties
+{
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HCI_Assignment_2.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/Part 2 - Take a Snapshot/Properties/Resources.resx b/Part 2 - Take a Snapshot/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/Part 2 - Take a Snapshot/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Part 2 - Take a Snapshot/Properties/Settings.Designer.cs b/Part 2 - Take a Snapshot/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..65454e9
--- /dev/null
+++ b/Part 2 - Take a Snapshot/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace HCI_Assignment_2.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/Part 2 - Take a Snapshot/Properties/Settings.settings b/Part 2 - Take a Snapshot/Properties/Settings.settings
new file mode 100644
index 0000000..3964565
--- /dev/null
+++ b/Part 2 - Take a Snapshot/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/Part 2 - Take a Snapshot/Snapshot.Designer.cs b/Part 2 - Take a Snapshot/Snapshot.Designer.cs
new file mode 100644
index 0000000..21fc7a7
--- /dev/null
+++ b/Part 2 - Take a Snapshot/Snapshot.Designer.cs
@@ -0,0 +1,77 @@
+namespace HCI_Assignment_2
+{
+ partial class Snapshot
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.pictureBox1 = new System.Windows.Forms.PictureBox();
+ this.button1 = new System.Windows.Forms.Button();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
+ this.SuspendLayout();
+ //
+ // pictureBox1
+ //
+ this.pictureBox1.Location = new System.Drawing.Point(11, 10);
+ this.pictureBox1.Name = "pictureBox1";
+ this.pictureBox1.Size = new System.Drawing.Size(640, 480);
+ this.pictureBox1.TabIndex = 0;
+ this.pictureBox1.TabStop = false;
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(539, 496);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(112, 23);
+ this.button1.TabIndex = 1;
+ this.button1.Text = "Save Image";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // Snapshot
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(663, 528);
+ this.Controls.Add(this.button1);
+ this.Controls.Add(this.pictureBox1);
+ this.MaximizeBox = false;
+ this.MaximumSize = new System.Drawing.Size(679, 567);
+ this.MinimizeBox = false;
+ this.MinimumSize = new System.Drawing.Size(679, 567);
+ this.Name = "Snapshot";
+ this.Text = "Snapshot";
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.PictureBox pictureBox1;
+ private System.Windows.Forms.Button button1;
+ }
+}
\ No newline at end of file
diff --git a/Part 2 - Take a Snapshot/Snapshot.cs b/Part 2 - Take a Snapshot/Snapshot.cs
new file mode 100644
index 0000000..04149e3
--- /dev/null
+++ b/Part 2 - Take a Snapshot/Snapshot.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HCI_Assignment_2
+{
+ public partial class Snapshot : Form
+ {
+
+ public Snapshot(Bitmap picture)
+ {
+ pictureBox1 = new PictureBox();
+ pictureBox1.Height = 480;
+ pictureBox1.Width = 640;
+ pictureBox1.BackgroundImage = (Bitmap)picture.Clone();
+
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ if (pictureBox1.Image != null)
+ pictureBox1.Image.Save("snapshot.jpg");
+ }
+ }
+}
diff --git a/Part 2 - Take a Snapshot/Snapshot.resx b/Part 2 - Take a Snapshot/Snapshot.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/Part 2 - Take a Snapshot/Snapshot.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Part 2 - Take a Snapshot/bin/Debug/AForge.Imaging.dll b/Part 2 - Take a Snapshot/bin/Debug/AForge.Imaging.dll
new file mode 100644
index 0000000..150e87d
Binary files /dev/null and b/Part 2 - Take a Snapshot/bin/Debug/AForge.Imaging.dll differ
diff --git a/Part 2 - Take a Snapshot/bin/Debug/AForge.Imaging.xml b/Part 2 - Take a Snapshot/bin/Debug/AForge.Imaging.xml
new file mode 100644
index 0000000..bd85baf
--- /dev/null
+++ b/Part 2 - Take a Snapshot/bin/Debug/AForge.Imaging.xml
@@ -0,0 +1,19015 @@
+
+
+
+ AForge.Imaging
+
+
+
+
+ Corners detector's interface.
+
+
+ The interface specifies set of methods, which should be implemented by different
+ corners detection algorithms.
+
+
+
+
+ Process image looking for corners.
+
+
+ Source image to process.
+
+ Returns list of found corners (X-Y coordinates).
+
+
+
+
+ Process image looking for corners.
+
+
+ Source image data to process.
+
+ Returns list of found corners (X-Y coordinates).
+
+
+
+
+ Process image looking for corners.
+
+
+ Unmanaged source image to process.
+
+ Returns list of found corners (X-Y coordinates).
+
+
+
+
+ Shrink an image by removing specified color from its boundaries.
+
+
+ Removes pixels with specified color from image boundaries making
+ the image smaller in size.
+
+ The filter accepts 8 bpp grayscale and 24 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Shrink filter = new Shrink( Color.Black );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Base class for filters, which may produce new image of different size as a
+ result of image processing.
+
+
+ The abstract class is the base class for all filters, which
+ do image processing creating new image of the size, which may differ from the
+ size of source image. Filters based on this class cannot be applied directly
+ to the source image, which is kept unchanged.
+
+ The base class itself does not define supported pixel formats of source
+ image and resulting pixel formats of destination image. Filters inheriting from
+ this base class, should specify supported pixel formats and their transformations
+ overriding abstract property.
+
+
+
+
+
+ Image processing filter interface.
+
+
+ The interface defines the set of methods, which should be
+ provided by all image processing filters. Methods of this interface
+ keep the source image unchanged and returt the result of image processing
+ filter as new image.
+
+
+
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The filter accepts bitmap data as input and returns the result
+ of image processing filter as new image. The source image data are kept
+ unchanged.
+
+
+
+
+ Apply filter to an image.
+
+
+ Image in unmanaged memory.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to be processed.
+ Destination image to store filter's result.
+
+ The method keeps the source image unchanged and puts the
+ the result of image processing filter into destination image.
+
+ The destination image must have the size, which is expected by
+ the filter.
+
+
+ In the case if destination image has incorrect
+ size.
+
+
+
+
+ Interface which provides information about image processing filter.
+
+
+ The interface defines set of properties, which provide different type
+ of information about image processing filters implementing interface
+ or another filter's interface.
+
+
+
+
+ Format translations dictionary.
+
+
+ The dictionary defines, which pixel formats are supported for
+ source images and which pixel format will be used for resulting image.
+
+
+ Keys of this dictionary defines all pixel formats which are supported for source
+ images, but corresponding values define what will be resulting pixel format. For
+ example, if value Format16bppGrayScale
+ is put into the dictionary with the
+ Format48bppRgb key, then it means
+ that the filter accepts color 48 bpp image and produces 16 bpp grayscale image as a result
+ of image processing.
+
+ The information provided by this property is mostly actual for filters, which can not
+ be applied directly to the source image, but provide new image a result. Since usually all
+ filters implement interface, the information provided by this property
+ (if filter also implements interface) may be useful to
+ user to resolve filter's capabilities.
+
+ Sample usage:
+
+ // get filter's IFilterInformation interface
+ IFilterInformation info = (IFilterInformation) filter;
+ // check if the filter supports our image's format
+ if ( info.FormatTranslations.ContainsKey( image.PixelFormat )
+ {
+ // format is supported, check what will be result of image processing
+ PixelFormat resultingFormat = info.FormatTranslations[image.PixelFormat];
+ }
+ ///
+
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The filter accepts bitmap data as input and returns the result
+ of image processing filter as new image. The source image data are kept
+ unchanged.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+ Destination image in unmanaged memory to put result into.
+
+ The method keeps the source image unchanged and puts result of image processing
+ into destination image.
+
+ The destination image must have the same width and height as source image. Also
+ destination image must have pixel format, which is expected by particular filter (see
+ property for information about pixel format conversions).
+
+
+ Unsupported pixel format of the source image.
+ Incorrect destination pixel format.
+ Destination image has wrong width and/or height.
+
+
+
+
+ Calculates new image size.
+
+
+ Source image data.
+
+ New image size - size of the destination image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+ The dictionary defines, which pixel formats are supported for
+ source images and which pixel format will be used for resulting image.
+
+
+ See for more information.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Color to remove from boundaries.
+
+
+
+
+ Calculates new image size.
+
+
+ Source image data.
+
+ New image size - size of the destination image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Color to remove from boundaries.
+
+
+
+
+
+ Rotate image using nearest neighbor algorithm.
+
+
+ The class implements image rotation filter using nearest
+ neighbor algorithm, which does not assume any interpolation.
+
+ Rotation is performed in counterclockwise direction.
+
+ The filter accepts 8/16 bpp grayscale images and 24/48 bpp color image
+ for processing.
+
+ Sample usage:
+
+ // create filter - rotate for 30 degrees keeping original image size
+ RotateNearestNeighbor filter = new RotateNearestNeighbor( 30, true );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Base class for image rotation filters.
+
+
+ The abstract class is the base class for all filters,
+ which implement rotating algorithms.
+
+
+
+
+ Rotation angle.
+
+
+
+
+ Keep image size or not.
+
+
+
+
+ Fill color.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Rotation angle.
+
+ This constructor sets property to false.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Rotation angle.
+ Keep image size or not.
+
+
+
+
+ Calculates new image size.
+
+
+ Source image data.
+
+ New image size - size of the destination image.
+
+
+
+
+ Rotation angle, [0, 360].
+
+
+
+
+ Keep image size or not.
+
+
+ The property determines if source image's size will be kept
+ as it is or not. If the value is set to false, then the new image will have
+ new dimension according to rotation angle. If the valus is set to
+ true, then the new image will have the same size, which means that some parts
+ of the image may be clipped because of rotation.
+
+
+
+
+
+ Fill color.
+
+
+ The fill color is used to fill areas of destination image,
+ which don't have corresponsing pixels in source image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Rotation angle.
+
+ This constructor sets property to
+ .
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Rotation angle.
+ Keep image size or not.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Conservative smoothing.
+
+
+ The filter implements conservative smoothing, which is a noise reduction
+ technique that derives its name from the fact that it employs a simple, fast filtering
+ algorithm that sacrifices noise suppression power in order to preserve the high spatial
+ frequency detail (e.g. sharp edges) in an image. It is explicitly designed to remove noise
+ spikes - isolated pixels of exceptionally low or high pixel intensity
+ (salt and pepper noise).
+
+ If the filter finds a pixel which has minimum/maximum value compared to its surrounding
+ pixel, then its value is replaced by minimum/maximum value of those surrounding pixel.
+ For example, lets suppose the filter uses kernel size of 3x3,
+ which means each pixel has 8 surrounding pixel. If pixel's value is smaller than any value
+ of surrounding pixels, then the value of the pixel is replaced by minimum value of those surrounding
+ pixels.
+
+ The filter accepts 8 bpp grayscale images and 24/32 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ ConservativeSmoothing filter = new ConservativeSmoothing( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Base class for filters, which require source image backup to make them applicable to
+ source image (or its part) directly.
+
+
+ The base class is used for filters, which can not do
+ direct manipulations with source image. To make effect of in-place filtering,
+ these filters create a background copy of the original image (done by this
+ base class) and then do manipulations with it putting result back to the original
+ source image.
+
+ The background copy of the source image is created only in the case of in-place
+ filtering. Otherwise background copy is not created - source image is processed and result is
+ put to destination image.
+
+ The base class is for those filters, which support as filtering entire image, as
+ partial filtering of specified rectangle only.
+
+
+
+
+
+ In-place filter interface.
+
+
+ The interface defines the set of methods, which should be
+ implemented by filters, which are capable to do image processing
+ directly on the source image. Not all image processing filters
+ can be applied directly to the source image - only filters, which do not
+ change image's dimension and pixel format, can be applied directly to the
+ source image.
+
+
+
+
+
+
+
+ Apply filter to an image.
+
+
+ Image to apply filter to.
+
+ The method applies filter directly to the provided image data.
+
+
+
+
+ Apply filter to an image.
+
+
+ Image to apply filter to.
+
+ The method applies filter directly to the provided image data.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Image in unmanaged memory.
+
+ The method applies filter directly to the provided image data.
+
+
+
+
+ In-place partial filter interface.
+
+
+ The interface defines the set of methods, which should be
+ implemented by filters, which are capable to do image processing
+ directly on the source image. Not all image processing filters
+ can be applied directly to the source image - only filters, which do not
+ change image dimension and pixel format, can be applied directly to the
+ source image.
+
+ The interface also supports partial image filtering, allowing to specify
+ image rectangle, which should be filtered.
+
+
+
+
+
+
+
+
+ Apply filter to an image or its part.
+
+
+ Image to apply filter to.
+ Image rectangle for processing by filter.
+
+ The method applies filter directly to the provided image data.
+
+
+
+
+ Apply filter to an image or its part.
+
+
+ Image to apply filter to.
+ Image rectangle for processing by filter.
+
+ The method applies filter directly to the provided image data.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Image in unmanaged memory.
+ Image rectangle for processing by filter.
+
+ The method applies filter directly to the provided image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The filter accepts bitmap data as input and returns the result
+ of image processing filter as new image. The source image data are kept
+ unchanged.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+ Destination image in unmanaged memory to put result into.
+
+ The method keeps the source image unchanged and puts result of image processing
+ into destination image.
+
+ The destination image must have the same width and height as source image. Also
+ destination image must have pixel format, which is expected by particular filter (see
+ property for information about pixel format conversions).
+
+
+ Unsupported pixel format of the source image.
+ Incorrect destination pixel format.
+ Destination image has wrong width and/or height.
+
+
+
+
+ Apply filter to an image.
+
+
+ Image to apply filter to.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Image data to apply filter to.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an unmanaged image.
+
+
+ Unmanaged image to apply filter to.
+
+ The method applies the filter directly to the provided source unmanaged image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image or its part.
+
+
+ Image to apply filter to.
+ Image rectangle for processing by the filter.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image or its part.
+
+
+ Image data to apply filter to.
+ Image rectangle for processing by the filter.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an unmanaged image or its part.
+
+
+ Unmanaged image to apply filter to.
+ Image rectangle for processing by the filter.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+ The dictionary defines, which pixel formats are supported for
+ source images and which pixel format will be used for resulting image.
+
+
+ See for more information.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Kernel size.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Kernel size, [3, 25].
+
+
+ Determines the size of pixel's square used for smoothing.
+
+ Default value is set to 3.
+
+ The value should be odd.
+
+
+
+
+
+ Rotate RGB channels.
+
+
+ The filter rotates RGB channels: red channel is replaced with green,
+ green channel is replaced with blue, blue channel is replaced with red.
+
+ The filter accepts 24/32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ RotateChannels filter = new RotateChannels( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Base class for filters, which may be applied directly to the source image or its part.
+
+
+ The abstract class is the base class for all filters, which can
+ be applied to an image producing new image as a result of image processing or
+ applied directly to the source image (or its part) without changing its size and
+ pixel format.
+
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The filter accepts bitmap data as input and returns the result
+ of image processing filter as new image. The source image data are kept
+ unchanged.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+ Destination image in unmanaged memory to put result into.
+
+ The method keeps the source image unchanged and puts result of image processing
+ into destination image.
+
+ The destination image must have the same width and height as source image. Also
+ destination image must have pixel format, which is expected by particular filter (see
+ property for information about pixel format conversions).
+
+
+ Unsupported pixel format of the source image.
+ Incorrect destination pixel format.
+ Destination image has wrong width and/or height.
+
+
+
+
+ Apply filter to an image.
+
+
+ Image to apply filter to.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Image data to apply filter to.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an unmanaged image.
+
+
+ Unmanaged image to apply filter to.
+
+ The method applies the filter directly to the provided source unmanaged image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image or its part.
+
+
+ Image to apply filter to.
+ Image rectangle for processing by the filter.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image or its part.
+
+
+ Image data to apply filter to.
+ Image rectangle for processing by the filter.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an unmanaged image or its part.
+
+
+ Unmanaged image to apply filter to.
+ Image rectangle for processing by the filter.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+ The dictionary defines, which pixel formats are supported for
+ source images and which pixel format will be used for resulting image.
+
+
+ See for more information.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Gamma correction filter.
+
+
+ The filter performs gamma correction
+ of specified image in RGB color space. Each pixels' value is converted using the Vout=Ving
+ equation, where g is gamma value.
+
+ The filter accepts 8 bpp grayscale and 24 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ GammaCorrection filter = new GammaCorrection( 0.5 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Gamma value.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Gamma value, [0.1, 5.0].
+
+
+ Default value is set to 2.2.
+
+
+
+
+ Brightness adjusting in RGB color space.
+
+
+ The filter operates in RGB color space and adjusts
+ pixels' brightness by increasing every pixel's RGB values by the specified
+ adjust value. The filter is based on
+ filter and simply sets all input ranges to (0, 255-) and
+ all output range to (, 255) in the case if the adjust value is positive.
+ If the adjust value is negative, then all input ranges are set to
+ (-, 255 ) and all output ranges are set to
+ ( 0, 255+).
+
+ See documentation for more information about the base filter.
+
+ The filter accepts 8 bpp grayscale and 24/32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ BrightnessCorrection filter = new BrightnessCorrection( -50 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Brightness adjust value.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Brightness adjust value, [-255, 255].
+
+
+ Default value is set to 10, which corresponds to increasing
+ RGB values of each pixel by 10.
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Dithering using Stucki error diffusion.
+
+
+ The filter represents binarization filter, which is based on
+ error diffusion dithering with Stucki coefficients. Error is diffused
+ on 12 neighbor pixels with next coefficients:
+
+ | * | 8 | 4 |
+ | 2 | 4 | 8 | 4 | 2 |
+ | 1 | 2 | 4 | 2 | 1 |
+
+ / 42
+
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ StuckiDithering filter = new StuckiDithering( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Base class for error diffusion dithering, where error is diffused to
+ adjacent neighbor pixels.
+
+
+ The class does error diffusion to adjacent neighbor pixels
+ using specified set of coefficients. These coefficients are represented by
+ 2 dimensional jugged array, where first array of coefficients is for
+ right-standing pixels, but the rest of arrays are for bottom-standing pixels.
+ All arrays except the first one should have odd number of coefficients.
+
+ Suppose that error diffusion coefficients are represented by the next
+ jugged array:
+
+
+ int[][] coefficients = new int[2][] {
+ new int[1] { 7 },
+ new int[3] { 3, 5, 1 }
+ };
+
+
+ The above coefficients are used to diffuse error over the next neighbor
+ pixels (* marks current pixel, coefficients are placed to corresponding
+ neighbor pixels):
+
+ | * | 7 |
+ | 3 | 5 | 1 |
+
+ / 16
+
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ ErrorDiffusionToAdjacentNeighbors filter = new ErrorDiffusionToAdjacentNeighbors(
+ new int[3][] {
+ new int[2] { 5, 3 },
+ new int[5] { 2, 4, 5, 4, 2 },
+ new int[3] { 2, 3, 2 }
+ } );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+
+
+
+
+ Base class for error diffusion dithering.
+
+
+ The class is the base class for binarization algorithms based on
+ error diffusion.
+
+ Binarization with error diffusion in its idea is similar to binarization based on thresholding
+ of pixels' cumulative value (see ). Each pixel is binarized based not only
+ on its own value, but on values of some surrounding pixels. During pixel's binarization, its binarization
+ error is distributed (diffused) to some neighbor pixels with some coefficients. This error diffusion
+ updates neighbor pixels changing their values, what affects their upcoming binarization. Error diffuses
+ only on unprocessed yet neighbor pixels, which are right and bottom pixels usually (in the case if image
+ processing is done from upper left corner to bottom right corner). Binarization error equals
+ to processing pixel value, if it is below threshold value, or pixel value minus 255 otherwise.
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+
+
+
+
+ Current processing X coordinate.
+
+
+
+
+ Current processing Y coordinate.
+
+
+
+
+ Processing X start position.
+
+
+
+
+ Processing Y start position.
+
+
+
+
+ Processing X stop position.
+
+
+
+
+ Processing Y stop position.
+
+
+
+
+ Processing image's stride (line size).
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Do error diffusion.
+
+
+ Current error value.
+ Pointer to current processing pixel.
+
+ All parameters of the image and current processing pixel's coordinates
+ are initialized in protected members.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Threshold value.
+
+
+ Default value is 128.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Diffusion coefficients.
+
+
+
+
+ Do error diffusion.
+
+
+ Current error value.
+ Pointer to current processing pixel.
+
+ All parameters of the image and current processing pixel's coordinates
+ are initialized by base class.
+
+
+
+
+ Diffusion coefficients.
+
+
+ Set of coefficients, which are used for error diffusion to
+ pixel's neighbors.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Interpolation routines.
+
+
+
+
+
+ Bicubic kernel.
+
+
+ X value.
+
+ Bicubic cooefficient.
+
+ The function implements bicubic kernel W(x) as described on
+ Wikipedia
+ (coefficient a is set to -0.5).
+
+
+
+
+ Binary erosion operator from Mathematical Morphology with 3x3 structuring element.
+
+
+ The filter represents an optimized version of
+ filter, which is aimed for binary images (containing black and white pixels) processed
+ with 3x3 structuring element. This makes this filter ideal for removing noise in binary
+ images – it removes all white pixels, which are neighbouring with at least one blank pixel.
+
+
+ See filter, which represents generic version of
+ erosion filter supporting custom structuring elements and wider range of image formats.
+
+ The filter accepts 8 bpp grayscale (binary) images for processing.
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+ Processing rectangle mast be at least 3x3 in size.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Filter iterator.
+
+
+ Filter iterator performs specified amount of filter's iterations.
+ The filter take the specified base filter and applies it
+ to source image specified amount of times.
+
+ The filter itself does not have any restrictions to pixel format of source
+ image. This is set by base filter.
+
+ The filter does image processing using only
+ interface of the specified base filter. This means
+ that this filter may not utilize all potential features of the base filter, like
+ in-place processing (see ) and region based processing
+ (see ). To utilize those features, it is required to
+ do filter's iteration manually.
+
+ Sample usage (morphological thinning):
+
+ // create filter sequence
+ FiltersSequence filterSequence = new FiltersSequence( );
+ // add 8 thinning filters with different structuring elements
+ filterSequence.Add( new HitAndMiss(
+ new short [,] { { 0, 0, 0 }, { -1, 1, -1 }, { 1, 1, 1 } },
+ HitAndMiss.Modes.Thinning ) );
+ filterSequence.Add( new HitAndMiss(
+ new short [,] { { -1, 0, 0 }, { 1, 1, 0 }, { -1, 1, -1 } },
+ HitAndMiss.Modes.Thinning ) );
+ filterSequence.Add( new HitAndMiss(
+ new short [,] { { 1, -1, 0 }, { 1, 1, 0 }, { 1, -1, 0 } },
+ HitAndMiss.Modes.Thinning ) );
+ filterSequence.Add( new HitAndMiss(
+ new short [,] { { -1, 1, -1 }, { 1, 1, 0 }, { -1, 0, 0 } },
+ HitAndMiss.Modes.Thinning ) );
+ filterSequence.Add( new HitAndMiss(
+ new short [,] { { 1, 1, 1 }, { -1, 1, -1 }, { 0, 0, 0 } },
+ HitAndMiss.Modes.Thinning ) );
+ filterSequence.Add( new HitAndMiss(
+ new short [,] { { -1, 1, -1 }, { 0, 1, 1 }, { 0, 0, -1 } },
+ HitAndMiss.Modes.Thinning ) );
+ filterSequence.Add( new HitAndMiss(
+ new short [,] { { 0, -1, 1 }, { 0, 1, 1 }, { 0, -1, 1 } },
+ HitAndMiss.Modes.Thinning ) );
+ filterSequence.Add( new HitAndMiss(
+ new short [,] { { 0, 0, -1 }, { 0, 1, 1 }, { -1, 1, -1 } },
+ HitAndMiss.Modes.Thinning ) );
+ // create filter iterator for 10 iterations
+ FilterIterator filter = new FilterIterator( filterSequence, 10 );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Filter to iterate.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Filter to iterate.
+ Iterations amount.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The filter accepts bitmap data as input and returns the result
+ of image processing filter as new image. The source image data are kept
+ unchanged.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+ Destination image in unmanaged memory to put result into.
+
+ The method keeps the source image unchanged and puts result of image processing
+ into destination image.
+
+ The destination image must have the same width and height as source image. Also
+ destination image must have pixel format, which is expected by particular filter (see
+ property for information about pixel format conversions).
+
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+ The filter provides format translation dictionary taken from
+ filter.
+
+
+
+
+
+ Base filter.
+
+
+ The base filter is the filter to be applied specified amount of iterations to
+ a specified image.
+
+
+
+
+ Iterations amount, [1, 255].
+
+
+ The amount of times to apply specified filter to a specified image.
+
+ Default value is set to 1.
+
+
+
+
+
+ Threshold binarization.
+
+
+ The filter does image binarization using specified threshold value. All pixels
+ with intensities equal or higher than threshold value are converted to white pixels. All other
+ pixels with intensities below threshold value are converted to black pixels.
+
+ The filter accepts 8 and 16 bpp grayscale images for processing.
+
+ Since the filter can be applied as to 8 bpp and to 16 bpp images,
+ the value should be set appropriately to the pixel format.
+ In the case of 8 bpp images the threshold value is in the [0, 255] range, but in the case
+ of 16 bpp images the threshold value is in the [0, 65535] range.
+
+ Sample usage:
+
+ // create filter
+ Threshold filter = new Threshold( 100 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Threshold value.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Threshold value.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Threshold value.
+
+
+ Default value is set to 128.
+
+
+
+
+ Base class for filters, which may be applied directly to the source image.
+
+
+ The abstract class is the base class for all filters, which can
+ be applied to an image producing new image as a result of image processing or
+ applied directly to the source image without changing its size and pixel format.
+
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The filter accepts bitmap data as input and returns the result
+ of image processing filter as new image. The source image data are kept
+ unchanged.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+ Destination image in unmanaged memory to put result into.
+
+ The method keeps the source image unchanged and puts result of image processing
+ into destination image.
+
+ The destination image must have the same width and height as source image. Also
+ destination image must have pixel format, which is expected by particular filter (see
+ property for information about pixel format conversions).
+
+
+ Unsupported pixel format of the source image.
+ Incorrect destination pixel format.
+ Destination image has wrong width and/or height.
+
+
+
+
+ Apply filter to an image.
+
+
+ Image to apply filter to.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Image data to apply filter to.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an unmanaged image.
+
+
+ Unmanaged image to apply filter to.
+
+ The method applies the filter directly to the provided source unmanaged image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+
+
+
+
+ Format translations dictionary.
+
+
+ The dictionary defines, which pixel formats are supported for
+ source images and which pixel format will be used for resulting image.
+
+
+ See for more information.
+
+
+
+
+
+ Add fillter - add pixel values of two images.
+
+
+ The add filter takes two images (source and overlay images)
+ of the same size and pixel format and produces an image, where each pixel equals
+ to the sum value of corresponding pixels from provided images (if sum is greater
+ than maximum allowed value, 255 or 65535, then it is truncated to that maximum).
+
+ The filter accepts 8 and 16 bpp grayscale images and 24, 32, 48 and 64 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Add filter = new Add( overlayImage );
+ // apply the filter
+ Bitmap resultImage = filter.Apply( sourceImage );
+
+
+ Source image:
+
+ Overlay image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Base class for filters, which operate with two images of the same size and format and
+ may be applied directly to the source image.
+
+
+ The abstract class is the base class for all filters, which can
+ be applied to an image producing new image as a result of image processing or
+ applied directly to the source image without changing its size and pixel format.
+
+ The base class is aimed for such type of filters, which require additional image
+ to process the source image. The additional image is set by
+ or property and must have the same size and pixel format
+ as source image. See documentation of particular inherited class for information
+ about overlay image purpose.
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Overlay image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged overlay image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+
+ Source and overlay images have different pixel formats and/or size.
+ Overlay image is not set.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Overlay image data.
+
+ Overlay image size and pixel format is checked by this base class, before
+ passing execution to inherited class.
+
+
+
+
+ Overlay image.
+
+
+
+ The property sets an overlay image, which will be used as the second image required
+ to process source image. See documentation of particular inherited class for information
+ about overlay image purpose.
+
+
+ Overlay image must have the same size and pixel format as source image.
+ Otherwise exception will be generated when filter is applied to source image.
+
+ Setting this property will clear the property -
+ only one overlay image is allowed: managed or unmanaged.
+
+
+
+
+
+ Unmanaged overlay image.
+
+
+
+ The property sets an overlay image, which will be used as the second image required
+ to process source image. See documentation of particular inherited class for information
+ about overlay image purpose.
+
+
+ Overlay image must have the same size and pixel format as source image.
+ Otherwise exception will be generated when filter is applied to source image.
+
+ Setting this property will clear the property -
+ only one overlay image is allowed: managed or unmanaged.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Overlay image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged overlay image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Overlay image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Color dithering using Stucki error diffusion.
+
+
+ The image processing routine represents color dithering algorithm, which is based on
+ error diffusion dithering with Stucki coefficients. Error is diffused
+ on 12 neighbor pixels with next coefficients:
+
+ | * | 8 | 4 |
+ | 2 | 4 | 8 | 4 | 2 |
+ | 1 | 2 | 4 | 2 | 1 |
+
+ / 42
+
+
+ The image processing routine accepts 24/32 bpp color images for processing. As a result this routine
+ produces 4 bpp or 8 bpp indexed image, which depends on size of the specified
+ color table - 4 bpp result for
+ color tables with 16 colors or less; 8 bpp result for larger color tables.
+
+ Sample usage:
+
+ // create color image quantization routine
+ ColorImageQuantizer ciq = new ColorImageQuantizer( new MedianCutQuantizer( ) );
+ // create 64 colors table
+ Color[] colorTable = ciq.CalculatePalette( image, 64 );
+ // create dithering routine
+ StuckiColorDithering dithering = new StuckiColorDithering( );
+ dithering.ColorTable = colorTable;
+ // apply the dithering routine
+ Bitmap newImage = dithering.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Base class for error diffusion color dithering, where error is diffused to
+ adjacent neighbor pixels.
+
+
+ The class does error diffusion to adjacent neighbor pixels
+ using specified set of coefficients. These coefficients are represented by
+ 2 dimensional jugged array, where first array of coefficients is for
+ right-standing pixels, but the rest of arrays are for bottom-standing pixels.
+ All arrays except the first one should have odd number of coefficients.
+
+ Suppose that error diffusion coefficients are represented by the next
+ jugged array:
+
+
+ int[][] coefficients = new int[2][] {
+ new int[1] { 7 },
+ new int[3] { 3, 5, 1 }
+ };
+
+
+ The above coefficients are used to diffuse error over the next neighbor
+ pixels (* marks current pixel, coefficients are placed to corresponding
+ neighbor pixels):
+
+ | * | 7 |
+ | 3 | 5 | 1 |
+
+ / 16
+
+
+ The image processing routine accepts 24/32 bpp color images for processing.
+
+ Sample usage:
+
+ // create dithering routine
+ ColorErrorDiffusionToAdjacentNeighbors dithering = new ColorErrorDiffusionToAdjacentNeighbors(
+ new int[3][] {
+ new int[2] { 5, 3 },
+ new int[5] { 2, 4, 5, 4, 2 },
+ new int[3] { 2, 3, 2 }
+ } );
+ // apply the dithering routine
+ Bitmap newImage = dithering.Apply( image );
+
+
+
+
+
+
+ Base class for error diffusion color dithering.
+
+
+ The class is the base class for color dithering algorithms based on
+ error diffusion.
+
+ Color dithering with error diffusion is based on the idea that each pixel from the specified source
+ image is substituted with a best matching color (or better say with color's index) from the specified color
+ table. However, the error (difference between color value in the source image and the best matching color)
+ is diffused to neighbor pixels of the source image, which affects the way those pixels are substituted by colors
+ from the specified table.
+
+ The image processing routine accepts 24/32 bpp color images for processing. As a result this routine
+ produces 4 bpp or 8 bpp indexed image, which depends on size of the specified color table - 4 bpp result for
+ color tables with 16 colors or less; 8 bpp result for larger color tables.
+
+
+
+
+
+ Current processing X coordinate.
+
+
+
+
+ Current processing Y coordinate.
+
+
+
+
+ Processing image's width.
+
+
+
+
+ Processing image's height.
+
+
+
+
+ Processing image's stride (line size).
+
+
+
+
+ Processing image's pixel size in bytes.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Do error diffusion.
+
+
+ Error value of red component.
+ Error value of green component.
+ Error value of blue component.
+ Pointer to current processing pixel.
+
+ All parameters of the image and current processing pixel's coordinates
+ are initialized in protected members.
+
+
+
+
+ Perform color dithering for the specified image.
+
+
+ Source image to do color dithering for.
+
+ Returns color dithered image. See for information about format of
+ the result image.
+
+ Unsupported pixel format of the source image. It must 24 or 32 bpp color image.
+
+
+
+
+ Perform color dithering for the specified image.
+
+
+ Source image to do color dithering for.
+
+ Returns color dithered image. See for information about format of
+ the result image.
+
+ Unsupported pixel format of the source image. It must 24 or 32 bpp color image.
+
+
+
+
+ Color table to use for image dithering. Must contain 2-256 colors.
+
+
+ Color table size determines format of the resulting image produced by this
+ image processing routine. If color table contains 16 color or less, then result image will have
+ 4 bpp indexed pixel format. If color table contains more than 16 colors, then result image will
+ have 8 bpp indexed pixel format.
+
+ By default the property is initialized with default 16 colors, which are:
+ Black, Dark Blue, Dark Green, Dark Cyan, Dark Red, Dark Magenta, Dark Khaki, Light Gray,
+ Gray, Blue, Green, Cyan, Red, Magenta, Yellow and White.
+
+
+ Color table length must be in the [2, 256] range.
+
+
+
+
+ Use color caching during color dithering or not.
+
+
+ The property specifies if internal cache of already processed colors should be used or not.
+ For each pixel in the original image the color dithering routine does search in target color palette to find
+ the best matching color. To avoid doing the search again and again for already processed colors, the class may
+ use internal dictionary which maps colors of original image to indexes in target color palette.
+
+
+ The property provides a trade off. On one hand it may speedup color dithering routine, but on another
+ hand it increases memory usage. Also cache usage may not be efficient for very small target color tables.
+
+ Default value is set to .
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Diffusion coefficients (see
+ for more information).
+
+
+
+
+ Do error diffusion.
+
+
+ Error value of red component.
+ Error value of green component.
+ Error value of blue component.
+ Pointer to current processing pixel.
+
+ All parameters of the image and current processing pixel's coordinates
+ are initialized by base class.
+
+
+
+
+ Diffusion coefficients.
+
+
+ Set of coefficients, which are used for error diffusion to
+ pixel's neighbors.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Interface which is implemented by different color quantization algorithms.
+
+
+ The interface defines set of methods, which are to be implemented by different
+ color quantization algorithms - algorithms which are aimed to provide reduced color table/palette
+ for a color image.
+
+ See documentation to particular implementation of the interface for additional information
+ about the algorithm.
+
+
+
+
+
+ Process color by a color quantization algorithm.
+
+
+ Color to process.
+
+ Depending on particular implementation of interface,
+ this method may simply process the specified color or store it in internal list for
+ later color palette calculation.
+
+
+
+
+ Get palette of the specified size.
+
+
+ Palette size to return.
+
+ Returns reduced color palette for the accumulated/processed colors.
+
+ The method must be called after continuously calling method and
+ returns reduced color palette for colors accumulated/processed so far.
+
+
+
+
+ Clear internals of the algorithm, like accumulated color table, etc.
+
+
+ The methods resets internal state of a color quantization algorithm returning
+ it to initial state.
+
+
+
+
+ Color dithering using Floyd-Steinberg error diffusion.
+
+
+ The image processing routine represents color dithering algorithm, which is based on
+ error diffusion dithering with Floyd-Steinberg
+ coefficients. Error is diffused on 4 neighbor pixels with the next coefficients:
+
+
+ | * | 7 |
+ | 3 | 5 | 1 |
+
+ / 16
+
+
+ The image processing routine accepts 24/32 bpp color images for processing. As a result this routine
+ produces 4 bpp or 8 bpp indexed image, which depends on size of the specified
+ color table - 4 bpp result for
+ color tables with 16 colors or less; 8 bpp result for larger color tables.
+
+ Sample usage:
+
+ // create color image quantization routine
+ ColorImageQuantizer ciq = new ColorImageQuantizer( new MedianCutQuantizer( ) );
+ // create 16 colors table
+ Color[] colorTable = ciq.CalculatePalette( image, 16 );
+ // create dithering routine
+ FloydSteinbergColorDithering dithering = new FloydSteinbergColorDithering( );
+ dithering.ColorTable = colorTable;
+ // apply the dithering routine
+ Bitmap newImage = dithering.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Template match class keeps information about found template match. The class is
+ used with template matching algorithms implementing
+ interface.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Rectangle of the matching area.
+ Similarity between template and found matching, [0..1].
+
+
+
+
+ Rectangle of the matching area.
+
+
+
+
+ Similarity between template and found matching, [0..1].
+
+
+
+
+ Susan corners detector.
+
+
+ The class implements Susan corners detector, which is described by
+ S.M. Smith in: S.M. Smith, "SUSAN - a new approach to low level image processing",
+ Internal Technical Report TR95SMS1, Defense Research Agency, Chobham Lane, Chertsey,
+ Surrey, UK, 1995.
+
+ Some implementation notes:
+
+ - Analyzing each pixel and searching for its USAN area, the 7x7 mask is used,
+ which is comprised of 37 pixels. The mask has circle shape:
+
+ xxx
+ xxxxx
+ xxxxxxx
+ xxxxxxx
+ xxxxxxx
+ xxxxx
+ xxx
+
+
+ - In the case if USAN's center of mass has the same coordinates as nucleus
+ (central point), the pixel is not a corner.
+ - For noise suppression the 5x5 square window is used.
+
+ The class processes only grayscale 8 bpp and color 24/32 bpp images.
+ In the case of color image, it is converted to grayscale internally using
+ filter.
+
+ Sample usage:
+
+ // create corners detector's instance
+ SusanCornersDetector scd = new SusanCornersDetector( );
+ // process image searching for corners
+ List<IntPoint> corners = scd.ProcessImage( image );
+ // process points
+ foreach ( IntPoint corner in corners )
+ {
+ // ...
+ }
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Brightness difference threshold.
+ Geometrical threshold.
+
+
+
+
+ Process image looking for corners.
+
+
+ Source image to process.
+
+ Returns list of found corners (X-Y coordinates).
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Process image looking for corners.
+
+
+ Source image data to process.
+
+ Returns list of found corners (X-Y coordinates).
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Process image looking for corners.
+
+
+ Unmanaged source image to process.
+
+ Returns array of found corners (X-Y coordinates).
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Brightness difference threshold.
+
+
+ The brightness difference threshold controls the amount
+ of pixels, which become part of USAN area. If difference between central
+ pixel (nucleus) and surrounding pixel is not higher than difference threshold,
+ then that pixel becomes part of USAN.
+
+ Increasing this value decreases the amount of detected corners.
+
+ Default value is set to 25.
+
+
+
+
+
+ Geometrical threshold.
+
+
+ The geometrical threshold sets the maximum number of pixels
+ in USAN area around corner. If potential corner has USAN with more pixels, than
+ it is not a corner.
+
+ Decreasing this value decreases the amount of detected corners - only sharp corners
+ are detected. Increasing this value increases the amount of detected corners, but
+ also increases amount of flat corners, which may be not corners at all.
+
+ Default value is set to 18, which is half of maximum amount of pixels in USAN.
+
+
+
+
+
+ Rotate image using bilinear interpolation.
+
+
+ Rotation is performed in counterclockwise direction.
+
+ The class implements image rotation filter using bilinear
+ interpolation algorithm.
+
+ The filter accepts 8 bpp grayscale images and 24 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter - rotate for 30 degrees keeping original image size
+ RotateBilinear filter = new RotateBilinear( 30, true );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Rotation angle.
+
+ This constructor sets property
+ to .
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Rotation angle.
+ Keep image size or not.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Simple water wave effect filter.
+
+
+ The image processing filter implements simple water wave effect. Using
+ properties of the class, it is possible to set number of vertical/horizontal waves,
+ as well as their amplitude.
+
+ Bilinear interpolation is used to create smooth effect.
+
+ The filter accepts 8 bpp grayscale images and 24/32
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ WaterWave filter = new WaterWave( );
+ filter.HorizontalWavesCount = 10;
+ filter.HorizontalWavesAmplitude = 5;
+ filter.VerticalWavesCount = 3;
+ filter.VerticalWavesAmplitude = 15;
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Base class for filters, which produce new image of the same size as a
+ result of image processing.
+
+
+ The abstract class is the base class for all filters, which
+ do image processing creating new image with the same size as source.
+ Filters based on this class cannot be applied directly to the source
+ image, which is kept unchanged.
+
+ The base class itself does not define supported pixel formats of source
+ image and resulting pixel formats of destination image. Filters inheriting from
+ this base class, should specify supported pixel formats and their transformations
+ overriding abstract property.
+
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The filter accepts bitmap data as input and returns the result
+ of image processing filter as new image. The source image data are kept
+ unchanged.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+ Destination image in unmanaged memory to put result into.
+
+ The method keeps the source image unchanged and puts result of image processing
+ into destination image.
+
+ The destination image must have the same width and height as source image. Also
+ destination image must have pixel format, which is expected by particular filter (see
+ property for information about pixel format conversions).
+
+
+ Unsupported pixel format of the source image.
+ Incorrect destination pixel format.
+ Destination image has wrong width and/or height.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+ The dictionary defines, which pixel formats are supported for
+ source images and which pixel format will be used for resulting image.
+
+
+ See for more information.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Number of horizontal waves, [1, 10000].
+
+
+ Default value is set to 5.
+
+
+
+
+ Number of vertical waves, [1, 10000].
+
+
+ Default value is set to 5.
+
+
+
+
+ Amplitude of horizontal waves measured in pixels, [0, 10000].
+
+
+ Default value is set to 10.
+
+
+
+
+ Amplitude of vertical waves measured in pixels, [0, 10000].
+
+
+ Default value is set to 10.
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Filter to mark (highlight) corners of objects.
+
+
+
+ The filter highlights corners of objects on the image using provided corners
+ detection algorithm.
+
+ The filter accepts 8 bpp grayscale and 24/32 color images for processing.
+
+ Sample usage:
+
+ // create corner detector's instance
+ SusanCornersDetector scd = new SusanCornersDetector( );
+ // create corner maker filter
+ CornersMarker filter = new CornersMarker( scd, Color.Red );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Interface of corners' detection algorithm.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Interface of corners' detection algorithm.
+ Marker's color used to mark corner.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Color used to mark corners.
+
+
+
+
+ Interface of corners' detection algorithm used to detect corners.
+
+
+
+
+ Flood filling with mean color starting from specified point.
+
+
+ The filter performs image's area filling (4 directional) starting
+ from the specified point. It fills
+ the area of the pointed color, but also fills other colors, which
+ are similar to the pointed within specified tolerance.
+ The area is filled using its mean color.
+
+
+ The filter is similar to filter, but instead
+ of filling the are with specified color, it fills the area with its mean color. This means
+ that this is a two pass filter - first pass is to calculate the mean value and the second pass is to
+ fill the area. Unlike to filter, this filter has nothing
+ to do in the case if zero tolerance is specified.
+
+ The filter accepts 8 bpp grayscale images and 24 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ PointedMeanFloodFill filter = new PointedMeanFloodFill( );
+ // configre the filter
+ filter.Tolerance = Color.FromArgb( 150, 92, 92 );
+ filter.StartingPoint = new IntPoint( 150, 100 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Flood fill tolerance.
+
+
+ The tolerance value determines the level of similarity between
+ colors to fill and the pointed color. If the value is set to zero, then the
+ filter does nothing, since the filling area contains only one color and its
+ filling with mean is meaningless.
+
+ The tolerance value is specified as ,
+ where each component (R, G and B) represents tolerance for the corresponding
+ component of color. This allows to set different tolerances for red, green
+ and blue components.
+
+ Default value is set to (16, 16, 16).
+
+
+
+
+
+ Point to start filling from.
+
+
+ The property allows to set the starting point, where filling is
+ started from.
+
+ Default value is set to (0, 0).
+
+
+
+
+
+ Color filtering.
+
+
+ The filter filters pixels inside/outside of specified RGB color range -
+ it keeps pixels with colors inside/outside of specified range and fills the rest with
+ specified color.
+
+ The filter accepts 24 and 32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ ColorFiltering filter = new ColorFiltering( );
+ // set color ranges to keep
+ filter.Red = new IntRange( 100, 255 );
+ filter.Green = new IntRange( 0, 75 );
+ filter.Blue = new IntRange( 0, 75 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Red components filtering range.
+ Green components filtering range.
+ Blue components filtering range.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Range of red color component.
+
+
+
+
+ Range of green color component.
+
+
+
+
+ Range of blue color component.
+
+
+
+
+ Fill color used to fill filtered pixels.
+
+
+
+
+ Determines, if pixels should be filled inside or outside of specified
+ color ranges.
+
+
+ Default value is set to , which means
+ the filter removes colors outside of the specified range.
+
+
+
+
+ Color dithering using Jarvis, Judice and Ninke error diffusion.
+
+
+ The image processing routine represents color dithering algorithm, which is based on
+ error diffusion dithering with Jarvis-Judice-Ninke coefficients. Error is diffused
+ on 12 neighbor pixels with next coefficients:
+
+ | * | 7 | 5 |
+ | 3 | 5 | 7 | 5 | 3 |
+ | 1 | 3 | 5 | 3 | 1 |
+
+ / 48
+
+
+ The image processing routine accepts 24/32 bpp color images for processing. As a result this routine
+ produces 4 bpp or 8 bpp indexed image, which depends on size of the specified
+ color table - 4 bpp result for
+ color tables with 16 colors or less; 8 bpp result for larger color tables.
+
+ Sample usage:
+
+ // create color image quantization routine
+ ColorImageQuantizer ciq = new ColorImageQuantizer( new MedianCutQuantizer( ) );
+ // create 32 colors table
+ Color[] colorTable = ciq.CalculatePalette( image, 32 );
+ // create dithering routine
+ JarvisJudiceNinkeColorDithering dithering = new JarvisJudiceNinkeColorDithering( );
+ dithering.ColorTable = colorTable;
+ // apply the dithering routine
+ Bitmap newImage = dithering.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Simple skeletonization filter.
+
+
+ The filter build simple objects' skeletons by thinning them until
+ they have one pixel wide "bones" horizontally and vertically. The filter uses
+ and colors to distinguish
+ between object and background.
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ SimpleSkeletonization filter = new SimpleSkeletonization( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Background pixel color.
+ Foreground pixel color.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Background pixel color.
+
+
+ The property sets background (none object) color to look for.
+
+ Default value is set to 0 - black.
+
+
+
+
+ Foreground pixel color.
+
+
+ The property sets objects' (none background) color to look for.
+
+ Default value is set to 255 - white.
+
+
+
+
+ Connected components labeling.
+
+
+ The filter performs labeling of objects in the source image. It colors
+ each separate object using different color. The image processing filter treats all none
+ black pixels as objects' pixels and all black pixel as background.
+
+ The filter accepts 8 bpp grayscale images and 24/32 bpp color images and produces
+ 24 bpp RGB image.
+
+ Sample usage:
+
+ // create filter
+ ConnectedComponentsLabeling filter = new ConnectedComponentsLabeling( );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+ // check objects count
+ int objectCount = filter.ObjectCount;
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Blob counter used to locate separate blobs.
+
+
+ The property allows to set blob counter to use for blobs' localization.
+
+ Default value is set to .
+
+
+
+
+
+ Colors used to color the binary image.
+
+
+
+
+ Specifies if blobs should be filtered.
+
+
+ See documentation for property
+ of class for more information.
+
+
+
+
+ Specifies if size filetering should be coupled or not.
+
+
+ See documentation for property
+ of class for more information.
+
+
+
+
+ Minimum allowed width of blob.
+
+
+
+
+
+ Minimum allowed height of blob.
+
+
+
+
+
+ Maximum allowed width of blob.
+
+
+
+
+
+ Maximum allowed height of blob.
+
+
+
+
+
+ Objects count.
+
+
+ The amount of objects found in the last processed image.
+
+
+
+
+ Morph filter.
+
+
+ The filter combines two images by taking
+ specified percent of pixels' intensities from source
+ image and the rest from overlay image. For example, if the
+ source percent value is set to 0.8, then each pixel
+ of the result image equals to 0.8 * source + 0.2 * overlay, where source
+ and overlay are corresponding pixels' values in source and overlay images.
+
+ The filter accepts 8 bpp grayscale and 24 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Morph filter = new Morph( overlayImage );
+ filter.SourcePercent = 0.75;
+ // apply the filter
+ Bitmap resultImage = filter.Apply( sourceImage );
+
+
+ Source image:
+
+ Overlay image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Overlay image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged overlay image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Overlay image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Percent of source image to keep, [0, 1].
+
+
+ The property specifies the percentage of source pixels' to take. The
+ rest is taken from an overlay image.
+
+
+
+
+ Filtering of frequencies outside of specified range in complex Fourier
+ transformed image.
+
+
+ The filer keeps only specified range of frequencies in complex
+ Fourier transformed image. The rest of frequencies are zeroed.
+
+ Sample usage:
+
+ // create complex image
+ ComplexImage complexImage = ComplexImage.FromBitmap( image );
+ // do forward Fourier transformation
+ complexImage.ForwardFourierTransform( );
+ // create filter
+ FrequencyFilter filter = new FrequencyFilter( new IntRange( 20, 128 ) );
+ // apply filter
+ filter.Apply( complexImage );
+ // do backward Fourier transformation
+ complexImage.BackwardFourierTransform( );
+ // get complex image as bitmat
+ Bitmap fourierImage = complexImage.ToBitmap( );
+
+
+ Initial image:
+
+ Fourier image:
+
+
+
+
+
+
+ Image processing filter, which operates with Fourier transformed
+ complex image.
+
+
+ The interface defines the set of methods, which should be
+ provided by all image processing filter, which operate with Fourier
+ transformed complex image.
+
+
+
+
+ Apply filter to complex image.
+
+
+ Complex image to apply filter to.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Range of frequencies to keep.
+
+
+
+
+ Apply filter to complex image.
+
+
+ Complex image to apply filter to.
+
+ The source complex image should be Fourier transformed.
+
+
+
+
+ Range of frequencies to keep.
+
+
+ The range specifies the range of frequencies to keep. Values is frequencies
+ outside of this range are zeroed.
+
+ Default value is set to [0, 1024].
+
+
+
+
+ Resize image using bicubic interpolation algorithm.
+
+
+ The class implements image resizing filter using bicubic
+ interpolation algorithm. It uses bicubic kernel W(x) as described on
+ Wikipedia
+ (coefficient a is set to -0.5).
+
+ The filter accepts 8 grayscale images and 24 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ ResizeBicubic filter = new ResizeBicubic( 400, 300 );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Base class for image resizing filters.
+
+
+ The abstract class is the base class for all filters,
+ which implement image rotation algorithms.
+
+
+
+
+
+ New image width.
+
+
+
+
+ New image height.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Width of the new resized image.
+ Height of the new resize image.
+
+
+
+
+ Calculates new image size.
+
+
+ Source image data.
+
+ New image size - size of the destination image.
+
+
+
+
+ Width of the new resized image.
+
+
+
+
+
+ Height of the new resized image.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Width of new image.
+ Height of new image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Performs quadrilateral transformation of an area in a given source image.
+
+
+ The class implements quadrilateral transformation algorithm,
+ which allows to transform any quadrilateral from a given source image
+ to a rectangular image. The idea of the algorithm is based on homogeneous
+ transformation and its math is described by Paul Heckbert in his
+ "Projective Mappings for Image Warping" paper.
+
+
+ The image processing filter accepts 8 grayscale images and 24/32 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // define quadrilateral's corners
+ List<IntPoint> corners = new List<IntPoint>( );
+ corners.Add( new IntPoint( 99, 99 ) );
+ corners.Add( new IntPoint( 156, 79 ) );
+ corners.Add( new IntPoint( 184, 126 ) );
+ corners.Add( new IntPoint( 122, 150 ) );
+ // create filter
+ QuadrilateralTransformation filter =
+ new QuadrilateralTransformation( corners, 200, 200 );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ New image width.
+
+
+
+
+ New image height.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Corners of the source quadrilateral area.
+ Width of the new transformed image.
+ Height of the new transformed image.
+
+ This constructor sets to
+ , which means that destination image will have width and
+ height as specified by user.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Corners of the source quadrilateral area.
+
+ This constructor sets to
+ , which means that destination image will have width and
+ height automatically calculated based on property.
+
+
+
+
+ Calculates new image size.
+
+
+ Source image data.
+
+ New image size - size of the destination image.
+
+ Source quadrilateral was not set.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Automatic calculation of destination image or not.
+
+
+ The property specifies how to calculate size of destination (transformed)
+ image. If the property is set to , then
+ and properties have effect and destination image's size is
+ specified by user. If the property is set to , then setting the above
+ mentioned properties does not have any effect, but destionation image's size is
+ automatically calculated from property - width and height
+ come from length of longest edges.
+
+
+ Default value is set to .
+
+
+
+
+
+ Quadrilateral's corners in source image.
+
+
+ The property specifies four corners of the quadrilateral area
+ in the source image to be transformed.
+
+
+
+
+
+ Width of the new transformed image.
+
+
+ The property defines width of the destination image, which gets
+ transformed quadrilateral image.
+
+ Setting the property does not have any effect, if
+ property is set to . In this case destination image's width
+ is calculated automatically based on property.
+
+
+
+
+
+ Height of the new transformed image.
+
+
+ The property defines height of the destination image, which gets
+ transformed quadrilateral image.
+
+ Setting the property does not have any effect, if
+ property is set to . In this case destination image's height
+ is calculated automatically based on property.
+
+
+
+
+
+ Specifies if bilinear interpolation should be used or not.
+
+
+ Default value is set to - interpolation
+ is used.
+
+
+
+
+
+ Saturation adjusting in HSL color space.
+
+
+ The filter operates in HSL color space and adjusts
+ pixels' saturation value, increasing it or decreasing by specified percentage.
+ The filters is based on filter, passing work to it after
+ recalculating saturation adjust value to input/output
+ ranges of the filter.
+
+ The filter accepts 24 and 32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ SaturationCorrection filter = new SaturationCorrection( -0.5f );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Saturation adjust value.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Saturation adjust value, [-1, 1].
+
+
+ Default value is set to 0.1, which corresponds to increasing
+ saturation by 10%.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Convolution filter.
+
+
+ The filter implements convolution operator, which calculates each pixel
+ of the result image as weighted sum of the correspond pixel and its neighbors in the source
+ image. The weights are set by convolution kernel. The weighted
+ sum is divided by before putting it into result image and also
+ may be thresholded using value.
+
+ Convolution is a simple mathematical operation which is fundamental to many common
+ image processing filters. Depending on the type of provided kernel, the filter may produce
+ different results, like blur image, sharpen it, find edges, etc.
+
+ The filter accepts 8 and 16 bpp grayscale images and 24, 32, 48 and 64 bpp
+ color images for processing. Note: depending on the value of
+ property, the alpha channel is either copied as is or processed with the kernel.
+
+ Sample usage:
+
+ // define emboss kernel
+ int[,] kernel = {
+ { -2, -1, 0 },
+ { -1, 1, 1 },
+ { 0, 1, 2 } };
+ // create filter
+ Convolution filter = new Convolution( kernel );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Convolution kernel.
+
+ Using this constructor (specifying only convolution kernel),
+ division factor will be calculated automatically
+ summing all kernel values. In the case if kernel's sum equals to zero,
+ division factor will be assigned to 1.
+
+ Invalid kernel size is specified. Kernel must be
+ square, its width/height should be odd and should be in the [3, 25] range.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Convolution kernel.
+ Divisor, used used to divide weighted sum.
+
+ Invalid kernel size is specified. Kernel must be
+ square, its width/height should be odd and should be in the [3, 25] range.
+ Divisor can not be equal to zero.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Convolution kernel.
+
+
+
+ Convolution kernel must be square and its width/height
+ should be odd and should be in the [3, 99] range.
+
+ Setting convolution kernel through this property does not
+ affect - it is not recalculated automatically.
+
+
+ Invalid kernel size is specified.
+
+
+
+
+ Division factor.
+
+
+ The value is used to divide convolution - weighted sum
+ of pixels is divided by this value.
+
+ The value may be calculated automatically in the case if constructor
+ with one parameter is used ().
+
+
+ Divisor can not be equal to zero.
+
+
+
+
+ Threshold to add to weighted sum.
+
+
+ The property specifies threshold value, which is added to each weighted
+ sum of pixels. The value is added right after division was done by
+ value.
+
+ Default value is set to 0.
+
+
+
+
+
+ Use dynamic divisor for edges or not.
+
+
+ The property specifies how to handle edges. If it is set to
+ , then the same divisor (which is specified by
+ property or calculated automatically) will be applied both for non-edge regions
+ and for edge regions. If the value is set to , then dynamically
+ calculated divisor will be used for edge regions, which is sum of those kernel
+ elements, which are taken into account for particular processed pixel
+ (elements, which are not outside image).
+
+ Default value is set to .
+
+
+
+
+
+ Specifies if alpha channel must be processed or just copied.
+
+
+ The property specifies the way how alpha channel is handled for 32 bpp
+ and 64 bpp images. If the property is set to , then alpha
+ channel's values are just copied as is. If the property is set to
+ then alpha channel is convolved using the specified kernel same way as RGB channels.
+
+ Default value is set to .
+
+
+
+
+
+ Convert grayscale image to RGB.
+
+
+ The filter creates color image from specified grayscale image
+ initializing all RGB channels to the same value - pixel's intensity of grayscale image.
+
+ The filter accepts 8 bpp grayscale images and produces
+ 24 bpp RGB image.
+
+ Sample usage:
+
+ // create filter
+ GrayscaleToRGB filter = new GrayscaleToRGB( );
+ // apply the filter
+ Bitmap rgbImage = filter.Apply( image );
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Adaptive thresholding using the internal image.
+
+
+ The image processing routine implements local thresholding technique described
+ by Derek Bradley and Gerhard Roth in the "Adaptive Thresholding Using the Integral Image" paper.
+
+
+ The brief idea of the algorithm is that every image's pixel is set to black if its brightness
+ is t percent lower (see ) than the average brightness
+ of surrounding pixels in the window of the specified size (see ), othwerwise it is set
+ to white.
+
+ Sample usage:
+
+ // create the filter
+ BradleyLocalThresholding filter = new BradleyLocalThresholding( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+
+
+
+
+ Window size to calculate average value of pixels for.
+
+
+ The property specifies window size around processing pixel, which determines number of
+ neighbor pixels to use for calculating their average brightness.
+
+ Default value is set to 41.
+
+ The value should be odd.
+
+
+
+
+
+ Brightness difference limit between processing pixel and average value across neighbors.
+
+
+ The property specifies what is the allowed difference percent between processing pixel
+ and average brightness of neighbor pixels in order to be set white. If the value of the
+ current pixel is t percent (this property value) lower than the average then it is set
+ to black, otherwise it is set to white.
+
+ Default value is set to 0.15.
+
+
+
+
+
+ Format translations dictionary.
+
+
+ See for more information.
+
+
+
+
+ Integral image.
+
+
+ The class implements integral image concept, which is described by
+ Viola and Jones in: P. Viola and M. J. Jones, "Robust real-time face detection",
+ Int. Journal of Computer Vision 57(2), pp. 137–154, 2004.
+
+ "An integral image I of an input image G is defined as the image in which the
+ intensity at a pixel position is equal to the sum of the intensities of all the pixels
+ above and to the left of that position in the original image."
+
+ The intensity at position (x, y) can be written as:
+
+ x y
+ I(x,y) = SUM( SUM( G(i,j) ) )
+ i=0 j=0
+
+
+ The class uses 32-bit integers to represent integral image.
+
+ The class processes only grayscale (8 bpp indexed) images.
+
+ This class contains two versions of each method: safe and unsafe. Safe methods do
+ checks of provided coordinates and ensure that these coordinates belong to the image, what makes
+ these methods slower. Unsafe methods do not do coordinates' checks and rely that these
+ coordinates belong to the image, what makes these methods faster.
+
+ Sample usage:
+
+ // create integral image
+ IntegralImage im = IntegralImage.FromBitmap( image );
+ // get pixels' mean value in the specified rectangle
+ float mean = im.GetRectangleMean( 10, 10, 20, 30 )
+
+
+
+
+
+
+ Intergral image's array.
+
+
+ See remarks to property.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image width.
+ Image height.
+
+ The constractor is protected, what makes it imposible to instantiate this
+ class directly. To create an instance of this class or
+ method should be used.
+
+
+
+
+ Construct integral image from source grayscale image.
+
+
+ Source grayscale image.
+
+ Returns integral image.
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Construct integral image from source grayscale image.
+
+
+ Source image data.
+
+ Returns integral image.
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Construct integral image from source grayscale image.
+
+
+ Source unmanaged image.
+
+ Returns integral image.
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Calculate sum of pixels in the specified rectangle.
+
+
+ X coordinate of left-top rectangle's corner.
+ Y coordinate of left-top rectangle's corner.
+ X coordinate of right-bottom rectangle's corner.
+ Y coordinate of right-bottom rectangle's corner.
+
+ Returns sum of pixels in the specified rectangle.
+
+ Both specified points are included into the calculation rectangle.
+
+
+
+
+ Calculate horizontal (X) haar wavelet at the specified point.
+
+
+ X coordinate of the point to calculate wavelet at.
+ Y coordinate of the point to calculate wavelet at.
+ Wavelet size to calculate.
+
+ Returns value of the horizontal wavelet at the specified point.
+
+ The method calculates horizontal wavelet, which is a difference
+ of two horizontally adjacent boxes' sums, i.e. A-B. A is the sum of rectangle with coordinates
+ (x, y-radius, x+radius-1, y+radius-1). B is the sum of rectangle with coordinates
+ (x-radius, y-radius, x-1, y+radiys-1).
+
+
+
+
+ Calculate vertical (Y) haar wavelet at the specified point.
+
+
+ X coordinate of the point to calculate wavelet at.
+ Y coordinate of the point to calculate wavelet at.
+ Wavelet size to calculate.
+
+ Returns value of the vertical wavelet at the specified point.
+
+ The method calculates vertical wavelet, which is a difference
+ of two vertical adjacent boxes' sums, i.e. A-B. A is the sum of rectangle with coordinates
+ (x-radius, y, x+radius-1, y+radius-1). B is the sum of rectangle with coordinates
+ (x-radius, y-radius, x+radius-1, y-1).
+
+
+
+
+ Calculate sum of pixels in the specified rectangle without checking it's coordinates.
+
+
+ X coordinate of left-top rectangle's corner.
+ Y coordinate of left-top rectangle's corner.
+ X coordinate of right-bottom rectangle's corner.
+ Y coordinate of right-bottom rectangle's corner.
+
+ Returns sum of pixels in the specified rectangle.
+
+ Both specified points are included into the calculation rectangle.
+
+
+
+
+ Calculate sum of pixels in the specified rectangle.
+
+
+ X coordinate of central point of the rectangle.
+ Y coordinate of central point of the rectangle.
+ Radius of the rectangle.
+
+ Returns sum of pixels in the specified rectangle.
+
+ The method calculates sum of pixels in square rectangle with
+ odd width and height. In the case if it is required to calculate sum of
+ 3x3 rectangle, then it is required to specify its center and radius equal to 1.
+
+
+
+
+
+ Calculate sum of pixels in the specified rectangle without checking it's coordinates.
+
+
+ X coordinate of central point of the rectangle.
+ Y coordinate of central point of the rectangle.
+ Radius of the rectangle.
+
+ Returns sum of pixels in the specified rectangle.
+
+ The method calculates sum of pixels in square rectangle with
+ odd width and height. In the case if it is required to calculate sum of
+ 3x3 rectangle, then it is required to specify its center and radius equal to 1.
+
+
+
+
+
+ Calculate mean value of pixels in the specified rectangle.
+
+
+ X coordinate of left-top rectangle's corner.
+ Y coordinate of left-top rectangle's corner.
+ X coordinate of right-bottom rectangle's corner.
+ Y coordinate of right-bottom rectangle's corner.
+
+ Returns mean value of pixels in the specified rectangle.
+
+ Both specified points are included into the calculation rectangle.
+
+
+
+
+ Calculate mean value of pixels in the specified rectangle without checking it's coordinates.
+
+
+ X coordinate of left-top rectangle's corner.
+ Y coordinate of left-top rectangle's corner.
+ X coordinate of right-bottom rectangle's corner.
+ Y coordinate of right-bottom rectangle's corner.
+
+ Returns mean value of pixels in the specified rectangle.
+
+ Both specified points are included into the calculation rectangle.
+
+
+
+
+ Calculate mean value of pixels in the specified rectangle.
+
+
+ X coordinate of central point of the rectangle.
+ Y coordinate of central point of the rectangle.
+ Radius of the rectangle.
+
+ Returns mean value of pixels in the specified rectangle.
+
+ The method calculates mean value of pixels in square rectangle with
+ odd width and height. In the case if it is required to calculate mean value of
+ 3x3 rectangle, then it is required to specify its center and radius equal to 1.
+
+
+
+
+
+ Calculate mean value of pixels in the specified rectangle without checking it's coordinates.
+
+
+ X coordinate of central point of the rectangle.
+ Y coordinate of central point of the rectangle.
+ Radius of the rectangle.
+
+ Returns mean value of pixels in the specified rectangle.
+
+ The method calculates mean value of pixels in square rectangle with
+ odd width and height. In the case if it is required to calculate mean value of
+ 3x3 rectangle, then it is required to specify its center and radius equal to 1.
+
+
+
+
+
+ Width of the source image the integral image was constructed for.
+
+
+
+
+ Height of the source image the integral image was constructed for.
+
+
+
+
+ Provides access to internal array keeping integral image data.
+
+
+
+ The array should be accessed by [y, x] indexing.
+
+ The array's size is [+1, +1]. The first
+ row and column are filled with zeros, what is done for more efficient calculation of
+ rectangles' sums.
+
+
+
+
+
+ Gather statistics about image in RGB color space.
+
+
+ The class is used to accumulate statistical values about images,
+ like histogram, mean, standard deviation, etc. for each color channel in RGB color
+ space.
+
+ The class accepts 8 bpp grayscale and 24/32 bpp color images for processing.
+
+ Sample usage:
+
+ // gather statistics
+ ImageStatistics stat = new ImageStatistics( image );
+ // get red channel's histogram
+ Histogram red = stat.Red;
+ // check mean value of red channel
+ if ( red.Mean > 128 )
+ {
+ // do further processing
+ }
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+
+ Source pixel format is not supported.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+ Mask image which specifies areas to collect statistics for.
+
+ The mask image must be a grayscale/binary (8bpp) image of the same size as the
+ specified source image, where black pixels (value 0) correspond to areas which should be excluded
+ from processing. So statistics is calculated only for pixels, which are none black in the mask image.
+
+
+ Source pixel format is not supported.
+ Mask image must be 8 bpp grayscale image.
+ Mask must have the same size as the source image to get statistics for.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+ Mask array which specifies areas to collect statistics for.
+
+ The mask array must be of the same size as the specified source image, where 0 values
+ correspond to areas which should be excluded from processing. So statistics is calculated only for pixels,
+ which have none zero corresponding value in the mask.
+
+
+ Source pixel format is not supported.
+ Mask must have the same size as the source image to get statistics for.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged image to gather statistics about.
+
+ Source pixel format is not supported.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+ Mask image which specifies areas to collect statistics for.
+
+ The mask image must be a grayscale/binary (8bpp) image of the same size as the
+ specified source image, where black pixels (value 0) correspond to areas which should be excluded
+ from processing. So statistics is calculated only for pixels, which are none black in the mask image.
+
+
+ Source pixel format is not supported.
+ Mask image must be 8 bpp grayscale image.
+ Mask must have the same size as the source image to get statistics for.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+ Mask array which specifies areas to collect statistics for.
+
+ The mask array must be of the same size as the specified source image, where 0 values
+ correspond to areas which should be excluded from processing. So statistics is calculated only for pixels,
+ which have none zero corresponding value in the mask.
+
+
+ Source pixel format is not supported.
+ Mask must have the same size as the source image to get statistics for.
+
+
+
+
+ Histogram of red channel.
+
+
+ The property is valid only for color images
+ (see property).
+
+
+
+
+ Histogram of green channel.
+
+
+ The property is valid only for color images
+ (see property).
+
+
+
+
+ Histogram of blue channel.
+
+
+ The property is valid only for color images
+ (see property).
+
+
+
+
+ Histogram of gray channel.
+
+
+ The property is valid only for grayscale images
+ (see property).
+
+
+
+
+ Histogram of red channel excluding black pixels.
+
+
+ The property keeps statistics about red channel, which
+ excludes all black pixels, what affects mean, standard deviation, etc.
+
+ The property is valid only for color images
+ (see property).
+
+
+
+
+ Histogram of green channel excluding black pixels.
+
+
+ The property keeps statistics about green channel, which
+ excludes all black pixels, what affects mean, standard deviation, etc.
+
+ The property is valid only for color images
+ (see property).
+
+
+
+
+ Histogram of blue channel excluding black pixels
+
+
+ The property keeps statistics about blue channel, which
+ excludes all black pixels, what affects mean, standard deviation, etc.
+
+ The property is valid only for color images
+ (see property).
+
+
+
+
+ Histogram of gray channel channel excluding black pixels.
+
+
+ The property keeps statistics about gray channel, which
+ excludes all black pixels, what affects mean, standard deviation, etc.
+
+ The property is valid only for grayscale images
+ (see property).
+
+
+
+
+ Total pixels count in the processed image.
+
+
+
+
+
+ Total pixels count in the processed image excluding black pixels.
+
+
+
+
+
+ Value wich specifies if the processed image was color or grayscale.
+
+
+ If the value is set to then
+ property should be used to get statistics information about image. Otherwise
+ , and properties should be used
+ for color images.
+
+
+
+
+ Horizontal intensity statistics.
+
+
+ The class provides information about horizontal distribution
+ of pixel intensities, which may be used to locate objects, their centers, etc.
+
+
+ The class accepts grayscale (8 bpp indexed and 16 bpp) and color (24, 32, 48 and 64 bpp) images.
+ In the case of 32 and 64 bpp color images, the alpha channel is not processed - statistics is not
+ gathered for this channel.
+
+ Sample usage:
+
+ // collect statistics
+ HorizontalIntensityStatistics his = new HorizontalIntensityStatistics( sourceImage );
+ // get gray histogram (for grayscale image)
+ Histogram histogram = his.Gray;
+ // output some histogram's information
+ System.Diagnostics.Debug.WriteLine( "Mean = " + histogram.Mean );
+ System.Diagnostics.Debug.WriteLine( "Min = " + histogram.Min );
+ System.Diagnostics.Debug.WriteLine( "Max = " + histogram.Max );
+
+
+ Sample grayscale image with its horizontal intensity histogram:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Source image data.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Source unmanaged image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Gather horizontal intensity statistics for specified image.
+
+
+ Source image.
+
+
+
+
+ Histogram for red channel.
+
+
+
+
+
+ Histogram for green channel.
+
+
+
+
+
+ Histogram for blue channel.
+
+
+
+
+
+ Histogram for gray channel (intensities).
+
+
+
+
+
+ Value wich specifies if the processed image was color or grayscale.
+
+
+ If the property equals to true, then the
+ property should be used to retrieve histogram for the processed grayscale image.
+ Otherwise , and property
+ should be used to retrieve histogram for particular RGB channel of the processed
+ color image.
+
+
+
+
+ Performs quadrilateral transformation using nearest neighbor algorithm for interpolation.
+
+
+ The class is deprecated and should be used instead.
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Corners of the source quadrilateral area.
+ Width of the new transformed image.
+ Height of the new transformed image.
+
+ This constructor sets to
+ , which means that destination image will have width and
+ height as specified by user.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Corners of the source quadrilateral area.
+
+ This constructor sets to
+ , which means that destination image will have width and
+ height automatically calculated based on property.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Calculates new image size.
+
+
+ Source image data.
+
+ New image size - size of the destination image.
+
+ The specified quadrilateral's corners are outside of the given image.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Automatic calculation of destination image or not.
+
+
+ The property specifies how to calculate size of destination (transformed)
+ image. If the property is set to , then
+ and properties have effect and destination image's size is
+ specified by user. If the property is set to , then setting the above
+ mentioned properties does not have any effect, but destionation image's size is
+ automatically calculated from property - width and height
+ come from length of longest edges.
+
+
+
+
+
+ Quadrilateral's corners in source image.
+
+
+ The property specifies four corners of the quadrilateral area
+ in the source image to be transformed.
+
+
+
+
+
+ Width of the new transformed image.
+
+
+ The property defines width of the destination image, which gets
+ transformed quadrilateral image.
+
+ Setting the property does not have any effect, if
+ property is set to . In this case destination image's width
+ is calculated automatically based on property.
+
+
+
+
+
+ Height of the new transformed image.
+
+
+ The property defines height of the destination image, which gets
+ transformed quadrilateral image.
+
+ Setting the property does not have any effect, if
+ property is set to . In this case destination image's height
+ is calculated automatically based on property.
+
+
+
+
+
+ Median filter.
+
+
+ The median filter is normally used to reduce noise in an image, somewhat like
+ the mean filter. However, it often does a better job than the mean
+ filter of preserving useful detail in the image.
+
+ Each pixel of the original source image is replaced with the median of neighboring pixel
+ values. The median is calculated by first sorting all the pixel values from the surrounding
+ neighborhood into numerical order and then replacing the pixel being considered with the
+ middle pixel value.
+
+ The filter accepts 8 bpp grayscale images and 24/32 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Median filter = new Median( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Processing square size.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Processing square size for the median filter, [3, 25].
+
+
+ Default value is set to 3.
+
+ The value should be odd.
+
+
+
+
+
+ Textured filter - filter an image using texture.
+
+
+ The filter is similar to filter in its
+ nature, but instead of working with source image and overly, it uses provided
+ filters to create images to merge (see and
+ properties). In addition, it uses a bit more complex formula for calculation
+ of destination pixel's value, which gives greater amount of flexibility:
+ dst = * ( src1 * textureValue + src2 * ( 1.0 - textureValue ) ) + * src2,
+ where src1 is value of pixel from the image produced by ,
+ src2 is value of pixel from the image produced by ,
+ dst is value of pixel in a destination image and textureValue is corresponding value
+ from provided texture (see or ).
+
+ It is possible to set to . In this case
+ original source image will be used instead of result produced by the second filter.
+
+ The filter 24 bpp color images for processing.
+
+ Sample usage #1:
+
+ // create filter
+ TexturedFilter filter = new TexturedFilter( new CloudsTexture( ),
+ new HueModifier( 50 ) );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Sample usage #2:
+
+ // create filter
+ TexturedFilter filter = new TexturedFilter( new CloudsTexture( ),
+ new GrayscaleBT709( ), new Sepia( ) );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image #1:
+
+ Result image #2:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Generated texture.
+ First filter.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Generated texture.
+ First filter.
+ Second filter.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Texture generator.
+ First filter.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Texture generator.
+ First filter.
+ Second filter.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+ Texture size does not match image size.
+ Filters should not change image dimension.
+
+
+
+
+ Format translations dictionary.
+
+
+ See for more information.
+
+
+
+
+ Filter level value, [0, 1].
+
+
+ Filtering factor determines portion of the destionation image, which is formed
+ as a result of merging source images using specified texture.
+
+ Default value is set to 1.0.
+
+ See class description for more details.
+
+
+
+
+
+ Preserve level value
+
+
+ Preserving factor determines portion taken from the image produced
+ by (or from original source) without applying textured
+ merge to it.
+
+ Default value is set to 0.0.
+
+ See class description for more details.
+
+
+
+
+
+ Generated texture.
+
+
+ Two dimensional array of texture intensities.
+
+ Size of the provided texture should be the same as size of images, which will
+ be passed to the filter.
+
+ The property has priority over this property - if
+ generator is specified than the static generated texture is not used.
+
+
+
+
+
+ Texture generator.
+
+
+ Generator used to generate texture.
+
+ The property has priority over the property.
+
+
+
+
+
+ First filter.
+
+
+ Filter, which is used to produce first image for the merge. The filter
+ needs to implement interface, so it could be possible
+ to get information about the filter. The filter must be able to process color 24 bpp
+ images and produce color 24 bpp or grayscale 8 bppp images as result.
+
+
+ The specified filter does not support 24 bpp color images.
+ The specified filter does not produce image of supported format.
+ The specified filter does not implement IFilterInformation interface.
+
+
+
+
+ Second filter
+
+
+ Filter, which is used to produce second image for the merge. The filter
+ needs to implement interface, so it could be possible
+ to get information about the filter. The filter must be able to process color 24 bpp
+ images and produce color 24 bpp or grayscale 8 bppp images as result.
+
+ The filter may be set to . In this case original source image
+ is used as a second image for the merge.
+
+
+ The specified filter does not support 24 bpp color images.
+ The specified filter does not produce image of supported format.
+ The specified filter does not implement IFilterInformation interface.
+
+
+
+
+ Top-hat operator from Mathematical Morphology.
+
+
+ Top-hat morphological operator subtracts
+ result of morphological opening on the input image
+ from the input image itself.
+
+ Applied to binary image, the filter allows to get all those object (their parts)
+ which were removed by opening filter, but never restored.
+
+ The filter accepts 8 and 16 bpp grayscale images and 24 and 48 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ TopHat filter = new TopHat( );
+ // apply the filter
+ filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Structuring element to pass to operator.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Difference edge detector.
+
+
+ The filter finds objects' edges by calculating maximum difference
+ between pixels in 4 directions around the processing pixel.
+
+ Suppose 3x3 square element of the source image (x - is currently processed
+ pixel):
+
+ P1 P2 P3
+ P8 x P4
+ P7 P6 P5
+
+ The corresponding pixel of the result image equals to:
+
+ max( |P1-P5|, |P2-P6|, |P3-P7|, |P4-P8| )
+
+
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ DifferenceEdgeDetector filter = new DifferenceEdgeDetector( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Mean filter.
+
+
+ The filter performs each pixel value's averaging with its 8 neighbors, which is
+ convolution filter using the mean kernel:
+
+
+ 1 1 1
+ 1 1 1
+ 1 1 1
+
+
+ For the list of supported pixel formats, see the documentation to
+ filter.
+
+ With the above kernel the convolution filter is just calculates each pixel's value
+ in result image as average of 9 corresponding pixels in the source image.
+
+ By default this filter sets property to
+ , so the alpha channel of 32 bpp and 64 bpp images is blurred as well.
+
+
+ Sample usage:
+
+ // create filter
+ Mean filter = new Mean( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Linear correction of RGB channels.
+
+
+ The filter performs linear correction of RGB channels by mapping specified
+ channels' input ranges to output ranges. It is similar to the
+ , but the remapping is linear.
+
+ The filter accepts 8 bpp grayscale and 24/32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ LevelsLinear filter = new LevelsLinear( );
+ // set ranges
+ filter.InRed = new IntRange( 30, 230 );
+ filter.InGreen = new IntRange( 50, 240 );
+ filter.InBlue = new IntRange( 10, 210 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Calculate conversion map.
+
+
+ Input range.
+ Output range.
+ Conversion map.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Red component's input range.
+
+
+
+
+ Green component's input range.
+
+
+
+
+ Blue component's input range.
+
+
+
+
+ Gray component's input range.
+
+
+
+
+ Input range for RGB components.
+
+
+ The property allows to set red, green and blue input ranges to the same value.
+
+
+
+
+ Red component's output range.
+
+
+
+
+ Green component's output range.
+
+
+
+
+ Blue component's output range.
+
+
+
+
+ Gray component's output range.
+
+
+
+
+ Output range for RGB components.
+
+
+ The property allows to set red, green and blue output ranges to the same value.
+
+
+
+
+ Threshold using Simple Image Statistics (SIS).
+
+
+ The filter performs image thresholding calculating threshold automatically
+ using simple image statistics method. For each pixel:
+
+ - two gradients are calculated - ex = |I(x + 1, y) - I(x - 1, y)| and
+ |I(x, y + 1) - I(x, y - 1)|;
+ - weight is calculated as maximum of two gradients;
+ - sum of weights is updated (weightTotal += weight);
+ - sum of weighted pixel values is updated (total += weight * I(x, y)).
+
+ The result threshold is calculated as sum of weighted pixel values divided by sum of weight.
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ SISThreshold filter = new SISThreshold( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image (calculated threshold is 127):
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Calculate binarization threshold for the given image.
+
+
+ Image to calculate binarization threshold for.
+ Rectangle to calculate binarization threshold for.
+
+ Returns binarization threshold.
+
+ The method is used to calculate binarization threshold only. The threshold
+ later may be applied to the image using image processing filter.
+
+ Source pixel format is not supported by the routine. It should be
+ 8 bpp grayscale (indexed) image.
+
+
+
+
+ Calculate binarization threshold for the given image.
+
+
+ Image to calculate binarization threshold for.
+ Rectangle to calculate binarization threshold for.
+
+ Returns binarization threshold.
+
+ The method is used to calculate binarization threshold only. The threshold
+ later may be applied to the image using image processing filter.
+
+ Source pixel format is not supported by the routine. It should be
+ 8 bpp grayscale (indexed) image.
+
+
+
+
+ Calculate binarization threshold for the given image.
+
+
+ Image to calculate binarization threshold for.
+ Rectangle to calculate binarization threshold for.
+
+ Returns binarization threshold.
+
+ The method is used to calculate binarization threshold only. The threshold
+ later may be applied to the image using image processing filter.
+
+ Source pixel format is not supported by the routine. It should be
+ 8 bpp grayscale (indexed) image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Threshold value.
+
+
+ The property is read only and represents the value, which
+ was automaticaly calculated using image statistics.
+
+
+
+
+ Difference filter - get the difference between overlay and source images.
+
+
+ The difference filter takes two images (source and
+ overlay images)
+ of the same size and pixel format and produces an image, where each pixel equals
+ to absolute difference between corresponding pixels from provided images.
+
+ The filter accepts 8 and 16 bpp grayscale images and 24, 32, 48 and 64 bpp
+ color images for processing.
+
+ In the case if images with alpha channel are used (32 or 64 bpp), visualization
+ of the result image may seem a bit unexpected - most probably nothing will be seen
+ (in the case if image is displayed according to its alpha channel). This may be
+ caused by the fact that after differencing the entire alpha channel will be zeroed
+ (zero difference between alpha channels), what means that the resulting image will be
+ 100% transparent.
+
+ Sample usage:
+
+ // create filter
+ Difference filter = new Difference( overlayImage );
+ // apply the filter
+ Bitmap resultImage = filter.Apply( sourceImage );
+
+
+ Source image:
+
+ Overlay image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Overlay image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged overlay image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Overlay image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Image in unmanaged memory.
+
+
+
+ The class represents wrapper of an image in unmanaged memory. Using this class
+ it is possible as to allocate new image in unmanaged memory, as to just wrap provided
+ pointer to unmanaged memory, where an image is stored.
+
+ Usage of unmanaged images is mostly beneficial when it is required to apply multiple
+ image processing routines to a single image. In such scenario usage of .NET managed images
+ usually leads to worse performance, because each routine needs to lock managed image
+ before image processing is done and then unlock it after image processing is done. Without
+ these lock/unlock there is no way to get direct access to managed image's data, which means
+ there is no way to do fast image processing. So, usage of managed images lead to overhead, which
+ is caused by locks/unlock. Unmanaged images are represented internally using unmanaged memory
+ buffer. This means that it is not required to do any locks/unlocks in order to get access to image
+ data (no overhead).
+
+ Sample usage:
+
+ // sample 1 - wrapping .NET image into unmanaged without
+ // making extra copy of image in memory
+ BitmapData imageData = image.LockBits(
+ new Rectangle( 0, 0, image.Width, image.Height ),
+ ImageLockMode.ReadWrite, image.PixelFormat );
+
+ try
+ {
+ UnmanagedImage unmanagedImage = new UnmanagedImage( imageData ) );
+ // apply several routines to the unmanaged image
+ }
+ finally
+ {
+ image.UnlockBits( imageData );
+ }
+
+
+ // sample 2 - converting .NET image into unmanaged
+ UnmanagedImage unmanagedImage = UnmanagedImage.FromManagedImage( image );
+ // apply several routines to the unmanaged image
+ ...
+ // conver to managed image if it is required to display it at some point of time
+ Bitmap managedImage = unmanagedImage.ToManagedImage( );
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Pointer to image data in unmanaged memory.
+ Image width in pixels.
+ Image height in pixels.
+ Image stride (line size in bytes).
+ Image pixel format.
+
+ Using this constructor, make sure all specified image attributes are correct
+ and correspond to unmanaged memory buffer. If some attributes are specified incorrectly,
+ this may lead to exceptions working with the unmanaged memory.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Locked bitmap data.
+
+ Unlike method, this constructor does not make
+ copy of managed image. This means that managed image must stay locked for the time of using the instance
+ of unamanged image.
+
+
+
+
+ Destroys the instance of the class.
+
+
+
+
+
+ Dispose the object.
+
+
+ Frees unmanaged resources used by the object. The object becomes unusable
+ after that.
+
+ The method needs to be called only in the case if unmanaged image was allocated
+ using method. In the case if the class instance was created using constructor,
+ this method does not free unmanaged memory.
+
+
+
+
+
+ Dispose the object.
+
+
+ Indicates if disposing was initiated manually.
+
+
+
+
+ Clone the unmanaged images.
+
+
+ Returns clone of the unmanaged image.
+
+ The method does complete cloning of the object.
+
+
+
+
+ Copy unmanaged image.
+
+
+ Destination image to copy this image to.
+
+ The method copies current unmanaged image to the specified image.
+ Size and pixel format of the destination image must be exactly the same.
+
+ Destination image has different size or pixel format.
+
+
+
+
+ Allocate new image in unmanaged memory.
+
+
+ Image width.
+ Image height.
+ Image pixel format.
+
+ Return image allocated in unmanaged memory.
+
+ Allocate new image with specified attributes in unmanaged memory.
+
+ The method supports only
+ Format8bppIndexed,
+ Format16bppGrayScale,
+ Format24bppRgb,
+ Format32bppRgb,
+ Format32bppArgb,
+ Format32bppPArgb,
+ Format48bppRgb,
+ Format64bppArgb and
+ Format64bppPArgb pixel formats.
+ In the case if Format8bppIndexed
+ format is specified, pallete is not not created for the image (supposed that it is
+ 8 bpp grayscale image).
+
+
+
+ Unsupported pixel format was specified.
+ Invalid image size was specified.
+
+
+
+
+ Create managed image from the unmanaged.
+
+
+ Returns managed copy of the unmanaged image.
+
+ The method creates a managed copy of the unmanaged image with the
+ same size and pixel format (it calls specifying
+ for the makeCopy parameter).
+
+
+
+
+ Create managed image from the unmanaged.
+
+
+ Make a copy of the unmanaged image or not.
+
+ Returns managed copy of the unmanaged image.
+
+ If the is set to , then the method
+ creates a managed copy of the unmanaged image, so the managed image stays valid even when the unmanaged
+ image gets disposed. However, setting this parameter to creates a managed image which is
+ just a wrapper around the unmanaged image. So if unmanaged image is disposed, the
+ managed image becomes no longer valid and accessing it will generate an exception.
+
+ The unmanaged image has some invalid properties, which results
+ in failure of converting it to managed image. This may happen if user used the
+ constructor specifying some
+ invalid parameters.
+
+
+
+
+ Create unmanaged image from the specified managed image.
+
+
+ Source managed image.
+
+ Returns new unmanaged image, which is a copy of source managed image.
+
+ The method creates an exact copy of specified managed image, but allocated
+ in unmanaged memory.
+
+ Unsupported pixel format of source image.
+
+
+
+
+ Create unmanaged image from the specified managed image.
+
+
+ Source locked image data.
+
+ Returns new unmanaged image, which is a copy of source managed image.
+
+ The method creates an exact copy of specified managed image, but allocated
+ in unmanaged memory. This means that managed image may be unlocked right after call to this
+ method.
+
+ Unsupported pixel format of source image.
+
+
+
+
+ Collect pixel values from the specified list of coordinates.
+
+
+ List of coordinates to collect pixels' value from.
+
+ Returns array of pixels' values from the specified coordinates.
+
+ The method goes through the specified list of points and for each point retrievs
+ corresponding pixel's value from the unmanaged image.
+
+ For grayscale image the output array has the same length as number of points in the
+ specified list of points. For color image the output array has triple length, containing pixels'
+ values in RGB order.
+
+ The method does not make any checks for valid coordinates and leaves this up to user.
+ If specified coordinates are out of image's bounds, the result is not predictable (crash in most cases).
+
+
+ This method is supposed for images with 8 bpp channels only (8 bpp grayscale image and
+ 24/32 bpp color images).
+
+
+ Unsupported pixel format of the source image. Use Collect16bppPixelValues() method for
+ images with 16 bpp channels.
+
+
+
+
+ Collect coordinates of none black pixels in the image.
+
+
+ Returns list of points, which have other than black color.
+
+
+
+
+ Collect coordinates of none black pixels within specified rectangle of the image.
+
+
+ Image's rectangle to process.
+
+ Returns list of points, which have other than black color.
+
+
+
+
+ Set pixels with the specified coordinates to the specified color.
+
+
+ List of points to set color for.
+ Color to set for the specified points.
+
+ For images having 16 bpp per color plane, the method extends the specified color
+ value to 16 bit by multiplying it by 256.
+
+
+
+
+ Set pixel with the specified coordinates to the specified color.
+
+
+ Point's coordiates to set color for.
+ Color to set for the pixel.
+
+ See for more information.
+
+
+
+
+ Set pixel with the specified coordinates to the specified color.
+
+
+ X coordinate of the pixel to set.
+ Y coordinate of the pixel to set.
+ Color to set for the pixel.
+
+ For images having 16 bpp per color plane, the method extends the specified color
+ value to 16 bit by multiplying it by 256.
+
+ For grayscale images this method will calculate intensity value based on the below formula:
+
+ 0.2125 * Red + 0.7154 * Green + 0.0721 * Blue
+
+
+
+
+
+
+
+ Set pixel with the specified coordinates to the specified value.
+
+
+ X coordinate of the pixel to set.
+ Y coordinate of the pixel to set.
+ Pixel value to set.
+
+ The method sets all color components of the pixel to the specified value.
+ If it is a grayscale image, then pixel's intensity is set to the specified value.
+ If it is a color image, then pixel's R/G/B components are set to the same specified value
+ (if an image has alpha channel, then it is set to maximum value - 255 or 65535).
+
+ For images having 16 bpp per color plane, the method extends the specified color
+ value to 16 bit by multiplying it by 256.
+
+
+
+
+
+ Get color of the pixel with the specified coordinates.
+
+
+ Point's coordiates to get color of.
+
+ Return pixel's color at the specified coordinates.
+
+ See for more information.
+
+
+
+
+ Get color of the pixel with the specified coordinates.
+
+
+ X coordinate of the pixel to get.
+ Y coordinate of the pixel to get.
+
+ Return pixel's color at the specified coordinates.
+
+
+ In the case if the image has 8 bpp grayscale format, the method will return a color with
+ all R/G/B components set to same value, which is grayscale intensity.
+
+ The method supports only 8 bpp grayscale images and 24/32 bpp color images so far.
+
+
+ The specified pixel coordinate is out of image's bounds.
+ Pixel format of this image is not supported by the method.
+
+
+
+
+ Collect pixel values from the specified list of coordinates.
+
+
+ List of coordinates to collect pixels' value from.
+
+ Returns array of pixels' values from the specified coordinates.
+
+ The method goes through the specified list of points and for each point retrievs
+ corresponding pixel's value from the unmanaged image.
+
+ For grayscale image the output array has the same length as number of points in the
+ specified list of points. For color image the output array has triple length, containing pixels'
+ values in RGB order.
+
+ The method does not make any checks for valid coordinates and leaves this up to user.
+ If specified coordinates are out of image's bounds, the result is not predictable (crash in most cases).
+
+
+ This method is supposed for images with 16 bpp channels only (16 bpp grayscale image and
+ 48/64 bpp color images).
+
+
+ Unsupported pixel format of the source image. Use Collect8bppPixelValues() method for
+ images with 8 bpp channels.
+
+
+
+
+ Pointer to image data in unmanaged memory.
+
+
+
+
+ Image width in pixels.
+
+
+
+
+ Image height in pixels.
+
+
+
+
+ Image stride (line size in bytes).
+
+
+
+
+ Image pixel format.
+
+
+
+
+ Clouds texture.
+
+
+ The texture generator creates textures with effect of clouds.
+
+ The generator is based on the Perlin noise function.
+
+ Sample usage:
+
+ // create texture generator
+ CloudsTexture textureGenerator = new CloudsTexture( );
+ // generate new texture
+ float[,] texture = textureGenerator.Generate( 320, 240 );
+ // convert it to image to visualize
+ Bitmap textureImage = TextureTools.ToBitmap( texture );
+
+
+ Result image:
+
+
+
+
+
+
+ Texture generator interface.
+
+
+ Each texture generator generates a 2-D texture of the specified size and returns
+ it as two dimensional array of intensities in the range of [0, 1] - texture's values.
+
+
+
+
+
+ Generate texture.
+
+
+ Texture's width.
+ Texture's height.
+
+ Two dimensional array of texture's intensities.
+
+ Generates new texture of the specified size.
+
+
+
+
+ Reset generator.
+
+
+ Resets the generator - resets all internal variables, regenerates
+ internal random numbers, etc.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Generate texture.
+
+
+ Texture's width.
+ Texture's height.
+
+ Two dimensional array of intensities.
+
+ Generates new texture of the specified size.
+
+
+
+
+ Reset generator.
+
+
+ Regenerates internal random numbers.
+
+
+
+
+ Searching of quadrilateral/triangle corners.
+
+
+ The class searches for quadrilateral's/triangle's corners on the specified image.
+ It first collects edge points of the object and then uses
+ to find corners
+ the quadrilateral/triangle.
+
+ The class treats all black pixels as background (none-object) and
+ all none-black pixels as object.
+
+ The class processes grayscale 8 bpp and color 24/32 bpp images.
+
+ Sample usage:
+
+ // get corners of the quadrilateral
+ QuadrilateralFinder qf = new QuadrilateralFinder( );
+ List<IntPoint> corners = qf.ProcessImage( image );
+
+ // lock image to draw on it with AForge.NET's methods
+ // (or draw directly on image without locking if it is unmanaged image)
+ BitmapData data = image.LockBits( new Rectangle( 0, 0, image.Width, image.Height ),
+ ImageLockMode.ReadWrite, image.PixelFormat );
+
+ Drawing.Polygon( data, corners, Color.Red );
+ for ( int i = 0; i < corners.Count; i++ )
+ {
+ Drawing.FillRectangle( data,
+ new Rectangle( corners[i].X - 2, corners[i].Y - 2, 5, 5 ),
+ Color.FromArgb( i * 32 + 127 + 32, i * 64, i * 64 ) );
+ }
+
+ image.UnlockBits( data );
+
+
+ Source image:
+
+ Result image:
+
+
+
+
+
+
+ Find corners of quadrilateral/triangular area in the specified image.
+
+
+ Source image to search quadrilateral for.
+
+ Returns a list of points, which are corners of the quadrilateral/triangular area found
+ in the specified image. The first point in the list is the point with lowest
+ X coordinate (and with lowest Y if there are several points with the same X value).
+ Points are in clockwise order (screen coordinates system).
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Find corners of quadrilateral/triangular area in the specified image.
+
+
+ Source image data to search quadrilateral for.
+
+ Returns a list of points, which are corners of the quadrilateral/triangular area found
+ in the specified image. The first point in the list is the point with lowest
+ X coordinate (and with lowest Y if there are several points with the same X value).
+ Points are in clockwise order (screen coordinates system).
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Find corners of quadrilateral/triangular area in the specified image.
+
+
+ Source image to search quadrilateral for.
+
+ Returns a list of points, which are corners of the quadrilateral/triangular area found
+ in the specified image. The first point in the list is the point with lowest
+ X coordinate (and with lowest Y if there are several points with the same X value).
+ Points are in clockwise order (screen coordinates system).
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Interface for custom blobs' filters used for filtering blobs after
+ blob counting.
+
+
+ The interface should be implemented by classes, which perform
+ custom blobs' filtering different from default filtering implemented in
+ . See
+ for additional information.
+
+
+
+
+
+ Check specified blob and decide if should be kept or not.
+
+
+ Blob to check.
+
+ Return if the blob should be kept or
+ if it should be removed.
+
+
+
+
+ Hough line.
+
+
+ Represents line of Hough Line transformation using
+ polar coordinates.
+ See Wikipedia
+ for information on how to convert polar coordinates to Cartesian coordinates.
+
+
+ Hough Line transformation does not provide
+ information about lines start and end points, only slope and distance from image's center. Using
+ only provided information it is not possible to draw the detected line as it exactly appears on
+ the source image. But it is possible to draw a line through the entire image, which contains the
+ source line (see sample code below).
+
+
+ Sample code to draw detected Hough lines:
+
+ HoughLineTransformation lineTransform = new HoughLineTransformation( );
+ // apply Hough line transofrm
+ lineTransform.ProcessImage( sourceImage );
+ Bitmap houghLineImage = lineTransform.ToBitmap( );
+ // get lines using relative intensity
+ HoughLine[] lines = lineTransform.GetLinesByRelativeIntensity( 0.5 );
+
+ foreach ( HoughLine line in lines )
+ {
+ // get line's radius and theta values
+ int r = line.Radius;
+ double t = line.Theta;
+
+ // check if line is in lower part of the image
+ if ( r < 0 )
+ {
+ t += 180;
+ r = -r;
+ }
+
+ // convert degrees to radians
+ t = ( t / 180 ) * Math.PI;
+
+ // get image centers (all coordinate are measured relative
+ // to center)
+ int w2 = image.Width /2;
+ int h2 = image.Height / 2;
+
+ double x0 = 0, x1 = 0, y0 = 0, y1 = 0;
+
+ if ( line.Theta != 0 )
+ {
+ // none-vertical line
+ x0 = -w2; // most left point
+ x1 = w2; // most right point
+
+ // calculate corresponding y values
+ y0 = ( -Math.Cos( t ) * x0 + r ) / Math.Sin( t );
+ y1 = ( -Math.Cos( t ) * x1 + r ) / Math.Sin( t );
+ }
+ else
+ {
+ // vertical line
+ x0 = line.Radius;
+ x1 = line.Radius;
+
+ y0 = h2;
+ y1 = -h2;
+ }
+
+ // draw line on the image
+ Drawing.Line( sourceData,
+ new IntPoint( (int) x0 + w2, h2 - (int) y0 ),
+ new IntPoint( (int) x1 + w2, h2 - (int) y1 ),
+ Color.Red );
+ }
+
+
+ To clarify meaning of and values
+ of detected Hough lines, let's take a look at the below sample image and
+ corresponding values of radius and theta for the lines on the image:
+
+
+
+
+ Detected radius and theta values (color in corresponding colors):
+
+ - Theta = 90, R = 125, I = 249;
+ - Theta = 0, R = -170, I = 187 (converts to Theta = 180, R = 170);
+ - Theta = 90, R = -58, I = 163 (converts to Theta = 270, R = 58);
+ - Theta = 101, R = -101, I = 130 (converts to Theta = 281, R = 101);
+ - Theta = 0, R = 43, I = 112;
+ - Theta = 45, R = 127, I = 82.
+
+
+
+
+
+
+
+
+
+
+ Line's slope - angle between polar axis and line's radius (normal going
+ from pole to the line). Measured in degrees, [0, 180).
+
+
+
+
+ Line's distance from image center, (−∞, +∞).
+
+
+ Negative line's radius means, that the line resides in lower
+ part of the polar coordinates system. This means that value
+ should be increased by 180 degrees and radius should be made positive.
+
+
+
+
+
+ Line's absolute intensity, (0, +∞).
+
+
+ Line's absolute intensity is a measure, which equals
+ to number of pixels detected on the line. This value is bigger for longer
+ lines.
+
+ The value may not be 100% reliable to measure exact number of pixels
+ on the line. Although these value correlate a lot (which means they are very close
+ in most cases), the intensity value may slightly vary.
+
+
+
+
+
+ Line's relative intensity, (0, 1].
+
+
+ Line's relative intensity is relation of line's
+ value to maximum found intensity. For the longest line (line with highest intesity) the
+ relative intensity is set to 1. If line's relative is set 0.5, for example, this means
+ its intensity is half of maximum found intensity.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Line's slope.
+ Line's distance from image center.
+ Line's absolute intensity.
+ Line's relative intensity.
+
+
+
+
+ Compare the object with another instance of this class.
+
+
+ Object to compare with.
+
+ A signed number indicating the relative values of this instance and value: 1) greater than zero -
+ this instance is greater than value; 2) zero - this instance is equal to value;
+ 3) greater than zero - this instance is less than value.
+
+ The sort order is descending.
+
+
+ Object are compared using their intensity value.
+
+
+
+
+
+ Hough line transformation.
+
+
+ The class implements Hough line transformation, which allows to detect
+ straight lines in an image. Lines, which are found by the class, are provided in
+ polar coordinates system -
+ lines' distances from image's center and lines' slopes are provided.
+ The pole of polar coordinates system is put into processing image's center and the polar
+ axis is directed to the right from the pole. Lines' slope is measured in degrees and
+ is actually represented by angle between polar axis and line's radius (normal going
+ from pole to the line), which is measured in counter-clockwise direction.
+
+
+ Found lines may have negative radius.
+ This means, that the line resides in lower part of the polar coordinates system
+ and its value should be increased by 180 degrees and
+ radius should be made positive.
+
+
+ The class accepts binary images for processing, which are represented by 8 bpp grayscale images.
+ All black pixels (0 pixel's value) are treated as background, but pixels with different value are
+ treated as lines' pixels.
+
+ See also documentation to class for additional information
+ about Hough Lines.
+
+ Sample usage:
+
+ HoughLineTransformation lineTransform = new HoughLineTransformation( );
+ // apply Hough line transofrm
+ lineTransform.ProcessImage( sourceImage );
+ Bitmap houghLineImage = lineTransform.ToBitmap( );
+ // get lines using relative intensity
+ HoughLine[] lines = lineTransform.GetLinesByRelativeIntensity( 0.5 );
+
+ foreach ( HoughLine line in lines )
+ {
+ // ...
+ }
+
+
+ Initial image:
+
+ Hough line transformation image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process an image building Hough map.
+
+
+ Source image to process.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Process an image building Hough map.
+
+
+ Source image to process.
+ Image's rectangle to process.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Process an image building Hough map.
+
+
+ Source image data to process.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Process an image building Hough map.
+
+
+ Source image data to process.
+ Image's rectangle to process.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Process an image building Hough map.
+
+
+ Source unmanaged image to process.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Process an image building Hough map.
+
+
+ Source unmanaged image to process.
+ Image's rectangle to process.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Convert Hough map to bitmap.
+
+
+ Returns 8 bppp grayscale bitmap, which shows Hough map.
+
+ Hough transformation was not yet done by calling
+ ProcessImage() method.
+
+
+
+
+ Get specified amount of lines with highest intensity.
+
+
+ Amount of lines to get.
+
+ Returns array of most intesive lines. If there are no lines detected,
+ the returned array has zero length.
+
+
+
+
+ Get lines with relative intensity higher then specified value.
+
+
+ Minimum relative intesity of lines.
+
+ Returns array of lines. If there are no lines detected,
+ the returned array has zero length.
+
+
+
+
+ Steps per degree.
+
+
+ The value defines quality of Hough line transformation and its ability to detect
+ lines' slope precisely.
+
+ Default value is set to 1. Minimum value is 1. Maximum value is 10.
+
+
+
+
+ Minimum line's intensity in Hough map to recognize a line.
+
+
+ The value sets minimum intensity level for a line. If a value in Hough
+ map has lower intensity, then it is not treated as a line.
+
+ Default value is set to 10.
+
+
+
+
+ Radius for searching local peak value.
+
+
+ The value determines radius around a map's value, which is analyzed to determine
+ if the map's value is a local maximum in specified area.
+
+ Default value is set to 4. Minimum value is 1. Maximum value is 10.
+
+
+
+
+ Maximum found intensity in Hough map.
+
+
+ The property provides maximum found line's intensity.
+
+
+
+
+ Found lines count.
+
+
+ The property provides total number of found lines, which intensity is higher (or equal to),
+ than the requested minimum intensity.
+
+
+
+
+ Performs quadrilateral transformation of an area in the source image.
+
+
+ The class implements simple algorithm described by
+ Olivier Thill
+ for transforming quadrilateral area from a source image into rectangular image.
+ The idea of the algorithm is based on finding for each line of destination
+ rectangular image a corresponding line connecting "left" and "right" sides of
+ quadrilateral in a source image. Then the line is linearly transformed into the
+ line in destination image.
+
+ Due to simplicity of the algorithm it does not do any correction for perspective.
+
+
+ To make sure the algorithm works correctly, it is preferred if the
+ "left-top" corner of the quadrilateral (screen coordinates system) is
+ specified first in the list of quadrilateral's corners. At least
+ user need to make sure that the "left" side (side connecting first and the last
+ corner) and the "right" side (side connecting second and third corners) are
+ not horizontal.
+
+ Use to avoid the above mentioned limitations,
+ which is a more advanced quadrilateral transformation algorithms (although a bit more
+ computationally expensive).
+
+ The image processing filter accepts 8 grayscale images and 24/32 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // define quadrilateral's corners
+ List<IntPoint> corners = new List<IntPoint>( );
+ corners.Add( new IntPoint( 99, 99 ) );
+ corners.Add( new IntPoint( 156, 79 ) );
+ corners.Add( new IntPoint( 184, 126 ) );
+ corners.Add( new IntPoint( 122, 150 ) );
+ // create filter
+ SimpleQuadrilateralTransformation filter =
+ new SimpleQuadrilateralTransformation( corners, 200, 200 );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ New image width.
+
+
+
+
+ New image height.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Corners of the source quadrilateral area.
+ Width of the new transformed image.
+ Height of the new transformed image.
+
+ This constructor sets to
+ , which means that destination image will have width and
+ height as specified by user.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Corners of the source quadrilateral area.
+
+ This constructor sets to
+ , which means that destination image will have width and
+ height automatically calculated based on property.
+
+
+
+
+ Calculates new image size.
+
+
+ Source image data.
+
+ New image size - size of the destination image.
+
+ Source quadrilateral was not set.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Automatic calculation of destination image or not.
+
+
+ The property specifies how to calculate size of destination (transformed)
+ image. If the property is set to , then
+ and properties have effect and destination image's size is
+ specified by user. If the property is set to , then setting the above
+ mentioned properties does not have any effect, but destionation image's size is
+ automatically calculated from property - width and height
+ come from length of longest edges.
+
+
+ Default value is set to .
+
+
+
+
+
+ Quadrilateral's corners in source image.
+
+
+ The property specifies four corners of the quadrilateral area
+ in the source image to be transformed.
+
+ See documentation to the
+ class itself for additional information.
+
+
+
+
+
+ Width of the new transformed image.
+
+
+ The property defines width of the destination image, which gets
+ transformed quadrilateral image.
+
+ Setting the property does not have any effect, if
+ property is set to . In this case destination image's width
+ is calculated automatically based on property.
+
+
+
+
+
+ Height of the new transformed image.
+
+
+ The property defines height of the destination image, which gets
+ transformed quadrilateral image.
+
+ Setting the property does not have any effect, if
+ property is set to . In this case destination image's height
+ is calculated automatically based on property.
+
+
+
+
+
+ Specifies if bilinear interpolation should be used or not.
+
+
+ Default value is set to - interpolation
+ is used.
+
+
+
+
+
+ Texturer filter.
+
+
+ Adjust pixels’ color values using factors from the given texture. In conjunction with different type
+ of texture generators, the filter may produce different type of interesting effects.
+
+ The filter uses specified texture to adjust values using the next formula:
+ dst = src * + src * * textureValue,
+ where src is value of pixel in a source image, dst is value of pixel in a destination image and
+ textureValue is corresponding value from provided texture (see or
+ ). Using and values it is possible
+ to control the portion of source data affected by texture.
+
+
+ In most cases the and properties are set in such
+ way, that + = 1. But there is no limitations actually
+ for those values, so their sum may be as greater, as lower than 1 in order create different type of
+ effects.
+
+ The filter accepts 8 bpp grayscale and 24 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Texturer filter = new Texturer( new TextileTexture( ), 0.3, 0.7 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Generated texture.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Generated texture.
+ Filter level value (see property).
+ Preserve level value (see property).
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Texture generator.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Texture generator.
+ Filter level value (see property).
+ Preserve level value (see property).
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+ See for more information.
+
+
+
+
+ Filter level value.
+
+
+ Filtering factor determines image fraction to filter - to multiply
+ by values from the provided texture.
+
+ Default value is set to 0.5.
+
+ See class description for more details.
+
+
+
+
+
+ Preserve level value.
+
+
+ Preserving factor determines image fraction to keep from filtering.
+
+ Default value is set to 0.5.
+
+ See class description for more details.
+
+
+
+
+
+ Generated texture.
+
+
+ Two dimensional array of texture intensities.
+
+ In the case if image passed to the filter is smaller or
+ larger than the specified texture, than image's region is processed, which equals to the
+ minimum overlapping area.
+
+ The property has priority over this property - if
+ generator is specified than the static generated texture is not used.
+
+
+
+
+
+ Texture generator.
+
+
+ Generator used to generate texture.
+
+ The property has priority over the property.
+
+
+
+
+
+ Luminance and saturation linear correction.
+
+
+ The filter operates in HSL color space and provides
+ with the facility of luminance and saturation linear correction - mapping specified channels'
+ input ranges to specified output ranges.
+
+ The filter accepts 24 and 32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ HSLLinear filter = new HSLLinear( );
+ // configure the filter
+ filter.InLuminance = new Range( 0, 0.85f );
+ filter.OutSaturation = new Range( 0.25f, 1 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Luminance input range.
+
+
+ Luminance component is measured in the range of [0, 1].
+
+
+
+
+ Luminance output range.
+
+
+ Luminance component is measured in the range of [0, 1].
+
+
+
+
+ Saturation input range.
+
+
+ Saturation component is measured in the range of [0, 1].
+
+
+
+
+ Saturation output range.
+
+
+ Saturation component is measured in the range of [0, 1].
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Blur filter.
+
+
+ The filter performs convolution filter using
+ the blur kernel:
+
+
+ 1 2 3 2 1
+ 2 4 5 4 2
+ 3 5 6 5 3
+ 2 4 5 4 2
+ 1 2 3 2 1
+
+
+ For the list of supported pixel formats, see the documentation to
+ filter.
+
+ By default this filter sets property to
+ , so the alpha channel of 32 bpp and 64 bpp images is blurred as well.
+
+
+ Sample usage:
+
+ // create filter
+ Blur filter = new Blur( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Simple posterization of an image.
+
+
+ The class implements simple posterization of an image by splitting
+ each color plane into adjacent areas of the specified size. After the process
+ is done, each color plane will contain maximum of 256/PosterizationInterval levels.
+ For example, if grayscale image is posterized with posterization interval equal to 64,
+ then result image will contain maximum of 4 tones. If color image is posterized with the
+ same posterization interval, then it will contain maximum of 43=64 colors.
+ See property to get information about the way how to control
+ color used to fill posterization areas.
+
+ Posterization is a process in photograph development which converts normal photographs
+ into an image consisting of distinct, but flat, areas of different tones or colors.
+
+ The filter accepts 8 bpp grayscale and 24/32 bpp color images.
+
+ Sample usage:
+
+ // create filter
+ SimplePosterization filter = new SimplePosterization( );
+ // process image
+ filter.ApplyInPlace( sourceImage );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Specifies filling type of posterization areas.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Posterization interval, which specifies size of posterization areas.
+
+
+ The property specifies size of adjacent posterization areas
+ for each color plane. The value has direct effect on the amount of colors
+ in the result image. For example, if grayscale image is posterized with posterization
+ interval equal to 64, then result image will contain maximum of 4 tones. If color
+ image is posterized with same posterization interval, then it will contain maximum
+ of 43=64 colors.
+
+ Default value is set to 64.
+
+
+
+
+
+ Posterization filling type.
+
+
+ The property controls the color, which is used to substitute
+ colors within the same posterization interval - minimum, maximum or average value.
+
+
+ Default value is set to .
+
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Enumeration of possible types of filling posterized areas.
+
+
+
+
+ Fill area with minimum color's value.
+
+
+
+
+ Fill area with maximum color's value.
+
+
+
+
+ Fill area with average color's value.
+
+
+
+
+ Dithering using Jarvis, Judice and Ninke error diffusion.
+
+
+ The filter represents binarization filter, which is based on
+ error diffusion dithering with Jarvis-Judice-Ninke coefficients. Error is diffused
+ on 12 neighbor pixels with next coefficients:
+
+ | * | 7 | 5 |
+ | 3 | 5 | 7 | 5 | 3 |
+ | 1 | 3 | 5 | 3 | 1 |
+
+ / 48
+
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ JarvisJudiceNinkeDithering filter = new JarvisJudiceNinkeDithering( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Median cut color quantization algorithm.
+
+
+ The class implements median cut
+ color quantization algorithm.
+
+ See also class, which may simplify processing of images.
+
+ Sample usage:
+
+ // create the color quantization algorithm
+ IColorQuantizer quantizer = new MedianCutQuantizer( );
+ // process colors (taken from image for example)
+ for ( int i = 0; i < pixelsToProcess; i++ )
+ {
+ quantizer.AddColor( /* pixel color */ );
+ }
+ // get palette reduced to 16 colors
+ Color[] palette = quantizer.GetPalette( 16 );
+
+
+
+
+
+
+
+
+ Add color to the list of processed colors.
+
+
+ Color to add to the internal list.
+
+ The method adds the specified color into internal list of processed colors. The list
+ is used later by method to build reduced color table of the specified size.
+
+
+
+
+
+ Get paletter of the specified size.
+
+
+ Palette size to get.
+
+ Returns reduced palette of the specified size, which covers colors processed so far.
+
+ The method must be called after continuously calling method and
+ returns reduced color palette for colors accumulated/processed so far.
+
+
+
+
+ Clear internal state of the color quantization algorithm by clearing the list of colors
+ so far processed.
+
+
+
+
+
+ Labirinth texture.
+
+
+ The texture generator creates textures with effect of labyrinth.
+
+ The generator is based on the Perlin noise function.
+
+ Sample usage:
+
+ // create texture generator
+ LabyrinthTexture textureGenerator = new LabyrinthTexture( );
+ // generate new texture
+ float[,] texture = textureGenerator.Generate( 320, 240 );
+ // convert it to image to visualize
+ Bitmap textureImage = TextureTools.ToBitmap( texture );
+
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Generate texture.
+
+
+ Texture's width.
+ Texture's height.
+
+ Two dimensional array of intensities.
+
+ Generates new texture of the specified size.
+
+
+
+
+ Reset generator.
+
+
+ Regenerates internal random numbers.
+
+
+
+
+ Template matching algorithm's interface.
+
+
+ The interface specifies set of methods, which should be implemented by different
+ template matching algorithms - algorithms, which search for the given template in specified
+ image.
+
+
+
+
+ Process image looking for matchings with specified template.
+
+
+ Source image to process.
+ Template image to search for.
+ Rectangle in source image to search template for.
+
+ Returns array of found matchings.
+
+
+
+
+ Process image looking for matchings with specified template.
+
+
+ Source image data to process.
+ Template image to search for.
+ Rectangle in source image to search template for.
+
+ Returns array of found matchings.
+
+
+
+
+ Process image looking for matchings with specified template.
+
+
+ Unmanaged source image to process.
+ Unmanaged template image to search for.
+ Rectangle in source image to search template for.
+
+ Returns array of found matchings.
+
+
+
+
+ Replace channel of YCbCr color space.
+
+
+ Replaces specified YCbCr channel of color image with
+ specified grayscale imge.
+
+ The filter is quite useful in conjunction with filter
+ (however may be used alone in some cases). Using the filter
+ it is possible to extract one of YCbCr channel, perform some image processing with it and then
+ put it back into the original color image.
+
+ The filter accepts 24 and 32 bpp color images for processing.
+
+ Sample usage:
+
+ // create YCbCrExtractChannel filter for channel extracting
+ YCbCrExtractChannel extractFilter = new YCbCrExtractChannel(
+ YCbCr.CbIndex );
+ // extract Cb channel
+ Bitmap cbChannel = extractFilter.Apply( image );
+ // invert the channel
+ Invert invertFilter = new Invert( );
+ invertFilter.ApplyInPlace( cbChannel );
+ // put the channel back into the source image
+ YCbCrReplaceChannel replaceFilter = new YCbCrReplaceChannel(
+ YCbCr.CbIndex, cbChannel );
+ replaceFilter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ YCbCr channel to replace.
+ Channel image to use for replacement.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ YCbCr channel to replace.
+ Unmanaged channel image to use for replacement.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+ Channel image size does not match source
+ image size.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ YCbCr channel to replace.
+
+
+ Default value is set to (Y channel).
+
+ Invalid channel was specified.
+
+
+
+
+ Grayscale image to use for channel replacement.
+
+
+
+ Setting this property will clear the property -
+ only one channel image is allowed: managed or unmanaged.
+
+
+ Channel image should be 8bpp indexed image (grayscale).
+
+
+
+
+ Unmanaged grayscale image to use for channel replacement.
+
+
+
+ Setting this property will clear the property -
+ only one channel image is allowed: managed or unmanaged.
+
+
+ Channel image should be 8bpp indexed image (grayscale).
+
+
+
+
+ Adaptive Smoothing - noise removal with edges preserving.
+
+
+ The filter is aimed to perform image smoothing, but keeping sharp edges.
+ This makes it applicable to additive noise removal and smoothing objects' interiors, but
+ not applicable for spikes (salt and pepper noise) removal.
+
+ The next calculations are done for each pixel:
+
+ - weights are calculate for 9 pixels - pixel itself and 8 neighbors:
+
+ w(x, y) = exp( -1 * (Gx^2 + Gy^2) / (2 * factor^2) )
+ Gx(x, y) = (I(x + 1, y) - I(x - 1, y)) / 2
+ Gy(x, y) = (I(x, y + 1) - I(x, y - 1)) / 2
+ ,
+ where factor is a configurable value determining smoothing's quality.
+ - sum of 9 weights is calclated (weightTotal);
+ - sum of 9 weighted pixel values is calculatd (total);
+ - destination pixel is calculated as total / weightTotal.
+
+
+ Description of the filter was found in "An Edge Detection Technique Using
+ the Facet Model and Parameterized Relaxation Labeling" by Ioannis Matalas, Student Member,
+ IEEE, Ralph Benjamin, and Richard Kitney.
+
+ The filter accepts 8 bpp grayscale images and 24 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ AdaptiveSmoothing filter = new AdaptiveSmoothing( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Factor value.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Factor value.
+
+
+ Factor determining smoothing quality (see
+ documentation).
+
+ Default value is set to 3.
+
+
+
+
+
+ Blobs filtering by size.
+
+
+ The filter performs filtering of blobs by their size in the specified
+ source image - all blobs, which are smaller or bigger then specified limits, are
+ removed from the image.
+
+ The image processing filter treats all none black pixels as objects'
+ pixels and all black pixel as background.
+
+ The filter accepts 8 bpp grayscale images and 24/32
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ BlobsFiltering filter = new BlobsFiltering( );
+ // configure filter
+ filter.CoupledSizeFiltering = true;
+ filter.MinWidth = 70;
+ filter.MinHeight = 70;
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Minimum allowed width of blob.
+ Minimum allowed height of blob.
+ Maximum allowed width of blob.
+ Maximum allowed height of blob.
+
+ This constructor creates an instance of class
+ with property set to false.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Minimum allowed width of blob.
+ Minimum allowed height of blob.
+ Maximum allowed width of blob.
+ Maximum allowed height of blob.
+ Specifies if size filetering should be coupled or not.
+
+ For information about coupled filtering mode see documentation for
+ property of
+ class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Custom blobs' filtering routine to use
+ (see ).
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Specifies if size filetering should be coupled or not.
+
+
+ See documentation for property
+ of class for more information.
+
+
+
+
+ Minimum allowed width of blob.
+
+
+
+
+
+ Minimum allowed height of blob.
+
+
+
+
+
+ Maximum allowed width of blob.
+
+
+
+
+
+ Maximum allowed height of blob.
+
+
+
+
+
+ Custom blobs' filter to use.
+
+
+ See for information
+ about custom blobs' filtering routine.
+
+
+
+
+ Hit-And-Miss operator from Mathematical Morphology.
+
+
+ The hit-and-miss filter represents generalization of
+ and filters by extending flexibility of structuring element and
+ providing different modes of its work. Structuring element may contain:
+
+ - 1 - foreground;
+ - 0 - background;
+ - -1 - don't care.
+
+
+
+ Filter's mode is set by property. The list of modes and its
+ documentation may be found in enumeration.
+
+ The filter accepts 8 bpp grayscale images for processing. Note: grayscale images are treated
+ as binary with 0 value equals to black and 255 value equals to white.
+
+ Sample usage:
+
+ // define kernel to remove pixels on the right side of objects
+ // (pixel is removed, if there is white pixel on the left and
+ // black pixel on the right)
+ short[,] se = new short[,] {
+ { -1, -1, -1 },
+ { 1, 1, 0 },
+ { -1, -1, -1 }
+ };
+ // create filter
+ HitAndMiss filter = new HitAndMiss( se, HitAndMiss.Modes.Thinning );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Structuring element.
+
+ Structuring elemement for the hit-and-miss morphological operator
+ must be square matrix with odd size in the range of [3, 99].
+
+ Invalid size of structuring element.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Structuring element.
+ Operation mode.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Operation mode.
+
+
+ Mode to use for the filter. See enumeration
+ for the list of available modes and their documentation.
+
+ Default mode is set to .
+
+
+
+
+ Hit and Miss modes.
+
+
+ Bellow is a list of modes meaning depending on pixel's correspondence
+ to specified structuring element:
+
+ - - on match pixel is set to white, otherwise to black;
+ - - on match pixel is set to black, otherwise not changed.
+ - - on match pixel is set to white, otherwise not changed.
+
+
+
+
+
+
+ Hit and miss mode.
+
+
+
+
+ Thinning mode.
+
+
+
+
+ Thickening mode.
+
+
+
+
+ Homogenity edge detector.
+
+
+ The filter finds objects' edges by calculating maximum difference
+ of processing pixel with neighboring pixels in 8 direction.
+
+ Suppose 3x3 square element of the source image (x - is currently processed
+ pixel):
+
+ P1 P2 P3
+ P8 x P4
+ P7 P6 P5
+
+ The corresponding pixel of the result image equals to:
+
+ max( |x-P1|, |x-P2|, |x-P3|, |x-P4|,
+ |x-P5|, |x-P6|, |x-P7|, |x-P8| )
+
+
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ HomogenityEdgeDetector filter = new HomogenityEdgeDetector( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Gaussian sharpen filter.
+
+
+ The filter performs convolution filter using
+ the kernel, which is calculate with the help of
+ method and then converted to integer sharpening kernel. First of all the integer kernel
+ is calculated from by dividing all elements by
+ the element with the smallest value. Then the integer kernel is converted to sharpen kernel by
+ negating all kernel's elements (multiplying with -1), but the central kernel's element
+ is calculated as 2 * sum - centralElement, where sum is the sum off elements
+ in the integer kernel before negating.
+
+ For the list of supported pixel formats, see the documentation to
+ filter.
+
+ Sample usage:
+
+ // create filter with kernel size equal to 11
+ // and Gaussia sigma value equal to 4.0
+ GaussianSharpen filter = new GaussianSharpen( 4, 11 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Gaussian sigma value.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Gaussian sigma value.
+ Kernel size.
+
+
+
+
+ Gaussian sigma value, [0.5, 5.0].
+
+
+ Sigma value for Gaussian function used to calculate
+ the kernel.
+
+ Default value is set to 1.4.
+
+
+
+
+
+ Kernel size, [3, 5].
+
+
+ Size of Gaussian kernel.
+
+ Default value is set to 5.
+
+
+
+
+
+ Merge filter - get MAX of pixels in two images.
+
+
+ The merge filter takes two images (source and overlay images)
+ of the same size and pixel format and produces an image, where each pixel equals
+ to the maximum value of corresponding pixels from provided images.
+
+ The filter accepts 8 and 16 bpp grayscale images and 24, 32, 48 and 64 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Merge filter = new Merge( overlayImage );
+ // apply the filter
+ Bitmap resultImage = filter.Apply( sourceImage );
+
+
+ Source image:
+
+ Overlay image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Overlay image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged overlay image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Overlay image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Skew angle checker for scanned documents.
+
+
+ The class implements document's skew checking algorithm, which is based
+ on Hough line transformation. The algorithm
+ is based on searching for text base lines - black line of text bottoms' followed
+ by white line below.
+
+ The routine supposes that a white-background document is provided
+ with black letters. The algorithm is not supposed for any type of objects, but for
+ document images with text.
+
+ The range of angles to detect is controlled by property.
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create instance of skew checker
+ DocumentSkewChecker skewChecker = new DocumentSkewChecker( );
+ // get documents skew angle
+ double angle = skewChecker.GetSkewAngle( documentImage );
+ // create rotation filter
+ RotateBilinear rotationFilter = new RotateBilinear( -angle );
+ rotationFilter.FillColor = Color.White;
+ // rotate image applying the filter
+ Bitmap rotatedImage = rotationFilter.Apply( documentImage );
+
+
+ Initial image:
+
+ Deskewed image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Get skew angle of the provided document image.
+
+
+ Document's image to get skew angle of.
+
+ Returns document's skew angle. If the returned angle equals to -90,
+ then document skew detection has failed.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Get skew angle of the provided document image.
+
+
+ Document's image to get skew angle of.
+ Image's rectangle to process (used to exclude processing of
+ regions, which are not relevant to skew detection).
+
+ Returns document's skew angle. If the returned angle equals to -90,
+ then document skew detection has failed.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Get skew angle of the provided document image.
+
+
+ Document's image data to get skew angle of.
+
+ Returns document's skew angle. If the returned angle equals to -90,
+ then document skew detection has failed.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Get skew angle of the provided document image.
+
+
+ Document's image data to get skew angle of.
+ Image's rectangle to process (used to exclude processing of
+ regions, which are not relevant to skew detection).
+
+ Returns document's skew angle. If the returned angle equals to -90,
+ then document skew detection has failed.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Get skew angle of the provided document image.
+
+
+ Document's unmanaged image to get skew angle of.
+
+ Returns document's skew angle. If the returned angle equals to -90,
+ then document skew detection has failed.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Get skew angle of the provided document image.
+
+
+ Document's unmanaged image to get skew angle of.
+ Image's rectangle to process (used to exclude processing of
+ regions, which are not relevant to skew detection).
+
+ Returns document's skew angle. If the returned angle equals to -90,
+ then document skew detection has failed.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Steps per degree, [1, 10].
+
+
+ The value defines quality of Hough transform and its ability to detect
+ line slope precisely.
+
+ Default value is set to 1.
+
+
+
+
+
+ Maximum skew angle to detect, [0, 45] degrees.
+
+
+ The value sets maximum document's skew angle to detect.
+ Document's skew angle can be as positive (rotated counter clockwise), as negative
+ (rotated clockwise). So setting this value to 25, for example, will lead to
+ [-25, 25] degrees detection range.
+
+ Scanned documents usually have skew in the [-20, 20] degrees range.
+
+ Default value is set to 30.
+
+
+
+
+
+ Minimum angle to detect skew in degrees.
+
+
+ The property is deprecated and setting it has not any effect.
+ Use property instead.
+
+
+
+
+ Maximum angle to detect skew in degrees.
+
+
+ The property is deprecated and setting it has not any effect.
+ Use property instead.
+
+
+
+
+ Radius for searching local peak value, [1, 10].
+
+
+ The value determines radius around a map's value, which is analyzed to determine
+ if the map's value is a local maximum in specified area.
+
+ Default value is set to 4.
+
+
+
+
+ Wood texture.
+
+
+ The texture generator creates textures with effect of
+ rings on trunk's shear. The property allows to specify the
+ desired amount of wood rings.
+
+ The generator is based on the Perlin noise function.
+
+ Sample usage:
+
+ // create texture generator
+ WoodTexture textureGenerator = new WoodTexture( );
+ // generate new texture
+ float[,] texture = textureGenerator.Generate( 320, 240 );
+ // convert it to image to visualize
+ Bitmap textureImage = TextureTools.ToBitmap( texture );
+
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Wood rings amount.
+
+
+
+
+ Generate texture.
+
+
+ Texture's width.
+ Texture's height.
+
+ Two dimensional array of intensities.
+
+ Generates new texture of the specified size.
+
+
+
+
+ Reset generator.
+
+
+ Regenerates internal random numbers.
+
+
+
+
+ Wood rings amount, ≥ 3.
+
+
+ The property sets the amount of wood rings, which make effect of
+ rings on trunk's shear.
+
+ Default value is set to 12.
+
+
+
+
+ Internal memory manager used by image processing routines.
+
+
+ The memory manager supports memory allocation/deallocation
+ caching. Caching means that memory blocks may be not freed on request, but
+ kept for later reuse.
+
+
+
+
+ Allocate unmanaged memory.
+
+
+ Memory size to allocate.
+
+ Return's pointer to the allocated memory buffer.
+
+ The method allocates requested amount of memory and returns pointer to it. It may avoid allocation
+ in the case some caching scheme is uses and there is already enough allocated memory available.
+
+ There is insufficient memory to satisfy the request.
+
+
+
+
+ Free unmanaged memory.
+
+
+ Pointer to memory buffer to free.
+
+ This method may skip actual deallocation of memory and keep it for future requests,
+ if some caching scheme is used.
+
+
+
+
+ Force freeing unused memory.
+
+
+ Frees and removes from cache memory blocks, which are not used by users.
+
+ Returns number of freed memory blocks.
+
+
+
+
+ Maximum amount of memory blocks to keep in cache.
+
+
+ The value specifies the amount of memory blocks, which could be
+ cached by the memory manager.
+
+ Default value is set to 3. Maximum value is 10.
+
+
+
+
+
+ Current amount of memory blocks in cache.
+
+
+
+
+
+ Amount of busy memory blocks in cache (which were not freed yet by user).
+
+
+
+
+
+ Amount of free memory blocks in cache (which are not busy by users).
+
+
+
+
+
+ Amount of cached memory in bytes.
+
+
+
+
+
+ Maximum memory block's size in bytes, which could be cached.
+
+
+ Memory blocks, which size is greater than this value, are not cached.
+
+
+
+
+ Minimum memory block's size in bytes, which could be cached.
+
+
+ Memory blocks, which size is less than this value, are not cached.
+
+
+
+
+ Extract YCbCr channel from image.
+
+
+ The filter extracts specified YCbCr channel of color image and returns
+ it in the form of grayscale image.
+
+ The filter accepts 24 and 32 bpp color images and produces
+ 8 bpp grayscale images.
+
+ Sample usage:
+
+ // create filter
+ YCbCrExtractChannel filter = new YCbCrExtractChannel( YCbCr.CrIndex );
+ // apply the filter
+ Bitmap crChannel = filter.Apply( image );
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ YCbCr channel to extract.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ YCbCr channel to extract.
+
+
+ Default value is set to (Y channel).
+
+ Invalid channel was specified.
+
+
+
+
+ Resize image using nearest neighbor algorithm.
+
+
+ The class implements image resizing filter using nearest
+ neighbor algorithm, which does not assume any interpolation.
+
+ The filter accepts 8 and 16 bpp grayscale images and 24, 32, 48 and 64 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ ResizeNearestNeighbor filter = new ResizeNearestNeighbor( 400, 300 );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Width of the new image.
+ Height of the new image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Crop an image.
+
+
+
+ The filter crops an image providing a new image, which contains only the specified
+ rectangle of the original image.
+
+ The filter accepts 8 and 16 bpp grayscale images and 24, 32, 48 and 64 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Crop filter = new Crop( new Rectangle( 75, 75, 320, 240 ) );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Rectangle to crop.
+
+
+
+
+ Calculates new image size.
+
+
+ Source image data.
+
+ New image size - size of the destination image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Rectangle to crop.
+
+
+
+
+ Flood filling with specified color starting from specified point.
+
+
+ The filter performs image's area filling (4 directional) starting
+ from the specified point. It fills
+ the area of the pointed color, but also fills other colors, which
+ are similar to the pointed within specified tolerance.
+ The area is filled using specified fill color.
+
+
+ The filter accepts 8 bpp grayscale images and 24 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ PointedColorFloodFill filter = new PointedColorFloodFill( );
+ // configure the filter
+ filter.Tolerance = Color.FromArgb( 150, 92, 92 );
+ filter.FillColor = Color.FromArgb( 255, 255, 255 );
+ filter.StartingPoint = new IntPoint( 150, 100 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Fill color.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Flood fill tolerance.
+
+
+ The tolerance value determines which colors to fill. If the
+ value is set to 0, then only color of the pointed pixel
+ is filled. If the value is not 0, then other colors may be filled as well,
+ which are similar to the color of the pointed pixel within the specified
+ tolerance.
+
+ The tolerance value is specified as ,
+ where each component (R, G and B) represents tolerance for the corresponding
+ component of color. This allows to set different tolerances for red, green
+ and blue components.
+
+
+
+
+
+ Fill color.
+
+
+ The fill color is used to fill image's area starting from the
+ specified point.
+
+ For grayscale images the color needs to be specified with all three
+ RGB values set to the same value, (128, 128, 128) for example.
+
+ Default value is set to black.
+
+
+
+
+
+ Point to start filling from.
+
+
+ The property allows to set the starting point, where filling is
+ started from.
+
+ Default value is set to (0, 0).
+
+
+
+
+
+ Erosion operator from Mathematical Morphology with 3x3 structuring element.
+
+
+ The filter represents an optimized version of
+ filter, which is aimed for grayscale image processing with 3x3 structuring element.
+
+ See filter, which represents generic version of
+ erosion filter supporting custom structuring elements and wider range of image formats.
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+ Processing rectangle mast be at least 3x3 in size.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Flat field correction filter.
+
+
+ The goal of flat-field correction is to remove artifacts from 2-D images that
+ are caused by variations in the pixel-to-pixel sensitivity of the detector and/or by distortions
+ in the optical path. The filter requires two images for the input - source image, which represents
+ acquisition of some objects (using microscope, for example), and background image, which is taken
+ without any objects presented. The source image is corrected using the formula: src = bgMean * src / bg,
+ where src - source image's pixel value, bg - background image's pixel value, bgMean - mean
+ value of background image.
+
+ If background image is not provided, then it will be automatically generated on each filter run
+ from source image. The automatically generated background image is produced running Gaussian Blur on the
+ original image with (sigma value is set to 5, kernel size is set to 21). Before blurring the original image
+ is resized to 1/3 of its original size and then the result of blurring is resized back to the original size.
+
+
+ The class processes only grayscale (8 bpp indexed) and color (24 bpp) images.
+
+ Sample usage:
+
+ // create filter
+ FlatFieldCorrection filter = new FlatFieldCorrection( bgImage );
+ // process image
+ filter.ApplyInPlace( sourceImage );
+
+
+ Source image:
+
+ Background image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ This constructor does not set background image, which means that background
+ image will be generated on the fly on each filter run. The automatically generated background
+ image is produced running Gaussian Blur on the original image with (sigma value is set to 5,
+ kernel size is set to 21). Before blurring the original image is resized to 1/3 of its original size
+ and then the result of blurring is resized back to the original size.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Background image used for flat field correction.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+
+
+
+
+ Background image used for flat field correction.
+
+
+ The property sets the background image (without any objects), which will be used
+ for illumination correction of an image passed to the filter.
+
+ The background image must have the same size and pixel format as source image.
+ Otherwise exception will be generated when filter is applied to source image.
+
+ Setting this property will clear the property -
+ only one background image is allowed: managed or unmanaged.
+
+
+
+
+
+ Background image used for flat field correction.
+
+
+ The property sets the background image (without any objects), which will be used
+ for illumination correction of an image passed to the filter.
+
+ The background image must have the same size and pixel format as source image.
+ Otherwise exception will be generated when filter is applied to source image.
+
+ Setting this property will clear the property -
+ only one background image is allowed: managed or unmanaged.
+
+
+
+
+
+ Format translations dictionary.
+
+
+ See for more information.
+
+
+
+
+ Color filtering in HSL color space.
+
+
+ The filter operates in HSL color space and filters
+ pixels, which color is inside/outside of the specified HSL range -
+ it keeps pixels with colors inside/outside of the specified range and fills the
+ rest with specified color.
+
+ The filter accepts 24 and 32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ HSLFiltering filter = new HSLFiltering( );
+ // set color ranges to keep
+ filter.Hue = new IntRange( 335, 0 );
+ filter.Saturation = new Range( 0.6f, 1 );
+ filter.Luminance = new Range( 0.1f, 1 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+ Sample usage with saturation update only:
+
+ // create filter
+ HSLFiltering filter = new HSLFiltering( );
+ // configure the filter
+ filter.Hue = new IntRange( 340, 20 );
+ filter.UpdateLuminance = false;
+ filter.UpdateHue = false;
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Range of hue component.
+ Range of saturation component.
+ Range of luminance component.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Range of hue component, [0, 359].
+
+
+ Because of hue values are cycled, the minimum value of the hue
+ range may have bigger integer value than the maximum value, for example [330, 30].
+
+
+
+
+ Range of saturation component, [0, 1].
+
+
+
+
+ Range of luminance component, [0, 1].
+
+
+
+
+ Fill color used to fill filtered pixels.
+
+
+
+
+ Determines, if pixels should be filled inside or outside specified
+ color range.
+
+
+ Default value is set to , which means
+ the filter removes colors outside of the specified range.
+
+
+
+
+ Determines, if hue value of filtered pixels should be updated.
+
+
+ The property specifies if hue of filtered pixels should be
+ updated with value from fill color or not.
+
+ Default value is set to .
+
+
+
+
+ Determines, if saturation value of filtered pixels should be updated.
+
+
+ The property specifies if saturation of filtered pixels should be
+ updated with value from fill color or not.
+
+ Default value is set to .
+
+
+
+
+ Determines, if luminance value of filtered pixels should be updated.
+
+
+ The property specifies if luminance of filtered pixels should be
+ updated with value from fill color or not.
+
+ Default value is set to .
+
+
+
+
+ Gaussian blur filter.
+
+
+ The filter performs convolution filter using
+ the kernel, which is calculate with the help of
+ method and then converted to integer kernel by dividing all elements by the element with the
+ smallest value. Using the kernel the convolution filter is known as Gaussian blur.
+
+ Using property it is possible to configure
+ sigma value of Gaussian function.
+
+ For the list of supported pixel formats, see the documentation to
+ filter.
+
+ By default this filter sets property to
+ , so the alpha channel of 32 bpp and 64 bpp images is blurred as well.
+
+
+ Sample usage:
+
+ // create filter with kernel size equal to 11
+ // and Gaussia sigma value equal to 4.0
+ GaussianBlur filter = new GaussianBlur( 4, 11 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Gaussian sigma value.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Gaussian sigma value.
+ Kernel size.
+
+
+
+
+ Gaussian sigma value, [0.5, 5.0].
+
+
+ Sigma value for Gaussian function used to calculate
+ the kernel.
+
+ Default value is set to 1.4.
+
+
+
+
+
+ Kernel size, [3, 21].
+
+
+ Size of Gaussian kernel.
+
+ Default value is set to 5.
+
+
+
+
+
+ Simple edge detector.
+
+
+ The filter performs convolution filter using
+ the edges kernel:
+
+
+ 0 -1 0
+ -1 4 -1
+ 0 -1 0
+
+
+ For the list of supported pixel formats, see the documentation to
+ filter.
+
+ Sample usage:
+
+ // create filter
+ Edges filter = new Edges( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Base class for filters, which operate with two images of the same size and format and
+ produce new image as a result.
+
+
+ The abstract class is the base class for all filters, which can
+ be applied to an image producing new image as a result of image processing.
+
+ The base class is aimed for such type of filters, which require additional image
+ to process the source image. The additional image is set by
+ or property and must have the same size and pixel format
+ as source image. See documentation of particular inherited class for information
+ about overlay image purpose.
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Overlay image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged overlay image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Overlay image data.
+ Destination image data
+
+ Overlay image size and pixel format is checked by this base class, before
+ passing execution to inherited class.
+
+
+
+
+ Overlay image.
+
+
+
+ The property sets an overlay image, which will be used as the second image required
+ to process source image. See documentation of particular inherited class for information
+ about overlay image purpose.
+
+
+ Overlay image must have the same size and pixel format as source image.
+ Otherwise exception will be generated when filter is applied to source image.
+
+ Setting this property will clear the property -
+ only one overlay image is allowed: managed or unmanaged.
+
+
+
+
+
+ Unmanaged overlay image.
+
+
+
+ The property sets an overlay image, which will be used as the second image required
+ to process source image. See documentation of particular inherited class for information
+ about overlay image purpose.
+
+
+ Overlay image must have the same size and pixel format as source image.
+ Otherwise exception will be generated when filter is applied to source image.
+
+ Setting this property will clear the property -
+ only one overlay image is allowed: managed or unmanaged.
+
+
+
+
+
+ Otsu thresholding.
+
+
+ The class implements Otsu thresholding, which is described in
+ N. Otsu, "A threshold selection method from gray-level histograms", IEEE Trans. Systems,
+ Man and Cybernetics 9(1), pp. 62–66, 1979.
+
+ This implementation instead of minimizing the weighted within-class variance
+ does maximization of between-class variance, what gives the same result. The approach is
+ described in this presentation.
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ OtsuThreshold filter = new OtsuThreshold( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+ // check threshold value
+ byte t = filter.ThresholdValue;
+ // ...
+
+
+ Initial image:
+
+ Result image (calculated threshold is 97):
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Calculate binarization threshold for the given image.
+
+
+ Image to calculate binarization threshold for.
+ Rectangle to calculate binarization threshold for.
+
+ Returns binarization threshold.
+
+ The method is used to calculate binarization threshold only. The threshold
+ later may be applied to the image using image processing filter.
+
+ Source pixel format is not supported by the routine. It should be
+ 8 bpp grayscale (indexed) image.
+
+
+
+
+ Calculate binarization threshold for the given image.
+
+
+ Image to calculate binarization threshold for.
+ Rectangle to calculate binarization threshold for.
+
+ Returns binarization threshold.
+
+ The method is used to calculate binarization threshold only. The threshold
+ later may be applied to the image using image processing filter.
+
+ Source pixel format is not supported by the routine. It should be
+ 8 bpp grayscale (indexed) image.
+
+
+
+
+ Calculate binarization threshold for the given image.
+
+
+ Image to calculate binarization threshold for.
+ Rectangle to calculate binarization threshold for.
+
+ Returns binarization threshold.
+
+ The method is used to calculate binarization threshold only. The threshold
+ later may be applied to the image using image processing filter.
+
+ Source pixel format is not supported by the routine. It should be
+ 8 bpp grayscale (indexed) image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Threshold value.
+
+
+ The property is read only and represents the value, which
+ was automaticaly calculated using Otsu algorithm.
+
+
+
+
+ Iterative threshold search and binarization.
+
+
+
+ The algorithm works in the following way:
+
+ - select any start threshold;
+ - compute average value of Background (µB) and Object (µO) values:
+ 1) all pixels with a value that is below threshold, belong to the Background values;
+ 2) all pixels greater or equal threshold, belong to the Object values.
+
+ - calculate new thresghold: (µB + µO) / 2;
+ - if |oldThreshold - newThreshold| is less than a given manimum allowed error, then stop iteration process
+ and create the binary image with the new threshold.
+
+
+
+ For additional information see Digital Image Processing, Gonzalez/Woods. Ch.10 page:599.
+
+ The filter accepts 8 and 16 bpp grayscale images for processing.
+
+ Since the filter can be applied as to 8 bpp and to 16 bpp images,
+ the initial value of property should be set appropriately to the
+ pixel format. In the case of 8 bpp images the threshold value is in the [0, 255] range, but
+ in the case of 16 bpp images the threshold value is in the [0, 65535] range.
+
+ Sample usage:
+
+ // create filter
+ IterativeThreshold filter = new IterativeThreshold( 2, 128 );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image (calculated threshold is 102):
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Minimum allowed error, that ends the iteration process.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Minimum allowed error, that ends the iteration process.
+ Initial threshold value.
+
+
+
+
+ Calculate binarization threshold for the given image.
+
+
+ Image to calculate binarization threshold for.
+ Rectangle to calculate binarization threshold for.
+
+ Returns binarization threshold.
+
+ The method is used to calculate binarization threshold only. The threshold
+ later may be applied to the image using image processing filter.
+
+ Source pixel format is not supported by the routine. It should
+ 8 bpp grayscale (indexed) or 16 bpp grayscale image.
+
+
+
+
+ Calculate binarization threshold for the given image.
+
+
+ Image to calculate binarization threshold for.
+ Rectangle to calculate binarization threshold for.
+
+ Returns binarization threshold.
+
+ The method is used to calculate binarization threshold only. The threshold
+ later may be applied to the image using image processing filter.
+
+ Source pixel format is not supported by the routine. It should
+ 8 bpp grayscale (indexed) or 16 bpp grayscale image.
+
+
+
+
+ Calculate binarization threshold for the given image.
+
+
+ Image to calculate binarization threshold for.
+ Rectangle to calculate binarization threshold for.
+
+ Returns binarization threshold.
+
+ The method is used to calculate binarization threshold only. The threshold
+ later may be applied to the image using image processing filter.
+
+ Source pixel format is not supported by the routine. It should
+ 8 bpp grayscale (indexed) or 16 bpp grayscale image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Minimum error, value when iterative threshold search is stopped.
+
+
+ Default value is set to 0.
+
+
+
+
+ Calculate Euclidean difference between two images and threshold it.
+
+
+ The filter produces similar to , however it uses
+ Euclidean distance for finding difference between pixel values instead of Manhattan distance. Result of this
+ image processing routine may be useful in motion detection applications or finding areas of significant
+ difference.
+
+ The filter accepts 8 and 24/32color images for processing.
+
+ Sample usage:
+
+ // create filter
+ ThresholdedEuclideanDifference filter = new ThresholdedEuclideanDifference( 60 );
+ // apply the filter
+ filter.OverlayImage = backgroundImage;
+ Bitmap resultImage = filter.Apply( sourceImage );
+
+
+ Source image:
+
+ Background image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Difference threshold (see ).
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Overlay image data.
+ Destination image data
+
+
+
+
+ Difference threshold.
+
+
+ The property specifies difference threshold. If difference between pixels of processing image
+ and overlay image is greater than this value, then corresponding pixel of result image is set to white; otherwise
+ black.
+
+
+ Default value is set to 15.
+
+
+
+
+ Number of pixels which were set to white in destination image during last image processing call.
+
+
+ The property may be useful to determine amount of difference between two images which,
+ for example, may be treated as amount of motion in motion detection applications, etc.
+
+
+
+
+ Format translations dictionary.
+
+
+ See for more information.
+
+
+
+
+ Intersect filter - get MIN of pixels in two images.
+
+
+ The intersect filter takes two images (source and overlay images)
+ of the same size and pixel format and produces an image, where each pixel equals
+ to the minimum value of corresponding pixels from provided images.
+
+ The filter accepts 8 and 16 bpp grayscale images and 24, 32, 48 and 64 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Intersect filter = new Intersect( overlayImage );
+ // apply the filter
+ Bitmap resultImage = filter.Apply( sourceImage );
+
+
+ Source image:
+
+ Overlay image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Overlay image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged overlay image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Overlay image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Color dithering using Sierra error diffusion.
+
+
+ The image processing routine represents color dithering algorithm, which is based on
+ error diffusion dithering with Sierra coefficients. Error is diffused
+ on 10 neighbor pixels with next coefficients:
+
+ | * | 5 | 3 |
+ | 2 | 4 | 5 | 4 | 2 |
+ | 2 | 3 | 2 |
+
+ / 32
+
+
+ The image processing routine accepts 24/32 bpp color images for processing. As a result this routine
+ produces 4 bpp or 8 bpp indexed image, which depends on size of the specified
+ color table - 4 bpp result for
+ color tables with 16 colors or less; 8 bpp result for larger color tables.
+
+ Sample usage:
+
+ // create dithering routine (use default color table)
+ SierraColorDithering dithering = new SierraColorDithering( );
+ // apply the dithering routine
+ Bitmap newImage = dithering.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Texture tools.
+
+
+ The class represents collection of different texture tools, like
+ converting a texture to/from grayscale image.
+
+ Sample usage:
+
+ // create texture generator
+ WoodTexture textureGenerator = new WoodTexture( );
+ // generate new texture
+ float[,] texture = textureGenerator.Generate( 320, 240 );
+ // convert it to image to visualize
+ Bitmap textureImage = TextureTools.ToBitmap( texture );
+
+
+
+
+
+
+ Convert texture to grayscale bitmap.
+
+
+ Texture to convert to bitmap.
+
+ Returns bitmap of the texture.
+
+
+
+
+ Convert grayscale bitmap to texture.
+
+
+ Image to convert to texture.
+
+ Returns texture as 2D float array.
+
+ Only grayscale (8 bpp indexed images) are supported.
+
+
+
+
+ Convert grayscale bitmap to texture
+
+
+ Image data to convert to texture
+
+ Returns texture as 2D float array.
+
+ Only grayscale (8 bpp indexed images) are supported.
+
+
+
+
+ Convert grayscale bitmap to texture.
+
+
+ Image data to convert to texture.
+
+ Returns texture as 2D float array.
+
+ Only grayscale (8 bpp indexed images) are supported.
+
+
+
+
+ Textile texture.
+
+
+ The texture generator creates textures with effect of textile.
+
+ The generator is based on the Perlin noise function.
+
+ Sample usage:
+
+ // create texture generator
+ TextileTexture textureGenerator = new TextileTexture( );
+ // generate new texture
+ float[,] texture = textureGenerator.Generate( 320, 240 );
+ // convert it to image to visualize
+ Bitmap textureImage = TextureTools.ToBitmap( texture );
+
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Generate texture.
+
+
+ Texture's width.
+ Texture's height.
+
+ Two dimensional array of intensities.
+
+ Generates new texture of the specified size.
+
+
+
+
+ Reset generator.
+
+
+ Regenerates internal random numbers.
+
+
+
+
+ Blob counter based on recursion.
+
+
+ The class counts and extracts stand alone objects in
+ images using recursive version of connected components labeling
+ algorithm.
+
+ The algorithm treats all pixels with values less or equal to
+ as background, but pixels with higher values are treated as objects' pixels.
+
+ Since this algorithm is based on recursion, it is
+ required to be careful with its application to big images with big blobs,
+ because in this case recursion will require big stack size and may lead
+ to stack overflow. The recursive version may be applied (and may be even
+ faster than ) to an image with small blobs -
+ "star sky" image (or small cells, for example, etc).
+
+ For blobs' searching the class supports 8 bpp indexed grayscale images and
+ 24/32 bpp color images.
+ See documentation about for information about which
+ pixel formats are supported for extraction of blobs.
+
+ Sample usage:
+
+ // create an instance of blob counter algorithm
+ RecursiveBlobCounter bc = new RecursiveBlobCounter( );
+ // process binary image
+ bc.ProcessImage( image );
+ Rectangle[] rects = bc.GetObjectsRectangles( );
+ // process blobs
+ foreach ( Rectangle rect in rects )
+ {
+ // ...
+ }
+
+
+
+
+
+
+ Base class for different blob counting algorithms.
+
+
+ The class is abstract and serves as a base for different blob counting algorithms.
+ Classes, which inherit from this base class, require to implement
+ method, which does actual building of object's label's map.
+
+ For blobs' searcing usually all inherited classes accept binary images, which are actually
+ grayscale thresholded images. But the exact supported format should be checked in particular class,
+ inheriting from the base class. For blobs' extraction the class supports grayscale (8 bpp indexed)
+ and color images (24 and 32 bpp).
+
+ Sample usage:
+
+ // create an instance of blob counter algorithm
+ BlobCounterBase bc = new ...
+ // set filtering options
+ bc.FilterBlobs = true;
+ bc.MinWidth = 5;
+ bc.MinHeight = 5;
+ // process binary image
+ bc.ProcessImage( image );
+ Blob[] blobs = bc.GetObjects( image, false );
+ // process blobs
+ foreach ( Blob blob in blobs )
+ {
+ // ...
+ // blob.Rectangle - blob's rectangle
+ // blob.Image - blob's image
+ }
+
+
+
+
+
+
+ Objects count.
+
+
+
+
+ Objects' labels.
+
+
+
+
+ Width of processed image.
+
+
+
+
+ Height of processed image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Creates new instance of the class with
+ an empty objects map. Before using methods, which provide information about blobs
+ or extract them, the ,
+ or
+ method should be called to collect objects map.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Binary image to look for objects in.
+
+ Creates new instance of the class with
+ initialized objects map built by calling method.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Binary image data to look for objects in.
+
+ Creates new instance of the class with
+ initialized objects map built by calling method.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged binary image to look for objects in.
+
+ Creates new instance of the class with
+ initialized objects map built by calling method.
+
+
+
+
+ Build objects map.
+
+
+ Source binary image.
+
+ Processes the image and builds objects map, which is used later to extracts blobs.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Build objects map.
+
+
+ Source binary image data.
+
+ Processes the image and builds objects map, which is used later to extracts blobs.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Build object map from raw image data.
+
+
+ Source unmanaged binary image data.
+
+ Processes the image and builds objects map, which is used later to extracts blobs.
+
+ Unsupported pixel format of the source image.
+ Thrown by some inherited classes if some image property other
+ than the pixel format is not supported. See that class's documentation or the exception message for details.
+
+
+
+
+ Get objects' rectangles.
+
+
+ Returns array of objects' rectangles.
+
+ The method returns array of objects rectangles. Before calling the
+ method, the ,
+ or method should be called, which will
+ build objects map.
+
+ No image was processed before, so objects' rectangles
+ can not be collected.
+
+
+
+
+ Get objects' information.
+
+
+ Returns array of partially initialized blobs (without property initialized).
+
+ By the amount of provided information, the method is between and
+ methods. The method provides array of blobs without initialized their image.
+ Blob's image may be extracted later using
+ or method.
+
+
+
+
+ // create blob counter and process image
+ BlobCounter bc = new BlobCounter( sourceImage );
+ // specify sort order
+ bc.ObjectsOrder = ObjectsOrder.Size;
+ // get objects' information (blobs without image)
+ Blob[] blobs = bc.GetObjectInformation( );
+ // process blobs
+ foreach ( Blob blob in blobs )
+ {
+ // check blob's properties
+ if ( blob.Rectangle.Width > 50 )
+ {
+ // the blob looks interesting, let's extract it
+ bc.ExtractBlobsImage( sourceImage, blob );
+ }
+ }
+
+
+
+ No image was processed before, so objects' information
+ can not be collected.
+
+
+
+
+ Get blobs.
+
+
+ Source image to extract objects from.
+
+ Returns array of blobs.
+ Specifies size of blobs' image to extract.
+ If set to each blobs' image will have the same size as
+ the specified image. If set to each blobs' image will
+ have the size of its blob.
+
+ The method returns array of blobs. Before calling the
+ method, the ,
+ or method should be called, which will build
+ objects map.
+
+ The method supports 24/32 bpp color and 8 bpp indexed grayscale images.
+
+
+ Unsupported pixel format of the provided image.
+ No image was processed before, so objects
+ can not be collected.
+
+
+
+
+ Get blobs.
+
+
+ Source unmanaged image to extract objects from.
+ Specifies size of blobs' image to extract.
+ If set to each blobs' image will have the same size as
+ the specified image. If set to each blobs' image will
+ have the size of its blob.
+
+ Returns array of blobs.
+
+ The method returns array of blobs. Before calling the
+ method, the ,
+ or method should be called, which will build
+ objects map.
+
+ The method supports 24/32 bpp color and 8 bpp indexed grayscale images.
+
+
+ Unsupported pixel format of the provided image.
+ No image was processed before, so objects
+ can not be collected.
+
+
+
+
+ Extract blob's image.
+
+
+ Source image to extract blob's image from.
+ Blob which is required to be extracted.
+ Specifies size of blobs' image to extract.
+ If set to each blobs' image will have the same size as
+ the specified image. If set to each blobs' image will
+ have the size of its blob.
+
+ The method is used to extract image of partially initialized blob, which
+ was provided by method. Before calling the
+ method, the ,
+ or method should be called, which will build
+ objects map.
+
+ The method supports 24/32 bpp color and 8 bpp indexed grayscale images.
+
+
+ Unsupported pixel format of the provided image.
+ No image was processed before, so blob
+ can not be extracted.
+
+
+
+
+ Extract blob's image.
+
+
+ Source unmanaged image to extract blob's image from.
+ Blob which is required to be extracted.
+ Specifies size of blobs' image to extract.
+ If set to each blobs' image will have the same size as
+ the specified image. If set to each blobs' image will
+ have the size of its blob.
+
+ The method is used to extract image of partially initialized blob, which
+ was provided by method. Before calling the
+ method, the ,
+ or method should be called, which will build
+ objects map.
+
+ The method supports 24/32 bpp color and 8 bpp indexed grayscale images.
+
+
+ Unsupported pixel format of the provided image.
+ No image was processed before, so blob
+ can not be extracted.
+
+
+
+
+ Get list of points on the left and right edges of the blob.
+
+
+ Blob to collect edge points for.
+ List of points on the left edge of the blob.
+ List of points on the right edge of the blob.
+
+ The method scans each line of the blob and finds the most left and the
+ most right points for it adding them to appropriate lists. The method may be very
+ useful in conjunction with different routines from ,
+ which allow finding convex hull or quadrilateral's corners.
+
+ Both lists of points are sorted by Y coordinate - points with smaller Y
+ value go first.
+
+
+ No image was processed before, so blob
+ can not be extracted.
+
+
+
+
+ Get list of points on the top and bottom edges of the blob.
+
+
+ Blob to collect edge points for.
+ List of points on the top edge of the blob.
+ List of points on the bottom edge of the blob.
+
+ The method scans each column of the blob and finds the most top and the
+ most bottom points for it adding them to appropriate lists. The method may be very
+ useful in conjunction with different routines from ,
+ which allow finding convex hull or quadrilateral's corners.
+
+ Both lists of points are sorted by X coordinate - points with smaller X
+ value go first.
+
+
+ No image was processed before, so blob
+ can not be extracted.
+
+
+
+
+ Get list of object's edge points.
+
+
+ Blob to collect edge points for.
+
+ Returns unsorted list of blob's edge points.
+
+ The method scans each row and column of the blob and finds the
+ most top/bottom/left/right points. The method returns similar result as if results of
+ both and
+ methods were combined, but each edge point occurs only once in the list.
+
+ Edge points in the returned list are not ordered. This makes the list unusable
+ for visualization with methods, which draw polygon or poly-line. But the returned list
+ can be used with such algorithms, like convex hull search, shape analyzer, etc.
+
+
+ No image was processed before, so blob
+ can not be extracted.
+
+
+
+
+ Actual objects map building.
+
+
+ Unmanaged image to process.
+
+ By the time this method is called bitmap's pixel format is not
+ yet checked, so this should be done by the class inheriting from the base class.
+ and members are initialized
+ before the method is called, so these members may be used safely.
+
+
+
+
+ Objects count.
+
+
+ Number of objects (blobs) found by method.
+
+
+
+
+
+ Objects' labels.
+
+
+ The array of width * height size, which holds
+ labels for all objects. Background is represented with 0 value,
+ but objects are represented with labels starting from 1.
+
+
+
+
+ Objects sort order.
+
+
+ The property specifies objects' sort order, which are provided
+ by , , etc.
+
+
+
+
+
+ Specifies if blobs should be filtered.
+
+
+ If the property is equal to false, then there is no any additional
+ post processing after image was processed. If the property is set to true, then
+ blobs filtering is done right after image processing routine. If
+ is set, then custom blobs' filtering is done, which is implemented by user. Otherwise
+ blobs are filtered according to dimensions specified in ,
+ , and properties.
+
+ Default value is set to .
+
+
+
+
+ Specifies if size filetering should be coupled or not.
+
+
+ In uncoupled filtering mode, objects are filtered out in the case if
+ their width is smaller than or height is smaller than
+ . But in coupled filtering mode, objects are filtered out in
+ the case if their width is smaller than and height is
+ smaller than . In both modes the idea with filtering by objects'
+ maximum size is the same as filtering by objects' minimum size.
+
+ Default value is set to , what means uncoupled filtering by size.
+
+
+
+
+
+ Minimum allowed width of blob.
+
+
+ The property specifies minimum object's width acceptable by blob counting
+ routine and has power only when property is set to
+ and custom blobs' filter is
+ set to .
+
+ See documentation to for additional information.
+
+
+
+
+
+ Minimum allowed height of blob.
+
+
+ The property specifies minimum object's height acceptable by blob counting
+ routine and has power only when property is set to
+ and custom blobs' filter is
+ set to .
+
+ See documentation to for additional information.
+
+
+
+
+
+ Maximum allowed width of blob.
+
+
+ The property specifies maximum object's width acceptable by blob counting
+ routine and has power only when property is set to
+ and custom blobs' filter is
+ set to .
+
+ See documentation to for additional information.
+
+
+
+
+
+ Maximum allowed height of blob.
+
+
+ The property specifies maximum object's height acceptable by blob counting
+ routine and has power only when property is set to
+ and custom blobs' filter is
+ set to .
+
+ See documentation to for additional information.
+
+
+
+
+
+ Custom blobs' filter to use.
+
+
+ The property specifies custom blobs' filtering routine to use. It has
+ effect only in the case if property is set to .
+
+ When custom blobs' filtering routine is set, it has priority over default filtering done
+ with , , and .
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Creates new instance of the class with
+ an empty objects map. Before using methods, which provide information about blobs
+ or extract them, the ,
+ or
+ method should be called to collect objects map.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to look for objects in.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image data to look for objects in.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged image to look for objects in.
+
+
+
+
+ Actual objects map building.
+
+
+ Unmanaged image to process.
+
+ The method supports 8 bpp indexed grayscale images and 24/32 bpp color images.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Background threshold's value.
+
+
+ The property sets threshold value for distinguishing between background
+ pixel and objects' pixels. All pixel with values less or equal to this property are
+ treated as background, but pixels with higher values are treated as objects' pixels.
+
+ In the case of colour images a pixel is treated as objects' pixel if any of its
+ RGB values are higher than corresponding values of this threshold.
+
+ For processing grayscale image, set the property with all RGB components eqaul.
+
+ Default value is set to (0, 0, 0) - black colour.
+
+
+
+
+ Gather statistics about image in HSL color space.
+
+
+ The class is used to accumulate statistical values about images,
+ like histogram, mean, standard deviation, etc. for each HSL color channel.
+
+ The class accepts 24 and 32 bpp color images for processing.
+
+ Sample usage:
+
+ // gather statistics
+ ImageStatisticsHSL stat = new ImageStatisticsHSL( image );
+ // get saturation channel's histogram
+ ContinuousHistogram saturation = stat.Saturation;
+ // check mean value of saturation channel
+ if ( saturation.Mean > 0.5 )
+ {
+ // do further processing
+ }
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+
+ Source pixel format is not supported.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+ Mask image which specifies areas to collect statistics for.
+
+ The mask image must be a grayscale/binary (8bpp) image of the same size as the
+ specified source image, where black pixels (value 0) correspond to areas which should be excluded
+ from processing. So statistics is calculated only for pixels, which are none black in the mask image.
+
+
+ Source pixel format is not supported.
+ Mask image must be 8 bpp grayscale image.
+ Mask must have the same size as the source image to get statistics for.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+ Mask array which specifies areas to collect statistics for.
+
+ The mask array must be of the same size as the specified source image, where 0 values
+ correspond to areas which should be excluded from processing. So statistics is calculated only for pixels,
+ which have none zero corresponding value in the mask.
+
+
+ Source pixel format is not supported.
+ Mask must have the same size as the source image to get statistics for.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged image to gather statistics about.
+
+ Source pixel format is not supported.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+ Mask image which specifies areas to collect statistics for.
+
+ The mask image must be a grayscale/binary (8bpp) image of the same size as the
+ specified source image, where black pixels (value 0) correspond to areas which should be excluded
+ from processing. So statistics is calculated only for pixels, which are none black in the mask image.
+
+
+ Source pixel format is not supported.
+ Mask image must be 8 bpp grayscale image.
+ Mask must have the same size as the source image to get statistics for.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+ Mask array which specifies areas to collect statistics for.
+
+ The mask array must be of the same size as the specified source image, where 0 values
+ correspond to areas which should be excluded from processing. So statistics is calculated only for pixels,
+ which have none zero corresponding value in the mask.
+
+
+ Source pixel format is not supported.
+ Mask must have the same size as the source image to get statistics for.
+
+
+
+
+ Histogram of saturation channel.
+
+
+
+
+
+ Histogram of luminance channel.
+
+
+
+
+
+ Histogram of saturation channel excluding black pixels.
+
+
+ The property keeps statistics about saturation channel, which
+ excludes all black pixels, what affects mean, standard deviation, etc.
+
+
+
+
+
+ Histogram of luminance channel excluding black pixels.
+
+
+ The property keeps statistics about luminance channel, which
+ excludes all black pixels, what affects mean, standard deviation, etc.
+
+
+
+
+
+ Total pixels count in the processed image.
+
+
+
+
+
+ Total pixels count in the processed image excluding black pixels.
+
+
+
+
+
+ Fill holes in objects in binary image.
+
+
+ The filter allows to fill black holes in white object in a binary image.
+ It is possible to specify maximum holes' size to fill using
+ and properties.
+
+ The filter accepts binary image only, which are represented as 8 bpp images.
+
+ Sample usage:
+
+ // create and configure the filter
+ FillHoles filter = new FillHoles( );
+ filter.MaxHoleHeight = 20;
+ filter.MaxHoleWidth = 20;
+ filter.CoupledSizeFiltering = false;
+ // apply the filter
+ Bitmap result = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+
+
+
+
+ Specifies if size filetering should be coupled or not.
+
+
+ In uncoupled filtering mode, holes are filled in the case if
+ their width is smaller than or equal to or height is smaller than
+ or equal to . But in coupled filtering mode, holes are filled only in
+ the case if both width and height are smaller or equal to the corresponding value.
+
+ Default value is set to , what means coupled filtering by size.
+
+
+
+
+
+ Maximum width of a hole to fill.
+
+
+ All holes, which have width greater than this value, are kept unfilled.
+ See for additional information.
+
+ Default value is set to .
+
+
+
+
+ Maximum height of a hole to fill.
+
+
+ All holes, which have height greater than this value, are kept unfilled.
+ See for additional information.
+
+ Default value is set to .
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Move canvas to the specified point.
+
+
+
+ The filter moves canvas to the specified area filling unused empty areas with specified color.
+
+ The filter accepts 8/16 bpp grayscale images and 24/32/48/64 bpp color image
+ for processing.
+
+ Sample usage:
+
+ // create filter
+ CanvasMove filter = new CanvasMove( new IntPoint( -50, -50 ), Color.Green );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Point to move the canvas to.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Point to move the canvas.
+ RGB color to use for filling areas empty areas in color images.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Point to move the canvas.
+ Gray color to use for filling empty areas in grayscale images.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Point to move the canvas.
+ RGB color to use for filling areas empty areas in color images.
+ Gray color to use for filling empty areas in grayscale images.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ RGB fill color.
+
+
+ The color is used to fill empty areas in color images.
+
+ Default value is set to white - ARGB(255, 255, 255, 255).
+
+
+
+
+ Gray fill color.
+
+
+ The color is used to fill empty areas in grayscale images.
+
+ Default value is set to white - 255.
+
+
+
+
+ Point to move the canvas to.
+
+
+
+
+
+ Replace RGB channel of color imgae.
+
+
+ Replaces specified RGB channel of color image with
+ specified grayscale image.
+
+ The filter is quite useful in conjunction with filter
+ (however may be used alone in some cases). Using the filter
+ it is possible to extract one of RGB channel, perform some image processing with it and then
+ put it back into the original color image.
+
+ The filter accepts 24, 32, 48 and 64 bpp color images for processing.
+
+ Sample usage:
+
+ // extract red channel
+ ExtractChannel extractFilter = new ExtractChannel( RGB.R );
+ Bitmap channel = extractFilter.Apply( image );
+ // threshold channel
+ Threshold thresholdFilter = new Threshold( 230 );
+ thresholdFilter.ApplyInPlace( channel );
+ // put the channel back
+ ReplaceChannel replaceFilter = new ReplaceChannel( RGB.R, channel );
+ replaceFilter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ ARGB channel to replace.
+ Channel image to use for replacement.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ RGB channel to replace.
+ Unmanaged channel image to use for replacement.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+ Channel image size does not match source
+ image size.
+ Channel image's format does not correspond to format of the source image.
+
+ Can not replace alpha channel of none ARGB image. The
+ exception is throw, when alpha channel is requested to be replaced in RGB image.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ ARGB channel to replace.
+
+
+ Default value is set to .
+
+ Invalid channel is specified.
+
+
+
+
+ Grayscale image to use for channel replacement.
+
+
+
+ Setting this property will clear the property -
+ only one channel image is allowed: managed or unmanaged.
+
+
+ Channel image should be 8 bpp indexed or 16 bpp grayscale image.
+
+
+
+
+ Unmanaged grayscale image to use for channel replacement.
+
+
+
+ Setting this property will clear the property -
+ only one channel image is allowed: managed or unmanaged.
+
+
+ Channel image should be 8 bpp indexed or 16 bpp grayscale image.
+
+
+
+
+ Grayscale image using R-Y algorithm.
+
+
+ The class uses R-Y algorithm to convert color image
+ to grayscale. The conversion coefficients are:
+
+ - Red: 0.5;
+ - Green: 0.419;
+ - Blue: 0.081.
+
+
+
+
+
+
+
+
+
+
+ Base class for image grayscaling.
+
+
+ This class is the base class for image grayscaling. Other
+ classes should inherit from this class and specify RGB
+ coefficients used for color image conversion to grayscale.
+
+ The filter accepts 24, 32, 48 and 64 bpp color images and produces
+ 8 (if source is 24 or 32 bpp image) or 16 (if source is 48 or 64 bpp image)
+ bpp grayscale image.
+
+ Sample usage:
+
+ // create grayscale filter (BT709)
+ Grayscale filter = new Grayscale( 0.2125, 0.7154, 0.0721 );
+ // apply the filter
+ Bitmap grayImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+ Portion of red channel's value to use during conversion from RGB to grayscale.
+
+
+
+
+ Portion of green channel's value to use during conversion from RGB to grayscale.
+
+
+
+
+ Portion of blue channel's value to use during conversion from RGB to grayscale.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Red coefficient.
+ Green coefficient.
+ Blue coefficient.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Set of predefined common grayscaling algorithms, which have aldready initialized
+ grayscaling coefficients.
+
+
+
+
+ Grayscale image using BT709 algorithm.
+
+
+ The instance uses BT709 algorithm to convert color image
+ to grayscale. The conversion coefficients are:
+
+ - Red: 0.2125;
+ - Green: 0.7154;
+ - Blue: 0.0721.
+
+
+ Sample usage:
+
+ // apply the filter
+ Bitmap grayImage = Grayscale.CommonAlgorithms.BT709.Apply( image );
+
+
+
+
+
+
+ Grayscale image using R-Y algorithm.
+
+
+ The instance uses R-Y algorithm to convert color image
+ to grayscale. The conversion coefficients are:
+
+ - Red: 0.5;
+ - Green: 0.419;
+ - Blue: 0.081.
+
+
+ Sample usage:
+
+ // apply the filter
+ Bitmap grayImage = Grayscale.CommonAlgorithms.RMY.Apply( image );
+
+
+
+
+
+
+ Grayscale image using Y algorithm.
+
+
+ The instance uses Y algorithm to convert color image
+ to grayscale. The conversion coefficients are:
+
+ - Red: 0.299;
+ - Green: 0.587;
+ - Blue: 0.114.
+
+
+ Sample usage:
+
+ // apply the filter
+ Bitmap grayImage = Grayscale.CommonAlgorithms.Y.Apply( image );
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Threshold binarization with error carry.
+
+
+ The filter is similar to filter in the way,
+ that it also uses threshold value for image binarization. Unlike regular threshold
+ filter, this filter uses cumulative pixel value in comparing with threshold value.
+ If cumulative pixel value is below threshold value, then image pixel becomes black.
+ If cumulative pixel value is equal or higher than threshold value, then image pixel
+ becomes white and cumulative pixel value is decreased by 255. In the beginning of each
+ image line the cumulative value is reset to 0.
+
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ Threshold filter = new Threshold( 100 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Threshold value.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Threshold value.
+
+
+ Default value is 128.
+
+
+
+
+ Color dithering using Burkes error diffusion.
+
+
+ The image processing routine represents color dithering algorithm, which is based on
+ error diffusion dithering with Burkes coefficients. Error is diffused
+ on 7 neighbor pixels with next coefficients:
+
+ | * | 8 | 4 |
+ | 2 | 4 | 8 | 4 | 2 |
+
+ / 32
+
+
+ The image processing routine accepts 24/32 bpp color images for processing. As a result this routine
+ produces 4 bpp or 8 bpp indexed image, which depends on size of the specified
+ color table - 4 bpp result for
+ color tables with 16 colors or less; 8 bpp result for larger color tables.
+
+ Sample usage:
+
+ // create color image quantization routine
+ ColorImageQuantizer ciq = new ColorImageQuantizer( new MedianCutQuantizer( ) );
+ // create 8 colors table
+ Color[] colorTable = ciq.CalculatePalette( image, 8 );
+ // create dithering routine
+ BurkesColorDithering dithering = new BurkesColorDithering( );
+ dithering.ColorTable = colorTable;
+ // apply the dithering routine
+ Bitmap newImage = dithering.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Moravec corners detector.
+
+
+ The class implements Moravec corners detector. For information about algorithm's
+ details its description
+ should be studied.
+
+ Due to limitations of Moravec corners detector (anisotropic response, etc.) its usage is limited
+ to certain cases only.
+
+ The class processes only grayscale 8 bpp and color 24/32 bpp images.
+
+ Sample usage:
+
+ // create corner detector's instance
+ MoravecCornersDetector mcd = new MoravecCornersDetector( );
+ // process image searching for corners
+ List<IntPoint> corners = scd.ProcessImage( image );
+ // process points
+ foreach ( IntPoint corner in corners )
+ {
+ // ...
+ }
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Threshold value, which is used to filter out uninteresting points.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Threshold value, which is used to filter out uninteresting points.
+ Window size used to determine if point is interesting.
+
+
+
+
+ Process image looking for corners.
+
+
+ Source image to process.
+
+ Returns array of found corners (X-Y coordinates).
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Process image looking for corners.
+
+
+ Source image data to process.
+
+ Returns array of found corners (X-Y coordinates).
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Process image looking for corners.
+
+
+ Unmanaged source image to process.
+
+ Returns array of found corners (X-Y coordinates).
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Window size used to determine if point is interesting, [3, 15].
+
+
+ The value specifies window size, which is used for initial searching of
+ corners candidates and then for searching local maximums.
+
+ Default value is set to 3.
+
+
+ Setting value is not odd.
+
+
+
+
+ Threshold value, which is used to filter out uninteresting points.
+
+
+ The value is used to filter uninteresting points - points which have value below
+ specified threshold value are treated as not corners candidates. Increasing this value decreases
+ the amount of detected point.
+
+ Default value is set to 500.
+
+
+
+
+
+ Mirroring filter.
+
+
+ The filter mirrors image around X and/or Y axis (horizontal and vertical
+ mirroring).
+
+ The filter accepts 8 bpp grayscale images and 24 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Mirror filter = new Mirror( false, true );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Specifies if mirroring should be done for X axis.
+ Specifies if mirroring should be done for Y axis
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Specifies if mirroring should be done for X axis (horizontal mirroring).
+
+
+
+
+
+ Specifies if mirroring should be done for Y axis (vertical mirroring).
+
+
+
+
+
+ Apply filter according to the specified mask.
+
+
+ The image processing routine applies the specified to
+ a source image according to the specified mask - if a pixel/value in the specified mask image/array
+ is set to 0, then the original pixel's value is kept; otherwise the pixel is filtered using the
+ specified base filter.
+
+ Mask can be specified as .NET's managed Bitmap, as
+ UnmanagedImage or as byte array.
+ In the case if mask is specified as image, it must be 8 bpp grayscale image. In all case
+ mask size must be the same as size of the image to process.
+
+ Pixel formats accepted by this filter are specified by the .
+
+ Sample usage:
+
+ // create the filter
+ MaskedFilter maskedFilter = new MaskedFilter( new Sepia( ), maskImage );
+ // apply the filter
+ maskedFilter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Mask image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Base filter to apply to the specified source image.
+ Mask image to use.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Base filter to apply to the specified source image.
+ Unmanaged mask image to use.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Base filter to apply to the specified source image.
+ to use.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+ None of the possible mask properties were set. Need to provide mask before applying the filter.
+ Invalid size of provided mask. Its size must be the same as the size of the image to mask.
+
+
+
+
+ Base filter to apply to the source image.
+
+
+ The property specifies base filter which is applied to the specified source
+ image (to all pixels which have corresponding none 0 value in mask image/array).
+
+ The base filter must implement interface.
+
+ The base filter must never change image's pixel format. For example, if source
+ image's pixel format is 24 bpp color image, then it must stay the same after the base
+ filter is applied.
+
+ The base filter must never change size of the source image.
+
+
+ Base filter can not be set to null.
+ The specified base filter must implement IFilterInformation interface.
+ The specified filter must never change pixel format.
+
+
+
+
+ Mask image to apply.
+
+
+ The property specifies mask image to use. The image must be grayscale
+ (8 bpp format) and have the same size as the source image to process.
+
+ When the property is set, both and
+ properties are set to .
+
+
+ The mask image must be 8 bpp grayscale image.
+
+
+
+
+ Unmanaged mask image to apply.
+
+
+ The property specifies unmanaged mask image to use. The image must be grayscale
+ (8 bpp format) and have the same size as the source image to process.
+
+ When the property is set, both and
+ properties are set to .
+
+
+ The mask image must be 8 bpp grayscale image.
+
+
+
+
+ Mask to apply.
+
+
+ The property specifies mask array to use. Size of the array must
+ be the same size as the size of the source image to process - its 0th dimension
+ must be equal to image's height and its 1st dimension must be equal to width. For
+ example, for 640x480 image, the mask array must be defined as:
+
+ byte[,] mask = new byte[480, 640];
+
+
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+ The property returns format translation table from the
+ .
+
+
+
+
+
+ Jitter filter.
+
+
+ The filter moves each pixel of a source image in
+ random direction within a window of specified radius.
+
+ The filter accepts 8 bpp grayscale images and 24/32
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Jitter filter = new Jitter( 4 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Jittering radius.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Jittering radius, [1, 10]
+
+
+ Determines radius in which pixels can move.
+
+ Default value is set to 2.
+
+
+
+
+
+ Fill areas iniside of the specified region.
+
+
+
+ The filter fills areas inside of specified region using the specified color.
+
+ The filter accepts 8bpp grayscale and 24/32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ CanvasFill filter = new CanvasFill( new Rectangle(
+ 5, 5, image.Width - 10, image.Height - 10 ), Color.Red );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Region to fill.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Region to fill.
+ RGB color to use for filling areas inside of specified region in color images.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Region to fill.
+ Gray color to use for filling areas inside of specified region in grayscale images.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Region to fill.
+ RGB color to use for filling areas inside of specified region in color images.
+ Gray color to use for filling areas inside of specified region in grayscale images.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ RGB fill color.
+
+
+ The color is used to fill areas out of specified region in color images.
+
+ Default value is set to white - RGB(255, 255, 255).
+
+
+
+
+ Gray fill color.
+
+
+ The color is used to fill areas out of specified region in grayscale images.
+
+ Default value is set to white - 255.
+
+
+
+
+ Region to fill.
+
+
+ Pixels inside of the specified region will be filled with specified color.
+
+
+
+
+ Histogram equalization filter.
+
+
+ The filter does histogram equalization increasing local contrast in images. The effect
+ of histogram equalization can be better seen on images, where pixel values have close contrast values.
+ Through this adjustment, pixels intensities can be better distributed on the histogram. This allows for
+ areas of lower local contrast to gain a higher contrast without affecting the global contrast.
+
+
+ The filter accepts 8 bpp grayscale images and 24/32 bpp
+ color images for processing.
+
+ For color images the histogram equalization is applied to each color plane separately.
+
+ Sample usage:
+
+ // create filter
+ HistogramEqualization filter = new HistogramEqualization( );
+ // process image
+ filter.ApplyInPlace( sourceImage );
+
+
+ Source image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Extract RGB channel from image.
+
+
+ Extracts specified channel of color image and returns
+ it as grayscale image.
+
+ The filter accepts 24, 32, 48 and 64 bpp color images and produces
+ 8 (if source is 24 or 32 bpp image) or 16 (if source is 48 or 64 bpp image)
+ bpp grayscale image.
+
+ Sample usage:
+
+ // create filter
+ ExtractChannel filter = new ExtractChannel( RGB.G );
+ // apply the filter
+ Bitmap channelImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ ARGB channel to extract.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+ Can not extract alpha channel from none ARGB image. The
+ exception is throw, when alpha channel is requested from RGB image.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ ARGB channel to extract.
+
+
+ Default value is set to .
+
+ Invalid channel is specified.
+
+
+
+
+ Dithering using Floyd-Steinberg error diffusion.
+
+
+ The filter represents binarization filter, which is based on
+ error diffusion dithering with Floyd-Steinberg
+ coefficients. Error is diffused on 4 neighbor pixels with next coefficients:
+
+
+ | * | 7 |
+ | 3 | 5 | 1 |
+
+ / 16
+
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ FloydSteinbergDithering filter = new FloydSteinbergDithering( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Core image relatad methods.
+
+
+ All methods of this class are static and represent general routines
+ used by different image processing classes.
+
+
+
+
+ Check if specified 8 bpp image is grayscale.
+
+
+ Image to check.
+
+ Returns true if the image is grayscale or false otherwise.
+
+ The methods checks if the image is a grayscale image of 256 gradients.
+ The method first examines if the image's pixel format is
+ Format8bppIndexed
+ and then it examines its palette to check if the image is grayscale or not.
+
+
+
+
+ Create and initialize new 8 bpp grayscale image.
+
+
+ Image width.
+ Image height.
+
+ Returns the created grayscale image.
+
+ The method creates new 8 bpp grayscale image and initializes its palette.
+ Grayscale image is represented as
+ Format8bppIndexed
+ image with palette initialized to 256 gradients of gray color.
+
+
+
+
+ Set pallete of the 8 bpp indexed image to grayscale.
+
+
+ Image to initialize.
+
+ The method initializes palette of
+ Format8bppIndexed
+ image with 256 gradients of gray color.
+
+ Provided image is not 8 bpp indexed image.
+
+
+
+
+ Clone image.
+
+
+ Source image.
+ Pixel format of result image.
+
+ Returns clone of the source image with specified pixel format.
+
+ The original Bitmap.Clone()
+ does not produce the desired result - it does not create a clone with specified pixel format.
+ More of it, the original method does not create an actual clone - it does not create a copy
+ of the image. That is why this method was implemented to provide the functionality.
+
+
+
+
+ Clone image.
+
+
+ Source image.
+
+ Return clone of the source image.
+
+ The original Bitmap.Clone()
+ does not produce the desired result - it does not create an actual clone (it does not create a copy
+ of the image). That is why this method was implemented to provide the functionality.
+
+
+
+
+ Clone image.
+
+
+ Source image data.
+
+ Clones image from source image data. The message does not clone pallete in the
+ case if the source image has indexed pixel format.
+
+
+
+
+ Format an image.
+
+
+ Source image to format.
+
+ Formats the image to one of the formats, which are supported
+ by the AForge.Imaging library. The image is left untouched in the
+ case if it is already of
+ Format24bppRgb or
+ Format32bppRgb or
+ Format32bppArgb or
+ Format48bppRgb or
+ Format64bppArgb
+ format or it is grayscale, otherwise the image
+ is converted to Format24bppRgb
+ format.
+
+ The method is deprecated and method should
+ be used instead with specifying desired pixel format.
+
+
+
+
+
+ Load bitmap from file.
+
+
+ File name to load bitmap from.
+
+ Returns loaded bitmap.
+
+ The method is provided as an alternative of
+ method to solve the issues of locked file. The standard .NET's method locks the source file until
+ image's object is disposed, so the file can not be deleted or overwritten. This method workarounds the issue and
+ does not lock the source file.
+
+ Sample usage:
+
+ Bitmap image = AForge.Imaging.Image.FromFile( "test.jpg" );
+
+
+
+
+
+
+ Convert bitmap with 16 bits per plane to a bitmap with 8 bits per plane.
+
+
+ Source image to convert.
+
+ Returns new image which is a copy of the source image but with 8 bits per plane.
+
+ The routine does the next pixel format conversions:
+
+ - Format16bppGrayScale to
+ Format8bppIndexed with grayscale palette;
+ - Format48bppRgb to
+ Format24bppRgb;
+ - Format64bppArgb to
+ Format32bppArgb;
+ - Format64bppPArgb to
+ Format32bppPArgb.
+
+
+
+ Invalid pixel format of the source image.
+
+
+
+
+ Convert bitmap with 8 bits per plane to a bitmap with 16 bits per plane.
+
+
+ Source image to convert.
+
+ Returns new image which is a copy of the source image but with 16 bits per plane.
+
+ The routine does the next pixel format conversions:
+
+ - Format8bppIndexed (grayscale palette assumed) to
+ Format16bppGrayScale;
+ - Format24bppRgb to
+ Format48bppRgb;
+ - Format32bppArgb to
+ Format64bppArgb;
+ - Format32bppPArgb to
+ Format64bppPArgb.
+
+
+
+ Invalid pixel format of the source image.
+
+
+
+
+ Linear correction of YCbCr channels.
+
+
+ The filter operates in YCbCr color space and provides
+ with the facility of linear correction of its channels - mapping specified channels'
+ input ranges to specified output ranges.
+
+ The filter accepts 24 and 32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ YCbCrLinear filter = new YCbCrLinear( );
+ // configure the filter
+ filter.InCb = new Range( -0.276f, 0.163f );
+ filter.InCr = new Range( -0.202f, 0.500f );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Y component's input range.
+
+
+ Y component is measured in the range of [0, 1].
+
+
+
+
+ Cb component's input range.
+
+
+ Cb component is measured in the range of [-0.5, 0.5].
+
+
+
+
+ Cr component's input range.
+
+
+ Cr component is measured in the range of [-0.5, 0.5].
+
+
+
+
+ Y component's output range.
+
+
+ Y component is measured in the range of [0, 1].
+
+
+
+
+ Cb component's output range.
+
+
+ Cb component is measured in the range of [-0.5, 0.5].
+
+
+
+
+ Cr component's output range.
+
+
+ Cr component is measured in the range of [-0.5, 0.5].
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Resize image using bilinear interpolation algorithm.
+
+
+ The class implements image resizing filter using bilinear
+ interpolation algorithm.
+
+ The filter accepts 8 grayscale images and 24/32 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ ResizeBilinear filter = new ResizeBilinear( 400, 300 );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Width of the new image.
+ Height of the new image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Oil painting filter.
+
+
+ Processing source image the filter changes each pixels' value
+ to the value of pixel with the most frequent intensity within window of the
+ specified size. Going through the window the filters
+ finds which intensity of pixels is the most frequent. Then it updates value
+ of the pixel in the center of the window to the value with the most frequent
+ intensity. The update procedure creates the effect of oil painting.
+
+ The filter accepts 8 bpp grayscale images and 24/32
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ OilPainting filter = new OilPainting( 15 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Brush size.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Brush size, [3, 21].
+
+
+ Window size to search for most frequent pixels' intensity.
+
+ Default value is set to 5.
+
+
+
+
+ Extract normalized RGB channel from color image.
+
+
+ Extracts specified normalized RGB channel of color image and returns
+ it as grayscale image.
+
+ Normalized RGB color space is defined as:
+
+ r = R / (R + G + B ),
+ g = G / (R + G + B ),
+ b = B / (R + G + B ),
+
+ where R, G and B are components of RGB color space and
+ r, g and b are components of normalized RGB color space.
+
+
+ The filter accepts 24, 32, 48 and 64 bpp color images and produces
+ 8 (if source is 24 or 32 bpp image) or 16 (if source is 48 or 64 bpp image)
+ bpp grayscale image.
+
+ Sample usage:
+
+ // create filter
+ ExtractNormalizedRGBChannel filter = new ExtractNormalizedRGBChannel( RGB.G );
+ // apply the filter
+ Bitmap channelImage = filter.Apply( image );
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Normalized RGB channel to extract.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Normalized RGB channel to extract.
+
+
+ Default value is set to .
+
+ Invalid channel is specified.
+
+
+
+
+ Binary dilatation operator from Mathematical Morphology with 3x3 structuring element.
+
+
+ The filter represents an optimized version of
+ filter, which is aimed for binary images (containing black and white pixels) processed
+ with 3x3 structuring element. This makes this filter ideal for growing objects in binary
+ images – it puts white pixel to the destination image in the case if there is at least
+ one white neighbouring pixel in the source image.
+
+ See filter, which represents generic version of
+ dilatation filter supporting custom structuring elements and wider range of image formats.
+
+ The filter accepts 8 bpp grayscale (binary) images for processing.
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+ Processing rectangle mast be at least 3x3 in size.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Sobel edge detector.
+
+
+ The filter searches for objects' edges by applying Sobel operator.
+
+ Each pixel of the result image is calculated as approximated absolute gradient
+ magnitude for corresponding pixel of the source image:
+
+ |G| = |Gx| + |Gy] ,
+
+ where Gx and Gy are calculate utilizing Sobel convolution kernels:
+
+ Gx Gy
+ -1 0 +1 +1 +2 +1
+ -2 0 +2 0 0 0
+ -1 0 +1 -1 -2 -1
+
+ Using the above kernel the approximated magnitude for pixel x is calculate using
+ the next equation:
+
+ P1 P2 P3
+ P8 x P4
+ P7 P6 P5
+
+ |G| = |P1 + 2P2 + P3 - P7 - 2P6 - P5| +
+ |P3 + 2P4 + P5 - P1 - 2P8 - P7|
+
+
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ SobelEdgeDetector filter = new SobelEdgeDetector( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Scale intensity or not.
+
+
+ The property determines if edges' pixels intensities of the result image
+ should be scaled in the range of the lowest and the highest possible intensity
+ values.
+
+ Default value is set to .
+
+
+
+
+
+ Sharpen filter
+
+
+ The filter performs convolution filter using
+ the sharpen kernel:
+
+
+ 0 -1 0
+ -1 5 -1
+ 0 -1 0
+
+
+ For the list of supported pixel formats, see the documentation to
+ filter.
+
+ Sample usage:
+
+ // create filter
+ Sharpen filter = new Sharpen( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Sepia filter - old brown photo.
+
+
+ The filter makes an image look like an old brown photo. The main
+ idea of the algorithm:
+
+ - transform to YIQ color space;
+ - modify it;
+ - transform back to RGB.
+
+
+
+ 1) RGB -> YIQ:
+
+ Y = 0.299 * R + 0.587 * G + 0.114 * B
+ I = 0.596 * R - 0.274 * G - 0.322 * B
+ Q = 0.212 * R - 0.523 * G + 0.311 * B
+
+
+
+
+ 2) update:
+
+ I = 51
+ Q = 0
+
+
+
+
+ 3) YIQ -> RGB:
+
+ R = 1.0 * Y + 0.956 * I + 0.621 * Q
+ G = 1.0 * Y - 0.272 * I - 0.647 * Q
+ B = 1.0 * Y - 1.105 * I + 1.702 * Q
+
+
+
+ The filter accepts 24/32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Sepia filter = new Sepia( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Invert image.
+
+
+ The filter inverts colored and grayscale images.
+
+ The filter accepts 8, 16 bpp grayscale and 24, 48 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Invert filter = new Invert( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Euclidean color filtering.
+
+
+ The filter filters pixels, which color is inside/outside
+ of RGB sphere with specified center and radius - it keeps pixels with
+ colors inside/outside of the specified sphere and fills the rest with
+ specified color.
+
+ The filter accepts 24 and 32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ EuclideanColorFiltering filter = new EuclideanColorFiltering( );
+ // set center colol and radius
+ filter.CenterColor = new RGB( 215, 30, 30 );
+ filter.Radius = 100;
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ RGB sphere's center.
+ RGB sphere's radius.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ RGB sphere's radius, [0, 450].
+
+
+ Default value is 100.
+
+
+
+
+ RGB sphere's center.
+
+
+ Default value is (255, 255, 255) - white color.
+
+
+
+
+ Fill color used to fill filtered pixels.
+
+
+
+
+ Determines, if pixels should be filled inside or outside specified
+ RGB sphere.
+
+
+ Default value is set to , which means
+ the filter removes colors outside of the specified range.
+
+
+
+
+ Exhaustive template matching.
+
+
+ The class implements exhaustive template matching algorithm,
+ which performs complete scan of source image, comparing each pixel with corresponding
+ pixel of template.
+
+ The class processes only grayscale 8 bpp and color 24 bpp images.
+
+ Sample usage:
+
+ // create template matching algorithm's instance
+ ExhaustiveTemplateMatching tm = new ExhaustiveTemplateMatching( 0.9f );
+ // find all matchings with specified above similarity
+ TemplateMatch[] matchings = tm.ProcessImage( sourceImage, templateImage );
+ // highlight found matchings
+ BitmapData data = sourceImage.LockBits(
+ new Rectangle( 0, 0, sourceImage.Width, sourceImage.Height ),
+ ImageLockMode.ReadWrite, sourceImage.PixelFormat );
+ foreach ( TemplateMatch m in matchings )
+ {
+ Drawing.Rectangle( data, m.Rectangle, Color.White );
+ // do something else with matching
+ }
+ sourceImage.UnlockBits( data );
+
+
+ The class also can be used to get similarity level between two image of the same
+ size, which can be useful to get information about how different/similar are images:
+
+ // create template matching algorithm's instance
+ // use zero similarity to make sure algorithm will provide anything
+ ExhaustiveTemplateMatching tm = new ExhaustiveTemplateMatching( 0 );
+ // compare two images
+ TemplateMatch[] matchings = tm.ProcessImage( image1, image2 );
+ // check similarity level
+ if ( matchings[0].Similarity > 0.95f )
+ {
+ // do something with quite similar images
+ }
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Similarity threshold.
+
+
+
+
+ Process image looking for matchings with specified template.
+
+
+ Source image to process.
+ Template image to search for.
+
+ Returns array of found template matches. The array is sorted by similarity
+ of found matches in descending order.
+
+ The source image has incorrect pixel format.
+ Template image is bigger than source image.
+
+
+
+
+ Process image looking for matchings with specified template.
+
+
+ Source image to process.
+ Template image to search for.
+ Rectangle in source image to search template for.
+
+ Returns array of found template matches. The array is sorted by similarity
+ of found matches in descending order.
+
+ The source image has incorrect pixel format.
+ Template image is bigger than source image.
+
+
+
+
+ Process image looking for matchings with specified template.
+
+
+ Source image data to process.
+ Template image to search for.
+
+ Returns array of found template matches. The array is sorted by similarity
+ of found matches in descending order.
+
+ The source image has incorrect pixel format.
+ Template image is bigger than source image.
+
+
+
+
+ Process image looking for matchings with specified template.
+
+
+ Source image data to process.
+ Template image to search for.
+ Rectangle in source image to search template for.
+
+ Returns array of found template matches. The array is sorted by similarity
+ of found matches in descending order.
+
+ The source image has incorrect pixel format.
+ Template image is bigger than source image.
+
+
+
+
+ Process image looking for matchings with specified template.
+
+
+ Unmanaged source image to process.
+ Unmanaged template image to search for.
+
+ Returns array of found template matches. The array is sorted by similarity
+ of found matches in descending order.
+
+ The source image has incorrect pixel format.
+ Template image is bigger than source image.
+
+
+
+
+ Process image looking for matchings with specified template.
+
+
+ Unmanaged source image to process.
+ Unmanaged template image to search for.
+ Rectangle in source image to search template for.
+
+ Returns array of found template matches. The array is sorted by similarity
+ of found matches in descending order.
+
+ The source image has incorrect pixel format.
+ Template image is bigger than search zone.
+
+
+
+
+ Similarity threshold, [0..1].
+
+
+ The property sets the minimal acceptable similarity between template
+ and potential found candidate. If similarity is lower than this value,
+ then object is not treated as matching with template.
+
+
+ Default value is set to 0.9.
+
+
+
+
+
+ Block matching implementation with the exhaustive search algorithm.
+
+
+ The class implements exhaustive search block matching algorithm
+ (see documentation for for information about
+ block matching algorithms). Exhaustive search algorithm tests each possible
+ location of block within search window trying to find a match with minimal
+ difference.
+
+ Because of the exhaustive nature of the algorithm, high performance
+ should not be expected in the case if big number of reference points is provided
+ or big block size and search radius are specified. Minimizing theses values increases
+ performance. But too small block size and search radius may affect quality.
+
+ The class processes only grayscale (8 bpp indexed) and color (24 bpp) images.
+
+ Sample usage:
+
+ // collect reference points using corners detector (for example)
+ SusanCornersDetector scd = new SusanCornersDetector( 30, 18 );
+ List<IntPoint> points = scd.ProcessImage( sourceImage );
+
+ // create block matching algorithm's instance
+ ExhaustiveBlockMatching bm = new ExhaustiveBlockMatching( 8, 12 );
+ // process images searching for block matchings
+ List<BlockMatch> matches = bm.ProcessImage( sourceImage, points, searchImage );
+
+ // draw displacement vectors
+ BitmapData data = sourceImage.LockBits(
+ new Rectangle( 0, 0, sourceImage.Width, sourceImage.Height ),
+ ImageLockMode.ReadWrite, sourceImage.PixelFormat );
+
+ foreach ( BlockMatch match in matches )
+ {
+ // highlight the original point in source image
+ Drawing.FillRectangle( data,
+ new Rectangle( match.SourcePoint.X - 1, match.SourcePoint.Y - 1, 3, 3 ),
+ Color.Yellow );
+ // draw line to the point in search image
+ Drawing.Line( data, match.SourcePoint, match.MatchPoint, Color.Red );
+
+ // check similarity
+ if ( match.Similarity > 0.98f )
+ {
+ // process block with high similarity somehow special
+ }
+ }
+
+ sourceImage.UnlockBits( data );
+
+
+ Test image 1 (source):
+
+ Test image 2 (search):
+
+ Result image:
+
+
+
+
+
+
+ Block matching interface.
+
+
+ The interface specifies set of methods, which should be implemented by different
+ block matching algorithms.
+
+ Block matching algorithms work with two images - source and search image - and
+ a set of reference points. For each provided reference point, the algorithm takes
+ a block from source image (reference point is a coordinate of block's center) and finds
+ the best match for it in search image providing its coordinate (search is done within
+ search window of specified size). In other words, block matching algorithm tries to
+ find new coordinates in search image of specified reference points in source image.
+
+
+
+
+
+
+ Process images matching blocks between them.
+
+
+ Source image with reference points.
+ List of reference points to be matched.
+ Image in which the reference points will be looked for.
+
+ Returns list of found block matches.
+
+
+
+
+ Process images matching blocks between them.
+
+
+ Source image with reference points.
+ List of reference points to be matched.
+ Image in which the reference points will be looked for.
+
+ Returns list of found block matches.
+
+
+
+
+ Process images matching blocks between them.
+
+
+ Source unmanaged image with reference points.
+ List of reference points to be matched.
+ Unmanaged image in which the reference points will be looked for.
+
+ Returns list of found block matches.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Block size to search for.
+ Search radius.
+
+
+
+
+ Process images matching blocks between hem.
+
+
+ Source image with reference points.
+ List of reference points to be matched.
+ Image in which the reference points will be looked for.
+
+ Returns list of found block matches. The list is sorted by similarity
+ of found matches in descending order.
+
+ Source and search images sizes must match.
+ Source images can be grayscale (8 bpp indexed) or color (24 bpp) image only.
+ Source and search images must have same pixel format.
+
+
+
+
+ Process images matching blocks between them.
+
+
+ Source image with reference points.
+ List of reference points to be matched.
+ Image in which the reference points will be looked for.
+
+ Returns list of found block matches. The list is sorted by similarity
+ of found matches in descending order.
+
+ Source and search images sizes must match.
+ Source images can be grayscale (8 bpp indexed) or color (24 bpp) image only.
+ Source and search images must have same pixel format.
+
+
+
+
+ Process images matching blocks between them.
+
+
+ Source unmanaged image with reference points.
+ List of reference points to be matched.
+ Unmanaged image in which the reference points will be looked for.
+
+ Returns list of found block matches. The list is sorted by similarity
+ of found matches in descending order.
+
+ Source and search images sizes must match.
+ Source images can be grayscale (8 bpp indexed) or color (24 bpp) image only.
+ Source and search images must have same pixel format.
+
+
+
+
+ Search radius.
+
+
+ The value specifies the shift from reference point in all
+ four directions, used to search for the best matching block.
+
+ Default value is set to 12.
+
+
+
+
+
+ Block size to search for.
+
+
+ The value specifies block size to search for. For each provided
+ reference pointer, a square block of this size is taken from the source image
+ (reference point becomes the coordinate of block's center) and the best match
+ is searched in second image within specified search
+ radius.
+
+ Default value is set to 16.
+
+
+
+
+
+ Similarity threshold, [0..1].
+
+
+ The property sets the minimal acceptable similarity between blocks
+ in source and search images. If similarity is lower than this value,
+ then the candidate block in search image is not treated as a match for the block
+ in source image.
+
+
+ Default value is set to 0.9.
+
+
+
+
+
+ Unsupported image format exception.
+
+
+ The unsupported image format exception is thrown in the case when
+ user passes an image of certain format to an image processing routine, which does
+ not support the format. Check documentation of the image processing routine
+ to discover which formats are supported by the routine.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Message providing some additional information.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Message providing some additional information.
+ Name of the invalid parameter.
+
+
+
+
+ Invalid image properties exception.
+
+
+ The invalid image properties exception is thrown in the case when
+ user provides an image with certain properties, which are treated as invalid by
+ particular image processing routine. Another case when this exception is
+ thrown is the case when user tries to access some properties of an image (or
+ of a recently processed image by some routine), which are not valid for that image.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Message providing some additional information.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Message providing some additional information.
+ Name of the invalid parameter.
+
+
+
+
+ Complex image.
+
+
+ The class is used to keep image represented in complex numbers sutable for Fourier
+ transformations.
+
+ Sample usage:
+
+ // create complex image
+ ComplexImage complexImage = ComplexImage.FromBitmap( image );
+ // do forward Fourier transformation
+ complexImage.ForwardFourierTransform( );
+ // get complex image as bitmat
+ Bitmap fourierImage = complexImage.ToBitmap( );
+
+
+ Initial image:
+
+ Fourier image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image width.
+ Image height.
+
+ The constractor is protected, what makes it imposible to instantiate this
+ class directly. To create an instance of this class or
+ method should be used.
+
+
+
+
+ Clone the complex image.
+
+
+ Returns copy of the complex image.
+
+
+
+
+ Create complex image from grayscale bitmap.
+
+
+ Source grayscale bitmap (8 bpp indexed).
+
+ Returns an instance of complex image.
+
+ The source image has incorrect pixel format.
+ Image width and height should be power of 2.
+
+
+
+
+ Create complex image from grayscale bitmap.
+
+
+ Source image data (8 bpp indexed).
+
+ Returns an instance of complex image.
+
+ The source image has incorrect pixel format.
+ Image width and height should be power of 2.
+
+
+
+
+ Convert complex image to bitmap.
+
+
+ Returns grayscale bitmap.
+
+
+
+
+ Applies forward fast Fourier transformation to the complex image.
+
+
+
+
+
+ Applies backward fast Fourier transformation to the complex image.
+
+
+
+
+
+ Image width.
+
+
+
+
+
+ Image height.
+
+
+
+
+
+ Status of the image - Fourier transformed or not.
+
+
+
+
+
+ Complex image's data.
+
+
+ Return's 2D array of [height, width] size, which keeps image's
+ complex data.
+
+
+
+
+ RGB components.
+
+
+ The class encapsulates RGB color components.
+ PixelFormat.Format24bppRgb
+ actually means BGR format.
+
+
+
+
+
+ Index of red component.
+
+
+
+
+ Index of green component.
+
+
+
+
+ Index of blue component.
+
+
+
+
+ Index of alpha component for ARGB images.
+
+
+
+
+ Red component.
+
+
+
+
+ Green component.
+
+
+
+
+ Blue component.
+
+
+
+
+ Alpha component.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Red component.
+ Green component.
+ Blue component.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Red component.
+ Green component.
+ Blue component.
+ Alpha component.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Initialize from specified color.
+
+
+
+
+ Color value of the class.
+
+
+
+
+ HSL components.
+
+
+ The class encapsulates HSL color components.
+
+
+
+
+ Hue component.
+
+
+ Hue is measured in the range of [0, 359].
+
+
+
+
+ Saturation component.
+
+
+ Saturation is measured in the range of [0, 1].
+
+
+
+
+ Luminance value.
+
+
+ Luminance is measured in the range of [0, 1].
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Hue component.
+ Saturation component.
+ Luminance component.
+
+
+
+
+ Convert from RGB to HSL color space.
+
+
+ Source color in RGB color space.
+ Destination color in HSL color space.
+
+ See HSL and HSV Wiki
+ for information about the algorithm to convert from RGB to HSL.
+
+
+
+
+ Convert from RGB to HSL color space.
+
+
+ Source color in RGB color space.
+
+ Returns instance, which represents converted color value.
+
+
+
+
+ Convert from HSL to RGB color space.
+
+
+ Source color in HSL color space.
+ Destination color in RGB color space.
+
+
+
+
+ Convert the color to RGB color space.
+
+
+ Returns instance, which represents converted color value.
+
+
+
+
+ YCbCr components.
+
+
+ The class encapsulates YCbCr color components.
+
+
+
+
+ Index of Y component.
+
+
+
+
+ Index of Cb component.
+
+
+
+
+ Index of Cr component.
+
+
+
+
+ Y component.
+
+
+
+
+ Cb component.
+
+
+
+
+ Cr component.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Y component.
+ Cb component.
+ Cr component.
+
+
+
+
+ Convert from RGB to YCbCr color space (Rec 601-1 specification).
+
+
+ Source color in RGB color space.
+ Destination color in YCbCr color space.
+
+
+
+
+ Convert from RGB to YCbCr color space (Rec 601-1 specification).
+
+
+ Source color in RGB color space.
+
+ Returns instance, which represents converted color value.
+
+
+
+
+ Convert from YCbCr to RGB color space.
+
+
+ Source color in YCbCr color space.
+ Destination color in RGB color spacs.
+
+
+
+
+ Convert the color to RGB color space.
+
+
+ Returns instance, which represents converted color value.
+
+
+
+
+ Color dithering with a thresold matrix (ordered dithering).
+
+
+ The class implements ordered color dithering as described on
+ Wikipedia.
+ The algorithm achieves dithering by applying a threshold map on
+ the pixels displayed, causing some of the pixels to be rendered at a different color, depending on
+ how far in between the color is of available color entries.
+
+ The image processing routine accepts 24/32 bpp color images for processing. As a result this routine
+ produces 4 bpp or 8 bpp indexed image, which depends on size of the specified
+ color table - 4 bpp result for
+ color tables with 16 colors or less; 8 bpp result for larger color tables.
+
+ Sample usage:
+
+ // create color image quantization routine
+ ColorImageQuantizer ciq = new ColorImageQuantizer( new MedianCutQuantizer( ) );
+ // create 256 colors table
+ Color[] colorTable = ciq.CalculatePalette( image, 256 );
+ // create dithering routine
+ OrderedColorDithering dithering = new OrderedColorDithering( );
+ dithering.ColorTable = colorTable;
+ // apply the dithering routine
+ Bitmap newImage = dithering.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Threshold matrix (see property).
+
+
+
+
+ Perform color dithering for the specified image.
+
+
+ Source image to do color dithering for.
+
+ Returns color dithered image. See for information about format of
+ the result image.
+
+ Unsupported pixel format of the source image. It must 24 or 32 bpp color image.
+
+
+
+
+ Perform color dithering for the specified image.
+
+
+ Source image to do color dithering for.
+
+ Returns color dithered image. See for information about format of
+ the result image.
+
+ Unsupported pixel format of the source image. It must 24 or 32 bpp color image.
+
+
+
+
+ Threshold matrix - values to add source image's values.
+
+
+ The property keeps a threshold matrix, which is applied to values of a source image
+ to dither. By adding these values to the source image the algorithm produces the effect when pixels
+ of the same color in source image may have different color in the result image (which depends on pixel's
+ position). This threshold map is also known as an index matrix or Bayer matrix.
+
+ By default the property is inialized with the below matrix:
+
+ 2 18 6 22
+ 26 10 30 14
+ 8 24 4 20
+ 32 16 28 12
+
+
+
+
+
+
+
+ Color table to use for image dithering. Must contain 2-256 colors.
+
+
+ Color table size determines format of the resulting image produced by this
+ image processing routine. If color table contains 16 color or less, then result image will have
+ 4 bpp indexed pixel format. If color table contains more than 16 colors, then result image will
+ have 8 bpp indexed pixel format.
+
+ By default the property is initialized with default 16 colors, which are:
+ Black, Dark Blue, Dark Green, Dark Cyan, Dark Red, Dark Magenta, Dark Khaki, Light Gray,
+ Gray, Blue, Green, Cyan, Red, Magenta, Yellow and White.
+
+
+ Color table length must be in the [2, 256] range.
+
+
+
+
+ Use color caching during color dithering or not.
+
+
+ The property specifies if internal cache of already processed colors should be used or not.
+ For each pixel in the original image the color dithering routine does search in target color palette to find
+ the best matching color. To avoid doing the search again and again for already processed colors, the class may
+ use internal dictionary which maps colors of original image to indexes in target color palette.
+
+
+ The property provides a trade off. On one hand it may speedup color dithering routine, but on another
+ hand it increases memory usage. Also cache usage may not be efficient for very small target color tables.
+
+ Default value is set to .
+
+
+
+
+
+ Block match class keeps information about found block match. The class is
+ used with block matching algorithms implementing
+ interface.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Reference point in source image.
+ Match point in search image (point of a found match).
+ Similarity between blocks in source and search images, [0..1].
+
+
+
+
+ Reference point in source image.
+
+
+
+
+ Match point in search image (point of a found match).
+
+
+
+
+ Similarity between blocks in source and search images, [0..1].
+
+
+
+
+ Image's blob.
+
+
+ The class represents a blob - part of another images. The
+ class encapsulates the blob itself and information about its position
+ in parent image.
+
+ The class is not responsible for blob's image disposing, so it should be
+ done manually when it is required.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Blob's ID in the original image.
+ Blob's rectangle in the original image.
+
+ This constructor leaves property not initialized. The blob's
+ image may be extracted later using
+ or method.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Source blob to copy.
+
+ This copy constructor leaves property not initialized. The blob's
+ image may be extracted later using
+ or method.
+
+
+
+
+ Blob's image.
+
+
+ The property keeps blob's image. In the case if it equals to null,
+ the image may be extracted using
+ or method.
+
+
+
+
+ Blob's image size.
+
+
+ The property specifies size of the blob's image.
+ If the property is set to , the blob's image size equals to the
+ size of original image. If the property is set to , the blob's
+ image size equals to size of actual blob.
+
+
+
+
+ Blob's rectangle in the original image.
+
+
+ The property specifies position of the blob in the original image
+ and its size.
+
+
+
+
+ Blob's ID in the original image.
+
+
+
+
+ Blob's area.
+
+
+ The property equals to blob's area measured in number of pixels
+ contained by the blob.
+
+
+
+
+ Blob's fullness, [0, 1].
+
+
+ The property equals to blob's fullness, which is calculated
+ as Area / ( Width * Height ). If it equals to 1, then
+ it means that entire blob's rectangle is filled by blob's pixel (no
+ blank areas), which is true only for rectangles. If it equals to 0.5,
+ for example, then it means that only half of the bounding rectangle is filled
+ by blob's pixels.
+
+
+
+
+ Blob's center of gravity point.
+
+
+ The property keeps center of gravity point, which is calculated as
+ mean value of X and Y coordinates of blob's points.
+
+
+
+
+ Blob's mean color.
+
+
+ The property keeps mean color of pixels comprising the blob.
+
+
+
+
+ Blob color's standard deviation.
+
+
+ The property keeps standard deviation of pixels' colors comprising the blob.
+
+
+
+
+ Hough circle.
+
+
+ Represents circle of Hough transform.
+
+
+
+
+
+
+ Circle center's X coordinate.
+
+
+
+
+ Circle center's Y coordinate.
+
+
+
+
+ Circle's radius.
+
+
+
+
+ Line's absolute intensity.
+
+
+
+
+ Line's relative intensity.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Circle's X coordinate.
+ Circle's Y coordinate.
+ Circle's radius.
+ Circle's absolute intensity.
+ Circle's relative intensity.
+
+
+
+
+ Compare the object with another instance of this class.
+
+
+ Object to compare with.
+
+ A signed number indicating the relative values of this instance and value: 1) greater than zero -
+ this instance is greater than value; 2) zero - this instance is equal to value;
+ 3) greater than zero - this instance is less than value.
+
+ The sort order is descending.
+
+
+ Object are compared using their intensity value.
+
+
+
+
+
+ Hough circle transformation.
+
+
+ The class implements Hough circle transformation, which allows to detect
+ circles of specified radius in an image.
+
+ The class accepts binary images for processing, which are represented by 8 bpp grayscale images.
+ All black pixels (0 pixel's value) are treated as background, but pixels with different value are
+ treated as circles' pixels.
+
+ Sample usage:
+
+ HoughCircleTransformation circleTransform = new HoughCircleTransformation( 35 );
+ // apply Hough circle transform
+ circleTransform.ProcessImage( sourceImage );
+ Bitmap houghCirlceImage = circleTransform.ToBitmap( );
+ // get circles using relative intensity
+ HoughCircle[] circles = circleTransform.GetCirclesByRelativeIntensity( 0.5 );
+
+ foreach ( HoughCircle circle in circles )
+ {
+ // ...
+ }
+
+
+ Initial image:
+
+ Hough circle transformation image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Circles' radius to detect.
+
+
+
+
+ Process an image building Hough map.
+
+
+ Source image to process.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Process an image building Hough map.
+
+
+ Source image data to process.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Process an image building Hough map.
+
+
+ Source unmanaged image to process.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Сonvert Hough map to bitmap.
+
+
+ Returns 8 bppp grayscale bitmap, which shows Hough map.
+
+ Hough transformation was not yet done by calling
+ ProcessImage() method.
+
+
+
+
+ Get specified amount of circles with highest intensity.
+
+
+ Amount of circles to get.
+
+ Returns arrary of most intesive circles. If there are no circles detected,
+ the returned array has zero length.
+
+
+
+
+ Get circles with relative intensity higher then specified value.
+
+
+ Minimum relative intesity of circles.
+
+ Returns arrary of most intesive circles. If there are no circles detected,
+ the returned array has zero length.
+
+
+
+
+ Minimum circle's intensity in Hough map to recognize a circle.
+
+
+ The value sets minimum intensity level for a circle. If a value in Hough
+ map has lower intensity, then it is not treated as a circle.
+
+ Default value is set to 10.
+
+
+
+
+ Radius for searching local peak value.
+
+
+ The value determines radius around a map's value, which is analyzed to determine
+ if the map's value is a local maximum in specified area.
+
+ Default value is set to 4. Minimum value is 1. Maximum value is 10.
+
+
+
+
+ Maximum found intensity in Hough map.
+
+
+ The property provides maximum found circle's intensity.
+
+
+
+
+ Found circles count.
+
+
+ The property provides total number of found circles, which intensity is higher (or equal to),
+ than the requested minimum intensity.
+
+
+
+
+ Performs quadrilateral transformation using bilinear algorithm for interpolation.
+
+
+ The class is deprecated and should be used instead.
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Corners of the source quadrilateral area.
+ Width of the new transformed image.
+ Height of the new transformed image.
+
+ This constructor sets to
+ , which means that destination image will have width and
+ height as specified by user.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Corners of the source quadrilateral area.
+
+ This constructor sets to
+ , which means that destination image will have width and
+ height automatically calculated based on property.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Calculates new image size.
+
+
+ Source image data.
+
+ New image size - size of the destination image.
+
+ The specified quadrilateral's corners are outside of the given image.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Automatic calculation of destination image or not.
+
+
+ The property specifies how to calculate size of destination (transformed)
+ image. If the property is set to , then
+ and properties have effect and destination image's size is
+ specified by user. If the property is set to , then setting the above
+ mentioned properties does not have any effect, but destionation image's size is
+ automatically calculated from property - width and height
+ come from length of longest edges.
+
+
+
+
+
+ Quadrilateral's corners in source image.
+
+
+ The property specifies four corners of the quadrilateral area
+ in the source image to be transformed.
+
+
+
+
+
+ Width of the new transformed image.
+
+
+ The property defines width of the destination image, which gets
+ transformed quadrilateral image.
+
+ Setting the property does not have any effect, if
+ property is set to . In this case destination image's width
+ is calculated automatically based on property.
+
+
+
+
+
+ Height of the new transformed image.
+
+
+ The property defines height of the destination image, which gets
+ transformed quadrilateral image.
+
+ Setting the property does not have any effect, if
+ property is set to . In this case destination image's height
+ is calculated automatically based on property.
+
+
+
+
+
+ Performs backward quadrilateral transformation into an area in destination image.
+
+
+ The class implements backward quadrilateral transformation algorithm,
+ which allows to transform any rectangular image into any quadrilateral area
+ in a given destination image. The idea of the algorithm is based on homogeneous
+ transformation and its math is described by Paul Heckbert in his
+ "Projective Mappings for Image Warping" paper.
+
+
+ The image processing routines implements similar math to ,
+ but performs it in backward direction.
+
+ The image processing filter accepts 8 grayscale images and 24/32 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // define quadrilateral's corners
+ List<IntPoint> corners = new List<IntPoint>( );
+ corners.Add( new IntPoint( 99, 99 ) );
+ corners.Add( new IntPoint( 156, 79 ) );
+ corners.Add( new IntPoint( 184, 126 ) );
+ corners.Add( new IntPoint( 122, 150 ) );
+ // create filter
+ BackwardQuadrilateralTransformation filter =
+ new BackwardQuadrilateralTransformation( sourceImage, corners );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Source image:
+
+ Destination image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Source image to be transformed into specified quadrilateral
+ (see ).
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Source unmanaged image to be transformed into specified quadrilateral
+ (see ).
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Source image to be transformed into specified quadrilateral
+ (see ).
+ Quadrilateral in destination image to transform into.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Source unmanaged image to be transformed into specified quadrilateral
+ (see ).
+ Quadrilateral in destination image to transform into.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Image data to process by the filter.
+
+ Destination quadrilateral was not set.
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Source image to be transformed into specified quadrilateral.
+
+
+ The property sets the source image, which will be transformed
+ to the specified quadrilateral and put into destination image the filter is applied to.
+
+ The source image must have the same pixel format as a destination image the filter
+ is applied to. Otherwise exception will be generated when filter is applied.
+
+ Setting this property will clear the property -
+ only one source image is allowed: managed or unmanaged.
+
+
+
+
+
+ Source unmanaged image to be transformed into specified quadrilateral.
+
+
+ The property sets the source image, which will be transformed
+ to the specified quadrilateral and put into destination image the filter is applied to.
+
+ The source image must have the same pixel format as a destination image the filter
+ is applied to. Otherwise exception will be generated when filter is applied.
+
+ Setting this property will clear the property -
+ only one source image is allowed: managed or unmanaged.
+
+
+
+
+
+ Quadrilateral in destination image to transform into.
+
+
+ The property specifies 4 corners of a quadrilateral area
+ in destination image where the source image will be transformed into.
+
+
+
+
+
+ Specifies if bilinear interpolation should be used or not.
+
+
+ Default value is set to - interpolation
+ is used.
+
+
+
+
+
+ Image warp effect filter.
+
+
+ The image processing filter implements a warping filter, which
+ sets pixels in destination image to values from source image taken with specified offset
+ (see ).
+
+
+ The filter accepts 8 bpp grayscale images and 24/32
+ color images for processing.
+
+ Sample usage:
+
+ // build warp map
+ int width = image.Width;
+ int height = image.Height;
+
+ IntPoint[,] warpMap = new IntPoint[height, width];
+
+ int size = 8;
+ int maxOffset = -size + 1;
+
+ for ( int y = 0; y < height; y++ )
+ {
+ for ( int x = 0; x < width; x++ )
+ {
+ int dx = ( x / size ) * size - x;
+ int dy = ( y / size ) * size - y;
+
+ if ( dx + dy <= maxOffset )
+ {
+ dx = ( x / size + 1 ) * size - 1 - x;
+ }
+
+ warpMap[y, x] = new IntPoint( dx, dy );
+ }
+ }
+ // create filter
+ ImageWarp filter = new ImageWarp( warpMap );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Map used for warping images (see ).
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Map used for warping images.
+
+
+ The property sets displacement map used for warping images.
+ The map sets offsets of pixels in source image, which are used to set values in destination
+ image. In other words, each pixel in destination image is set to the same value
+ as pixel in source image with corresponding offset (coordinates of pixel in source image
+ are calculated as sum of destination coordinate and corresponding value from warp map).
+
+
+ The map array is accessed using [y, x] indexing, i.e.
+ first dimension in the map array corresponds to Y axis of image.
+
+ If the map is smaller or bigger than the image to process, then only minimum
+ overlapping area of the image is processed. This allows to prepare single big map and reuse
+ it for a set of images for creating similar effects.
+
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Horizontal run length smoothing algorithm.
+
+
+ The class implements horizontal run length smoothing algorithm, which
+ is described in: K.Y. Wong, R.G. Casey and F.M. Wahl, "Document analysis system,"
+ IBM J. Res. Devel., Vol. 26, NO. 6,111). 647-656, 1982.
+
+ Unlike the original description of this algorithm, this implementation must be applied
+ to inverted binary images containing document, i.e. white text on black background. So this
+ implementation fills horizontal black gaps between white pixels.
+
+ This algorithm is usually used together with ,
+ and then further analysis of white blobs.
+
+ The filter accepts 8 bpp grayscale images, which are supposed to be binary inverted documents.
+
+ Sample usage:
+
+ // create filter
+ HorizontalRunLengthSmoothing hrls = new HorizontalRunLengthSmoothing( 32 );
+ // apply the filter
+ hrls.ApplyInPlace( image );
+
+
+ Source image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Maximum gap size to fill (see ).
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Maximum gap size to fill (in pixels).
+
+
+ The property specifies maximum horizontal gap between white pixels to fill.
+ If number of black pixels between some white pixels is bigger than this value, then those
+ black pixels are left as is; otherwise the gap is filled with white pixels.
+
+
+ Default value is set to 10. Minimum value is 1. Maximum value is 1000.
+
+
+
+
+ Process gaps between objects and image borders or not.
+
+
+ The property sets if gaps between image borders and objects must be treated as
+ gaps between objects and also filled.
+
+ Default value is set to .
+
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Extract the biggest blob from image.
+
+
+ The filter locates the biggest blob in the source image and extracts it.
+ The filter also can use the source image for the biggest blob's location only, but extract it from
+ another image, which is set using property. The original image
+ usually is the source of the processed image.
+
+ The filter accepts 8 bpp grayscale images and 24/32 color images for processing as source image passed to
+ method and also for the .
+
+ Sample usage:
+
+ // create filter
+ ExtractBiggestBlob filter = new ExtractBiggestBlob( );
+ // apply the filter
+ Bitmap biggestBlobsImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to get biggest blob from.
+
+ Returns image of the biggest blob.
+
+ Unsupported pixel format of the source image.
+ Unsupported pixel format of the original image.
+ Source and original images must have the same size.
+ The source image does not contain any blobs.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to get biggest blob from.
+
+ Returns image of the biggest blob.
+
+ Unsupported pixel format of the source image.
+ Unsupported pixel format of the original image.
+ Source and original images must have the same size.
+ The source image does not contain any blobs.
+
+
+
+
+ Apply filter to an image (not implemented).
+
+
+ Image in unmanaged memory.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method is not implemented.
+
+
+
+
+ Apply filter to an image (not implemented).
+
+
+ Source image to be processed.
+ Destination image to store filter's result.
+
+ The method is not implemented.
+
+
+
+
+ Position of the extracted blob.
+
+
+ After applying the filter this property keeps position of the extracted
+ blob in the source image.
+
+
+
+
+ Format translations dictionary.
+
+
+ The dictionary defines, which pixel formats are supported for
+ source images and which pixel format will be used for resulting image.
+
+
+ See for more information.
+
+
+
+
+
+ Original image, which is the source of the processed image where the biggest blob is searched for.
+
+
+ The property may be set to . In this case the biggest blob
+ is extracted from the image, which is passed to image.
+
+
+
+
+
+ Dilatation operator from Mathematical Morphology with 3x3 structuring element.
+
+
+ The filter represents an optimized version of
+ filter, which is aimed for grayscale image processing with 3x3 structuring element.
+
+ See filter, which represents generic version of
+ dilatation filter supporting custom structuring elements and wider range of image formats.
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+ Processing rectangle mast be at least 3x3 in size.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Grayscale image using BT709 algorithm.
+
+
+ The class uses BT709 algorithm to convert color image
+ to grayscale. The conversion coefficients are:
+
+ - Red: 0.2125;
+ - Green: 0.7154;
+ - Blue: 0.0721.
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Possible object orders.
+
+
+ The enumeration defines possible sorting orders of objects, found by blob
+ counting classes.
+
+
+
+
+ Unsorted order (as it is collected by algorithm).
+
+
+
+
+ Objects are sorted by size in descending order (bigger objects go first).
+ Size is calculated as Width * Height.
+
+
+
+
+ Objects are sorted by area in descending order (bigger objects go first).
+
+
+
+
+ Objects are sorted by Y coordinate, then by X coordinate in ascending order
+ (smaller coordinates go first).
+
+
+
+
+ Objects are sorted by X coordinate, then by Y coordinate in ascending order
+ (smaller coordinates go first).
+
+
+
+
+ Blob counter - counts objects in image, which are separated by black background.
+
+
+ The class counts and extracts stand alone objects in
+ images using connected components labeling algorithm.
+
+ The algorithm treats all pixels with values less or equal to
+ as background, but pixels with higher values are treated as objects' pixels.
+
+ For blobs' searching the class supports 8 bpp indexed grayscale images and
+ 24/32 bpp color images that are at least two pixels wide. Images that are one
+ pixel wide can be processed if they are rotated first, or they can be processed
+ with .
+ See documentation about for information about which
+ pixel formats are supported for extraction of blobs.
+
+ Sample usage:
+
+ // create an instance of blob counter algorithm
+ BlobCounter bc = new BlobCounter( );
+ // process binary image
+ bc.ProcessImage( image );
+ Rectangle[] rects = bc.GetObjectsRectangles( );
+ // process blobs
+ foreach ( Rectangle rect in rects )
+ {
+ // ...
+ }
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Creates new instance of the class with
+ an empty objects map. Before using methods, which provide information about blobs
+ or extract them, the ,
+ or
+ method should be called to collect objects map.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to look for objects in.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image data to look for objects in.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged image to look for objects in.
+
+
+
+
+ Actual objects map building.
+
+
+ Unmanaged image to process.
+
+ The method supports 8 bpp indexed grayscale images and 24/32 bpp color images.
+
+ Unsupported pixel format of the source image.
+ Cannot process images that are one pixel wide. Rotate the image
+ or use .
+
+
+
+
+ Background threshold's value.
+
+
+ The property sets threshold value for distinguishing between background
+ pixel and objects' pixels. All pixel with values less or equal to this property are
+ treated as background, but pixels with higher values are treated as objects' pixels.
+
+ In the case of colour images a pixel is treated as objects' pixel if any of its
+ RGB values are higher than corresponding values of this threshold.
+
+ For processing grayscale image, set the property with all RGB components eqaul.
+
+ Default value is set to (0, 0, 0) - black colour.
+
+
+
+
+ Gather statistics about image in YCbCr color space.
+
+
+ The class is used to accumulate statistical values about images,
+ like histogram, mean, standard deviation, etc. for each YCbCr color channel.
+
+ The class accepts 24 and 32 bpp color images for processing.
+
+ Sample usage:
+
+ // gather statistics
+ ImageStatisticsYCbCr stat = new ImageStatisticsYCbCr( image );
+ // get Y channel's histogram
+ ContinuousHistogram y = stat.Y;
+ // check mean value of Y channel
+ if ( y.Mean > 0.5 )
+ {
+ // do further processing
+ }
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+
+ Source pixel format is not supported.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+ Mask image which specifies areas to collect statistics for.
+
+ The mask image must be a grayscale/binary (8bpp) image of the same size as the
+ specified source image, where black pixels (value 0) correspond to areas which should be excluded
+ from processing. So statistics is calculated only for pixels, which are none black in the mask image.
+
+
+ Source pixel format is not supported.
+ Mask image must be 8 bpp grayscale image.
+ Mask must have the same size as the source image to get statistics for.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+ Mask array which specifies areas to collect statistics for.
+
+ The mask array must be of the same size as the specified source image, where 0 values
+ correspond to areas which should be excluded from processing. So statistics is calculated only for pixels,
+ which have none zero corresponding value in the mask.
+
+
+ Source pixel format is not supported.
+ Mask must have the same size as the source image to get statistics for.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged image to gather statistics about.
+
+ Source pixel format is not supported.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+ Mask image which specifies areas to collect statistics for.
+
+ The mask image must be a grayscale/binary (8bpp) image of the same size as the
+ specified source image, where black pixels (value 0) correspond to areas which should be excluded
+ from processing. So statistics is calculated only for pixels, which are none black in the mask image.
+
+
+ Source pixel format is not supported.
+ Mask image must be 8 bpp grayscale image.
+ Mask must have the same size as the source image to get statistics for.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Image to gather statistics about.
+ Mask array which specifies areas to collect statistics for.
+
+ The mask array must be of the same size as the specified source image, where 0 values
+ correspond to areas which should be excluded from processing. So statistics is calculated only for pixels,
+ which have none zero corresponding value in the mask.
+
+
+ Source pixel format is not supported.
+ Mask must have the same size as the source image to get statistics for.
+
+
+
+
+ Histogram of Y channel.
+
+
+
+
+
+ Histogram of Cb channel.
+
+
+
+
+
+ Histogram of Cr channel.
+
+
+
+
+
+ Histogram of Y channel excluding black pixels.
+
+
+ The property keeps statistics about Y channel, which
+ excludes all black pixels, what affects mean, standard deviation, etc.
+
+
+
+
+
+ Histogram of Cb channel excluding black pixels
+
+
+ The property keeps statistics about Cb channel, which
+ excludes all black pixels, what affects mean, standard deviation, etc.
+
+
+
+
+
+ Histogram of Cr channel excluding black pixels
+
+
+ The property keeps statistics about Cr channel, which
+ excludes all black pixels, what affects mean, standard deviation, etc.
+
+
+
+
+
+ Total pixels count in the processed image.
+
+
+
+
+
+ Total pixels count in the processed image excluding black pixels.
+
+
+
+
+
+ Color filtering in YCbCr color space.
+
+
+ The filter operates in YCbCr color space and filters
+ pixels, which color is inside/outside of the specified YCbCr range -
+ it keeps pixels with colors inside/outside of the specified range and fills the
+ rest with specified color.
+
+ The filter accepts 24 and 32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ YCbCrFiltering filter = new YCbCrFiltering( );
+ // set color ranges to keep
+ filter.Cb = new Range( -0.2f, 0.0f );
+ filter.Cr = new Range( 0.26f, 0.5f );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Range of Y component.
+ Range of Cb component.
+ Range of Cr component.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Range of Y component, [0, 1].
+
+
+
+
+
+ Range of Cb component, [-0.5, 0.5].
+
+
+
+
+
+ Range of Cr component, [-0.5, 0.5].
+
+
+
+
+
+ Fill color used to fill filtered pixels.
+
+
+
+
+ Determines, if pixels should be filled inside or outside specified
+ color range.
+
+
+ Default value is set to , which means
+ the filter removes colors outside of the specified range.
+
+
+
+
+ Determines, if Y value of filtered pixels should be updated.
+
+
+ The property specifies if Y channel of filtered pixels should be
+ updated with value from fill color or not.
+
+ Default value is set to .
+
+
+
+
+ Determines, if Cb value of filtered pixels should be updated.
+
+
+ The property specifies if Cb channel of filtered pixels should be
+ updated with value from fill color or not.
+
+ Default value is set to .
+
+
+
+
+ Determines, if Cr value of filtered pixels should be updated.
+
+
+ The property specifies if Cr channel of filtered pixels should be
+ updated with value from fill color or not.
+
+ Default value is set to .
+
+
+
+
+ Bilateral filter implementation - edge preserving smoothing and noise reduction that uses chromatic and spatial factors.
+
+
+
+ Bilateral filter conducts "selective" Gaussian smoothing of areas of same color (domains) which removes noise and contrast artifacts
+ while preserving sharp edges.
+
+ Two major parameters and define the result of the filter.
+ By changing these parameters you may achieve either only noise reduction with little change to the
+ image or get nice looking effect to the entire image.
+
+ Although the filter can use parallel processing large values
+ (greater than 25) on high resolution images may decrease speed of processing. Also on high
+ resolution images small values (less than 9) may not provide noticeable
+ results.
+
+ More details on the algorithm can be found by following this
+ link.
+
+ The filter accepts 8 bpp grayscale images and 24/32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ BilateralSmoothing filter = new BilateralSmoothing( );
+ filter.KernelSize = 7;
+ filter.SpatialFactor = 10;
+ filter.ColorFactor = 60;
+ filter.ColorPower = 0.5;
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Specifies if exception must be thrown in the case a large
+ kernel size is used which may lead
+ to significant performance issues.
+
+
+
+ Default value is set to .
+
+
+
+
+
+ Enable or not parallel processing on multi-core CPUs.
+
+
+ If the property is set to , then this image processing
+ routine will run in parallel on the systems with multiple core/CPUs. The
+ is used to make it parallel.
+
+ Default value is set to .
+
+
+
+
+
+ Size of a square for limiting surrounding pixels that take part in calculations, [3, 255].
+
+
+ The greater the value the more is the general power of the filter. Small values
+ (less than 9) on high resolution images (3000 pixels wide) do not give significant results.
+ Large values increase the number of calculations and degrade performance.
+
+ The value of this property must be an odd integer in the [3, 255] range if
+ is set to or in the [3, 25] range
+ otherwise.
+
+ Default value is set to 9.
+
+
+ The specified value is out of range (see
+ eception message for details).
+ The value of this must be an odd integer.
+
+
+
+
+ Determines smoothing power within a color domain (neighbor pixels of similar color), >= 1.
+
+
+
+ Default value is set to 10.
+
+
+
+
+
+ Exponent power, used in Spatial function calculation, >= 1.
+
+
+
+ Default value is set to 2.
+
+
+
+
+
+ Determines the variance of color for a color domain, >= 1.
+
+
+
+ Default value is set to 50.
+
+
+
+
+
+ Exponent power, used in Color function calculation, >= 1.
+
+
+
+ Default value is set to 2.
+
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Opening operator from Mathematical Morphology.
+
+
+ Opening morphology operator equals to erosion followed
+ by dilatation.
+
+ Applied to binary image, the filter may be used for removing small object keeping big objects
+ unchanged. Since erosion is used first, it removes all small objects. Then dilatation restores big
+ objects, which were not removed by erosion.
+
+ See documentation to and classes for more
+ information and list of supported pixel formats.
+
+ Sample usage:
+
+ // create filter
+ Opening filter = new Opening( );
+ // apply the filter
+ filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Initializes new instance of the class using
+ default structuring element for both and
+ classes - 3x3 structuring element with all elements equal to 1.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Structuring element.
+
+ See documentation to and
+ classes for information about structuring element constraints.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The filter accepts bitmap data as input and returns the result
+ of image processing filter as new image. The source image data are kept
+ unchanged.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+ Destination image in unmanaged memory to put result into.
+
+ The method keeps the source image unchanged and puts result of image processing
+ into destination image.
+
+ The destination image must have the same width and height as source image. Also
+ destination image must have pixel format, which is expected by particular filter (see
+ property for information about pixel format conversions).
+
+
+ Unsupported pixel format of the source image.
+ Incorrect destination pixel format.
+ Destination image has wrong width and/or height.
+
+
+
+
+ Apply filter to an image.
+
+
+ Image to apply filter to.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Image data to apply filter to.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an unmanaged image.
+
+
+ Unmanaged image to apply filter to.
+
+ The method applies the filter directly to the provided source unmanaged image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image or its part.
+
+
+ Image to apply filter to.
+ Image rectangle for processing by the filter.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image or its part.
+
+
+ Image data to apply filter to.
+ Image rectangle for processing by the filter.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an unmanaged image or its part.
+
+
+ Unmanaged image to apply filter to.
+ Image rectangle for processing by the filter.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Dilatation operator from Mathematical Morphology.
+
+
+ The filter assigns maximum value of surrounding pixels to each pixel of
+ the result image. Surrounding pixels, which should be processed, are specified by
+ structuring element: 1 - to process the neighbor, -1 - to skip it.
+
+ The filter especially useful for binary image processing, where it allows to grow
+ separate objects or join objects.
+
+ For processing image with 3x3 structuring element, there are different optimizations
+ available, like and .
+
+ The filter accepts 8 and 16 bpp grayscale images and 24 and 48 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Dilatation filter = new Dilatation( );
+ // apply the filter
+ filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Initializes new instance of the class using
+ default structuring element - 3x3 structuring element with all elements equal to 1.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Structuring element.
+
+ Structuring elemement for the dilatation morphological operator
+ must be square matrix with odd size in the range of [3, 99].
+
+ Invalid size of structuring element.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Filters' collection to apply to an image in sequence.
+
+
+ The class represents collection of filters, which need to be applied
+ to an image in sequence. Using the class user may specify set of filters, which will
+ be applied to source image one by one in the order user defines them.
+
+ The class itself does not define which pixel formats are accepted for the source
+ image and which pixel formats may be produced by the filter. Format of acceptable source
+ and possible output is defined by filters, which added to the sequence.
+
+ Sample usage:
+
+ // create filter, which is binarization sequence
+ FiltersSequence filter = new FiltersSequence(
+ new GrayscaleBT709( ),
+ new Threshold( )
+ );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Sequence of filters to apply.
+
+
+
+
+ Add new filter to the sequence.
+
+
+ Filter to add to the sequence.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ No filters were added into the filters' sequence.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The filter accepts bitmap data as input and returns the result
+ of image processing filter as new image. The source image data are kept
+ unchanged.
+
+ No filters were added into the filters' sequence.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ No filters were added into the filters' sequence.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+ Destination image in unmanaged memory to put result into.
+
+ The method keeps the source image unchanged and puts result of image processing
+ into destination image.
+
+ The destination image must have width, height and pixel format as it is expected by
+ the final filter in the sequence.
+
+
+ No filters were added into the filters' sequence.
+
+
+
+
+ Get filter at the specified index.
+
+
+ Index of filter to get.
+
+ Returns filter at specified index.
+
+
+
+
+ Contrast adjusting in RGB color space.
+
+
+ The filter operates in RGB color space and adjusts
+ pixels' contrast value by increasing RGB values of bright pixel and decreasing
+ RGB values of dark pixels (or vise versa if contrast needs to be decreased).
+ The filter is based on
+ filter and simply sets all input ranges to (, 255-) and
+ all output range to (0, 255) in the case if the factor value is positive.
+ If the factor value is negative, then all input ranges are set to
+ (0, 255 ) and all output ranges are set to
+ (-, 255_).
+
+ See documentation forr more information about the base filter.
+
+ The filter accepts 8 bpp grayscale and 24/32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ ContrastCorrection filter = new ContrastCorrection( 15 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Contrast adjusting factor.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Contrast adjusting factor, [-127, 127].
+
+
+ Factor which is used to adjust contrast. Factor values greater than
+ 0 increase contrast making light areas lighter and dark areas darker. Factor values
+ less than 0 decrease contrast - decreasing variety of contrast.
+
+ Default value is set to 10.
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Marble texture.
+
+
+ The texture generator creates textures with effect of marble.
+ The and properties allow to control the look
+ of marble texture in X/Y directions.
+
+ The generator is based on the Perlin noise function.
+
+ Sample usage:
+
+ // create texture generator
+ MarbleTexture textureGenerator = new MarbleTexture( );
+ // generate new texture
+ float[,] texture = textureGenerator.Generate( 320, 240 );
+ // convert it to image to visualize
+ Bitmap textureImage = TextureTools.ToBitmap( texture );
+
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ X period value.
+ Y period value.
+
+
+
+
+ Generate texture.
+
+
+ Texture's width.
+ Texture's height.
+
+ Two dimensional array of intensities.
+
+ Generates new texture of the specified size.
+
+
+
+
+ Reset generator.
+
+
+ Regenerates internal random numbers.
+
+
+
+
+ X period value, ≥ 2.
+
+
+ Default value is set to 5.
+
+
+
+
+ Y period value, ≥ 2.
+
+
+ Default value is set to 10.
+
+
+
+
+ Transform rectangle image into circle (to polar coordinates).
+
+
+ The image processing routine does transformation of the source image into
+ circle (polar transformation). The produced effect is similar to GIMP's "Polar Coordinates"
+ distortion filter (or its equivalent in Photoshop).
+
+
+ The filter accepts 8 bpp grayscale and 24/32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ TransformToPolar filter = new TransformToPolar( );
+ filter.OffsetAngle = 0;
+ filter.CirlceDepth = 1;
+ filter.UseOriginalImageSize = false;
+ filter.NewSize = new Size( 200, 200 );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Calculates new image size.
+
+
+ Source image data.
+
+ New image size - size of the destination image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Circularity coefficient of the mapping, [0, 1].
+
+
+ The property specifies circularity coefficient of the mapping to be done.
+ If the coefficient is set to 1, then the mapping will produce ideal circle. If the coefficient
+ is set to 0, then the mapping will occupy entire area of the destination image (circle will
+ be extended into direction of edges). Changing the property from 0 to 1 user may balance
+ circularity of the produced output.
+
+
+ Default value is set to 1.
+
+
+
+
+
+ Offset angle used to shift mapping, [-360, 360] degrees.
+
+
+ The property specifies offset angle, which can be used to shift
+ mapping in counter clockwise direction. For example, if user sets this property to 30, then
+ start of polar mapping is shifted by 30 degrees in counter clockwise direction.
+
+ Default value is set to 0.
+
+
+
+
+
+ Specifies direction of mapping.
+
+
+ The property specifies direction of mapping source image's X axis. If the
+ property is set to , the image is mapped in clockwise direction;
+ otherwise in counter clockwise direction.
+
+ Default value is set to .
+
+
+
+
+
+ Specifies if top of the source image should go to center or edge of the result image.
+
+
+ The property specifies position of the source image's top line in the destination
+ image. If the property is set to , then it goes to the center of the result image;
+ otherwise it goes to the edge.
+
+ Default value is set to .
+
+
+
+
+
+ Fill color to use for unprocessed areas.
+
+
+ The property specifies fill color, which is used to fill unprocessed areas.
+ In the case if is greater than 0, then there will be some areas on
+ the image's edge, which are not filled by the produced "circular" image, but are filled by
+ the specified color.
+
+
+ Default value is set to .
+
+
+
+
+
+ Size of destination image.
+
+
+ The property specifies size of result image produced by this image
+ processing routine in the case if property
+ is set to .
+
+ Both width and height must be in the [1, 10000] range.
+
+ Default value is set to 200 x 200.
+
+
+
+
+
+ Use source image size for destination or not.
+
+
+ The property specifies if the image processing routine should create destination
+ image of the same size as original image or of the size specified by
+ property.
+
+ Default value is set to .
+
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Transform polar image into rectangle.
+
+
+ The image processing routine is oposite transformation to the one done by
+ routine, i.e. transformation from polar image into rectangle. The produced effect is similar to GIMP's
+ "Polar Coordinates" distortion filter (or its equivalent in Photoshop).
+
+ The filter accepts 8 bpp grayscale and 24/32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ TransformFromPolar filter = new TransformFromPolar( );
+ filter.OffsetAngle = 0;
+ filter.CirlceDepth = 1;
+ filter.UseOriginalImageSize = false;
+ filter.NewSize = new Size( 360, 120 );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Calculates new image size.
+
+
+ Source image data.
+
+ New image size - size of the destination image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Circularity coefficient of the mapping, [0, 1].
+
+
+ The property specifies circularity coefficient of the mapping to be done.
+ If the coefficient is set to 1, then destination image will be produced by mapping
+ ideal circle from the source image, which is placed in source image's centre and its
+ radius equals to the minimum distance from centre to the image’s edge. If the coefficient
+ is set to 0, then the mapping will use entire area of the source image (circle will
+ be extended into direction of edges). Changing the property from 0 to 1 user may balance
+ circularity of the produced output.
+
+ Default value is set to 1.
+
+
+
+
+
+ Offset angle used to shift mapping, [-360, 360] degrees.
+
+
+ The property specifies offset angle, which can be used to shift
+ mapping in clockwise direction. For example, if user sets this property to 30, then
+ start of polar mapping is shifted by 30 degrees in clockwise direction.
+
+ Default value is set to 0.
+
+
+
+
+
+ Specifies direction of mapping.
+
+
+ The property specifies direction of mapping source image. If the
+ property is set to , the image is mapped in clockwise direction;
+ otherwise in counter clockwise direction.
+
+ Default value is set to .
+
+
+
+
+
+ Specifies if centre of the source image should to top or bottom of the result image.
+
+
+ The property specifies position of the source image's centre in the destination image.
+ If the property is set to , then it goes to the top of the result image;
+ otherwise it goes to the bottom.
+
+ Default value is set to .
+
+
+
+
+
+ Size of destination image.
+
+
+ The property specifies size of result image produced by this image
+ processing routine in the case if property
+ is set to .
+
+ Both width and height must be in the [1, 10000] range.
+
+ Default value is set to 200 x 200.
+
+
+
+
+
+ Use source image size for destination or not.
+
+
+ The property specifies if the image processing routine should create destination
+ image of the same size as original image or of the size specified by
+ property.
+
+ Default value is set to .
+
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Rotate image using bicubic interpolation.
+
+
+ The class implements image rotation filter using bicubic
+ interpolation algorithm. It uses bicubic kernel W(x) as described on
+ Wikipedia
+ (coefficient a is set to -0.5).
+
+ Rotation is performed in counterclockwise direction.
+
+ The filter accepts 8 bpp grayscale images and 24 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter - rotate for 30 degrees keeping original image size
+ RotateBicubic filter = new RotateBicubic( 30, true );
+ // apply the filter
+ Bitmap newImage = filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Rotation angle.
+
+ This constructor sets property
+ to .
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Rotation angle.
+ Keep image size or not.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Vertical run length smoothing algorithm.
+
+
+ The class implements vertical run length smoothing algorithm, which
+ is described in: K.Y. Wong, R.G. Casey and F.M. Wahl, "Document analysis system,"
+ IBM J. Res. Devel., Vol. 26, NO. 6,111). 647-656, 1982.
+
+ Unlike the original description of this algorithm, this implementation must be applied
+ to inverted binary images containing document, i.e. white text on black background. So this
+ implementation fills vertical black gaps between white pixels.
+
+ This algorithm is usually used together with ,
+ and then further analysis of white blobs.
+
+ The filter accepts 8 bpp grayscale images, which are supposed to be binary inverted documents.
+
+ Sample usage:
+
+ // create filter
+ VerticalRunLengthSmoothing vrls = new VerticalRunLengthSmoothing( 32 );
+ // apply the filter
+ vrls.ApplyInPlace( image );
+
+
+ Source image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Maximum gap size to fill (see ).
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Maximum gap size to fill (in pixels).
+
+
+ The property specifies maximum vertical gap between white pixels to fill.
+ If number of black pixels between some white pixels is bigger than this value, then those
+ black pixels are left as is; otherwise the gap is filled with white pixels.
+
+
+ Default value is set to 10. Minimum value is 1. Maximum value is 1000.
+
+
+
+
+ Process gaps between objects and image borders or not.
+
+
+ The property sets if gaps between image borders and objects must be treated as
+ gaps between objects and also filled.
+
+ Default value is set to .
+
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Salt and pepper noise.
+
+
+ The filter adds random salt and pepper noise - sets
+ maximum or minimum values to randomly selected pixels.
+
+ The filter accepts 8 bpp grayscale images and 24/32 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ SaltAndPepperNoise filter = new SaltAndPepperNoise( 10 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Amount of noise to generate in percents, [0, 100].
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Amount of noise to generate in percents, [0, 100].
+
+
+
+
+
+ Additive noise filter.
+
+
+ The filter adds random value to each pixel of the source image.
+ The distribution of random values can be specified by random generator.
+
+
+ The filter accepts 8 bpp grayscale images and 24 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create random generator
+ IRandomNumberGenerator generator = new UniformGenerator( new Range( -50, 50 ) );
+ // create filter
+ AdditiveNoise filter = new AdditiveNoise( generator );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Random number genertor used to add noise.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Random number genertor used to add noise.
+
+
+ Default generator is uniform generator in the range of (-10, 10).
+
+
+
+
+ Closing operator from Mathematical Morphology.
+
+
+ Closing morphology operator equals to dilatation followed
+ by erosion.
+
+ Applied to binary image, the filter may be used connect or fill objects. Since dilatation is used
+ first, it may connect/fill object areas. Then erosion restores objects. But since dilatation may connect
+ something before, erosion may not remove after that because of the formed connection.
+
+ See documentation to and classes for more
+ information and list of supported pixel formats.
+
+ Sample usage:
+
+ // create filter
+ Closing filter = new Closing( );
+ // apply the filter
+ filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Initializes new instance of the class using
+ default structuring element for both and
+ classes - 3x3 structuring element with all elements equal to 1.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Structuring element.
+
+ See documentation to and
+ classes for information about structuring element constraints.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Source image to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The filter accepts bitmap data as input and returns the result
+ of image processing filter as new image. The source image data are kept
+ unchanged.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+
+ Returns filter's result obtained by applying the filter to
+ the source image.
+
+ The method keeps the source image unchanged and returns
+ the result of image processing filter as new image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image in unmanaged memory.
+
+
+ Source image in unmanaged memory to apply filter to.
+ Destination image in unmanaged memory to put result into.
+
+ The method keeps the source image unchanged and puts result of image processing
+ into destination image.
+
+ The destination image must have the same width and height as source image. Also
+ destination image must have pixel format, which is expected by particular filter (see
+ property for information about pixel format conversions).
+
+
+ Unsupported pixel format of the source image.
+ Incorrect destination pixel format.
+ Destination image has wrong width and/or height.
+
+
+
+
+ Apply filter to an image.
+
+
+ Image to apply filter to.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image.
+
+
+ Image data to apply filter to.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an unmanaged image.
+
+
+ Unmanaged image to apply filter to.
+
+ The method applies the filter directly to the provided source unmanaged image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image or its part.
+
+
+ Image to apply filter to.
+ Image rectangle for processing by the filter.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an image or its part.
+
+
+ Image data to apply filter to.
+ Image rectangle for processing by the filter.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Apply filter to an unmanaged image or its part.
+
+
+ Unmanaged image to apply filter to.
+ Image rectangle for processing by the filter.
+
+ The method applies the filter directly to the provided source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Hue modifier.
+
+
+ The filter operates in HSL color space and updates
+ pixels' hue values setting it to the specified value (luminance and
+ saturation are kept unchanged). The result of the filter looks like the image
+ is observed through a glass of the given color.
+
+ The filter accepts 24 and 32 bpp color images for processing.
+ Sample usage:
+
+ // create filter
+ HueModifier filter = new HueModifier( 180 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Hue value to set.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Hue value to set, [0, 359].
+
+
+ Default value is set to 0.
+
+
+
+
+ Set of Bayer patterns supported by .
+
+
+
+
+ Pattern:
+ G R
+ B G
+
+
+
+
+ Pattern:
+ B G
+ G R
+
+
+
+
+ Optimized Bayer fileter image processing routine.
+
+
+ The class implements Bayer filter
+ routine, which creates color image out of grayscale image produced by image sensor built with
+ Bayer color matrix.
+
+ This class does all the same as class. However this version is
+ optimized for some well known patterns defined in enumeration.
+ Also this class processes images with even width and height only. Image size must be at least 2x2 pixels.
+
+
+ The filter accepts 8 bpp grayscale images and produces 24 bpp RGB image.
+
+ Sample usage:
+
+ // create filter
+ BayerFilter filter = new BayerFilter( );
+ // apply the filter
+ Bitmap rgbImage = filter.Apply( image );
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Bayer pattern of source images to decode.
+
+
+ The property specifies Bayer pattern of source images to be
+ decoded into color images.
+
+ Default value is set to .
+
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Color remapping.
+
+
+ The filter allows to remap colors of the image. Unlike filter
+ the filter allow to do non-linear remapping. For each pixel of specified image the filter changes
+ its values (value of each color plane) to values, which are stored in remapping arrays by corresponding
+ indexes. For example, if pixel's RGB value equals to (32, 96, 128), the filter will change it to
+ ([32], [96], [128]).
+
+ The filter accepts 8 bpp grayscale and 24/32 bpp color images for processing.
+
+ Sample usage:
+
+ // create map
+ byte[] map = new byte[256];
+ for ( int i = 0; i < 256; i++ )
+ {
+ map[i] = (byte) Math.Min( 255, Math.Pow( 2, (double) i / 32 ) );
+ }
+ // create filter
+ ColorRemapping filter = new ColorRemapping( map, map, map );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Initializes the filter without any remapping. All
+ pixel values are mapped to the same values.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Red map.
+ Green map.
+ Blue map.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Gray map.
+
+ This constructor is supposed for grayscale images.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Remapping array for red color plane.
+
+
+ The remapping array should contain 256 remapping values. The remapping occurs
+ by changing pixel's red value r to [r].
+
+ A map should be array with 256 value.
+
+
+
+
+ Remapping array for green color plane.
+
+
+ The remapping array should contain 256 remapping values. The remapping occurs
+ by changing pixel's green value g to [g].
+
+ A map should be array with 256 value.
+
+
+
+
+ Remapping array for blue color plane.
+
+
+ The remapping array should contain 256 remapping values. The remapping occurs
+ by changing pixel's blue value b to [b].
+
+ A map should be array with 256 value.
+
+
+
+
+ Remapping array for gray color.
+
+
+ The remapping array should contain 256 remapping values. The remapping occurs
+ by changing pixel's value g to [g].
+
+ The gray map is for grayscale images only.
+
+ A map should be array with 256 value.
+
+
+
+
+ Binarization with thresholds matrix.
+
+
+ Idea of the filter is the same as idea of filter -
+ change pixel value to white, if its intensity is equal or higher than threshold value, or
+ to black otherwise. But instead of using single threshold value for all pixel, the filter
+ uses matrix of threshold values. Processing image is divided to adjacent windows of matrix
+ size each. For pixels binarization inside of each window, corresponding threshold values are
+ used from specified threshold matrix.
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create binarization matrix
+ byte[,] matrix = new byte[4, 4]
+ {
+ { 95, 233, 127, 255 },
+ { 159, 31, 191, 63 },
+ { 111, 239, 79, 207 },
+ { 175, 47, 143, 15 }
+ };
+ // create filter
+ OrderedDithering filter = new OrderedDithering( matrix );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Thresholds matrix.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Ordered dithering using Bayer matrix.
+
+
+ The filter represents filter initialized
+ with the next threshold matrix:
+
+ byte[,] matrix = new byte[4, 4]
+ {
+ { 0, 192, 48, 240 },
+ { 128, 64, 176, 112 },
+ { 32, 224, 16, 208 },
+ { 160, 96, 144, 80 }
+ };
+
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ BayerDithering filter = new BayerDithering( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Vertical intensity statistics.
+
+
+ The class provides information about vertical distribution
+ of pixel intensities, which may be used to locate objects, their centers, etc.
+
+
+ The class accepts grayscale (8 bpp indexed and 16 bpp) and color (24, 32, 48 and 64 bpp) images.
+ In the case of 32 and 64 bpp color images, the alpha channel is not processed - statistics is not
+ gathered for this channel.
+
+ Sample usage:
+
+ // collect statistics
+ VerticalIntensityStatistics vis = new VerticalIntensityStatistics( sourceImage );
+ // get gray histogram (for grayscale image)
+ Histogram histogram = vis.Gray;
+ // output some histogram's information
+ System.Diagnostics.Debug.WriteLine( "Mean = " + histogram.Mean );
+ System.Diagnostics.Debug.WriteLine( "Min = " + histogram.Min );
+ System.Diagnostics.Debug.WriteLine( "Max = " + histogram.Max );
+
+
+ Sample grayscale image with its vertical intensity histogram:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Source image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Source image data.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Source unmanaged image.
+
+ Unsupported pixel format of the source image.
+
+
+
+
+ Gather vertical intensity statistics for specified image.
+
+
+ Source image.
+
+
+
+
+ Histogram for red channel.
+
+
+
+
+
+ Histogram for green channel.
+
+
+
+
+
+ Histogram for blue channel.
+
+
+
+
+
+ Histogram for gray channel (intensities).
+
+
+
+
+
+ Value wich specifies if the processed image was color or grayscale.
+
+
+ If the property equals to true, then the
+ property should be used to retrieve histogram for the processed grayscale image.
+ Otherwise , and property
+ should be used to retrieve histogram for particular RGB channel of the processed
+ color image.
+
+
+
+
+ Merge two images using factors from texture.
+
+
+ The filter is similar to filter in its idea, but
+ instead of using single value for balancing amount of source's and overlay's image
+ values (see ), the filter uses texture, which determines
+ the amount to take from source image and overlay image.
+
+ The filter uses specified texture to adjust values using the next formula:
+ dst = src * textureValue + ovr * ( 1.0 - textureValue ),
+ where src is value of pixel in a source image, ovr is value of pixel in
+ overlay image, dst is value of pixel in a destination image and
+ textureValue is corresponding value from provided texture (see or
+ ).
+
+ The filter accepts 8 bpp grayscale and 24 bpp color images for processing.
+
+ Sample usage #1:
+
+ // create filter
+ TexturedMerge filter = new TexturedMerge( new TextileTexture( ) );
+ // create an overlay image to merge with
+ filter.OverlayImage = new Bitmap( image.Width, image.Height,
+ PixelFormat.Format24bppRgb );
+ // fill the overlay image with solid color
+ PointedColorFloodFill fillFilter = new PointedColorFloodFill( Color.DarkKhaki );
+ fillFilter.ApplyInPlace( filter.OverlayImage );
+ // apply the merge filter
+ filter.ApplyInPlace( image );
+
+
+ Sample usage #2:
+
+ // create filter
+ TexturedMerge filter = new TexturedMerge( new CloudsTexture( ) );
+ // create 2 images with modified Hue
+ HueModifier hm1 = new HueModifier( 50 );
+ HueModifier hm2 = new HueModifier( 200 );
+ filter.OverlayImage = hm2.Apply( image );
+ hm1.ApplyInPlace( image );
+ // apply the merge filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image #1:
+
+ Result image #2:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Generated texture.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Texture generator.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Overlay image data.
+
+
+
+
+ Format translations dictionary.
+
+
+ See for more information.
+
+
+
+
+ Generated texture.
+
+
+ Two dimensional array of texture intensities.
+
+ In the case if image passed to the filter is smaller or
+ larger than the specified texture, than image's region is processed, which equals to the
+ minimum overlapping area.
+
+ The property has priority over this property - if
+ generator is specified than the static generated texture is not used.
+
+
+
+
+
+ Texture generator.
+
+
+ Generator used to generate texture.
+
+ The property has priority over the property.
+
+
+
+
+
+ Fill areas outiside of specified region.
+
+
+
+ The filter fills areas outside of specified region using the specified color.
+
+ The filter accepts 8bpp grayscale and 24/32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ CanvasCrop filter = new CanvasCrop( new Rectangle(
+ 5, 5, image.Width - 10, image.Height - 10 ), Color.Red );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Region to keep.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Region to keep.
+ RGB color to use for filling areas outside of specified region in color images.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Region to keep.
+ Gray color to use for filling areas outside of specified region in grayscale images.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Region to keep.
+ RGB color to use for filling areas outside of specified region in color images.
+ Gray color to use for filling areas outside of specified region in grayscale images.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ RGB fill color.
+
+
+ The color is used to fill areas out of specified region in color images.
+
+ Default value is set to white - RGB(255, 255, 255).
+
+
+
+
+ Gray fill color.
+
+
+ The color is used to fill areas out of specified region in grayscale images.
+
+ Default value is set to white - 255.
+
+
+
+
+ Region to keep.
+
+
+ Pixels inside of the specified region will keep their values, but
+ pixels outside of the region will be filled with specified color.
+
+
+
+
+ Erosion operator from Mathematical Morphology.
+
+
+ The filter assigns minimum value of surrounding pixels to each pixel of
+ the result image. Surrounding pixels, which should be processed, are specified by
+ structuring element: 1 - to process the neighbor, -1 - to skip it.
+
+ The filter especially useful for binary image processing, where it removes pixels, which
+ are not surrounded by specified amount of neighbors. It gives ability to remove noisy pixels
+ (stand-alone pixels) or shrink objects.
+
+ For processing image with 3x3 structuring element, there are different optimizations
+ available, like and .
+
+ The filter accepts 8 and 16 bpp grayscale images and 24 and 48 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Erosion filter = new Erosion( );
+ // apply the filter
+ filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Initializes new instance of the class using
+ default structuring element - 3x3 structuring element with all elements equal to 1.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Structuring element.
+
+ Structuring elemement for the erosion morphological operator
+ must be square matrix with odd size in the range of [3, 99].
+
+ Invalid size of structuring element.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Bottop-hat operator from Mathematical Morphology.
+
+
+ Bottom-hat morphological operator subtracts
+ input image from the result of morphological closing on the
+ the input image.
+
+ Applied to binary image, the filter allows to get all object parts, which were
+ added by closing filter, but were not removed after that due
+ to formed connections/fillings.
+
+ The filter accepts 8 and 16 bpp grayscale images and 24 and 48 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ BottomHat filter = new BottomHat( );
+ // apply the filter
+ filter.Apply( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Structuring element to pass to operator.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Grayscale image using Y algorithm.
+
+
+ The class uses Y algorithm to convert color image
+ to grayscale. The conversion coefficients are:
+
+ - Red: 0.299;
+ - Green: 0.587;
+ - Blue: 0.114.
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Contrast stretching filter.
+
+
+ Contrast stretching (or as it is often called normalization) is a simple image enhancement
+ technique that attempts to improve the contrast in an image by 'stretching' the range of intensity values
+ it contains to span a desired range of values, e.g. the full range of pixel values that the image type
+ concerned allows. It differs from the more sophisticated histogram equalization
+ in that it can only apply a linear scaling function to the image pixel values.
+
+ The result of this filter may be achieved by using class, which allows to
+ get pixels' intensities histogram, and filter, which does linear correction
+ of pixel's intensities.
+
+ The filter accepts 8 bpp grayscale and 24 bpp color images.
+
+ Sample usage:
+
+ // create filter
+ ContrastStretch filter = new ContrastStretch( );
+ // process image
+ filter.ApplyInPlace( sourceImage );
+
+
+ Source image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Channels filters.
+
+
+ The filter does color channels' filtering by clearing (filling with
+ specified values) values, which are inside/outside of the specified value's
+ range. The filter allows to fill certain ranges of RGB color channels with specified
+ value.
+
+ The filter is similar to , but operates with not
+ entire pixels, but with their RGB values individually. This means that pixel itself may
+ not be filtered (will be kept), but one of its RGB values may be filtered if they are
+ inside/outside of specified range.
+
+ The filter accepts 24 and 32 bpp color images for processing.
+
+ Sample usage:
+
+ // create filter
+ ChannelFiltering filter = new ChannelFiltering( );
+ // set channels' ranges to keep
+ filter.Red = new IntRange( 0, 255 );
+ filter.Green = new IntRange( 100, 255 );
+ filter.Blue = new IntRange( 100, 255 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Red channel's filtering range.
+ Green channel's filtering range.
+ Blue channel's filtering range.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Calculate filtering map.
+
+
+ Filtering range.
+ Fillter value.
+ Fill outside or inside the range.
+ Filtering map.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Red channel's range.
+
+
+
+
+ Red fill value.
+
+
+
+
+ Green channel's range.
+
+
+
+
+ Green fill value.
+
+
+
+
+ Blue channel's range.
+
+
+
+
+ Blue fill value.
+
+
+
+
+ Determines, if red channel should be filled inside or outside filtering range.
+
+
+ Default value is set to .
+
+
+
+
+ Determines, if green channel should be filled inside or outside filtering range.
+
+
+ Default value is set to .
+
+
+
+
+ Determines, if blue channel should be filled inside or outside filtering range.
+
+
+ Default value is set to .
+
+
+
+
+ Generic Bayer fileter image processing routine.
+
+
+ The class implements Bayer filter
+ routine, which creates color image out of grayscale image produced by image sensor built with
+ Bayer color matrix.
+
+ This Bayer filter implementation is made generic by allowing user to specify used
+ Bayer pattern. This makes it slower. For optimized version
+ of the Bayer filter see class, which implements Bayer filter
+ specifically optimized for some well known patterns.
+
+ The filter accepts 8 bpp grayscale images and produces 24 bpp RGB image.
+
+ Sample usage:
+
+ // create filter
+ BayerFilter filter = new BayerFilter( );
+ // apply the filter
+ Bitmap rgbImage = filter.Apply( image );
+
+
+ Source image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+
+
+
+
+ Specifies if demosaicing must be done or not.
+
+
+ The property specifies if color demosaicing must be done or not.
+ If the property is set to , then pixels of the result color image
+ are colored according to the Bayer pattern used, i.e. every pixel
+ of the source grayscale image is copied to corresponding color plane of the result image.
+ If the property is set to , then pixels of the result image
+ are set to color, which is obtained by averaging color components from the 3x3 window - pixel
+ itself plus 8 surrounding neighbors.
+
+ Default value is set to .
+
+
+
+
+
+ Specifies Bayer pattern used for decoding color image.
+
+
+ The property specifies 2x2 array of RGB color indexes, which set the
+ Bayer patter used for decoding color image.
+
+ By default the property is set to:
+
+ new int[2, 2] { { RGB.G, RGB.R }, { RGB.B, RGB.G } }
+ ,
+ which corresponds to
+
+ G R
+ B G
+
+ pattern.
+
+
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Move towards filter.
+
+
+ The result of this filter is an image, which is based on source image,
+ but updated in the way to decrease diffirence with overlay image - source image is
+ moved towards overlay image. The update equation is defined in the next way:
+ res = src + Min( Abs( ovr - src ), step ) * Sign( ovr - src ).
+
+ The bigger is step size value the more resulting
+ image will look like overlay image. For example, in the case if step size is equal
+ to 255 (or 65535 for images with 16 bits per channel), the resulting image will be
+ equal to overlay image regardless of source image's pixel values. In the case if step
+ size is set to 1, the resulting image will very little differ from the source image.
+ But, in the case if the filter is applied repeatedly to the resulting image again and
+ again, it will become equal to overlay image in maximum 255 (65535 for images with 16
+ bits per channel) iterations.
+
+ The filter accepts 8 and 16 bpp grayscale images and 24, 32, 48 and 64 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ MoveTowards filter = new MoveTowards( overlayImage, 20 );
+ // apply the filter
+ Bitmap resultImage = filter.Apply( sourceImage );
+
+
+ Source image:
+
+ Overlay image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Overlay image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Overlay image.
+ Step size.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged overlay image.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged overlay image.
+ Step size.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Overlay image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Step size, [0, 65535].
+
+
+
+ The property defines the maximum amount of changes per pixel in the source image.
+
+ Default value is set to 1.
+
+
+
+
+
+ Drawing primitives.
+
+
+ The class allows to do drawing of some primitives directly on
+ locked image data or unmanaged image.
+
+ All methods of this class support drawing only on color 24/32 bpp images and
+ on grayscale 8 bpp indexed images.
+
+ When it comes to alpha blending for 24/32 bpp images, all calculations are done
+ as described on Wikipeadia
+ (see "over" operator).
+
+
+
+
+
+ Fill rectangle on the specified image.
+
+
+ Source image data to draw on.
+ Rectangle's coordinates to fill.
+ Rectangle's color.
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Fill rectangle on the specified image.
+
+
+ Source image to draw on.
+ Rectangle's coordinates to fill.
+ Rectangle's color.
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Draw rectangle on the specified image.
+
+
+ Source image data to draw on.
+ Rectangle's coordinates to draw.
+ Rectangle's color.
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Draw rectangle on the specified image.
+
+
+ Source image to draw on.
+ Rectangle's coordinates to draw.
+ Rectangle's color.
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Draw a line on the specified image.
+
+
+ Source image data to draw on.
+ The first point to connect.
+ The second point to connect.
+ Line's color.
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Draw a line on the specified image.
+
+
+ Source image to draw on.
+ The first point to connect.
+ The second point to connect.
+ Line's color.
+
+ The source image has incorrect pixel format.
+
+
+
+
+ Draw a polygon on the specified image.
+
+
+ Source image data to draw on.
+ Points of the polygon to draw.
+ Polygon's color.
+
+ The method draws a polygon by connecting all points from the
+ first one to the last one and then connecting the last point with the first one.
+
+
+
+
+
+ Draw a polygon on the specified image.
+
+
+ Source image to draw on.
+ Points of the polygon to draw.
+ Polygon's color.
+
+ The method draws a polygon by connecting all points from the
+ first one to the last one and then connecting the last point with the first one.
+
+
+
+
+
+ Draw a polyline on the specified image.
+
+
+ Source image data to draw on.
+ Points of the polyline to draw.
+ polyline's color.
+
+ The method draws a polyline by connecting all points from the
+ first one to the last one. Unlike
+ method, this method does not connect the last point with the first one.
+
+
+
+
+
+ Draw a polyline on the specified image.
+
+
+ Source image to draw on.
+ Points of the polyline to draw.
+ polyline's color.
+
+ The method draws a polyline by connecting all points from the
+ first one to the last one. Unlike
+ method, this method does not connect the last point with the first one.
+
+
+
+
+
+ Color quantization tools.
+
+
+ The class contains methods aimed to simplify work with color quantization
+ algorithms implementing interface. Using its methods it is possible
+ to calculate reduced color palette for the specified image or reduce colors to the specified number.
+
+ Sample usage:
+
+ // instantiate the images' color quantization class
+ ColorImageQuantizer ciq = new ColorImageQuantizer( new MedianCutQuantizer( ) );
+ // get 16 color palette for a given image
+ Color[] colorTable = ciq.CalculatePalette( image, 16 );
+
+ // ... or just reduce colors in the specified image
+ Bitmap newImage = ciq.ReduceColors( image, 16 );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Color quantization algorithm to use for processing images.
+
+
+
+
+ Calculate reduced color palette for the specified image.
+
+
+ Image to calculate palette for.
+ Palette size to calculate.
+
+ Return reduced color palette for the specified image.
+
+ See for details.
+
+
+
+
+ Calculate reduced color palette for the specified image.
+
+
+ Image to calculate palette for.
+ Palette size to calculate.
+
+ Return reduced color palette for the specified image.
+
+ The method processes the specified image and feeds color value of each pixel
+ to the specified color quantization algorithm. Finally it returns color palette built by
+ that algorithm.
+
+ Unsupported format of the source image - it must 24 or 32 bpp color image.
+
+
+
+
+ Create an image with reduced number of colors.
+
+
+ Source image to process.
+ Number of colors to get in the output image, [2, 256].
+
+ Returns image with reduced number of colors.
+
+ See for details.
+
+
+
+
+ Create an image with reduced number of colors.
+
+
+ Source image to process.
+ Number of colors to get in the output image, [2, 256].
+
+ Returns image with reduced number of colors.
+
+ The method creates an image, which looks similar to the specified image, but contains
+ reduced number of colors. First, target color palette is calculated using
+ method and then a new image is created, where pixels from the given source image are substituted by
+ best matching colors from calculated color table.
+
+ The output image has 4 bpp or 8 bpp indexed pixel format depending on the target palette size -
+ 4 bpp for palette size 16 or less; 8 bpp otherwise.
+
+
+ Unsupported format of the source image - it must 24 or 32 bpp color image.
+ Invalid size of the target color palette.
+
+
+
+
+ Create an image with reduced number of colors using the specified palette.
+
+
+ Source image to process.
+ Target color palette. Must contatin 2-256 colors.
+
+ Returns image with reduced number of colors.
+
+ See for details.
+
+
+
+
+ Create an image with reduced number of colors using the specified palette.
+
+
+ Source image to process.
+ Target color palette. Must contatin 2-256 colors.
+
+ Returns image with reduced number of colors.
+
+ The method creates an image, which looks similar to the specified image, but contains
+ reduced number of colors. Is substitutes every pixel of the source image with the closest matching color
+ in the specified paletter.
+
+ The output image has 4 bpp or 8 bpp indexed pixel format depending on the target palette size -
+ 4 bpp for palette size 16 or less; 8 bpp otherwise.
+
+
+ Unsupported format of the source image - it must 24 or 32 bpp color image.
+ Invalid size of the target color palette.
+
+
+
+
+ Color quantization algorithm used by this class to build color palettes for the specified images.
+
+
+
+
+
+ Use color caching during color reduction or not.
+
+
+ The property has effect only for methods like and
+ specifies if internal cache of already processed colors should be used or not. For each pixel in the original
+ image the color reduction routine does search in target color palette to find the best matching color.
+ To avoid doing the search again and again for already processed colors, the class may use internal dictionary
+ which maps colors of original image to indexes in target color palette.
+
+
+ The property provides a trade off. On one hand it may speedup color reduction routine, but on another
+ hand it increases memory usage. Also cache usage may not be efficient for very small target color tables.
+
+ Default value is set to .
+
+
+
+
+
+ Pixellate filter.
+
+
+ The filter processes an image creating the effect of an image with larger
+ pixels - pixellated image. The effect is achieved by filling image's rectangles of the
+ specified size by the color, which is mean color value for the corresponding rectangle.
+ The size of rectangles to process is set by and
+ properties.
+
+ The filter accepts 8 bpp grayscale images and 24 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Pixellate filter = new Pixellate( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Pixel size.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Pixel width.
+ Pixel height.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Pixel width, [2, 32].
+
+
+ Default value is set to 8.
+
+
+
+
+
+
+
+ Pixel height, [2, 32].
+
+
+ Default value is set to 8.
+
+
+
+
+
+
+
+ Pixel size, [2, 32].
+
+
+ The property is used to set both and
+ simultaneously.
+
+
+
+
+ Apply mask to the specified image.
+
+
+ The filter applies mask to the specified image - keeps all pixels
+ in the image if corresponding pixels/values of the mask are not equal to 0. For all
+ 0 pixels/values in mask, corresponding pixels in the source image are set to 0.
+
+ Mask can be specified as .NET's managed Bitmap, as
+ UnmanagedImage or as byte array.
+ In the case if mask is specified as image, it must be 8 bpp grayscale image. In all case
+ mask size must be the same as size of the image to process.
+
+ The filter accepts 8/16 bpp grayscale and 24/32/48/64 bpp color images for processing.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Mask image to use.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged mask image to use.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ to use.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+ None of the possible mask properties were set. Need to provide mask before applying the filter.
+ Invalid size of provided mask. Its size must be the same as the size of the image to mask.
+
+
+
+
+ Mask image to apply.
+
+
+ The property specifies mask image to use. The image must be grayscale
+ (8 bpp format) and have the same size as the source image to process.
+
+ When the property is set, both and
+ properties are set to .
+
+
+ The mask image must be 8 bpp grayscale image.
+
+
+
+
+ Unmanaged mask image to apply.
+
+
+ The property specifies unmanaged mask image to use. The image must be grayscale
+ (8 bpp format) and have the same size as the source image to process.
+
+ When the property is set, both and
+ properties are set to .
+
+
+ The mask image must be 8 bpp grayscale image.
+
+
+
+
+ Mask to apply.
+
+
+ The property specifies mask array to use. Size of the array must
+ be the same size as the size of the source image to process - its 0th dimension
+ must be equal to image's height and its 1st dimension must be equal to width. For
+ example, for 640x480 image, the mask array must be defined as:
+
+ byte[,] mask = new byte[480, 640];
+
+
+
+
+
+
+ Format translations dictionary.
+
+
+ See
+ documentation for additional information.
+
+
+
+
+ Canny edge detector.
+
+
+ The filter searches for objects' edges by applying Canny edge detector.
+ The implementation follows
+ Bill Green's Canny edge detection tutorial.
+
+ The implemented canny edge detector has one difference with the above linked algorithm.
+ The difference is in hysteresis step, which is a bit simplified (getting faster as a result). On the
+ hysteresis step each pixel is compared with two threshold values: and
+ . If pixel's value is greater or equal to , then
+ it is kept as edge pixel. If pixel's value is greater or equal to , then
+ it is kept as edge pixel only if there is at least one neighbouring pixel (8 neighbours are checked) which
+ has value greater or equal to ; otherwise it is none edge pixel. In the case
+ if pixel's value is less than , then it is marked as none edge immediately.
+
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ CannyEdgeDetector filter = new CannyEdgeDetector( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Low threshold.
+ High threshold.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Low threshold.
+ High threshold.
+ Gaussian sigma.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Destination image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Low threshold.
+
+
+ Low threshold value used for hysteresis
+ (see tutorial
+ for more information).
+
+ Default value is set to 20.
+
+
+
+
+
+ High threshold.
+
+
+ High threshold value used for hysteresis
+ (see tutorial
+ for more information).
+
+ Default value is set to 100.
+
+
+
+
+
+ Gaussian sigma.
+
+
+ Sigma value for Gaussian bluring.
+
+
+
+
+ Gaussian size.
+
+
+ Size of Gaussian kernel.
+
+
+
+
+ Linear correction of RGB channels for images, which have 16 bpp planes (16 bit gray images or 48/64 bit colour images).
+
+
+ The filter performs linear correction of RGB channels by mapping specified
+ channels' input ranges to output ranges. This version of the filter processes only images
+ with 16 bpp colour planes. See for 8 bpp version.
+
+ The filter accepts 16 bpp grayscale and 48/64 bpp colour images for processing.
+
+ Sample usage:
+
+ // create filter
+ LevelsLinear16bpp filter = new LevelsLinear16bpp( );
+ // set ranges
+ filter.InRed = new IntRange( 3000, 42000 );
+ filter.InGreen = new IntRange( 5000, 37500 );
+ filter.InBlue = new IntRange( 1000, 60000 );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Image rectangle for processing by the filter.
+
+
+
+
+ Calculate conversion map.
+
+
+ Input range.
+ Output range.
+ Conversion map.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Red component's input range.
+
+
+
+
+ Green component's input range.
+
+
+
+
+ Blue component's input range.
+
+
+
+
+ Gray component's input range.
+
+
+
+
+ Input range for RGB components.
+
+
+ The property allows to set red, green and blue input ranges to the same value.
+
+
+
+
+ Red component's output range.
+
+
+
+
+ Green component's output range.
+
+
+
+
+ Blue component's output range.
+
+
+
+
+ Gray component's output range.
+
+
+
+
+ Output range for RGB components.
+
+
+ The property allows to set red, green and blue output ranges to the same value.
+
+
+
+
+ Dithering using Sierra error diffusion.
+
+
+ The filter represents binarization filter, which is based on
+ error diffusion dithering with Sierra coefficients. Error is diffused
+ on 10 neighbor pixels with next coefficients:
+
+ | * | 5 | 3 |
+ | 2 | 4 | 5 | 4 | 2 |
+ | 2 | 3 | 2 |
+
+ / 32
+
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ SierraDithering filter = new SierraDithering( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Dithering using Burkes error diffusion.
+
+
+ The filter represents binarization filter, which is based on
+ error diffusion dithering with Burkes coefficients. Error is diffused
+ on 7 neighbor pixels with next coefficients:
+
+ | * | 8 | 4 |
+ | 2 | 4 | 8 | 4 | 2 |
+
+ / 32
+
+
+ The filter accepts 8 bpp grayscale images for processing.
+
+ Sample usage:
+
+ // create filter
+ BurkesDithering filter = new BurkesDithering( );
+ // apply the filter
+ filter.ApplyInPlace( image );
+
+
+ Initial image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Calculate difference between two images and threshold it.
+
+
+ The filter produces similar result as applying filter and
+ then filter - thresholded difference between two images. Result of this
+ image processing routine may be useful in motion detection applications or finding areas of significant
+ difference.
+
+ The filter accepts 8 and 24/32color images for processing.
+ In the case of color images, the image processing routine differences sum over 3 RGB channels (Manhattan distance), i.e.
+ |diffR| + |diffG| + |diffB|.
+
+
+ Sample usage:
+
+ // create filter
+ ThresholdedDifference filter = new ThresholdedDifference( 60 );
+ // apply the filter
+ filter.OverlayImage = backgroundImage;
+ Bitmap resultImage = filter.Apply( sourceImage );
+
+
+ Source image:
+
+ Background image:
+
+ Result image:
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Difference threshold (see ).
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Overlay image data.
+ Destination image data
+
+
+
+
+ Difference threshold.
+
+
+ The property specifies difference threshold. If difference between pixels of processing image
+ and overlay image is greater than this value, then corresponding pixel of result image is set to white; otherwise
+ black.
+
+
+ Default value is set to 15.
+
+
+
+
+ Number of pixels which were set to white in destination image during last image processing call.
+
+
+ The property may be useful to determine amount of difference between two images which,
+ for example, may be treated as amount of motion in motion detection applications, etc.
+
+
+
+
+ Format translations dictionary.
+
+
+ See for more information.
+
+
+
+
+ Subtract filter - subtract pixel values of two images.
+
+
+ The subtract filter takes two images (source and overlay images)
+ of the same size and pixel format and produces an image, where each pixel equals
+ to the difference value of corresponding pixels from provided images (if difference is less
+ than minimum allowed value, 0, then it is truncated to that minimum value).
+
+ The filter accepts 8 and 16 bpp grayscale images and 24, 32, 48 and 64 bpp
+ color images for processing.
+
+ Sample usage:
+
+ // create filter
+ Subtract filter = new Subtract( overlayImage );
+ // apply the filter
+ Bitmap resultImage = filter.Apply( sourceImage );
+
+
+ Source image:
+
+ Overlay image:
+
+ Result image:
+
+
+
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Overlay image
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Unmanaged overlay image.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data.
+ Overlay image data.
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Stereo anaglyph filter.
+
+
+ The image processing filter produces stereo anaglyph images which are
+ aimed to be viewed through anaglyph glasses with red filter over the left eye and
+ cyan over the right.
+
+
+
+ The stereo image is produced by combining two images of the same scene taken
+ from a bit different points. The right image must be provided to the filter using
+ property, but the left image must be provided to
+ method, which creates the anaglyph image.
+
+ The filter accepts 24 bpp color images for processing.
+
+ See enumeration for the list of supported anaglyph algorithms.
+
+ Sample usage:
+
+ // create filter
+ StereoAnaglyph filter = new StereoAnaglyph( );
+ // set right image as overlay
+ filter.Overlay = rightImage
+ // apply the filter (providing left image)
+ Bitmap resultImage = filter.Apply( leftImage );
+
+
+ Source image (left):
+
+ Overlay image (right):
+
+ Result image:
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Algorithm to use for creating anaglyph images.
+
+
+
+
+ Process the filter on the specified image.
+
+
+ Source image data (left image).
+ Overlay image data (right image).
+
+
+
+
+ Algorithm to use for creating anaglyph images.
+
+
+ Default value is set to .
+
+
+
+
+ Format translations dictionary.
+
+
+
+
+ Enumeration of algorithms for creating anaglyph images.
+
+
+ See anaglyph methods comparison for
+ descipton of different algorithms.
+
+
+
+
+
+ Creates anaglyph image using the below calculations:
+
+ - Ra=0.299*Rl+0.587*Gl+0.114*Bl;
+ - Ga=0;
+ - Ba=0.299*Rr+0.587*Gr+0.114*Br.
+
+
+
+
+
+ Creates anaglyph image using the below calculations:
+
+ - Ra=0.299*Rl+0.587*Gl+0.114*Bl;
+ - Ga=0.299*Rr+0.587*Gr+0.114*Br;
+ - Ba=0.299*Rr+0.587*Gr+0.114*Br.
+
+
+
+
+
+ Creates anaglyph image using the below calculations:
+
+ - Ra=Rl;
+ - Ga=Gr;
+ - Ba=Br.
+
+
+
+
+
+ Creates anaglyph image using the below calculations:
+
+ - Ra=0.299*Rl+0.587*Gl+0.114*Bl;
+ - Ga=Gr;
+ - Ba=Br.
+
+
+
+
+
+ Creates anaglyph image using the below calculations:
+
+ - Ra=0.7*Gl+0.3*Bl;
+ - Ga=Gr;
+ - Ba=Br.
+
+
+
+
+
diff --git a/Part 2 - Take a Snapshot/bin/Debug/AForge.Math.dll b/Part 2 - Take a Snapshot/bin/Debug/AForge.Math.dll
new file mode 100644
index 0000000..bdc5e5b
Binary files /dev/null and b/Part 2 - Take a Snapshot/bin/Debug/AForge.Math.dll differ
diff --git a/Part 2 - Take a Snapshot/bin/Debug/AForge.Math.xml b/Part 2 - Take a Snapshot/bin/Debug/AForge.Math.xml
new file mode 100644
index 0000000..2d86543
--- /dev/null
+++ b/Part 2 - Take a Snapshot/bin/Debug/AForge.Math.xml
@@ -0,0 +1,5676 @@
+
+
+
+ AForge.Math
+
+
+
+
+ Set of tool functions.
+
+
+ The class contains different utility functions.
+
+
+
+
+ Calculates power of 2.
+
+
+ Power to raise in.
+
+ Returns specified power of 2 in the case if power is in the range of
+ [0, 30]. Otherwise returns 0.
+
+
+
+
+ Checks if the specified integer is power of 2.
+
+
+ Integer number to check.
+
+ Returns true if the specified number is power of 2.
+ Otherwise returns false.
+
+
+
+
+ Get base of binary logarithm.
+
+
+ Source integer number.
+
+ Power of the number (base of binary logarithm).
+
+
+
+
+ Interface for distance metric algorithms.
+
+
+ The interface defines a set of methods implemented
+ by distance metric algorithms. These algorithms typically take a set of points and return a
+ distance measure of the x and y coordinates. In this case, the points are represented by two vectors.
+
+ Distance metric algorithms are used in many machine learning algorithms e.g K-nearest neighbor
+ and K-means clustering.
+
+ For additional details about distance metrics, documentation of the
+ particular algorithms should be studied.
+
+
+
+
+
+ Returns distance between two N-dimensional double vectors.
+
+
+ 1st point vector.
+ 2nd point vector.
+
+ Returns distance measurement determined by the given algorithm.
+
+
+
+
+ Histogram for discrete random values.
+
+
+ The class wraps histogram for discrete stochastic function, which is represented
+ by integer array, where indexes of the array are treated as values of the stochastic function,
+ but array values are treated as "probabilities" (total amount of hits).
+
+
+ Sample usage:
+
+ // create histogram
+ Histogram histogram = new Histogram( new int[10] { 0, 0, 1, 3, 6, 8, 11, 0, 0, 0 } );
+ // get mean and standard deviation values
+ Console.WriteLine( "mean = " + histogram.Mean + ", std.dev = " + histogram.StdDev );
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Values of the histogram.
+
+ Indexes of the input array are treated as values of stochastic function,
+ but array values are treated as "probabilities" (total amount of hits).
+
+
+
+
+
+ Get range around median containing specified percentage of values.
+
+
+ Values percentage around median.
+
+ Returns the range which containes specifies percentage of values.
+
+ The method calculates range of stochastic variable, which summary probability
+ comprises the specified percentage of histogram's hits.
+
+ Sample usage:
+
+ // create histogram
+ Histogram histogram = new Histogram( new int[10] { 0, 0, 1, 3, 6, 8, 11, 0, 0, 0 } );
+ // get 50% range
+ IntRange range = histogram.GetRange( 0.5 );
+ // show the range ([4, 6])
+ Console.WriteLine( "50% range = [" + range.Min + ", " + range.Max + "]" );
+
+
+
+
+
+
+ Update statistical value of the histogram.
+
+
+ The method recalculates statistical values of the histogram, like mean,
+ standard deviation, etc., in the case if histogram's values were changed directly.
+ The method should be called only in the case if histogram's values were retrieved
+ through property and updated after that.
+
+
+
+
+
+ Values of the histogram.
+
+
+ Indexes of this array are treated as values of stochastic function,
+ but array values are treated as "probabilities" (total amount of hits).
+
+
+
+
+
+ Mean value.
+
+
+ The property allows to retrieve mean value of the histogram.
+
+ Sample usage:
+
+ // create histogram
+ Histogram histogram = new Histogram( new int[10] { 0, 0, 1, 3, 6, 8, 11, 0, 0, 0 } );
+ // get mean value (= 4.862)
+ Console.WriteLine( "mean = " + histogram.Mean.ToString( "F3" ) );
+
+
+
+
+
+
+ Standard deviation.
+
+
+ The property allows to retrieve standard deviation value of the histogram.
+
+ Sample usage:
+
+ // create histogram
+ Histogram histogram = new Histogram( new int[10] { 0, 0, 1, 3, 6, 8, 11, 0, 0, 0 } );
+ // get std.dev. value (= 1.136)
+ Console.WriteLine( "std.dev. = " + histogram.StdDev.ToString( "F3" ) );
+
+
+
+
+
+
+ Median value.
+
+
+ The property allows to retrieve median value of the histogram.
+
+ Sample usage:
+
+ // create histogram
+ Histogram histogram = new Histogram( new int[10] { 0, 0, 1, 3, 6, 8, 11, 0, 0, 0 } );
+ // get median value (= 5)
+ Console.WriteLine( "median = " + histogram.Median );
+
+
+
+
+
+
+ Minimum value.
+
+
+ The property allows to retrieve minimum value of the histogram with non zero
+ hits count.
+
+ Sample usage:
+
+ // create histogram
+ Histogram histogram = new Histogram( new int[10] { 0, 0, 1, 3, 6, 8, 11, 0, 0, 0 } );
+ // get min value (= 2)
+ Console.WriteLine( "min = " + histogram.Min );
+
+
+
+
+
+
+ Maximum value.
+
+
+ The property allows to retrieve maximum value of the histogram with non zero
+ hits count.
+
+ Sample usage:
+
+ // create histogram
+ Histogram histogram = new Histogram( new int[10] { 0, 0, 1, 3, 6, 8, 11, 0, 0, 0 } );
+ // get max value (= 6)
+ Console.WriteLine( "max = " + histogram.Max );
+
+
+
+
+
+
+ Total count of values.
+
+
+ The property represents total count of values contributed to the histogram, which is
+ essentially sum of the array.
+
+ Sample usage:
+
+ // create histogram
+ Histogram histogram = new Histogram( new int[10] { 0, 0, 1, 3, 6, 8, 11, 0, 0, 0 } );
+ // get total value (= 29)
+ Console.WriteLine( "total = " + histogram.TotalCount );
+
+
+
+
+
+
+ Set of statistics functions.
+
+
+ The class represents collection of simple functions used
+ in statistics.
+
+
+
+
+ Calculate mean value.
+
+
+ Histogram array.
+
+ Returns mean value.
+
+ The input array is treated as histogram, i.e. its
+ indexes are treated as values of stochastic function, but
+ array values are treated as "probabilities" (total amount of
+ hits).
+
+ Sample usage:
+
+ // create histogram array
+ int[] histogram = new int[] { 1, 1, 2, 3, 6, 8, 11, 12, 7, 3 };
+ // calculate mean value
+ double mean = Statistics.Mean( histogram );
+ // output it (5.759)
+ Console.WriteLine( "mean = " + mean.ToString( "F3" ) );
+
+
+
+
+
+
+ Calculate standard deviation.
+
+
+ Histogram array.
+
+ Returns value of standard deviation.
+
+ The input array is treated as histogram, i.e. its
+ indexes are treated as values of stochastic function, but
+ array values are treated as "probabilities" (total amount of
+ hits).
+
+ Sample usage:
+
+ // create histogram array
+ int[] histogram = new int[] { 1, 1, 2, 3, 6, 8, 11, 12, 7, 3 };
+ // calculate standard deviation value
+ double stdDev = Statistics.StdDev( histogram );
+ // output it (1.999)
+ Console.WriteLine( "std.dev. = " + stdDev.ToString( "F3" ) );
+
+
+
+
+
+
+ Calculate standard deviation.
+
+
+ Histogram array.
+ Mean value of the histogram.
+
+ Returns value of standard deviation.
+
+ The input array is treated as histogram, i.e. its
+ indexes are treated as values of stochastic function, but
+ array values are treated as "probabilities" (total amount of
+ hits).
+
+ The method is an equevalent to the method,
+ but it relieas on the passed mean value, which is previously calculated
+ using method.
+
+
+
+
+
+ Calculate median value.
+
+
+ Histogram array.
+
+ Returns value of median.
+
+
+ The input array is treated as histogram, i.e. its
+ indexes are treated as values of stochastic function, but
+ array values are treated as "probabilities" (total amount of
+ hits).
+
+ The median value is calculated accumulating histogram's
+ values starting from the left point until the sum reaches 50% of
+ histogram's sum.
+
+ Sample usage:
+
+ // create histogram array
+ int[] histogram = new int[] { 1, 1, 2, 3, 6, 8, 11, 12, 7, 3 };
+ // calculate median value
+ int median = Statistics.Median( histogram );
+ // output it (6)
+ Console.WriteLine( "median = " + median );
+
+
+
+
+
+
+ Get range around median containing specified percentage of values.
+
+
+ Histogram array.
+ Values percentage around median.
+
+ Returns the range which containes specifies percentage
+ of values.
+
+
+ The input array is treated as histogram, i.e. its
+ indexes are treated as values of stochastic function, but
+ array values are treated as "probabilities" (total amount of
+ hits).
+
+ The method calculates range of stochastic variable, which summary probability
+ comprises the specified percentage of histogram's hits.
+
+ Sample usage:
+
+ // create histogram array
+ int[] histogram = new int[] { 1, 1, 2, 3, 6, 8, 11, 12, 7, 3 };
+ // get 75% range around median
+ IntRange range = Statistics.GetRange( histogram, 0.75 );
+ // output it ([4, 8])
+ Console.WriteLine( "range = [" + range.Min + ", " + range.Max + "]" );
+
+
+
+
+
+
+ Calculate entropy value.
+
+
+ Histogram array.
+
+ Returns entropy value of the specified histagram array.
+
+ The input array is treated as histogram, i.e. its
+ indexes are treated as values of stochastic function, but
+ array values are treated as "probabilities" (total amount of
+ hits).
+
+ Sample usage:
+
+ // create histogram array with 2 values of equal probabilities
+ int[] histogram1 = new int[2] { 3, 3 };
+ // calculate entropy
+ double entropy1 = Statistics.Entropy( histogram1 );
+ // output it (1.000)
+ Console.WriteLine( "entropy1 = " + entropy1.ToString( "F3" ) );
+
+ // create histogram array with 4 values of equal probabilities
+ int[] histogram2 = new int[4] { 1, 1, 1, 1 };
+ // calculate entropy
+ double entropy2 = Statistics.Entropy( histogram2 );
+ // output it (2.000)
+ Console.WriteLine( "entropy2 = " + entropy2.ToString( "F3" ) );
+
+ // create histogram array with 4 values of different probabilities
+ int[] histogram3 = new int[4] { 1, 2, 3, 4 };
+ // calculate entropy
+ double entropy3 = Statistics.Entropy( histogram3 );
+ // output it (1.846)
+ Console.WriteLine( "entropy3 = " + entropy3.ToString( "F3" ) );
+
+
+
+
+
+
+ Calculate mode value.
+
+
+ Histogram array.
+
+ Returns mode value of the histogram array.
+
+
+ The input array is treated as histogram, i.e. its
+ indexes are treated as values of stochastic function, but
+ array values are treated as "probabilities" (total amount of
+ hits).
+
+ Returns the minimum mode value if the specified histogram is multimodal.
+
+ Sample usage:
+
+ // create array
+ int[] values = new int[] { 1, 1, 2, 3, 6, 8, 11, 12, 7, 3 };
+ // calculate mode value
+ int mode = Statistics.Mode( values );
+ // output it (7)
+ Console.WriteLine( "mode = " + mode );
+
+
+
+
+
+
+ Gaussian random numbers generator.
+
+
+ The random number generator generates gaussian
+ random numbers with specified mean and standard deviation values.
+
+ The generator uses generator as base
+ to generate random numbers.
+
+ Sample usage:
+
+ // create instance of random generator
+ IRandomNumberGenerator generator = new GaussianGenerator( 5.0, 1.5 );
+ // generate random number
+ float randomNumber = generator.Next( );
+
+
+
+
+
+
+ Interface for random numbers generators.
+
+
+ The interface defines set of methods and properties, which should
+ be implemented by different algorithms for random numbers generatation.
+
+
+
+
+
+ Generate next random number.
+
+
+ Returns next random number.
+
+
+
+
+ Set seed of the random numbers generator.
+
+
+ Seed value.
+
+
+
+
+ Mean value of generator.
+
+
+
+
+
+ Variance value of generator.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Mean value.
+ Standard deviation value.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Mean value.
+ Standard deviation value.
+ Seed value to initialize random numbers generator.
+
+
+
+
+ Generate next random number.
+
+
+ Returns next random number.
+
+
+
+
+ Set seed of the random numbers generator.
+
+
+ Seed value.
+
+ Resets random numbers generator initializing it with
+ specified seed value.
+
+
+
+
+ Mean value of the generator.
+
+
+
+
+
+ Variance value of the generator.
+
+
+
+
+
+ Standard deviation value.
+
+
+
+
+
+ The class encapsulates 2D line segment and provides some tool methods related to lines.
+
+
+ The class provides some methods which are related to line segments:
+ distance to point, finding intersection point, etc.
+
+
+ A line segment may be converted to a .
+
+ Sample usage:
+
+ // create a segment
+ LineSegment segment = new LineSegment( new Point( 0, 0 ), new Point( 3, 4 ) );
+ // get segment's length
+ float length = segment.Length;
+
+ // get intersection point with a line
+ Point? intersection = segment.GetIntersectionWith(
+ new Line( new Point( -3, 8 ), new Point( 0, 4 ) ) );
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Segment's start point.
+ Segment's end point.
+
+ Thrown if the two points are the same.
+
+
+
+
+ Converts this to a by discarding
+ its endpoints and extending it infinitely in both directions.
+
+
+ The segment to convert to a .
+
+ Returns a that contains this .
+
+
+
+
+ Calculate Euclidean distance between a point and a finite line segment.
+
+
+ The point to calculate the distance to.
+
+ Returns the Euclidean distance between this line segment and the specified point. Unlike
+ , this returns the distance from the finite segment. (0,0) is 5 units
+ from the segment (0,5)-(0,8), but is 0 units from the line through those points.
+
+
+
+
+ Finds, provided it exists, the intersection point with the specified .
+
+
+ to find intersection with.
+
+ Returns intersection point with the specified , or , if
+ the two segments do not intersect.
+
+ If the two segments do not intersect, the method returns . If the two
+ segments share multiple points, this throws an .
+
+
+ Thrown if the segments overlap - if they have
+ multiple points in common.
+
+
+
+
+ Finds, provided it exists, the intersection point with the specified .
+
+
+ to find intersection with.
+
+ Returns intersection point with the specified , or , if
+ the line does not intersect with this segment.
+
+ If the line and the segment do not intersect, the method returns . If the line
+ and the segment share multiple points, the method throws an .
+
+
+ Thrown if this segment is a portion of
+ line.
+
+
+
+
+ Equality operator - checks if two line segments have equal parameters.
+
+
+ First line segment to check.
+ Second line segment to check.
+
+ Returns if parameters of specified
+ line segments are equal.
+
+
+
+
+ Inequality operator - checks if two lines have different parameters.
+
+
+ First line segment to check.
+ Second line segment to check.
+
+ Returns if parameters of specified
+ line segments are not equal.
+
+
+
+
+ Check if this instance of equals to the specified one.
+
+
+ Another line segment to check equalty to.
+
+ Return if objects are equal.
+
+
+
+
+ Get hash code for this instance.
+
+
+ Returns the hash code for this instance.
+
+
+
+
+ Get string representation of the class.
+
+
+ Returns string, which contains values of the like in readable form.
+
+
+
+
+ Start point of the line segment.
+
+
+
+
+ End point of the line segment.
+
+
+
+
+ Get segment's length - Euclidean distance between its and points.
+
+
+
+
+ Gaussian function.
+
+
+ The class is used to calculate 1D and 2D Gaussian functions for
+ specified (s) value:
+
+
+ 1-D: f(x) = exp( x * x / ( -2 * s * s ) ) / ( s * sqrt( 2 * PI ) )
+
+ 2-D: f(x, y) = exp( x * x + y * y / ( -2 * s * s ) ) / ( s * s * 2 * PI )
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Sigma value.
+
+
+
+
+ 1-D Gaussian function.
+
+
+ x value.
+
+ Returns function's value at point .
+
+ The function calculates 1-D Gaussian function:
+
+
+ f(x) = exp( x * x / ( -2 * s * s ) ) / ( s * sqrt( 2 * PI ) )
+
+
+
+
+
+
+ 2-D Gaussian function.
+
+
+ x value.
+ y value.
+
+ Returns function's value at point (, ).
+
+ The function calculates 2-D Gaussian function:
+
+
+ f(x, y) = exp( x * x + y * y / ( -2 * s * s ) ) / ( s * s * 2 * PI )
+
+
+
+
+
+
+ 1-D Gaussian kernel.
+
+
+ Kernel size (should be odd), [3, 101].
+
+ Returns 1-D Gaussian kernel of the specified size.
+
+ The function calculates 1-D Gaussian kernel, which is array
+ of Gaussian function's values in the [-r, r] range of x value, where
+ r=floor(/2).
+
+
+ Wrong kernel size.
+
+
+
+
+ 2-D Gaussian kernel.
+
+
+ Kernel size (should be odd), [3, 101].
+
+ Returns 2-D Gaussian kernel of specified size.
+
+ The function calculates 2-D Gaussian kernel, which is array
+ of Gaussian function's values in the [-r, r] range of x,y values, where
+ r=floor(/2).
+
+
+ Wrong kernel size.
+
+
+
+
+ Sigma value.
+
+
+ Sigma property of Gaussian function.
+
+ Default value is set to 1. Minimum allowed value is 0.00000001.
+
+
+
+
+
+ Fourier transformation.
+
+
+ The class implements one dimensional and two dimensional
+ Discrete and Fast Fourier Transformation.
+
+
+
+
+ One dimensional Discrete Fourier Transform.
+
+
+ Data to transform.
+ Transformation direction.
+
+
+
+
+ Two dimensional Discrete Fourier Transform.
+
+
+ Data to transform.
+ Transformation direction.
+
+
+
+
+ One dimensional Fast Fourier Transform.
+
+
+ Data to transform.
+ Transformation direction.
+
+ The method accepts array of 2n size
+ only, where n may vary in the [1, 14] range.
+
+ Incorrect data length.
+
+
+
+
+ Two dimensional Fast Fourier Transform.
+
+
+ Data to transform.
+ Transformation direction.
+
+ The method accepts array of 2n size
+ only in each dimension, where n may vary in the [1, 14] range. For example, 16x16 array
+ is valid, but 15x15 is not.
+
+ Incorrect data length.
+
+
+
+
+ Fourier transformation direction.
+
+
+
+
+ Forward direction of Fourier transformation.
+
+
+
+
+ Backward direction of Fourier transformation.
+
+
+
+
+ The class encapsulates 2D line and provides some tool methods related to lines.
+
+
+ The class provides some methods which are related to lines:
+ angle between lines, distance to point, finding intersection point, etc.
+
+
+ Generally, the equation of the line is y = * x +
+ . However, when is an Infinity,
+ would normally be meaningless, and it would be
+ impossible to distinguish the line x = 5 from the line x = -5. Therefore,
+ if is or
+ , the line's equation is instead
+ x = .
+
+ Sample usage:
+
+ // create a line
+ Line line = Line.FromPoints( new Point( 0, 0 ), new Point( 3, 4 ) );
+ // check if it is vertical or horizontal
+ if ( line.IsVertical || line.IsHorizontal )
+ {
+ // ...
+ }
+
+ // get intersection point with another line
+ Point intersection = line.GetIntersectionWith(
+ Line.FromPoints( new Point( 3, 0 ), new Point( 0, 4 ) ) );
+
+
+
+
+
+
+ Creates a that goes through the two specified points.
+
+
+ One point on the line.
+ Another point on the line.
+
+ Returns a representing the line between
+ and .
+
+ Thrown if the two points are the same.
+
+
+
+
+ Creates a with the specified slope and intercept.
+
+
+ The slope of the line
+ The Y-intercept of the line, unless the slope is an
+ infinity, in which case the line's equation is "x = intercept" instead.
+
+ Returns a representing the specified line.
+
+ The construction here follows the same rules as for the rest of this class.
+ Most lines are expressed as y = slope * x + intercept. Vertical lines, however, are
+ x = intercept. This is indicated by being true or by
+ returning or
+ .
+
+
+
+
+ Constructs a from a radius and an angle (in degrees).
+
+
+ The minimum distance from the line to the origin.
+ The angle of the vector from the origin to the line.
+
+ Returns a representing the specified line.
+
+ is the minimum distance from the origin
+ to the line, and is the counterclockwise rotation from
+ the positive X axis to the vector through the origin and normal to the line.
+ This means that if is in [0,180), the point on the line
+ closest to the origin is on the positive X or Y axes, or in quadrants I or II. Likewise,
+ if is in [180,360), the point on the line closest to the
+ origin is on the negative X or Y axes, or in quadrants III or IV.
+
+ Thrown if radius is negative.
+
+
+
+
+ Constructs a from a point and an angle (in degrees).
+
+
+ The minimum distance from the line to the origin.
+ The angle of the normal vector from the origin to the line.
+
+ is the counterclockwise rotation from
+ the positive X axis to the vector through the origin and normal to the line.
+ This means that if is in [0,180), the point on the line
+ closest to the origin is on the positive X or Y axes, or in quadrants I or II. Likewise,
+ if is in [180,360), the point on the line closest to the
+ origin is on the negative X or Y axes, or in quadrants III or IV.
+
+ Returns a representing the specified line.
+
+
+
+
+ Calculate minimum angle between this line and the specified line measured in [0, 90] degrees range.
+
+
+ The line to find angle between.
+
+ Returns minimum angle between lines.
+
+
+
+
+ Finds intersection point with the specified line.
+
+
+ Line to find intersection with.
+
+ Returns intersection point with the specified line, or
+ if the lines are parallel and distinct.
+
+ Thrown if the specified line is the same line as this line.
+
+
+
+
+ Finds, provided it exists, the intersection point with the specified .
+
+
+ to find intersection with.
+
+ Returns intersection point with the specified , or ,
+ if this line does not intersect with the segment.
+
+ If the line and segment do not intersect, the method returns .
+ If the line and segment share multiple points, the method throws an .
+
+
+ Thrown if is a portion
+ of this line.
+
+
+
+
+ Calculate Euclidean distance between a point and a line.
+
+
+ The point to calculate distance to.
+
+ Returns the Euclidean distance between this line and the specified point. Unlike
+ , this returns the distance from the infinite line. (0,0) is 0 units
+ from the line defined by (0,5) and (0,8), but is 5 units from the segment with those endpoints.
+
+
+
+
+ Equality operator - checks if two lines have equal parameters.
+
+
+ First line to check.
+ Second line to check.
+
+ Returns if parameters of specified
+ lines are equal.
+
+
+
+
+ Inequality operator - checks if two lines have different parameters.
+
+
+ First line to check.
+ Second line to check.
+
+ Returns if parameters of specified
+ lines are not equal.
+
+
+
+
+ Check if this instance of equals to the specified one.
+
+
+ Another line to check equalty to.
+
+ Return if objects are equal.
+
+
+
+
+ Get hash code for this instance.
+
+
+ Returns the hash code for this instance.
+
+
+
+
+ Get string representation of the class.
+
+
+ Returns string, which contains values of the like in readable form.
+
+
+
+
+ Checks if the line vertical or not.
+
+
+
+
+
+ Checks if the line horizontal or not.
+
+
+
+
+ Gets the slope of the line.
+
+
+
+
+ If not , gets the Line's Y-intercept.
+ If gets the line's X-intercept.
+
+
+
+
+ Jaccard distance metric.
+
+
+ This class represents the
+ Jaccard distance metric.
+
+ Sample usage:
+
+ // instantiate new distance class
+ JaccardDistance dist = new JaccardDistance( );
+ // create two vectors for inputs
+ double[] p = new double[] { 2.5, 3.5, 3.0, 3.5, 2.5, 3.0 };
+ double[] q = new double[] { 3.0, 3.5, 1.5, 5.0, 3.5, 3.0 };
+ // get distance between the two vectors
+ double distance = dist.GetDistance( p, q );
+
+
+
+
+
+
+ Returns distance between two N-dimensional double vectors.
+
+
+ 1st point vector.
+ 2nd point vector.
+
+ Returns Jaccard distance between two supplied vectors.
+
+ Thrown if the two vectors are of different dimensions (if specified
+ array have different length).
+
+
+
+
+ Collection of some gemetry tool methods.
+
+
+
+
+
+ Calculate angle between to vectors measured in [0, 180] degrees range.
+
+
+ Starting point of both vectors.
+ Ending point of the first vector.
+ Ending point of the second vector.
+
+ Returns angle between specified vectors measured in degrees.
+
+
+
+
+ Calculate minimum angle between two lines measured in [0, 90] degrees range.
+
+
+ A point on the first line.
+ Another point on the first line.
+ A point on the second line.
+ Another point on the second line.
+
+ Returns minimum angle between two lines.
+
+ It is preferred to use if it is required to calculate angle
+ multiple times for one of the lines.
+
+ and are the same,
+ -OR- and are the same.
+
+
+
+
+ Shape optimizer, which merges points within close distance to each other.
+
+
+ This shape optimizing algorithm checks all points of a shape
+ and merges any two points which are within specified distance
+ to each other. Two close points are replaced by a single point, which has
+ mean coordinates of the removed points.
+
+ Because of the fact that the algorithm performs points merging
+ while it goes through a shape, it may merge several points (more than 2) into a
+ single point, where distance between extreme points may be bigger
+ than the specified limit. For example, suppose
+ a case with 3 points, where 1st and 2nd points are close enough to be merged, but the
+ 3rd point is a little bit further. During merging of 1st and 2nd points, it may
+ happen that the new point with mean coordinates will get closer to the 3rd point,
+ so they will be merged also on next iteration of the algorithm.
+
+
+ For example, the below circle shape comprised of 65 points, can be optimized to 8 points
+ by setting to 28.
+
+
+
+
+
+
+
+ Interface for shape optimizing algorithms.
+
+
+ The interface defines set of methods, which should be implemented
+ by shape optimizing algorithms. These algorithms take input shape, which is defined
+ by a set of points (corners of convex hull, etc.), and remove some insignificant points from it,
+ which has little influence on the final shape's look.
+
+ The shape optimizing algorithms can be useful in conjunction with such algorithms
+ like convex hull searching, which usually may provide many hull points, where some
+ of them are insignificant and could be removed.
+
+ For additional details about shape optimizing algorithms, documentation of
+ particular algorithm should be studied.
+
+
+
+
+
+ Optimize specified shape.
+
+
+ Shape to be optimized.
+
+ Returns final optimized shape, which may have reduced amount of points.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Maximum allowed distance between points, which are
+ merged during optimization (see ).
+
+
+
+
+ Optimize specified shape.
+
+
+ Shape to be optimized.
+
+ Returns final optimized shape, which may have reduced amount of points.
+
+
+
+
+ Maximum allowed distance between points, which are merged during optimization, [0, ∞).
+
+
+ The property sets maximum allowed distance between two points of
+ a shape, which are replaced by single point with mean coordinates.
+
+ Default value is set to 10.
+
+
+
+
+ Standard random numbers generator.
+
+
+ The random number generator generates gaussian
+ random numbers with zero mean and standard deviation of one. The generator
+ implements polar form of the Box-Muller transformation.
+
+ The generator uses generator as a base
+ to generate random numbers.
+
+ Sample usage:
+
+ // create instance of random generator
+ IRandomNumberGenerator generator = new StandardGenerator( );
+ // generate random number
+ float randomNumber = generator.Next( );
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Seed value to initialize random numbers generator.
+
+
+
+
+ Generate next random number.
+
+
+ Returns next random number.
+
+
+
+
+ Set seed of the random numbers generator.
+
+
+ Seed value.
+
+ Resets random numbers generator initializing it with
+ specified seed value.
+
+
+
+
+ Mean value of the generator.
+
+
+
+
+
+ Variance value of the generator.
+
+
+
+
+
+ 3D pose estimation algorithm (coplanar case).
+
+
+ The class implements an algorithm for 3D object's pose estimation from it's
+ 2D coordinates obtained by perspective projection, when the object is described coplanar points.
+ The idea of the implemented math and algorithm is described in "Iterative Pose Estimation using
+ Coplanar Feature Points" paper written by Oberkampf, Daniel DeMenthon and Larry Davis
+ (the implementation of the algorithm is very close translation of the pseudo code given by the
+ paper, so should be easy to follow).
+
+ At this point the implementation works only with models described by 4 points, which is
+ the minimum number of points enough for 3D pose estimation.
+
+ The 4 model's point are supposed to be coplanar, i.e. supposed to reside all within
+ same planer. See for none coplanar case.
+
+ Read 3D Pose Estimation article for
+ additional information and samples.
+
+ Sample usage:
+
+ // points of real object - model
+ Vector3[] copositObject = new Vector3[4]
+ {
+ new Vector3( -56.5f, 0, 56.5f ),
+ new Vector3( 56.5f, 0, 56.5f ),
+ new Vector3( 56.5f, 0, -56.5f ),
+ new Vector3( -56.5f, 0, -56.5f ),
+ };
+ // focal length of camera used to capture the object
+ float focalLength = 640; // depends on your camera or projection system
+ // initialize CoPOSIT object
+ CoplanarPosit coposit = new CoplanarPosit( copositObject, focalLength );
+
+ // 2D points of te object - projection
+ AForge.Point[] projectedPoints = new AForge.Point[4]
+ {
+ new AForge.Point( -77, 48 ),
+ new AForge.Point( 44, 66 ),
+ new AForge.Point( 75, -36 ),
+ new AForge.Point( -61, -58 ),
+ };
+ // estimate pose
+ Matrix3x3 rotationMatrix;
+ Vector3 translationVector;
+ coposit.EstimatePose( projectedPoints,
+ out rotationMatrix, out translationVector );
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Array of vectors containing coordinates of four real model's point.
+ Effective focal length of the camera used to capture the model.
+
+ The model must have 4 points.
+
+
+
+
+ Estimate pose of a model from it's projected 2D coordinates.
+
+
+ 4 2D points of the model's projection.
+ Gets best estimation of object's rotation.
+ Gets best estimation of object's translation.
+
+ 4 points must be be given for pose estimation.
+
+ Because of the Coplanar POSIT algorithm's nature, it provides two pose estimations,
+ which are valid from the algorithm's math point of view. For each pose an error is calculated,
+ which specifies how good estimation fits to the specified real 2D coordinated. The method
+ provides the best estimation through its output parameters and
+ . This may be enough for many of the pose estimation application.
+ For those, who require checking the alternate pose estimation, it can be obtained using
+ and properties.
+ The calculated error is provided for both estimations through and
+ properties.
+
+
+
+
+
+ Best estimated pose recently found.
+
+
+ The property keeps best estimated pose found by the latest call to .
+ The same estimated pose is provided by that method also and can be accessed through this property
+ for convenience.
+
+ See also and .
+
+
+
+
+
+ Best estimated translation recently found.
+
+
+ The property keeps best estimated translation found by the latest call to .
+ The same estimated translation is provided by that method also and can be accessed through this property
+ for convenience.
+
+ See also and .
+
+
+
+
+
+ Error of the best pose estimation.
+
+
+ The property keeps error of the best pose estimation, which is calculated as average
+ error between real angles of the specified quadrilateral and angles of the quadrilateral which
+ is a projection of the best pose estimation. The error is measured degrees in (angle).
+
+
+
+
+
+ Alternate estimated pose recently found.
+
+
+ The property keeps alternate estimated pose found by the latest call to .
+
+ See also and .
+
+
+
+
+
+ Alternated estimated translation recently found.
+
+
+ The property keeps alternate estimated translation found by the latest call to .
+
+ See also and .
+
+
+
+
+
+ Error of the alternate pose estimation.
+
+
+ The property keeps error of the alternate pose estimation, which is calculated as average
+ error between real angles of the specified quadrilateral and angles of the quadrilateral which
+ is a projection of the alternate pose estimation. The error is measured in degrees (angle).
+
+
+
+
+
+ Coordinates of the model points which pose should be estimated.
+
+
+
+
+ Effective focal length of the camera used to capture the model.
+
+
+
+
+ Pearson correlation metric.
+
+
+ This class represents the
+ Pearson correlation metric.
+
+ Sample usage:
+
+ // instantiate new pearson correlation class
+ PearsonCorrelation cor = new PearsonCorrelation( );
+ // create two vectors for inputs
+ double[] p = new double[] { 2.5, 3.5, 3.0, 3.5, 2.5, 3.0 };
+ double[] q = new double[] { 3.0, 3.5, 1.5, 5.0, 3.5, 3.0 };
+ // get correlation between the two vectors
+ double correlation = cor.GetSimilarityScore( p, q );
+
+
+
+
+
+
+ Interface for similarity algorithms.
+
+
+ The interface defines a set of methods implemented
+ by similarity and correlation algorithms. These algorithms typically take a set of points and return a
+ similarity score for the two vectors.
+
+ Similarity and correlation algorithms are used in many machine learning and collaborative
+ filtering algorithms.
+
+ For additional details about similarity metrics, documentation of the
+ particular algorithms should be studied.
+
+
+
+
+
+ Returns similarity score for two N-dimensional double vectors.
+
+
+ 1st point vector.
+ 2nd point vector.
+
+ Returns similarity score determined by the given algorithm.
+
+
+
+
+ Returns the pearson correlation for two N-dimensional double vectors.
+
+
+ 1st point vector.
+ 2nd point vector.
+
+ Returns Pearson correlation between two supplied vectors.
+
+ Thrown if the two vectors are of different dimensions (if specified
+ array have different length).
+
+
+
+
+ A class for checking simple geometrical shapes.
+
+
+ The class performs checking/detection of some simple geometrical
+ shapes for provided set of points (shape's edge points). During the check
+ the class goes through the list of all provided points and checks how accurately
+ they fit into assumed shape.
+
+ All the shape checks allow some deviation of
+ points from the shape with assumed parameters. In other words it is allowed
+ that specified set of points may form a little bit distorted shape, which may be
+ still recognized. The allowed amount of distortion is controlled by two
+ properties ( and ),
+ which allow higher distortion level for bigger shapes and smaller amount of
+ distortion for smaller shapes. Checking specified set of points, the class
+ calculates mean distance between specified set of points and edge of the assumed
+ shape. If the mean distance is equal to or less than maximum allowed distance,
+ then a shape is recognized. The maximum allowed distance is calculated as:
+
+ maxDistance = max( minAcceptableDistortion, relativeDistortionLimit * ( width + height ) / 2 )
+
+ , where width and height is the size of bounding rectangle for the
+ specified points.
+
+
+ See also and properties,
+ which set acceptable errors for polygon sub type checking done by
+ method.
+
+ See the next article for details about the implemented algorithms:
+ Detecting some simple shapes in images.
+
+
+ Sample usage:
+
+ private List<IntPoint> idealCicle = new List<IntPoint>( );
+ private List<IntPoint> distorredCircle = new List<IntPoint>( );
+ System.Random rand = new System.Random( );
+
+ // generate sample circles
+ float radius = 100;
+
+ for ( int i = 0; i < 360; i += 10 )
+ {
+ float angle = (float) ( (float) i / 180 * System.Math.PI );
+
+ // add point to ideal circle
+ idealCicle.Add( new IntPoint(
+ (int) ( radius * System.Math.Cos( angle ) ),
+ (int) ( radius * System.Math.Sin( angle ) ) ) );
+
+ // add a bit distortion for distorred cirlce
+ float distorredRadius = radius + rand.Next( 7 ) - 3;
+
+ distorredCircle.Add( new IntPoint(
+ (int) ( distorredRadius * System.Math.Cos( angle ) ),
+ (int) ( distorredRadius * System.Math.Sin( angle ) ) ) );
+ }
+
+ // check shape
+ SimpleShapeChecker shapeChecker = new SimpleShapeChecker( );
+
+ if ( shapeChecker.IsCircle( idealCicle ) )
+ {
+ // ...
+ }
+
+ if ( shapeChecker.CheckShapeType( distorredCircle ) == ShapeType.Circle )
+ {
+ // ...
+ }
+
+
+
+
+
+
+ Check type of the shape formed by specified points.
+
+
+ Shape's points to check.
+
+ Returns type of the detected shape.
+
+
+
+
+ Check if the specified set of points form a circle shape.
+
+
+ Shape's points to check.
+
+ Returns if the specified set of points form a
+ circle shape or otherwise.
+
+ Circle shape must contain at least 8 points to be recognized.
+ The method returns always, of number of points in the specified
+ shape is less than 8.
+
+
+
+
+ Check if the specified set of points form a circle shape.
+
+
+ Shape's points to check.
+ Receives circle's center on successful return.
+ Receives circle's radius on successful return.
+
+ Returns if the specified set of points form a
+ circle shape or otherwise.
+
+ Circle shape must contain at least 8 points to be recognized.
+ The method returns always, of number of points in the specified
+ shape is less than 8.
+
+
+
+
+ Check if the specified set of points form a quadrilateral shape.
+
+
+ Shape's points to check.
+
+ Returns if the specified set of points form a
+ quadrilateral shape or otherwise.
+
+
+
+
+ Check if the specified set of points form a quadrilateral shape.
+
+
+ Shape's points to check.
+ List of quadrilateral corners on successful return.
+
+ Returns if the specified set of points form a
+ quadrilateral shape or otherwise.
+
+
+
+
+ Check if the specified set of points form a triangle shape.
+
+
+ Shape's points to check.
+
+ Returns if the specified set of points form a
+ triangle shape or otherwise.
+
+
+
+
+ Check if the specified set of points form a triangle shape.
+
+
+ Shape's points to check.
+ List of triangle corners on successful return.
+
+ Returns if the specified set of points form a
+ triangle shape or otherwise.
+
+
+
+
+ Check if the specified set of points form a convex polygon shape.
+
+
+ Shape's points to check.
+ List of polygon corners on successful return.
+
+ Returns if the specified set of points form a
+ convex polygon shape or otherwise.
+
+ The method is able to detect only triangles and quadrilaterals
+ for now. Check number of detected corners to resolve type of the detected polygon.
+
+
+
+
+
+ Check sub type of a convex polygon.
+
+
+ Corners of the convex polygon to check.
+
+ Return detected sub type of the specified shape.
+
+ The method check corners of a convex polygon detecting
+ its subtype. Polygon's corners are usually retrieved using
+ method, but can be any list of 3-4 points (only sub types of triangles and
+ quadrilateral are checked).
+
+ See and properties,
+ which set acceptable errors for polygon sub type checking.
+
+
+
+
+
+ Check if a shape specified by the set of points fits a convex polygon
+ specified by the set of corners.
+
+
+ Shape's points to check.
+ Corners of convex polygon to check fitting into.
+
+ Returns if the specified shape fits
+ the specified convex polygon or otherwise.
+
+ The method checks if the set of specified points form the same shape
+ as the set of provided corners.
+
+
+
+
+ Minimum value of allowed shapes' distortion.
+
+
+ The property sets minimum value for allowed shapes'
+ distortion (in pixels). See documentation to
+ class for more details about this property.
+
+ Default value is set to 0.5.
+
+
+
+
+
+ Maximum value of allowed shapes' distortion, [0, 1].
+
+
+ The property sets maximum value for allowed shapes'
+ distortion. The value is measured in [0, 1] range, which corresponds
+ to [0%, 100%] range, which means that maximum allowed shapes'
+ distortion is calculated relatively to shape's size. This results to
+ higher allowed distortion level for bigger shapes and smaller allowed
+ distortion for smaller shapers. See documentation to
+ class for more details about this property.
+
+ Default value is set to 0.03 (3%).
+
+
+
+
+
+ Maximum allowed angle error in degrees, [0, 20].
+
+
+ The value sets maximum allowed difference between two angles to
+ treat them as equal. It is used by method to
+ check for parallel lines and angles of triangles and quadrilaterals.
+ For example, if angle between two lines equals 5 degrees and this properties value
+ is set to 7, then two compared lines are treated as parallel.
+
+ Default value is set to 7.
+
+
+
+
+
+ Maximum allowed difference in sides' length (relative to shapes' size), [0, 1].
+
+
+ The values sets maximum allowed difference between two sides' length
+ to treat them as equal. The error value is set relative to shapes size and measured
+ in [0, 1] range, which corresponds to [0%, 100%] range. Absolute length error in pixels
+ is calculated as:
+
+ LengthError * ( width + height ) / 2
+
+ , where width and height is the size of bounding rectangle for the
+ specified shape.
+
+
+ Default value is set to 0.1 (10%).
+
+
+
+
+
+ Graham scan algorithm for finding convex hull.
+
+
+ The class implements
+ Graham scan algorithm for finding convex hull
+ of a given set of points.
+
+ Sample usage:
+
+ // generate some random points
+ Random rand = new Random( );
+ List<IntPoint> points = new List<IntPoint>( );
+
+ for ( int i = 0; i < 10; i++ )
+ {
+ points.Add( new IntPoint(
+ rand.Next( 200 ) - 100,
+ rand.Next( 200 ) - 100 ) );
+ }
+
+ // find the convex hull
+ IConvexHullAlgorithm hullFinder = new GrahamConvexHull( );
+ List<IntPoint> hull = hullFinder.FindHull( points );
+
+
+
+
+
+
+ Interface defining methods for algorithms, which search for convex hull of the specified points' set.
+
+
+ The interface defines a method, which should be implemented by different classes
+ performing convex hull search for specified set of points.
+
+ All algorithms, implementing this interface, should follow two rules for the found convex hull:
+
+ - the first point in the returned list is the point with lowest X coordinate (and with lowest Y if
+ there are several points with the same X value);
+ - points in the returned list are given in counter clockwise order
+ (Cartesian
+ coordinate system).
+
+
+
+
+
+
+
+ Find convex hull for the given set of points.
+
+
+ Set of points to search convex hull for.
+
+ Returns set of points, which form a convex hull for the given .
+
+
+
+
+ Find convex hull for the given set of points.
+
+
+ Set of points to search convex hull for.
+
+ Returns set of points, which form a convex hull for the given .
+ The first point in the list is the point with lowest X coordinate (and with lowest Y if there are
+ several points with the same X value). Points are provided in counter clockwise order
+ (Cartesian
+ coordinate system).
+
+
+
+
+ Euclidean distance metric.
+
+
+ This class represents the
+ Euclidean distance metric.
+
+ Sample usage:
+
+ // instantiate new distance class
+ EuclideanDistance dist = new EuclideanDistance( );
+ // create two vectors for inputs
+ double[] p = new double[] { 2.5, 3.5, 3.0, 3.5, 2.5, 3.0 };
+ double[] q = new double[] { 3.0, 3.5, 1.5, 5.0, 3.5, 3.0 };
+ // get distance between the two vectors
+ double distance = dist.GetDistance( p, q );
+
+
+
+
+
+
+ Returns distance between two N-dimensional double vectors.
+
+
+ 1st point vector.
+ 2nd point vector.
+
+ Returns Euclidean distance between two supplied vectors.
+
+ Thrown if the two vectors are of different dimensions (if specified
+ array have different length).
+
+
+
+
+ Shape optimizer, which removes points within close range to shapes' body.
+
+
+ This shape optimizing algorithm checks all points of the shape and
+ removes those of them, which are in a certain distance to a line connecting previous and
+ the next points. In other words, it goes through all adjacent edges of a shape and checks
+ what is the distance between the corner formed by these two edges and a possible edge, which
+ could be used as substitution of these edges. If the distance is equal or smaller than
+ the specified value, then the point is removed,
+ so the two edges are substituted by a single one. When optimization process is done,
+ the new shape has reduced amount of points and none of the removed points are further away
+ from the new shape than the specified limit.
+
+ The shape optimizer does not optimize shapes to less than 3 points, so optimized
+ shape always will have at least 3 points.
+
+
+ For example, the below circle shape comprised of 65 points, can be optimized to 8 points
+ by setting to 10.
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Maximum allowed distance between removed points
+ and optimized shape (see ).
+
+
+
+
+ Optimize specified shape.
+
+
+ Shape to be optimized.
+
+ Returns final optimized shape, which may have reduced amount of points.
+
+
+
+
+ Maximum allowed distance between removed points and optimized shape, [0, ∞).
+
+
+ The property sets maximum allowed distance between points removed from original
+ shape and optimized shape - none of the removed points are further away
+ from the new shape than the specified limit.
+
+
+ Default value is set to 5.
+
+
+
+
+ Shape optimizer, which removes obtuse angles (close to flat) from a shape.
+
+
+ This shape optimizing algorithm checks all adjacent edges of a shape
+ and substitutes any 2 edges with a single edge if angle between them is greater than
+ . The algorithm makes sure there are not obtuse angles in
+ a shape, which are very close to flat line.
+
+ The shape optimizer does not optimize shapes to less than 3 points, so optimized
+ shape always will have at least 3 points.
+
+
+ For example, the below circle shape comprised of 65 points, can be optimized to 10 points
+ by setting to 160.
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Maximum acceptable angle between two edges of a shape (see ).
+
+
+
+
+ Optimize specified shape.
+
+
+ Shape to be optimized.
+
+ Returns final optimized shape, which may have reduced amount of points.
+
+
+
+
+ Maximum angle between adjacent edges to keep in a shape, [140, 180].
+
+
+ The property sets maximum angle between adjacent edges, which is kept
+ during optimization. All edges, which have a greater angle between them, are substituted
+ by a single edge.
+
+ Default value is set to 160.
+
+
+
+
+ Uniform random numbers generator.
+
+
+ The random numbers generator generates uniformly
+ distributed numbers in the specified range - values
+ are greater or equal to minimum range's value and less than maximum range's
+ value.
+
+ The generator uses generator
+ to generate random numbers.
+
+ Sample usage:
+
+ // create instance of random generator
+ IRandomNumberGenerator generator = new UniformGenerator( new Range( 50, 100 ) );
+ // generate random number
+ float randomNumber = generator.Next( );
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Random numbers range.
+
+ Initializes random numbers generator with zero seed.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Random numbers range.
+ Seed value to initialize random numbers generator.
+
+
+
+
+ Generate next random number.
+
+
+ Returns next random number.
+
+
+
+
+ Set seed of the random numbers generator.
+
+
+ Seed value.
+
+ Resets random numbers generator initializing it with
+ specified seed value.
+
+
+
+
+ Mean value of the generator.
+
+
+
+
+
+ Variance value of the generator.
+
+
+
+
+
+ Random numbers range.
+
+
+ Range of random numbers to generate. Generated numbers are
+ greater or equal to minimum range's value and less than maximum range's
+ value.
+
+
+
+
+
+ Manhattan distance metric.
+
+
+ This class represents the
+ Manhattan distance metric
+ (aka City Block and Taxi Cab distance).
+
+ Sample usage:
+
+ // instantiate new distance class
+ ManhattanDistance dist = new ManhattanDistance( );
+ // create two vectors for inputs
+ double[] p = new double[] { 2.5, 3.5, 3.0, 3.5, 2.5, 3.0 };
+ double[] q = new double[] { 3.0, 3.5, 1.5, 5.0, 3.5, 3.0 };
+ // get distance between the two vectors
+ double distance = dist.GetDistance( p, q );
+
+
+
+
+
+
+ Returns distance between two N-dimensional double vectors.
+
+
+ 1st point vector.
+ 2nd point vector.
+
+ Returns Manhattan distance between two supplied vectors.
+
+ Thrown if the two vectors are of different dimensions (if specified
+ array have different length).
+
+
+
+
+ 4D Vector structure with X, Y, Z and W coordinates.
+
+
+ The structure incapsulates X, Y, Z and W coordinates of a 4D vector and
+ provides some operations with it.
+
+
+
+
+ X coordinate of the vector.
+
+
+
+
+ Y coordinate of the vector.
+
+
+
+
+ Z coordinate of the vector.
+
+
+
+
+ W coordinate of the vector.
+
+
+
+
+ Initializes a new instance of the structure.
+
+
+ X coordinate of the vector.
+ Y coordinate of the vector.
+ Z coordinate of the vector.
+ W coordinate of the vector.
+
+
+
+
+ Initializes a new instance of the structure.
+
+
+ Value, which is set to all 4 coordinates of the vector.
+
+
+
+
+ Returns a string representation of this object.
+
+
+ A string representation of this object.
+
+
+
+
+ Returns array representation of the vector.
+
+
+ Array with 4 values containing X/Y/Z/W coordinates.
+
+
+
+
+ Adds corresponding coordinates of two vectors.
+
+
+ The vector to add to.
+ The vector to add to the first vector.
+
+ Returns a vector which coordinates are equal to sum of corresponding
+ coordinates of the two specified vectors.
+
+
+
+
+ Adds corresponding coordinates of two vectors.
+
+
+ The vector to add to.
+ The vector to add to the first vector.
+
+ Returns a vector which coordinates are equal to sum of corresponding
+ coordinates of the two specified vectors.
+
+
+
+
+ Adds a value to all coordinates of the specified vector.
+
+
+ Vector to add the specified value to.
+ Value to add to all coordinates of the vector.
+
+ Returns new vector with all coordinates increased by the specified value.
+
+
+
+
+ Adds a value to all coordinates of the specified vector.
+
+
+ Vector to add the specified value to.
+ Value to add to all coordinates of the vector.
+
+ Returns new vector with all coordinates increased by the specified value.
+
+
+
+
+ Subtracts corresponding coordinates of two vectors.
+
+
+ The vector to subtract from.
+ The vector to subtract from the first vector.
+
+ Returns a vector which coordinates are equal to difference of corresponding
+ coordinates of the two specified vectors.
+
+
+
+
+ Subtracts corresponding coordinates of two vectors.
+
+
+ The vector to subtract from.
+ The vector to subtract from the first vector.
+
+ Returns a vector which coordinates are equal to difference of corresponding
+ coordinates of the two specified vectors.
+
+
+
+
+ Subtracts a value from all coordinates of the specified vector.
+
+
+ Vector to subtract the specified value from.
+ Value to subtract from all coordinates of the vector.
+
+ Returns new vector with all coordinates decreased by the specified value.
+
+
+
+
+ Subtracts a value from all coordinates of the specified vector.
+
+
+ Vector to subtract the specified value from.
+ Value to subtract from all coordinates of the vector.
+
+ Returns new vector with all coordinates decreased by the specified value.
+
+
+
+
+ Multiplies corresponding coordinates of two vectors.
+
+
+ The first vector to multiply.
+ The second vector to multiply.
+
+ Returns a vector which coordinates are equal to multiplication of corresponding
+ coordinates of the two specified vectors.
+
+
+
+
+ Multiplies corresponding coordinates of two vectors.
+
+
+ The first vector to multiply.
+ The second vector to multiply.
+
+ Returns a vector which coordinates are equal to multiplication of corresponding
+ coordinates of the two specified vectors.
+
+
+
+
+ Multiplies coordinates of the specified vector by the specified factor.
+
+
+ Vector to multiply coordinates of.
+ Factor to multiple coordinates of the specified vector by.
+
+ Returns new vector with all coordinates multiplied by the specified factor.
+
+
+
+
+ Multiplies coordinates of the specified vector by the specified factor.
+
+
+ Vector to multiply coordinates of.
+ Factor to multiple coordinates of the specified vector by.
+
+ Returns new vector with all coordinates multiplied by the specified factor.
+
+
+
+
+ Divides corresponding coordinates of two vectors.
+
+
+ The first vector to divide.
+ The second vector to devide.
+
+ Returns a vector which coordinates are equal to coordinates of the first vector divided by
+ corresponding coordinates of the second vector.
+
+
+
+
+ Divides corresponding coordinates of two vectors.
+
+
+ The first vector to divide.
+ The second vector to devide.
+
+ Returns a vector which coordinates are equal to coordinates of the first vector divided by
+ corresponding coordinates of the second vector.
+
+
+
+
+ Divides coordinates of the specified vector by the specified factor.
+
+
+ Vector to divide coordinates of.
+ Factor to divide coordinates of the specified vector by.
+
+ Returns new vector with all coordinates divided by the specified factor.
+
+
+
+
+ Divides coordinates of the specified vector by the specified factor.
+
+
+ Vector to divide coordinates of.
+ Factor to divide coordinates of the specified vector by.
+
+ Returns new vector with all coordinates divided by the specified factor.
+
+
+
+
+ Tests whether two specified vectors are equal.
+
+
+ The left-hand vector.
+ The right-hand vector.
+
+ Returns if the two vectors are equal or otherwise.
+
+
+
+
+ Tests whether two specified vectors are not equal.
+
+
+ The left-hand vector.
+ The right-hand vector.
+
+ Returns if the two vectors are not equal or otherwise.
+
+
+
+
+ Tests whether the vector equals to the specified one.
+
+
+ The vector to test equality with.
+
+ Returns if the two vectors are equal or otherwise.
+
+
+
+
+ Tests whether the vector equals to the specified object.
+
+
+ The object to test equality with.
+
+ Returns if the vector equals to the specified object or otherwise.
+
+
+
+
+ Returns the hashcode for this instance.
+
+
+ A 32-bit signed integer hash code.
+
+
+
+
+ Normalizes the vector by dividing it’s all coordinates with the vector's norm.
+
+
+ Returns the value of vectors’ norm before normalization.
+
+
+
+
+ Inverse the vector.
+
+
+ Returns a vector with all coordinates equal to 1.0 divided by the value of corresponding coordinate
+ in this vector (or equal to 0.0 if this vector has corresponding coordinate also set to 0.0).
+
+
+
+
+ Calculate absolute values of the vector.
+
+
+ Returns a vector with all coordinates equal to absolute values of this vector's coordinates.
+
+
+
+
+ Calculates dot product of two vectors.
+
+
+ First vector to use for dot product calculation.
+ Second vector to use for dot product calculation.
+
+ Returns dot product of the two specified vectors.
+
+
+
+
+ Converts the vector to a 3D vector.
+
+
+ Returns 3D vector which has X/Y/Z coordinates equal to X/Y/Z coordinates
+ of this vector divided by .
+
+
+
+
+ Returns maximum value of the vector.
+
+
+ Returns maximum value of all 4 vector's coordinates.
+
+
+
+
+ Returns minimum value of the vector.
+
+
+ Returns minimum value of all 4 vector's coordinates.
+
+
+
+
+ Returns index of the coordinate with maximum value.
+
+
+ Returns index of the coordinate, which has the maximum value - 0 for X,
+ 1 for Y, 2 for Z or 3 for W.
+
+ If there are multiple coordinates which have the same maximum value, the
+ property returns smallest index.
+
+
+
+
+
+ Returns index of the coordinate with minimum value.
+
+
+ Returns index of the coordinate, which has the minimum value - 0 for X,
+ 1 for Y, 2 for Z or 3 for W.
+
+ If there are multiple coordinates which have the same minimum value, the
+ property returns smallest index.
+
+
+
+
+
+ Returns vector's norm.
+
+
+ Returns Euclidean norm of the vector, which is a
+ square root of the sum: X2+Y2+Z2+W2.
+
+
+
+
+
+ Returns square of the vector's norm.
+
+
+ Return X2+Y2+Z2+W2, which is
+ a square of vector's norm or a dot product of this vector
+ with itself.
+
+
+
+
+ Uniform random numbers generator in the range of [0, 1).
+
+
+ The random number generator generates uniformly
+ distributed numbers in the range of [0, 1) - greater or equal to 0.0
+ and less than 1.0.
+
+ At this point the generator is based on the
+ internal .NET generator, but may be rewritten to
+ use faster generation algorithm.
+
+ Sample usage:
+
+ // create instance of random generator
+ IRandomNumberGenerator generator = new UniformOneGenerator( );
+ // generate random number
+ float randomNumber = generator.Next( );
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Initializes random numbers generator with zero seed.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Seed value to initialize random numbers generator.
+
+
+
+
+ Generate next random number.
+
+
+ Returns next random number.
+
+
+
+
+ Set seed of the random numbers generator.
+
+
+ Seed value.
+
+ Resets random numbers generator initializing it with
+ specified seed value.
+
+
+
+
+ Mean value of the generator.
+
+
+
+
+
+ Variance value of the generator.
+
+
+
+
+
+ Exponential random numbers generator.
+
+
+ The random number generator generates exponential
+ random numbers with specified rate value (lambda).
+
+ The generator uses generator as a base
+ to generate random numbers.
+
+ Sample usage:
+
+ // create instance of random generator
+ IRandomNumberGenerator generator = new ExponentialGenerator( 5 );
+ // generate random number
+ float randomNumber = generator.Next( );
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Rate value.
+
+ Rate value should be greater than zero.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Rate value (inverse mean).
+ Seed value to initialize random numbers generator.
+
+ Rate value should be greater than zero.
+
+
+
+
+ Generate next random number
+
+
+ Returns next random number.
+
+
+
+
+ Set seed of the random numbers generator.
+
+
+ Seed value.
+
+ Resets random numbers generator initializing it with
+ specified seed value.
+
+
+
+
+ Rate value (inverse mean).
+
+
+ The rate value should be positive and non zero.
+
+
+
+
+ Mean value of the generator.
+
+
+
+
+
+ Variance value of the generator.
+
+
+
+
+
+ A structure representing 4x4 matrix.
+
+
+ The structure incapsulates elements of a 4x4 matrix and
+ provides some operations with it.
+
+
+
+
+ Row 0 column 0 element of the matrix.
+
+
+
+
+ Row 0 column 1 element of the matrix.
+
+
+
+
+ Row 0 column 2 element of the matrix.
+
+
+
+
+ Row 0 column 3 element of the matrix.
+
+
+
+
+ Row 1 column 0 element of the matrix.
+
+
+
+
+ Row 1 column 1 element of the matrix.
+
+
+
+
+ Row 1 column 2 element of the matrix.
+
+
+
+
+ Row 1 column 3 element of the matrix.
+
+
+
+
+ Row 2 column 0 element of the matrix.
+
+
+
+
+ Row 2 column 1 element of the matrix.
+
+
+
+
+ Row 2 column 2 element of the matrix.
+
+
+
+
+ Row 2 column 3 element of the matrix.
+
+
+
+
+ Row 3 column 0 element of the matrix.
+
+
+
+
+ Row 3 column 1 element of the matrix.
+
+
+
+
+ Row 3 column 2 element of the matrix.
+
+
+
+
+ Row 3 column 3 element of the matrix.
+
+
+
+
+ Returns array representation of the matrix.
+
+
+ Returns array which contains all elements of the matrix in the row-major order.
+
+
+
+
+ Creates rotation matrix around Y axis.
+
+
+ Rotation angle around Y axis in radians.
+
+ Returns rotation matrix to rotate an object around Y axis.
+
+
+
+
+ Creates rotation matrix around X axis.
+
+
+ Rotation angle around X axis in radians.
+
+ Returns rotation matrix to rotate an object around X axis.
+
+
+
+
+ Creates rotation matrix around Z axis.
+
+
+ Rotation angle around Z axis in radians.
+
+ Returns rotation matrix to rotate an object around Z axis.
+
+
+
+
+ Creates rotation matrix to rotate an object around X, Y and Z axes.
+
+
+ Rotation angle around Y axis in radians.
+ Rotation angle around X axis in radians.
+ Rotation angle around Z axis in radians.
+
+ Returns rotation matrix to rotate an object around all 3 axes.
+
+
+ The routine assumes roll-pitch-yaw rotation order, when creating rotation
+ matrix, i.e. an object is first rotated around Z axis, then around X axis and finally around
+ Y axis.
+
+
+
+
+
+ Extract rotation angles from the rotation matrix.
+
+
+ Extracted rotation angle around Y axis in radians.
+ Extracted rotation angle around X axis in radians.
+ Extracted rotation angle around Z axis in radians.
+
+ The routine assumes roll-pitch-yaw rotation order when extracting rotation angle.
+ Using extracted angles with the should provide same rotation matrix.
+
+
+ The method assumes the provided matrix represent valid rotation matrix.
+
+ Sample usage:
+
+ // assume we have a rotation matrix created like this
+ float yaw = 10.0f / 180 * Math.PI;
+ float pitch = 30.0f / 180 * Math.PI;
+ float roll = 45.0f / 180 * Math.PI;
+
+ Matrix4x4 rotationMatrix = Matrix3x3.CreateFromYawPitchRoll( yaw, pitch, roll );
+ // ...
+
+ // now somewhere in the code you may want to get rotation
+ // angles back from a matrix assuming same rotation order
+ float extractedYaw;
+ float extractedPitch;
+ float extractedRoll;
+
+ rotation.ExtractYawPitchRoll( out extractedYaw, out extractedPitch, out extractedRoll );
+
+
+
+
+
+
+ Creates 4x4 tranformation matrix from 3x3 rotation matrix.
+
+
+ Source 3x3 rotation matrix.
+
+ Returns 4x4 rotation matrix.
+
+ The source 3x3 rotation matrix is copied into the top left corner of the result 4x4 matrix,
+ i.e. it represents 0th, 1st and 2nd row/column. The element is set to 1 and the rest
+ elements of 3rd row and 3rd column are set to zeros.
+
+
+
+
+ Creates translation matrix for the specified movement amount.
+
+
+ Vector which set direction and amount of movement.
+
+ Returns translation matrix.
+
+ The specified vector is copied to the 3rd column of the result matrix.
+ All diagonal elements are set to 1. The rest of matrix is initialized with zeros.
+
+
+
+
+ Creates a view matrix for the specified camera position and target point.
+
+
+ Position of camera.
+ Target point towards which camera is pointing.
+
+ Returns a view matrix.
+
+ Camera's "up" vector is supposed to be (0, 1, 0).
+
+
+
+
+ Creates a perspective projection matrix.
+
+
+ Width of the view volume at the near view plane.
+ Height of the view volume at the near view plane.
+ Distance to the near view plane.
+ Distance to the far view plane.
+
+ Return a perspective projection matrix.
+
+ Both near and far view planes' distances must be greater than zero.
+ Near plane must be closer than the far plane.
+
+
+
+
+ Creates a matrix from 4 rows specified as vectors.
+
+
+ First row of the matrix to create.
+ Second row of the matrix to create.
+ Third row of the matrix to create.
+ Fourth row of the matrix to create.
+
+ Returns a matrix from specified rows.
+
+
+
+
+ Creates a matrix from 4 columns specified as vectors.
+
+
+ First column of the matrix to create.
+ Second column of the matrix to create.
+ Third column of the matrix to create.
+ Fourth column of the matrix to create.
+
+ Returns a matrix from specified columns.
+
+
+
+
+ Creates a diagonal matrix using the specified vector as diagonal elements.
+
+
+ Vector to use for diagonal elements of the matrix.
+
+ Returns a diagonal matrix.
+
+
+
+
+ Get row of the matrix.
+
+
+ Row index to get, [0, 3].
+
+ Returns specified row of the matrix as a vector.
+
+ Invalid row index was specified.
+
+
+
+
+ Get column of the matrix.
+
+
+ Column index to get, [0, 3].
+
+ Returns specified column of the matrix as a vector.
+
+ Invalid column index was specified.
+
+
+
+
+ Multiplies two specified matrices.
+
+
+ Matrix to multiply.
+ Matrix to multiply by.
+
+ Return new matrix, which the result of multiplication of the two specified matrices.
+
+
+
+
+ Multiplies two specified matrices.
+
+
+ Matrix to multiply.
+ Matrix to multiply by.
+
+ Return new matrix, which the result of multiplication of the two specified matrices.
+
+
+
+
+ Adds corresponding components of two matrices.
+
+
+ The matrix to add to.
+ The matrix to add to the first matrix.
+
+ Returns a matrix which components are equal to sum of corresponding
+ components of the two specified matrices.
+
+
+
+
+ Adds corresponding components of two matrices.
+
+
+ The matrix to add to.
+ The matrix to add to the first matrix.
+
+ Returns a matrix which components are equal to sum of corresponding
+ components of the two specified matrices.
+
+
+
+
+ Subtracts corresponding components of two matrices.
+
+
+ The matrix to subtract from.
+ The matrix to subtract from the first matrix.
+
+ Returns a matrix which components are equal to difference of corresponding
+ components of the two specified matrices.
+
+
+
+
+ Subtracts corresponding components of two matrices.
+
+
+ The matrix to subtract from.
+ The matrix to subtract from the first matrix.
+
+ Returns a matrix which components are equal to difference of corresponding
+ components of the two specified matrices.
+
+
+
+
+ Multiplies specified matrix by the specified vector.
+
+
+ Matrix to multiply by vector.
+ Vector to multiply matrix by.
+
+ Returns new vector which is the result of multiplication of the specified matrix
+ by the specified vector.
+
+
+
+
+ Multiplies specified matrix by the specified vector.
+
+
+ Matrix to multiply by vector.
+ Vector to multiply matrix by.
+
+ Returns new vector which is the result of multiplication of the specified matrix
+ by the specified vector.
+
+
+
+
+ Tests whether two specified matrices are equal.
+
+
+ The left-hand matrix.
+ The right-hand matrix.
+
+ Returns if the two matrices are equal or otherwise.
+
+
+
+
+ Tests whether two specified matrices are not equal.
+
+
+ The left-hand matrix.
+ The right-hand matrix.
+
+ Returns if the two matrices are not equal or otherwise.
+
+
+
+
+ Tests whether the matrix equals to the specified one.
+
+
+ The matrix to test equality with.
+
+ Returns if the two matrices are equal or otherwise.
+
+
+
+
+ Tests whether the matrix equals to the specified object.
+
+
+ The object to test equality with.
+
+ Returns if the matrix equals to the specified object or otherwise.
+
+
+
+
+ Returns the hashcode for this instance.
+
+
+ A 32-bit signed integer hash code.
+
+
+
+
+ Provides an identity matrix with all diagonal elements set to 1.
+
+
+
+
+ Enumeration of some basic shape types.
+
+
+
+
+ Unknown shape type.
+
+
+
+
+ Circle shape.
+
+
+
+
+ Triangle shape.
+
+
+
+
+ Quadrilateral shape.
+
+
+
+
+ Some common sub types of some basic shapes.
+
+
+
+
+ Unrecognized sub type of a shape (generic shape which does not have
+ any specific sub type).
+
+
+
+
+ Quadrilateral with one pair of parallel sides.
+
+
+
+
+ Quadrilateral with two pairs of parallel sides.
+
+
+
+
+ Parallelogram with perpendicular adjacent sides.
+
+
+
+
+ Parallelogram with all sides equal.
+
+
+
+
+ Rectangle with all sides equal.
+
+
+
+
+ Triangle with all sides/angles equal.
+
+
+
+
+ Triangle with two sides/angles equal.
+
+
+
+
+ Triangle with a 90 degrees angle.
+
+
+
+
+ Triangle with a 90 degrees angle and other two angles are equal.
+
+
+
+
+ Set of tools for processing collection of points in 2D space.
+
+
+ The static class contains set of routines, which provide different
+ operations with collection of points in 2D space. For example, finding the
+ furthest point from a specified point or line.
+
+ Sample usage:
+
+ // create points' list
+ List<IntPoint> points = new List<IntPoint>( );
+ points.Add( new IntPoint( 10, 10 ) );
+ points.Add( new IntPoint( 20, 15 ) );
+ points.Add( new IntPoint( 15, 30 ) );
+ points.Add( new IntPoint( 40, 12 ) );
+ points.Add( new IntPoint( 30, 20 ) );
+ // get furthest point from the specified point
+ IntPoint p1 = PointsCloud.GetFurthestPoint( points, new IntPoint( 15, 15 ) );
+ Console.WriteLine( p1.X + ", " + p1.Y );
+ // get furthest point from line
+ IntPoint p2 = PointsCloud.GetFurthestPointFromLine( points,
+ new IntPoint( 50, 0 ), new IntPoint( 0, 50 ) );
+ Console.WriteLine( p2.X + ", " + p2.Y );
+
+
+
+
+
+
+ Shift cloud by adding specified value to all points in the collection.
+
+
+ Collection of points to shift their coordinates.
+ Point to shift by.
+
+
+
+
+ Get bounding rectangle of the specified list of points.
+
+
+ Collection of points to get bounding rectangle for.
+ Point comprised of smallest X and Y coordinates.
+ Point comprised of biggest X and Y coordinates.
+
+
+
+
+ Get center of gravity for the specified list of points.
+
+
+ List of points to calculate center of gravity for.
+
+ Returns center of gravity (mean X-Y values) for the specified list of points.
+
+
+
+
+ Find furthest point from the specified point.
+
+
+ Collection of points to search furthest point in.
+ The point to search furthest point from.
+
+ Returns a point, which is the furthest away from the .
+
+
+
+
+ Find two furthest points from the specified line.
+
+
+ Collection of points to search furthest points in.
+ First point forming the line.
+ Second point forming the line.
+ First found furthest point.
+ Second found furthest point (which is on the
+ opposite side from the line compared to the );
+
+ The method finds two furthest points from the specified line,
+ where one point is on one side from the line and the second point is on
+ another side from the line.
+
+
+
+
+ Find two furthest points from the specified line.
+
+
+ Collection of points to search furthest points in.
+ First point forming the line.
+ Second point forming the line.
+ First found furthest point.
+ Distance between the first found point and the given line.
+ Second found furthest point (which is on the
+ opposite side from the line compared to the );
+ Distance between the second found point and the given line.
+
+ The method finds two furthest points from the specified line,
+ where one point is on one side from the line and the second point is on
+ another side from the line.
+
+
+
+
+ Find the furthest point from the specified line.
+
+
+ Collection of points to search furthest point in.
+ First point forming the line.
+ Second point forming the line.
+
+ Returns a point, which is the furthest away from the
+ specified line.
+
+ The method finds the furthest point from the specified line.
+ Unlike the
+ method, this method find only one point, which is the furthest away from the line
+ regardless of side from the line.
+
+
+
+
+ Find the furthest point from the specified line.
+
+
+ Collection of points to search furthest points in.
+ First point forming the line.
+ Second point forming the line.
+ Distance between the furthest found point and the given line.
+
+ Returns a point, which is the furthest away from the
+ specified line.
+
+ The method finds the furthest point from the specified line.
+ Unlike the
+ method, this method find only one point, which is the furthest away from the line
+ regardless of side from the line.
+
+
+
+
+ Find corners of quadrilateral or triangular area, which contains the specified collection of points.
+
+
+ Collection of points to search quadrilateral for.
+
+ Returns a list of 3 or 4 points, which are corners of the quadrilateral or
+ triangular area filled by specified collection of point. The first point in the list
+ is the point with lowest X coordinate (and with lowest Y if there are several points
+ with the same X value). The corners are provided in counter clockwise order
+ (Cartesian
+ coordinate system).
+
+ The method makes an assumption that the specified collection of points
+ form some sort of quadrilateral/triangular area. With this assumption it tries to find corners
+ of the area.
+
+ The method does not search for bounding quadrilateral/triangular area,
+ where all specified points are inside of the found quadrilateral/triangle. Some of the
+ specified points potentially may be outside of the found quadrilateral/triangle, since the
+ method takes corners only from the specified collection of points, but does not calculate such
+ to form true bounding quadrilateral/triangle.
+
+ See property for additional information.
+
+
+
+
+
+ Relative distortion limit allowed for quadrilaterals, [0.0, 0.25].
+
+
+ The value of this property is used to calculate distortion limit used by
+ , when processing potential corners and making decision
+ if the provided points form a quadrilateral or a triangle. The distortion limit is
+ calculated as:
+
+ distrtionLimit = RelativeDistortionLimit * ( W * H ) / 2,
+
+ where W and H are width and height of the "points cloud" passed to the
+ .
+
+
+ To explain the idea behind distortion limit, let’s suppose that quadrilateral finder routine found
+ the next candidates for corners:
+ 
+ As we can see on the above picture, the shape there potentially can be a triangle, but not quadrilateral
+ (suppose that points list comes from a hand drawn picture or acquired from camera, so some
+ inaccuracy may exist). It may happen that the D point is just a distortion (noise, etc).
+ So the check what is the distance between a potential corner
+ (D in this case) and a line connecting two adjacent points (AB in this case). If the distance is smaller
+ then the distortion limit, then the point may be rejected, so the shape turns into triangle.
+
+
+ An exception is the case when both C and D points are very close to the AB line,
+ so both their distances are less than distortion limit. In this case both points will be accepted as corners -
+ the shape is just a flat quadrilateral.
+
+ Default value is set to 0.1.
+
+
+
+
+
+ 3D Vector structure with X, Y and Z coordinates.
+
+
+ The structure incapsulates X, Y and Z coordinates of a 3D vector and
+ provides some operations with it.
+
+
+
+
+ X coordinate of the vector.
+
+
+
+
+ Y coordinate of the vector.
+
+
+
+
+ Z coordinate of the vector.
+
+
+
+
+ Initializes a new instance of the structure.
+
+
+ X coordinate of the vector.
+ Y coordinate of the vector.
+ Z coordinate of the vector.
+
+
+
+
+ Initializes a new instance of the structure.
+
+
+ Value, which is set to all 3 coordinates of the vector.
+
+
+
+
+ Returns a string representation of this object.
+
+
+ A string representation of this object.
+
+
+
+
+ Returns array representation of the vector.
+
+
+ Array with 3 values containing X/Y/Z coordinates.
+
+
+
+
+ Adds corresponding coordinates of two vectors.
+
+
+ The vector to add to.
+ The vector to add to the first vector.
+
+ Returns a vector which coordinates are equal to sum of corresponding
+ coordinates of the two specified vectors.
+
+
+
+
+ Adds corresponding coordinates of two vectors.
+
+
+ The vector to add to.
+ The vector to add to the first vector.
+
+ Returns a vector which coordinates are equal to sum of corresponding
+ coordinates of the two specified vectors.
+
+
+
+
+ Adds a value to all coordinates of the specified vector.
+
+
+ Vector to add the specified value to.
+ Value to add to all coordinates of the vector.
+
+ Returns new vector with all coordinates increased by the specified value.
+
+
+
+
+ Adds a value to all coordinates of the specified vector.
+
+
+ Vector to add the specified value to.
+ Value to add to all coordinates of the vector.
+
+ Returns new vector with all coordinates increased by the specified value.
+
+
+
+
+ Subtracts corresponding coordinates of two vectors.
+
+
+ The vector to subtract from.
+ The vector to subtract from the first vector.
+
+ Returns a vector which coordinates are equal to difference of corresponding
+ coordinates of the two specified vectors.
+
+
+
+
+ Subtracts corresponding coordinates of two vectors.
+
+
+ The vector to subtract from.
+ The vector to subtract from the first vector.
+
+ Returns a vector which coordinates are equal to difference of corresponding
+ coordinates of the two specified vectors.
+
+
+
+
+ Subtracts a value from all coordinates of the specified vector.
+
+
+ Vector to subtract the specified value from.
+ Value to subtract from all coordinates of the vector.
+
+ Returns new vector with all coordinates decreased by the specified value.
+
+
+
+
+ Subtracts a value from all coordinates of the specified vector.
+
+
+ Vector to subtract the specified value from.
+ Value to subtract from all coordinates of the vector.
+
+ Returns new vector with all coordinates decreased by the specified value.
+
+
+
+
+ Multiplies corresponding coordinates of two vectors.
+
+
+ The first vector to multiply.
+ The second vector to multiply.
+
+ Returns a vector which coordinates are equal to multiplication of corresponding
+ coordinates of the two specified vectors.
+
+
+
+
+ Multiplies corresponding coordinates of two vectors.
+
+
+ The first vector to multiply.
+ The second vector to multiply.
+
+ Returns a vector which coordinates are equal to multiplication of corresponding
+ coordinates of the two specified vectors.
+
+
+
+
+ Multiplies coordinates of the specified vector by the specified factor.
+
+
+ Vector to multiply coordinates of.
+ Factor to multiple coordinates of the specified vector by.
+
+ Returns new vector with all coordinates multiplied by the specified factor.
+
+
+
+
+ Multiplies coordinates of the specified vector by the specified factor.
+
+
+ Vector to multiply coordinates of.
+ Factor to multiple coordinates of the specified vector by.
+
+ Returns new vector with all coordinates multiplied by the specified factor.
+
+
+
+
+ Divides corresponding coordinates of two vectors.
+
+
+ The first vector to divide.
+ The second vector to devide.
+
+ Returns a vector which coordinates are equal to coordinates of the first vector divided by
+ corresponding coordinates of the second vector.
+
+
+
+
+ Divides corresponding coordinates of two vectors.
+
+
+ The first vector to divide.
+ The second vector to devide.
+
+ Returns a vector which coordinates are equal to coordinates of the first vector divided by
+ corresponding coordinates of the second vector.
+
+
+
+
+ Divides coordinates of the specified vector by the specified factor.
+
+
+ Vector to divide coordinates of.
+ Factor to divide coordinates of the specified vector by.
+
+ Returns new vector with all coordinates divided by the specified factor.
+
+
+
+
+ Divides coordinates of the specified vector by the specified factor.
+
+
+ Vector to divide coordinates of.
+ Factor to divide coordinates of the specified vector by.
+
+ Returns new vector with all coordinates divided by the specified factor.
+
+
+
+
+ Tests whether two specified vectors are equal.
+
+
+ The left-hand vector.
+ The right-hand vector.
+
+ Returns if the two vectors are equal or otherwise.
+
+
+
+
+ Tests whether two specified vectors are not equal.
+
+
+ The left-hand vector.
+ The right-hand vector.
+
+ Returns if the two vectors are not equal or otherwise.
+
+
+
+
+ Tests whether the vector equals to the specified one.
+
+
+ The vector to test equality with.
+
+ Returns if the two vectors are equal or otherwise.
+
+
+
+
+ Tests whether the vector equals to the specified object.
+
+
+ The object to test equality with.
+
+ Returns if the vector equals to the specified object or otherwise.
+
+
+
+
+ Returns the hashcode for this instance.
+
+
+ A 32-bit signed integer hash code.
+
+
+
+
+ Normalizes the vector by dividing it’s all coordinates with the vector's norm.
+
+
+ Returns the value of vectors’ norm before normalization.
+
+
+
+
+ Inverse the vector.
+
+
+ Returns a vector with all coordinates equal to 1.0 divided by the value of corresponding coordinate
+ in this vector (or equal to 0.0 if this vector has corresponding coordinate also set to 0.0).
+
+
+
+
+ Calculate absolute values of the vector.
+
+
+ Returns a vector with all coordinates equal to absolute values of this vector's coordinates.
+
+
+
+
+ Calculates cross product of two vectors.
+
+
+ First vector to use for cross product calculation.
+ Second vector to use for cross product calculation.
+
+ Returns cross product of the two specified vectors.
+
+
+
+
+ Calculates dot product of two vectors.
+
+
+ First vector to use for dot product calculation.
+ Second vector to use for dot product calculation.
+
+ Returns dot product of the two specified vectors.
+
+
+
+
+ Converts the vector to a 4D vector.
+
+
+ Returns 4D vector which is an extension of the 3D vector.
+
+ The method returns a 4D vector which has X, Y and Z coordinates equal to the
+ coordinates of this 3D vector and W coordinate set to 1.0.
+
+
+
+
+
+ Returns maximum value of the vector.
+
+
+ Returns maximum value of all 3 vector's coordinates.
+
+
+
+
+ Returns minimum value of the vector.
+
+
+ Returns minimum value of all 3 vector's coordinates.
+
+
+
+
+ Returns index of the coordinate with maximum value.
+
+
+ Returns index of the coordinate, which has the maximum value - 0 for X,
+ 1 for Y or 2 for Z.
+
+ If there are multiple coordinates which have the same maximum value, the
+ property returns smallest index.
+
+
+
+
+
+ Returns index of the coordinate with minimum value.
+
+
+ Returns index of the coordinate, which has the minimum value - 0 for X,
+ 1 for Y or 2 for Z.
+
+ If there are multiple coordinates which have the same minimum value, the
+ property returns smallest index.
+
+
+
+
+
+ Returns vector's norm.
+
+
+ Returns Euclidean norm of the vector, which is a
+ square root of the sum: X2+Y2+Z2.
+
+
+
+
+
+ Returns square of the vector's norm.
+
+
+ Return X2+Y2+Z2, which is
+ a square of vector's norm or a dot product of this vector
+ with itself.
+
+
+
+
+ Cosine similarity metric.
+
+
+ This class represents the
+ Cosine Similarity metric.
+
+ Sample usage:
+
+ // instantiate new similarity class
+ CosineSimilarity sim = new CosineSimilarity( );
+ // create two vectors for inputs
+ double[] p = new double[] { 2.5, 3.5, 3.0, 3.5, 2.5, 3.0 };
+ double[] q = new double[] { 3.0, 3.5, 1.5, 5.0, 3.5, 3.0 };
+ // get similarity between the two vectors
+ double similarityScore = sim.GetSimilarityScore( p, q );
+
+
+
+
+
+
+ Returns similarity score for two N-dimensional double vectors.
+
+
+ 1st point vector.
+ 2nd point vector.
+
+ Returns Cosine similarity between two supplied vectors.
+
+ Thrown if the two vectors are of different dimensions (if specified
+ array have different length).
+
+
+
+
+ 3D pose estimation algorithm.
+
+
+ The class implements an algorithm for 3D object's pose estimation from it's
+ 2D coordinates obtained by perspective projection, when the object is described none coplanar points.
+ The idea of the implemented math and algorithm is described in "Model-Based Object Pose in 25
+ Lines of Code" paper written by Daniel F. DeMenthon and Larry S. Davis (the implementation of
+ the algorithm is almost 1 to 1 translation of the pseudo code given by the paper, so should
+ be easy to follow).
+
+ At this point the implementation works only with models described by 4 points, which is
+ the minimum number of points enough for 3D pose estimation.
+
+ The 4 model's point must not be coplanar, i.e. must not reside all within
+ same planer. See for coplanar case.
+
+ Read 3D Pose Estimation article for
+ additional information and samples.
+
+ Sample usage:
+
+ // points of real object - model
+ Vector3[] positObject = new Vector3[4]
+ {
+ new Vector3( 28, 28, -28 ),
+ new Vector3( -28, 28, -28 ),
+ new Vector3( 28, -28, -28 ),
+ new Vector3( 28, 28, 28 ),
+ };
+ // focal length of camera used to capture the object
+ float focalLength = 640; // depends on your camera or projection system
+ // initialize POSIT object
+ Posit posit = new Posit( positObject, focalLength );
+
+ // 2D points of te object - projection
+ AForge.Point[] projectedPoints = new AForge.Point[4]
+ {
+ new AForge.Point( -4, 29 ),
+ new AForge.Point( -180, 86 ),
+ new AForge.Point( -5, -102 ),
+ new AForge.Point( 76, 137 ),
+ };
+ // estimate pose
+ Matrix3x3 rotationMatrix;
+ Vector3 translationVector;
+ posit.EstimatePose( projectedPoints,
+ out rotationMatrix, out translationVector );
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Array of vectors containing coordinates of four real model's point (points
+ must not be on the same plane).
+ Effective focal length of the camera used to capture the model.
+
+ The model must have 4 points.
+
+
+
+
+ Estimate pose of a model from it's projected 2D coordinates.
+
+
+ 4 2D points of the model's projection.
+ Gets object's rotation.
+ Gets object's translation.
+
+ 4 points must be be given for pose estimation.
+
+
+
+
+ Coordinates of the model points which pose should be estimated.
+
+
+
+
+ Effective focal length of the camera used to capture the model.
+
+
+
+
+ Histogram for continuous random values.
+
+
+ The class wraps histogram for continuous stochastic function, which is represented
+ by integer array and range of the function. Values of the integer array are treated
+ as total amount of hits on the corresponding subranges, which are calculated by splitting the
+ specified range into required amount of consequent ranges.
+
+ For example, if the integer array is equal to { 1, 2, 4, 8, 16 } and the range is set
+ to [0, 1], then the histogram consists of next subranges:
+
+ - [0.0, 0.2] - 1 hit;
+ - [0.2, 0.4] - 2 hits;
+ - [0.4, 0.6] - 4 hits;
+ - [0.6, 0.8] - 8 hits;
+ - [0.8, 1.0] - 16 hits.
+
+
+
+ Sample usage:
+
+ // create histogram
+ ContinuousHistogram histogram = new ContinuousHistogram(
+ new int[] { 0, 0, 8, 4, 2, 4, 7, 1, 0 }, new Range( 0.0f, 1.0f ) );
+ // get mean and standard deviation values
+ Console.WriteLine( "mean = " + histogram.Mean + ", std.dev = " + histogram.StdDev );
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Values of the histogram.
+ Range of random values.
+
+ Values of the integer array are treated as total amount of hits on the
+ corresponding subranges, which are calculated by splitting the specified range into
+ required amount of consequent ranges (see class
+ description for more information).
+
+
+
+
+
+ Get range around median containing specified percentage of values.
+
+
+ Values percentage around median.
+
+ Returns the range which containes specifies percentage of values.
+
+ The method calculates range of stochastic variable, which summary probability
+ comprises the specified percentage of histogram's hits.
+
+ Sample usage:
+
+ // create histogram
+ ContinuousHistogram histogram = new ContinuousHistogram(
+ new int[] { 0, 0, 8, 4, 2, 4, 7, 1, 0 }, new Range( 0.0f, 1.0f ) );
+ // get 50% range
+ Range range = histogram.GetRange( 0.5f );
+ // show the range ([0.25, 0.75])
+ Console.WriteLine( "50% range = [" + range.Min + ", " + range.Max + "]" );
+
+
+
+
+
+
+ Update statistical value of the histogram.
+
+
+ The method recalculates statistical values of the histogram, like mean,
+ standard deviation, etc. The method should be called only in the case if histogram
+ values were retrieved through property and updated after that.
+
+
+
+
+
+ Values of the histogram.
+
+
+
+
+
+ Range of random values.
+
+
+
+
+
+ Mean value.
+
+
+ The property allows to retrieve mean value of the histogram.
+
+ Sample usage:
+
+ // create histogram
+ ContinuousHistogram histogram = new ContinuousHistogram(
+ new int[] { 0, 0, 8, 4, 2, 4, 7, 1, 0 }, new Range( 0.0f, 1.0f ) );
+ // get mean value (= 0.505 )
+ Console.WriteLine( "mean = " + histogram.Mean.ToString( "F3" ) );
+
+
+
+
+
+
+ Standard deviation.
+
+
+ The property allows to retrieve standard deviation value of the histogram.
+
+ Sample usage:
+
+ // create histogram
+ ContinuousHistogram histogram = new ContinuousHistogram(
+ new int[] { 0, 0, 8, 4, 2, 4, 7, 1, 0 }, new Range( 0.0f, 1.0f ) );
+ // get std.dev. value (= 0.215)
+ Console.WriteLine( "std.dev. = " + histogram.StdDev.ToString( "F3" ) );
+
+
+
+
+
+
+ Median value.
+
+
+ The property allows to retrieve median value of the histogram.
+
+ Sample usage:
+
+ // create histogram
+ ContinuousHistogram histogram = new ContinuousHistogram(
+ new int[] { 0, 0, 8, 4, 2, 4, 7, 1, 0 }, new Range( 0.0f, 1.0f ) );
+ // get median value (= 0.500)
+ Console.WriteLine( "median = " + histogram.Median.ToString( "F3" ) );
+
+
+
+
+
+
+ Minimum value.
+
+
+ The property allows to retrieve minimum value of the histogram with non zero
+ hits count.
+
+ Sample usage:
+
+ // create histogram
+ ContinuousHistogram histogram = new ContinuousHistogram(
+ new int[] { 0, 0, 8, 4, 2, 4, 7, 1, 0 }, new Range( 0.0f, 1.0f ) );
+ // get min value (= 0.250)
+ Console.WriteLine( "min = " + histogram.Min.ToString( "F3" ) );
+
+
+
+
+
+ Maximum value.
+
+
+ The property allows to retrieve maximum value of the histogram with non zero
+ hits count.
+
+ Sample usage:
+
+ // create histogram
+ ContinuousHistogram histogram = new ContinuousHistogram(
+ new int[] { 0, 0, 8, 4, 2, 4, 7, 1, 0 }, new Range( 0.0f, 1.0f ) );
+ // get max value (= 0.875)
+ Console.WriteLine( "max = " + histogram.Max.ToString( "F3" ) );
+
+
+
+
+
+
+ A structure representing 3x3 matrix.
+
+
+ The structure incapsulates elements of a 3x3 matrix and
+ provides some operations with it.
+
+
+
+
+ Row 0 column 0 element of the matrix.
+
+
+
+
+ Row 0 column 1 element of the matrix.
+
+
+
+
+ Row 0 column 2 element of the matrix.
+
+
+
+
+ Row 1 column 0 element of the matrix.
+
+
+
+
+ Row 1 column 1 element of the matrix.
+
+
+
+
+ Row 1 column 2 element of the matrix.
+
+
+
+
+ Row 2 column 0 element of the matrix.
+
+
+
+
+ Row 2 column 1 element of the matrix.
+
+
+
+
+ Row 2 column 2 element of the matrix.
+
+
+
+
+ Returns array representation of the matrix.
+
+
+ Returns array which contains all elements of the matrix in the row-major order.
+
+
+
+
+ Creates rotation matrix around Y axis.
+
+
+ Rotation angle around Y axis in radians.
+
+ Returns rotation matrix to rotate an object around Y axis.
+
+
+
+
+ Creates rotation matrix around X axis.
+
+
+ Rotation angle around X axis in radians.
+
+ Returns rotation matrix to rotate an object around X axis.
+
+
+
+
+ Creates rotation matrix around Z axis.
+
+
+ Rotation angle around Z axis in radians.
+
+ Returns rotation matrix to rotate an object around Z axis.
+
+
+
+
+ Creates rotation matrix to rotate an object around X, Y and Z axes.
+
+
+ Rotation angle around Y axis in radians.
+ Rotation angle around X axis in radians.
+ Rotation angle around Z axis in radians.
+
+ Returns rotation matrix to rotate an object around all 3 axes.
+
+
+ The routine assumes roll-pitch-yaw rotation order, when creating rotation
+ matrix, i.e. an object is first rotated around Z axis, then around X axis and finally around
+ Y axis.
+
+
+
+
+
+ Extract rotation angles from the rotation matrix.
+
+
+ Extracted rotation angle around Y axis in radians.
+ Extracted rotation angle around X axis in radians.
+ Extracted rotation angle around Z axis in radians.
+
+ The routine assumes roll-pitch-yaw rotation order when extracting rotation angle.
+ Using extracted angles with the should provide same rotation matrix.
+
+
+ The method assumes the provided matrix represent valid rotation matrix.
+
+ Sample usage:
+
+ // assume we have a rotation matrix created like this
+ float yaw = 10.0f / 180 * Math.PI;
+ float pitch = 30.0f / 180 * Math.PI;
+ float roll = 45.0f / 180 * Math.PI;
+
+ Matrix3x3 rotationMatrix = Matrix3x3.CreateFromYawPitchRoll( yaw, pitch, roll );
+ // ...
+
+ // now somewhere in the code you may want to get rotation
+ // angles back from a matrix assuming same rotation order
+ float extractedYaw;
+ float extractedPitch;
+ float extractedRoll;
+
+ rotation.ExtractYawPitchRoll( out extractedYaw, out extractedPitch, out extractedRoll );
+
+
+
+
+
+
+ Creates a matrix from 3 rows specified as vectors.
+
+
+ First row of the matrix to create.
+ Second row of the matrix to create.
+ Third row of the matrix to create.
+
+ Returns a matrix from specified rows.
+
+
+
+
+ Creates a matrix from 3 columns specified as vectors.
+
+
+ First column of the matrix to create.
+ Second column of the matrix to create.
+ Third column of the matrix to create.
+
+ Returns a matrix from specified columns.
+
+
+
+
+ Creates a diagonal matrix using the specified vector as diagonal elements.
+
+
+ Vector to use for diagonal elements of the matrix.
+
+ Returns a diagonal matrix.
+
+
+
+
+ Get row of the matrix.
+
+
+ Row index to get, [0, 2].
+
+ Returns specified row of the matrix as a vector.
+
+ Invalid row index was specified.
+
+
+
+
+ Get column of the matrix.
+
+
+ Column index to get, [0, 2].
+
+ Returns specified column of the matrix as a vector.
+
+ Invalid column index was specified.
+
+
+
+
+ Multiplies two specified matrices.
+
+
+ Matrix to multiply.
+ Matrix to multiply by.
+
+ Return new matrix, which the result of multiplication of the two specified matrices.
+
+
+
+
+ Multiplies two specified matrices.
+
+
+ Matrix to multiply.
+ Matrix to multiply by.
+
+ Return new matrix, which the result of multiplication of the two specified matrices.
+
+
+
+
+ Adds corresponding components of two matrices.
+
+
+ The matrix to add to.
+ The matrix to add to the first matrix.
+
+ Returns a matrix which components are equal to sum of corresponding
+ components of the two specified matrices.
+
+
+
+
+ Adds corresponding components of two matrices.
+
+
+ The matrix to add to.
+ The matrix to add to the first matrix.
+
+ Returns a matrix which components are equal to sum of corresponding
+ components of the two specified matrices.
+
+
+
+
+ Subtracts corresponding components of two matrices.
+
+
+ The matrix to subtract from.
+ The matrix to subtract from the first matrix.
+
+ Returns a matrix which components are equal to difference of corresponding
+ components of the two specified matrices.
+
+
+
+
+ Subtracts corresponding components of two matrices.
+
+
+ The matrix to subtract from.
+ The matrix to subtract from the first matrix.
+
+ Returns a matrix which components are equal to difference of corresponding
+ components of the two specified matrices.
+
+
+
+
+ Multiplies specified matrix by the specified vector.
+
+
+ Matrix to multiply by vector.
+ Vector to multiply matrix by.
+
+ Returns new vector which is the result of multiplication of the specified matrix
+ by the specified vector.
+
+
+
+
+ Multiplies specified matrix by the specified vector.
+
+
+ Matrix to multiply by vector.
+ Vector to multiply matrix by.
+
+ Returns new vector which is the result of multiplication of the specified matrix
+ by the specified vector.
+
+
+
+
+ Multiplies matrix by the specified factor.
+
+
+ Matrix to multiply.
+ Factor to multiple the specified matrix by.
+
+ Returns new matrix with all components equal to corresponding components of the
+ specified matrix multiples by the specified factor.
+
+
+
+
+ Multiplies matrix by the specified factor.
+
+
+ Matrix to multiply.
+ Factor to multiple the specified matrix by.
+
+ Returns new matrix with all components equal to corresponding components of the
+ specified matrix multiples by the specified factor.
+
+
+
+
+ Adds specified value to all components of the specified matrix.
+
+
+ Matrix to add value to.
+ Value to add to all components of the specified matrix.
+
+ Returns new matrix with all components equal to corresponding components of the
+ specified matrix increased by the specified value.
+
+
+
+
+ Adds specified value to all components of the specified matrix.
+
+
+ Matrix to add value to.
+ Value to add to all components of the specified matrix.
+
+ Returns new matrix with all components equal to corresponding components of the
+ specified matrix increased by the specified value.
+
+
+
+
+ Tests whether two specified matrices are equal.
+
+
+ The left-hand matrix.
+ The right-hand matrix.
+
+ Returns if the two matrices are equal or otherwise.
+
+
+
+
+ Tests whether two specified matrices are not equal.
+
+
+ The left-hand matrix.
+ The right-hand matrix.
+
+ Returns if the two matrices are not equal or otherwise.
+
+
+
+
+ Tests whether the matrix equals to the specified one.
+
+
+ The matrix to test equality with.
+
+ Returns if the two matrices are equal or otherwise.
+
+
+
+
+ Tests whether the matrix equals to the specified object.
+
+
+ The object to test equality with.
+
+ Returns if the matrix equals to the specified object or otherwise.
+
+
+
+
+ Returns the hashcode for this instance.
+
+
+ A 32-bit signed integer hash code.
+
+
+
+
+ Transpose the matrix, AT.
+
+
+ Return a matrix which equals to transposition of this matrix.
+
+
+
+
+ Multiply the matrix by its transposition, A*AT.
+
+
+ Returns a matrix which is the result of multiplying this matrix by its transposition.
+
+
+
+
+ Multiply transposition of this matrix by itself, AT*A.
+
+
+ Returns a matrix which is the result of multiplying this matrix's transposition by itself.
+
+
+
+
+ Calculate adjugate of the matrix, adj(A).
+
+
+ Returns adjugate of the matrix.
+
+
+
+
+ Calculate inverse of the matrix, A-1.
+
+
+ Returns inverse of the matrix.
+
+ Cannot calculate inverse of the matrix since it is singular.
+
+
+
+
+ Calculate pseudo inverse of the matrix, A+.
+
+
+ Returns pseudo inverse of the matrix.
+
+ The pseudo inverse of the matrix is calculate through its
+ as V*E+*UT.
+
+
+
+
+ Calculate Singular Value Decomposition (SVD) of the matrix, such as A=U*E*VT.
+
+
+ Output parameter which gets 3x3 U matrix.
+ Output parameter which gets diagonal elements of the E matrix.
+ Output parameter which gets 3x3 V matrix.
+
+ Having components U, E and V the source matrix can be reproduced using below code:
+
+ Matrix3x3 source = u * Matrix3x3.Diagonal( e ) * v.Transpose( );
+
+
+
+
+
+
+ Provides an identity matrix with all diagonal elements set to 1.
+
+
+
+
+ Calculates determinant of the matrix.
+
+
+
+
+ Perlin noise function.
+
+
+ The class implements 1-D and 2-D Perlin noise functions, which represent
+ sum of several smooth noise functions with different frequency and amplitude. The description
+ of Perlin noise function and its calculation may be found on
+ Hugo Elias's page.
+
+
+ The number of noise functions, which comprise the resulting Perlin noise function, is
+ set by property. Amplitude and frequency values for each octave
+ start from values, which are set by and
+ properties.
+
+ Sample usage (clouds effect):
+
+ // create Perlin noise function
+ PerlinNoise noise = new PerlinNoise( 8, 0.5, 1.0 / 32 );
+ // generate clouds effect
+ float[,] texture = new float[height, width];
+
+ for ( int y = 0; y < height; y++ )
+ {
+ for ( int x = 0; x < width; x++ )
+ {
+ texture[y, x] =
+ Math.Max( 0.0f, Math.Min( 1.0f,
+ (float) noise.Function2D( x, y ) * 0.5f + 0.5f
+ ) );
+ }
+ }
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Number of octaves (see property).
+ Persistence value (see property).
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Number of octaves (see property).
+ Persistence value (see property).
+ Initial frequency (see property).
+ Initial amplitude (see property).
+
+
+
+
+ 1-D Perlin noise function.
+
+
+ x value.
+
+ Returns function's value at point .
+
+
+
+
+ 2-D Perlin noise function.
+
+
+ x value.
+ y value.
+
+ Returns function's value at point (, ).
+
+
+
+
+ Ordinary noise function
+
+
+
+
+ Smoothed noise.
+
+
+
+
+ Cosine interpolation.
+
+
+
+
+ Initial frequency.
+
+
+ The property sets initial frequency of the first octave. Frequencies for
+ next octaves are calculated using the next equation:
+ frequencyi = * 2i,
+ where i = [0, ).
+
+
+ Default value is set to 1.
+
+
+
+
+
+ Initial amplitude.
+
+
+ The property sets initial amplitude of the first octave. Amplitudes for
+ next octaves are calculated using the next equation:
+ amplitudei = * i,
+ where i = [0, ).
+
+
+ Default value is set to 1.
+
+
+
+
+
+ Persistence value.
+
+
+ The property sets so called persistence value, which controls the way
+ how amplitude is calculated for each octave comprising
+ the Perlin noise function.
+
+ Default value is set to 0.65.
+
+
+
+
+
+ Number of octaves, [1, 32].
+
+
+ The property sets the number of noise functions, which sum up the resulting
+ Perlin noise function.
+
+ Default value is set to 4.
+
+
+
+
+
+ Cosine distance metric.
+
+
+ This class represents the cosine distance metric (1 - cosine similarity)
+ .
+
+
+ Sample usage:
+
+ // instantiate new distance class
+ CosineDistance dist = new CosineDistance();
+ // create two vectors for inputs
+ double[] p = new double[] { 2.5, 3.5, 3.0, 3.5, 2.5, 3.0 };
+ double[] q = new double[] { 3.0, 3.5, 1.5, 5.0, 3.5, 3.0 };
+ // get distance between the two vectors
+ double distance = dist.GetDistance( p, q );
+
+
+
+
+
+
+ Returns distance between two N-dimensional double vectors.
+
+
+ 1st point vector.
+ 2nd point vector.
+
+ Returns Cosine distance between two supplied vectors.
+
+ Thrown if the two vectors are of different dimensions (if specified
+ array have different length).
+
+
+
+
+ Complex number wrapper class.
+
+
+ The class encapsulates complex number and provides
+ set of different operators to manipulate it, lake adding, subtractio,
+ multiplication, etc.
+
+ Sample usage:
+
+ // define two complex numbers
+ Complex c1 = new Complex( 3, 9 );
+ Complex c2 = new Complex( 8, 3 );
+ // sum
+ Complex s1 = Complex.Add( c1, c2 );
+ Complex s2 = c1 + c2;
+ Complex s3 = c1 + 5;
+ // difference
+ Complex d1 = Complex.Subtract( c1, c2 );
+ Complex d2 = c1 - c2;
+ Complex d3 = c1 - 2;
+
+
+
+
+
+
+ Real part of the complex number.
+
+
+
+
+ Imaginary part of the complex number.
+
+
+
+
+ A double-precision complex number that represents zero.
+
+
+
+
+ A double-precision complex number that represents one.
+
+
+
+
+ A double-precision complex number that represents the squere root of (-1).
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Real part.
+ Imaginary part.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Source complex number.
+
+
+
+
+ Adds two complex numbers.
+
+
+ A instance.
+ A instance.
+
+ Returns new instance containing the sum of specified
+ complex numbers.
+
+
+
+
+ Adds scalar value to a complex number.
+
+
+ A instance.
+ A scalar value.
+
+ Returns new instance containing the sum of specified
+ complex number and scalar value.
+
+
+
+
+ Adds two complex numbers and puts the result into the third complex number.
+
+
+ A instance.
+ A instance.
+ A instance to hold the result.
+
+
+
+
+ Adds scalar value to a complex number and puts the result into another complex number.
+
+
+ A instance.
+ A scalar value.
+ A instance to hold the result.
+
+
+
+
+ Subtracts one complex number from another.
+
+
+ A instance to subtract from.
+ A instance to be subtracted.
+
+ Returns new instance containing the subtraction result (a - b).
+
+
+
+
+ Subtracts a scalar from a complex number.
+
+
+ A instance to subtract from.
+ A scalar value to be subtracted.
+
+ Returns new instance containing the subtraction result (a - s).
+
+
+
+
+ Subtracts a complex number from a scalar value.
+
+
+ A scalar value to subtract from.
+ A instance to be subtracted.
+
+ Returns new instance containing the subtraction result (s - a).
+
+
+
+
+ Subtracts one complex number from another and puts the result in the third complex number.
+
+
+ A instance to subtract from.
+ A instance to be subtracted.
+ A instance to hold the result.
+
+
+
+
+ Subtracts a scalar value from a complex number and puts the result into another complex number.
+
+
+ A instance to subtract from.
+ A scalar value to be subtracted.
+ A instance to hold the result.
+
+
+
+
+ Subtracts a complex number from a scalar value and puts the result into another complex number.
+
+
+ A scalar value to subtract from.
+ A instance to be subtracted.
+ A instance to hold the result.
+
+
+
+
+ Multiplies two complex numbers.
+
+
+ A instance.
+ A instance.
+
+ Returns new instance containing the result of multiplication.
+
+
+
+
+ Multiplies a complex number by a scalar value.
+
+
+ A instance.
+ A scalar value.
+
+ Returns new instance containing the result of multiplication.
+
+
+
+
+ Multiplies two complex numbers and puts the result in a third complex number.
+
+
+ A instance.
+ A instance.
+ A instance to hold the result.
+
+
+
+
+ Multiplies a complex number by a scalar value and puts the result into another complex number.
+
+
+ A instance.
+ A scalar value.
+ A instance to hold the result.
+
+
+
+
+ Divides one complex number by another complex number.
+
+
+ A instance.
+ A instance.
+
+ Returns new instance containing the result.
+
+ Can not divide by zero.
+
+
+
+
+ Divides a complex number by a scalar value.
+
+
+ A instance.
+ A scalar value.
+
+ Returns new instance containing the result.
+
+ Can not divide by zero.
+
+
+
+
+ Divides a scalar value by a complex number.
+
+
+ A scalar value.
+ A instance.
+
+ Returns new instance containing the result.
+
+ Can not divide by zero.
+
+
+
+
+ Divides one complex number by another complex number and puts the result in a third complex number.
+
+
+ A instance.
+ A instance.
+ A instance to hold the result.
+
+ Can not divide by zero.
+
+
+
+
+ Divides a complex number by a scalar value and puts the result into another complex number.
+
+
+ A instance.
+ A scalar value.
+ A instance to hold the result.
+
+ Can not divide by zero.
+
+
+
+
+ Divides a scalar value by a complex number and puts the result into another complex number.
+
+
+ A instance.
+ A scalar value.
+ A instance to hold the result.
+
+ Can not divide by zero.
+
+
+
+
+ Negates a complex number.
+
+
+ A instance.
+
+ Returns new instance containing the negated values.
+
+
+
+
+ Tests whether two complex numbers are approximately equal using default tolerance value.
+
+
+ A instance.
+ A instance.
+
+ Return if the two vectors are approximately equal or otherwise.
+
+ The default tolerance value, which is used for the test, equals to 8.8817841970012523233891E-16.
+
+
+
+
+ Tests whether two complex numbers are approximately equal given a tolerance value.
+
+
+ A instance.
+ A instance.
+ The tolerance value used to test approximate equality.
+
+ The default tolerance value, which is used for the test, equals to 8.8817841970012523233891E-16.
+
+
+
+
+ Converts the specified string to its equivalent.
+
+
+ A string representation of a complex number.
+
+ Returns new instance that represents the complex number
+ specified by the parameter.
+
+ String representation of the complex number is not correctly formatted.
+
+
+
+
+ Try to convert the specified string to its equivalent.
+
+
+ A string representation of a complex number.
+
+ instance to output the result to.
+
+ Returns boolean value that indicates if the parse was successful or not.
+
+
+
+
+ Calculates square root of a complex number.
+
+
+ A instance.
+
+ Returns new instance containing the square root of the specified
+ complex number.
+
+
+
+
+ Calculates natural (base e) logarithm of a complex number.
+
+
+ A instance.
+
+ Returns new instance containing the natural logarithm of the specified
+ complex number.
+
+
+
+
+ Calculates exponent (e raised to the specified power) of a complex number.
+
+
+ A instance.
+
+ Returns new instance containing the exponent of the specified
+ complex number.
+
+
+
+
+ Calculates Sine value of the complex number.
+
+
+ A instance.
+
+ Returns new instance containing the Sine value of the specified
+ complex number.
+
+
+
+
+ Calculates Cosine value of the complex number.
+
+
+ A instance.
+
+ Returns new instance containing the Cosine value of the specified
+ complex number.
+
+
+
+
+ Calculates Tangent value of the complex number.
+
+
+ A instance.
+
+ Returns new instance containing the Tangent value of the specified
+ complex number.
+
+
+
+
+ Returns the hashcode for this instance.
+
+
+ A 32-bit signed integer hash code.
+
+
+
+ Returns a value indicating whether this instance is equal to the specified object.
+
+
+ An object to compare to this instance.
+
+ Returns if is a and has the same values as this instance or otherwise.
+
+
+
+
+ Returns a string representation of this object.
+
+
+ A string representation of this object.
+
+
+
+
+ Tests whether two specified complex numbers are equal.
+
+
+ The left-hand complex number.
+ The right-hand complex number.
+
+ Returns if the two complex numbers are equal or otherwise.
+
+
+
+
+ Tests whether two specified complex numbers are not equal.
+
+
+ The left-hand complex number.
+ The right-hand complex number.
+
+ Returns if the two complex numbers are not equal or otherwise.
+
+
+
+
+ Negates the complex number.
+
+
+ A instance.
+
+ Returns new instance containing the negated values.
+
+
+
+
+ Adds two complex numbers.
+
+
+ A instance.
+ A instance.
+
+ Returns new instance containing the sum.
+
+
+
+
+ Adds a complex number and a scalar value.
+
+
+ A instance.
+ A scalar value.
+
+ Returns new instance containing the sum.
+
+
+
+
+ Adds a complex number and a scalar value.
+
+
+ A instance.
+ A scalar value.
+
+ Returns new instance containing the sum.
+
+
+
+
+ Subtracts one complex number from another complex number.
+
+
+ A instance.
+ A instance.
+
+ Returns new instance containing the difference.
+
+
+
+
+ Subtracts a scalar value from a complex number.
+
+
+ A instance.
+ A scalar value.
+
+ Returns new instance containing the difference.
+
+
+
+
+ Subtracts a complex number from a scalar value.
+
+
+ A scalar value.
+ A instance.
+
+ Returns new instance containing the difference.
+
+
+
+
+ Multiplies two complex numbers.
+
+
+ A instance.
+ A instance.
+
+ Returns new instance containing the result of multiplication.
+
+
+
+
+ Multiplies a complex number by a scalar value.
+
+
+ A scalar value.
+ A instance.
+
+ Returns new instance containing the result of multiplication.
+
+
+
+
+ Multiplies a complex number by a scalar value.
+
+
+ A instance.
+ A scalar value.
+
+ Returns new instance containing the result of multiplication.
+
+
+
+
+ Divides one complex number by another complex number.
+
+
+ A instance.
+ A instance.
+
+ A new Complex instance containing the result.
+ Returns new instance containing the result of division.
+
+
+
+
+ Divides a complex number by a scalar value.
+
+
+ A instance.
+ A scalar value.
+
+ Returns new instance containing the result of division.
+
+
+
+
+ Divides a scalar value by a complex number.
+
+
+ A instance.
+ A scalar value.
+
+ Returns new instance containing the result of division.
+
+
+
+
+ Converts from a single-precision real number to a complex number.
+
+
+ Single-precision real number to convert to complex number.
+
+ Returns new instance containing complex number with
+ real part initialized to the specified value.
+
+
+
+
+ Converts from a double-precision real number to a complex number.
+
+
+ Double-precision real number to convert to complex number.
+
+ Returns new instance containing complex number with
+ real part initialized to the specified value.
+
+
+
+
+ Creates an exact copy of this object.
+
+
+ Returns clone of the complex number.
+
+
+
+
+ Creates an exact copy of this object.
+
+
+ Returns clone of the complex number.
+
+
+
+
+ Populates a with the data needed to serialize the target object.
+
+
+ The to populate with data.
+ The destination (see ) for this serialization.
+
+
+
+
+ Magnitude value of the complex number.
+
+
+ Magnitude of the complex number, which equals to Sqrt( Re * Re + Im * Im ).
+
+
+
+
+ Phase value of the complex number.
+
+
+ Phase of the complex number, which equals to Atan( Im / Re ).
+
+
+
+
+ Squared magnitude value of the complex number.
+
+
+
+
+ Hamming distance metric.
+
+
+ This class represents the
+ Hamming distance metric.
+
+ Sample usage:
+
+ // instantiate new distance class
+ HammingDistance dist = new HammingDistance( );
+ // create two vectors for inputs
+ double[] p = new double[] { 2.5, 3.5, 3.0, 3.5, 2.5, 3.0 };
+ double[] q = new double[] { 3.0, 3.5, 1.5, 5.0, 3.5, 3.0 };
+ // get distance between the two vectors
+ double distance = dist.GetDistance( p, q );
+
+
+
+
+
+
+ Returns distance between two N-dimensional double vectors.
+
+
+ 1st point vector.
+ 2nd point vector.
+
+ Returns Hamming distance between two supplied vectors.
+
+ Thrown if the two vectors are of different dimensions (if specified
+ array have different length).
+
+
+
+
+ Euclidean similarity metric.
+
+
+ This class represents the
+ Euclidean Similarity metric,
+ which is calculated as 1.0 / ( 1.0 + EuclideanDistance ).
+
+ Sample usage:
+
+ // instantiate new similarity class
+ EuclideanSimilarity sim = new EuclideanSimilarity( );
+ // create two vectors for inputs
+ double[] p = new double[] { 2.5, 3.5, 3.0, 3.5, 2.5, 3.0 };
+ double[] q = new double[] { 3.0, 3.5, 1.5, 5.0, 3.5, 3.0 };
+ // get simirarity between the two vectors
+ double similarityScore = sim.GetSimilarityScore( p, q );
+
+
+
+
+
+
+ Returns similarity score for two N-dimensional double vectors.
+
+
+ 1st point vector.
+ 2nd point vector.
+
+ Returns Euclidean similarity between two supplied vectors.
+
+ Thrown if the two vectors are of different dimensions (if specified
+ array have different length).
+
+
+
+
diff --git a/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.DirectShow.dll b/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.DirectShow.dll
new file mode 100644
index 0000000..e3f806f
Binary files /dev/null and b/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.DirectShow.dll differ
diff --git a/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.DirectShow.xml b/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.DirectShow.xml
new file mode 100644
index 0000000..5d62c10
--- /dev/null
+++ b/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.DirectShow.xml
@@ -0,0 +1,4108 @@
+
+
+
+ AForge.Video.DirectShow
+
+
+
+
+ A strongly-typed resource class, for looking up localized strings, etc.
+
+
+
+
+ Returns the cached ResourceManager instance used by this class.
+
+
+
+
+ Overrides the current thread's CurrentUICulture property for all
+ resource lookups using this strongly typed resource class.
+
+
+
+
+ This interface is exposed by all input and output pins of DirectShow filters.
+
+
+
+
+
+ Connects the pin to another pin.
+
+
+ Other pin to connect to.
+ Type to use for the connections (optional).
+
+ Return's HRESULT error code.
+
+
+
+
+ Makes a connection to this pin and is called by a connecting pin.
+
+
+ Connecting pin.
+ Media type of the samples to be streamed.
+
+ Return's HRESULT error code.
+
+
+
+
+ Breaks the current pin connection.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Returns a pointer to the connecting pin.
+
+
+ Receives IPin interface of connected pin (if any).
+
+ Return's HRESULT error code.
+
+
+
+
+ Returns the media type of this pin's connection.
+
+
+ Pointer to an structure. If the pin is connected,
+ the media type is returned. Otherwise, the structure is initialized to a default state in which
+ all elements are 0, with the exception of lSampleSize, which is set to 1, and
+ FixedSizeSamples, which is set to true.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves information about this pin (for example, the name, owning filter, and direction).
+
+
+ structure that receives the pin information.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the direction for this pin.
+
+
+ Receives direction of the pin.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves an identifier for the pin.
+
+
+ Pin identifier.
+
+ Return's HRESULT error code.
+
+
+
+
+ Queries whether a given media type is acceptable by the pin.
+
+
+ structure that specifies the media type.
+
+ Return's HRESULT error code.
+
+
+
+
+ Provides an enumerator for this pin's preferred media types.
+
+
+ Address of a variable that receives a pointer to the IEnumMediaTypes interface.
+
+ Return's HRESULT error code.
+
+
+
+
+ Provides an array of the pins to which this pin internally connects.
+
+
+ Address of an array of IPin pointers.
+ On input, specifies the size of the array. When the method returns,
+ the value is set to the number of pointers returned in the array.
+
+ Return's HRESULT error code.
+
+
+
+
+ Notifies the pin that no additional data is expected.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Begins a flush operation.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Ends a flush operation.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Specifies that samples following this call are grouped as a segment with a given start time, stop time, and rate.
+
+
+ Start time of the segment, relative to the original source, in 100-nanosecond units.
+ End time of the segment, relative to the original source, in 100-nanosecond units.
+ Rate at which this segment should be processed, as a percentage of the original rate.
+
+ Return's HRESULT error code.
+
+
+
+
+ The interface provides methods for building a filter graph. An application can use it to add filters to
+ the graph, connect or disconnect filters, remove filters, and perform other basic operations.
+
+
+
+
+
+ Adds a filter to the graph and gives it a name.
+
+
+ Filter to add to the graph.
+ Name of the filter.
+
+ Return's HRESULT error code.
+
+
+
+
+ Removes a filter from the graph.
+
+
+ Filter to be removed from the graph.
+
+ Return's HRESULT error code.
+
+
+
+
+ Provides an enumerator for all filters in the graph.
+
+
+ Filter enumerator.
+
+ Return's HRESULT error code.
+
+
+
+
+ Finds a filter that was added with a specified name.
+
+
+ Name of filter to search for.
+ Interface of found filter.
+
+ Return's HRESULT error code.
+
+
+
+
+ Connects two pins directly (without intervening filters).
+
+
+ Output pin.
+ Input pin.
+ Media type to use for the connection.
+
+ Return's HRESULT error code.
+
+
+
+
+ Breaks the existing pin connection and reconnects it to the same pin.
+
+
+ Pin to disconnect and reconnect.
+
+ Return's HRESULT error code.
+
+
+
+
+ Disconnects a specified pin.
+
+
+ Pin to disconnect.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the reference clock to the default clock.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ The interface is exposed by source filters to set the file name and media type of the media file that they are to render.
+
+
+
+
+
+ Loads the source filter with the file.
+
+
+ The name of the file to open.
+ Media type of the file. This can be null.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the current file.
+
+
+ Name of media file.
+ Receives media type.
+
+ Return's HRESULT error code.
+
+
+
+
+ The interface controls certain video capture operations such as enumerating available
+ frame rates and image orientation.
+
+
+
+
+
+ Retrieves the capabilities of the underlying hardware.
+
+
+ Pin to query capabilities from.
+ Get capabilities of the specified pin.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the video control mode of operation.
+
+
+ The pin to set the video control mode on.
+ Value specifying a combination of the flags to set the video control mode.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the video control mode of operation.
+
+
+ The pin to retrieve the video control mode from.
+ Gets combination of flags, which specify the video control mode.
+
+ Return's HRESULT error code.
+
+
+
+
+ The method retrieves the actual frame rate, expressed as a frame duration in 100-nanosecond units.
+ USB (Universal Serial Bus) and IEEE 1394 cameras may provide lower frame rates than requested
+ because of bandwidth availability. This is only available during video streaming.
+
+
+ The pin to retrieve the frame rate from.
+ Gets frame rate in frame duration in 100-nanosecond units.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the maximum frame rate currently available based on bus bandwidth usage for connections
+ such as USB and IEEE 1394 camera devices where the maximum frame rate can be limited by bandwidth
+ availability.
+
+
+ The pin to retrieve the maximum frame rate from.
+ Index of the format to query for maximum frame rate. This index corresponds
+ to the order in which formats are enumerated by .
+ Frame image size (width and height) in pixels.
+ Gets maximum available frame rate. The frame rate is expressed as frame duration in 100-nanosecond units.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves a list of available frame rates.
+
+
+ The pin to retrieve the maximum frame rate from.
+ Index of the format to query for maximum frame rate. This index corresponds
+ to the order in which formats are enumerated by .
+ Frame image size (width and height) in pixels.
+ Number of elements in the list of frame rates.
+ Array of frame rates in 100-nanosecond units.
+
+ Return's HRESULT error code.
+
+
+
+
+ DirectShow filter categories.
+
+
+
+
+ Audio input device category.
+
+
+ Equals to CLSID_AudioInputDeviceCategory.
+
+
+
+
+ Video input device category.
+
+
+ Equals to CLSID_VideoInputDeviceCategory.
+
+
+
+
+ Video compressor category.
+
+
+ Equals to CLSID_VideoCompressorCategory.
+
+
+
+
+ Audio compressor category
+
+
+ Equals to CLSID_AudioCompressorCategory.
+
+
+
+
+ Provides the CLSID of an object that can be stored persistently in the system. Allows the object to specify which object
+ handler to use in the client process, as it is used in the default implementation of marshaling.
+
+
+
+
+ Retrieves the class identifier (CLSID) of the object.
+
+
+
+
+
+
+ The IAMCameraControl interface controls camera settings such as zoom, pan, aperture adjustment,
+ or shutter speed. To obtain this interface, query the filter that controls the camera.
+
+
+
+
+ Gets the range and default value of a specified camera property.
+
+
+ Specifies the property to query.
+ Receives the minimum value of the property.
+ Receives the maximum value of the property.
+ Receives the step size for the property.
+ Receives the default value of the property.
+ Receives a member of the CameraControlFlags enumeration, indicating whether the property is controlled automatically or manually.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets a specified property on the camera.
+
+
+ Specifies the property to set.
+ Specifies the new value of the property.
+ Specifies the desired control setting, as a member of the CameraControlFlags enumeration.
+
+ Return's HRESULT error code.
+
+
+
+
+ Gets the current setting of a camera property.
+
+
+ Specifies the property to retrieve.
+ Receives the value of the property.
+ Receives a member of the CameraControlFlags enumeration.
+ The returned value indicates whether the setting is controlled manually or automatically.
+
+ Return's HRESULT error code.
+
+
+
+
+ Capabilities of video device such as frame size and frame rate.
+
+
+
+
+ Frame size supported by video device.
+
+
+
+
+ Average frame rate of video device for corresponding frame size.
+
+
+
+
+ Maximum frame rate of video device for corresponding frame size.
+
+
+
+
+ Number of bits per pixel provided by the camera.
+
+
+
+
+ Check if the video capability equals to the specified object.
+
+
+ Object to compare with.
+
+ Returns true if both are equal are equal or false otherwise.
+
+
+
+
+ Check if two video capabilities are equal.
+
+
+ Second video capability to compare with.
+
+ Returns true if both video capabilities are equal or false otherwise.
+
+
+
+
+ Get hash code of the object.
+
+
+ Returns hash code ot the object
+
+
+
+ Equality operator.
+
+
+ First object to check.
+ Seconds object to check.
+
+ Return true if both objects are equal or false otherwise.
+
+
+
+ Inequality operator.
+
+
+ First object to check.
+ Seconds object to check.
+
+ Return true if both objects are not equal or false otherwise.
+
+
+
+ Frame rate supported by video device for corresponding frame size.
+
+
+ This field is depricated - should not be used.
+ Its value equals to .
+
+
+
+
+
+ Specifies the physical type of pin (audio or video).
+
+
+
+
+ Default value of connection type. Physically it does not exist, but just either to specify that
+ connection type should not be changed (input) or was not determined (output).
+
+
+
+
+ Specifies a tuner pin for video.
+
+
+
+
+ Specifies a composite pin for video.
+
+
+
+
+ Specifies an S-Video (Y/C video) pin.
+
+
+
+
+ Specifies an RGB pin for video.
+
+
+
+
+ Specifies a YRYBY (Y, R–Y, B–Y) pin for video.
+
+
+
+
+ Specifies a serial digital pin for video.
+
+
+
+
+ Specifies a parallel digital pin for video.
+
+
+
+
+ Specifies a SCSI (Small Computer System Interface) pin for video.
+
+
+
+
+ Specifies an AUX (auxiliary) pin for video.
+
+
+
+
+ Specifies an IEEE 1394 pin for video.
+
+
+
+
+ Specifies a USB (Universal Serial Bus) pin for video.
+
+
+
+
+ Specifies a video decoder pin.
+
+
+
+
+ Specifies a video encoder pin.
+
+
+
+
+ Specifies a SCART (Peritel) pin for video.
+
+
+
+
+ Not used.
+
+
+
+
+ Specifies a tuner pin for audio.
+
+
+
+
+ Specifies a line pin for audio.
+
+
+
+
+ Specifies a microphone pin.
+
+
+
+
+ Specifies an AES/EBU (Audio Engineering Society/European Broadcast Union) digital pin for audio.
+
+
+
+
+ Specifies an S/PDIF (Sony/Philips Digital Interface Format) digital pin for audio.
+
+
+
+
+ Specifies a SCSI pin for audio.
+
+
+
+
+ Specifies an AUX pin for audio.
+
+
+
+
+ Specifies an IEEE 1394 pin for audio.
+
+
+
+
+ Specifies a USB pin for audio.
+
+
+
+
+ Specifies an audio decoder pin.
+
+
+
+
+ This enumeration indicates a pin's direction.
+
+
+
+
+
+ Input pin.
+
+
+
+
+ Output pin.
+
+
+
+
+ The structure describes the format of a media sample.
+
+
+
+
+
+ Globally unique identifier (GUID) that specifies the major type of the media sample.
+
+
+
+
+ GUID that specifies the subtype of the media sample.
+
+
+
+
+ If true, samples are of a fixed size.
+
+
+
+
+ If true, samples are compressed using temporal (interframe) compression.
+
+
+
+
+ Size of the sample in bytes. For compressed data, the value can be zero.
+
+
+
+
+ GUID that specifies the structure used for the format block.
+
+
+
+
+ Not used.
+
+
+
+
+ Size of the format block, in bytes.
+
+
+
+
+ Pointer to the format block.
+
+
+
+
+ Destroys the instance of the class.
+
+
+
+
+
+ Dispose the object.
+
+
+
+
+
+ Dispose the object
+
+
+ Indicates if disposing was initiated manually.
+
+
+
+
+ The structure contains information about a pin.
+
+
+
+
+
+ Owning filter.
+
+
+
+
+ Direction of the pin.
+
+
+
+
+ Name of the pin.
+
+
+
+
+ Filter's name.
+
+
+
+
+ Owning graph.
+
+
+
+
+ The structure describes the bitmap and color information for a video image.
+
+
+
+
+
+ structure that specifies the source video window.
+
+
+
+
+ structure that specifies the destination video window.
+
+
+
+
+ Approximate data rate of the video stream, in bits per second.
+
+
+
+
+ Data error rate, in bit errors per second.
+
+
+
+
+ The desired average display time of the video frames, in 100-nanosecond units.
+
+
+
+
+ structure that contains color and dimension information for the video image bitmap.
+
+
+
+
+ The structure describes the bitmap and color information for a video image (v2).
+
+
+
+
+
+ structure that specifies the source video window.
+
+
+
+
+ structure that specifies the destination video window.
+
+
+
+
+ Approximate data rate of the video stream, in bits per second.
+
+
+
+
+ Data error rate, in bit errors per second.
+
+
+
+
+ The desired average display time of the video frames, in 100-nanosecond units.
+
+
+
+
+ Flags that specify how the video is interlaced.
+
+
+
+
+ Flag set to indicate that the duplication of the stream should be restricted.
+
+
+
+
+ The X dimension of picture aspect ratio.
+
+
+
+
+ The Y dimension of picture aspect ratio.
+
+
+
+
+ Reserved for future use.
+
+
+
+
+ Reserved for future use.
+
+
+
+
+ structure that contains color and dimension information for the video image bitmap.
+
+
+
+
+ The structure contains information about the dimensions and color format of a device-independent bitmap (DIB).
+
+
+
+
+
+ Specifies the number of bytes required by the structure.
+
+
+
+
+ Specifies the width of the bitmap.
+
+
+
+
+ Specifies the height of the bitmap, in pixels.
+
+
+
+
+ Specifies the number of planes for the target device. This value must be set to 1.
+
+
+
+
+ Specifies the number of bits per pixel.
+
+
+
+
+ If the bitmap is compressed, this member is a FOURCC the specifies the compression.
+
+
+
+
+ Specifies the size, in bytes, of the image.
+
+
+
+
+ Specifies the horizontal resolution, in pixels per meter, of the target device for the bitmap.
+
+
+
+
+ Specifies the vertical resolution, in pixels per meter, of the target device for the bitmap.
+
+
+
+
+ Specifies the number of color indices in the color table that are actually used by the bitmap.
+
+
+
+
+ Specifies the number of color indices that are considered important for displaying the bitmap.
+
+
+
+
+ The structure defines the coordinates of the upper-left and lower-right corners of a rectangle.
+
+
+
+
+
+ Specifies the x-coordinate of the upper-left corner of the rectangle.
+
+
+
+
+ Specifies the y-coordinate of the upper-left corner of the rectangle.
+
+
+
+
+ Specifies the x-coordinate of the lower-right corner of the rectangle.
+
+
+
+
+ Specifies the y-coordinate of the lower-right corner of the rectangle.
+
+
+
+
+ The CAUUID structure is a Counted Array of UUID or GUID types.
+
+
+
+
+
+ Size of the array pointed to by pElems.
+
+
+
+
+ Pointer to an array of UUID values, each of which specifies UUID.
+
+
+
+
+ Performs manual marshaling of pElems to retrieve an array of Guid objects.
+
+
+ A managed representation of pElems.
+
+
+
+
+ Enumeration of DirectShow event codes.
+
+
+
+
+ Specifies a filter's state or the state of the filter graph.
+
+
+
+
+ Stopped. The filter is not processing data.
+
+
+
+
+ Paused. The filter is processing data, but not rendering it.
+
+
+
+
+ Running. The filter is processing and rendering data.
+
+
+
+
+ The interface is exposed by the Sample Grabber Filter. It enables an application to retrieve
+ individual media samples as they move through the filter graph.
+
+
+
+
+
+ Specifies whether the filter should stop the graph after receiving one sample.
+
+
+ Boolean value specifying whether the filter should stop the graph after receiving one sample.
+
+ Return's HRESULT error code.
+
+
+
+
+ Specifies the media type for the connection on the Sample Grabber's input pin.
+
+
+ Specifies the required media type.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the media type for the connection on the Sample Grabber's input pin.
+
+
+ structure, which receives media type.
+
+ Return's HRESULT error code.
+
+
+
+
+ Specifies whether to copy sample data into a buffer as it goes through the filter.
+
+
+ Boolean value specifying whether to buffer sample data.
+ If true, the filter copies sample data into an internal buffer.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves a copy of the sample that the filter received most recently.
+
+
+ Pointer to the size of the buffer. If pBuffer is NULL, this parameter receives the required size.
+ Pointer to a buffer to receive a copy of the sample, or NULL.
+
+ Return's HRESULT error code.
+
+
+
+
+ Not currently implemented.
+
+
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Specifies a callback method to call on incoming samples.
+
+
+ interface containing the callback method, or NULL to cancel the callback.
+ Index specifying the callback method.
+
+ Return's HRESULT error code.
+
+
+
+
+ This interface builds capture graphs and other custom filter graphs.
+
+
+
+
+
+ Specify filter graph for the capture graph builder to use.
+
+
+ Filter graph's interface.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieve the filter graph that the builder is using.
+
+
+ Filter graph's interface.
+
+ Return's HRESULT error code.
+
+
+
+
+ Create file writing section of the filter graph.
+
+
+ GUID that represents either the media subtype of the output or the
+ class identifier (CLSID) of a multiplexer filter or file writer filter.
+ Output file name.
+ Receives the multiplexer's interface.
+ Receives the file writer's IFileSinkFilter interface. Can be NULL.
+
+ Return's HRESULT error code.
+
+
+
+
+ Searche the graph for a specified interface, starting from a specified filter.
+
+
+ GUID that specifies the search criteria.
+ GUID that specifies the major media type of an output pin, or NULL.
+ interface of the filter. The method begins searching from this filter.
+ Interface identifier (IID) of the interface to locate.
+ Receives found interface.
+
+ Return's HRESULT error code.
+
+
+
+
+ Connect an output pin on a source filter to a rendering filter, optionally through a compression filter.
+
+
+ Pin category.
+ Major-type GUID that specifies the media type of the output pin.
+ Starting filter for the connection.
+ Interface of an intermediate filter, such as a compression filter. Can be NULL.
+ Sink filter, such as a renderer or mux filter.
+
+ Return's HRESULT error code.
+
+
+
+
+ Set the start and stop times for one or more streams of captured data.
+
+
+ Pin category.
+ Major-type GUID that specifies the media type.
+ interface that specifies which filter to control.
+ Start time.
+ Stop time.
+ Value that is sent as the second parameter of the
+ EC_STREAM_CONTROL_STARTED event notification.
+ Value that is sent as the second parameter of the
+ EC_STREAM_CONTROL_STOPPED event notification.
+
+ Return's HRESULT error code.
+
+
+
+
+ Preallocate a capture file to a specified size.
+
+
+ File name to create or resize.
+ Size of the file to allocate, in bytes.
+
+ Return's HRESULT error code.
+
+
+
+
+ Copy the valid media data from a capture file.
+
+
+ Old file name.
+ New file name.
+ Boolean value that specifies whether pressing the ESC key cancels the copy operation.
+ IAMCopyCaptureFileProgress interface to display progress information, or NULL.
+
+ Return's HRESULT error code.
+
+
+
+
+
+
+
+ Interface on a filter, or to an interface on a pin.
+ Pin direction (input or output).
+ Pin category.
+ Media type.
+ Boolean value that specifies whether the pin must be unconnected.
+ Zero-based index of the pin to retrieve, from the set of matching pins.
+ Interface of the matching pin.
+
+ Return's HRESULT error code.
+
+
+
+
+ This interface provides methods that enable an application to build a filter graph.
+
+
+
+
+
+ Adds a filter to the graph and gives it a name.
+
+
+ Filter to add to the graph.
+ Name of the filter.
+
+ Return's HRESULT error code.
+
+
+
+
+ Removes a filter from the graph.
+
+
+ Filter to be removed from the graph.
+
+ Return's HRESULT error code.
+
+
+
+
+ Provides an enumerator for all filters in the graph.
+
+
+ Filter enumerator.
+
+ Return's HRESULT error code.
+
+
+
+
+ Finds a filter that was added with a specified name.
+
+
+ Name of filter to search for.
+ Interface of found filter.
+
+ Return's HRESULT error code.
+
+
+
+
+ Connects two pins directly (without intervening filters).
+
+
+ Output pin.
+ Input pin.
+ Media type to use for the connection.
+
+ Return's HRESULT error code.
+
+
+
+
+ Breaks the existing pin connection and reconnects it to the same pin.
+
+
+ Pin to disconnect and reconnect.
+
+ Return's HRESULT error code.
+
+
+
+
+ Disconnects a specified pin.
+
+
+ Pin to disconnect.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the reference clock to the default clock.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Connects two pins. If they will not connect directly, this method connects them with intervening transforms.
+
+
+ Output pin.
+ Input pin.
+
+ Return's HRESULT error code.
+
+
+
+
+ Adds a chain of filters to a specified output pin to render it.
+
+
+ Output pin.
+
+ Return's HRESULT error code.
+
+
+
+
+ Builds a filter graph that renders the specified file.
+
+
+ Specifies a string that contains file name or device moniker.
+ Reserved.
+
+ Return's HRESULT error code.
+
+
+
+
+ Adds a source filter to the filter graph for a specific file.
+
+
+ Specifies the name of the file to load.
+ Specifies a name for the source filter.
+ Variable that receives the interface of the source filter.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the file for logging actions taken when attempting to perform an operation.
+
+
+ Handle to the log file.
+
+ Return's HRESULT error code.
+
+
+
+
+ Requests that the graph builder return as soon as possible from its current task.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Queries whether the current operation should continue.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ The interface provides callback methods for the method.
+
+
+
+
+
+ Callback method that receives a pointer to the media sample.
+
+
+ Starting time of the sample, in seconds.
+ Pointer to the sample's IMediaSample interface.
+
+ Return's HRESULT error code.
+
+
+
+
+ Callback method that receives a pointer to the sample bufferю
+
+
+ Starting time of the sample, in seconds.
+ Pointer to a buffer that contains the sample data.
+ Length of the buffer pointed to by buffer, in bytes
+
+ Return's HRESULT error code.
+
+
+
+
+ Local video device selection form.
+
+
+ The form provides a standard way of selecting local video
+ device (USB web camera, capture board, etc. - anything supporting DirectShow
+ interface), which can be reused across applications. It allows selecting video
+ device, video size and snapshots size (if device supports snapshots and
+ user needs them).
+
+
+
+
+
+
+
+ Required designer variable.
+
+
+
+
+ Clean up any resources being used.
+
+ true if managed resources should be disposed; otherwise, false.
+
+
+
+ Required method for Designer support - do not modify
+ the contents of this method with the code editor.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Specifies if snapshot configuration should be done or not.
+
+
+ The property specifies if the dialog form should
+ allow configuration of snapshot sizes (if selected video source supports
+ snapshots). If the property is set to , then
+ the form will provide additional combo box enumerating supported
+ snapshot sizes. Otherwise the combo boxes will be hidden.
+
+
+ If the property is set to and selected
+ device supports snapshots, then
+ property of the configured device is set to
+ .
+
+ Default value of the property is set to .
+
+
+
+
+
+ Provides configured video device.
+
+
+ The property provides configured video device if user confirmed
+ the dialog using "OK" button. If user canceled the dialog, the property is
+ set to .
+
+
+
+
+ Moniker string of the selected video device.
+
+
+ The property allows to get moniker string of the selected device
+ on form completion or set video device which should be selected by default on
+ form loading.
+
+
+
+
+ Video frame size of the selected device.
+
+
+ The property allows to get video size of the selected device
+ on form completion or set the size to be selected by default on form loading.
+
+
+
+
+
+ Snapshot frame size of the selected device.
+
+
+ The property allows to get snapshot size of the selected device
+ on form completion or set the size to be selected by default on form loading
+ (if property is set ).
+
+
+
+
+ Video input to use with video capture card.
+
+
+ The property allows to get video input of the selected device
+ on form completion or set it to be selected by default on form loading.
+
+
+
+
+ Some miscellaneous functions.
+
+
+
+
+
+ Get filter's pin.
+
+
+ Filter to get pin of.
+ Pin's direction.
+ Pin's number.
+
+ Returns filter's pin.
+
+
+
+
+ Get filter's input pin.
+
+
+ Filter to get pin of.
+ Pin's number.
+
+ Returns filter's pin.
+
+
+
+
+ Get filter's output pin.
+
+
+ Filter to get pin of.
+ Pin's number.
+
+ Returns filter's pin.
+
+
+
+
+ The interface indicates that an object supports property pages.
+
+
+
+
+
+ Fills a counted array of GUID values where each GUID specifies the
+ CLSID of each property page that can be displayed in the property
+ sheet for this object.
+
+
+ Pointer to a CAUUID structure that must be initialized
+ and filled before returning.
+
+ Return's HRESULT error code.
+
+
+
+
+ Enumerates pins on a filter.
+
+
+
+
+
+ Retrieves a specified number of pins.
+
+
+ Number of pins to retrieve.
+ Array of size cPins that is filled with IPin pointers.
+ Receives the number of pins retrieved.
+
+ Return's HRESULT error code.
+
+
+
+
+ Skips a specified number of pins in the enumeration sequence.
+
+
+ Number of pins to skip.
+
+ Return's HRESULT error code.
+
+
+
+
+ Resets the enumeration sequence to the beginning.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Makes a copy of the enumerator with the same enumeration state.
+
+
+ Duplicate of the enumerator.
+
+ Return's HRESULT error code.
+
+
+
+
+ This interface sets the output format on certain capture and compression filters,
+ for both audio and video.
+
+
+
+
+
+ Set the output format on the pin.
+
+
+ Media type to set.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the audio or video stream's format.
+
+
+ Retrieved media type.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieve the number of format capabilities that this pin supports.
+
+
+ Variable that receives the number of format capabilities.
+ Variable that receives the size of the configuration structure in bytes.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieve a set of format capabilities.
+
+
+ Specifies the format capability to retrieve, indexed from zero.
+ Retrieved media type.
+ Byte array, which receives information about capabilities.
+
+ Return's HRESULT error code.
+
+
+
+
+ Collection of filters' information objects.
+
+
+ The class allows to enumerate DirectShow filters of specified category. For
+ a list of categories see .
+
+ Sample usage:
+
+ // enumerate video devices
+ videoDevices = new FilterInfoCollection( FilterCategory.VideoInputDevice );
+ // list devices
+ foreach ( FilterInfo device in videoDevices )
+ {
+ // ...
+ }
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Guid of DirectShow filter category. See .
+
+ Build collection of filters' information objects for the
+ specified filter category.
+
+
+
+
+ Get filter information object.
+
+
+ Index of filter information object to retrieve.
+
+ Filter information object.
+
+
+
+
+ Video source for local video capture device (for example USB webcam).
+
+
+ This video source class captures video data from local video capture device,
+ like USB web camera (or internal), frame grabber, capture board - anything which
+ supports DirectShow interface. For devices which has a shutter button or
+ support external software triggering, the class also allows to do snapshots. Both
+ video size and snapshot size can be configured.
+
+ Sample usage:
+
+ // enumerate video devices
+ videoDevices = new FilterInfoCollection( FilterCategory.VideoInputDevice );
+ // create video source
+ VideoCaptureDevice videoSource = new VideoCaptureDevice( videoDevices[0].MonikerString );
+ // set NewFrame event handler
+ videoSource.NewFrame += new NewFrameEventHandler( video_NewFrame );
+ // start the video source
+ videoSource.Start( );
+ // ...
+ // signal to stop when you no longer need capturing
+ videoSource.SignalToStop( );
+ // ...
+
+ private void video_NewFrame( object sender, NewFrameEventArgs eventArgs )
+ {
+ // get new frame
+ Bitmap bitmap = eventArgs.Frame;
+ // process the frame
+ }
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Moniker string of video capture device.
+
+
+
+
+ Start video source.
+
+
+ Starts video source and return execution to caller. Video source
+ object creates background thread and notifies about new frames with the
+ help of event.
+
+
+
+
+ Signal video source to stop its work.
+
+
+ Signals video source to stop its background thread, stop to
+ provide new frames and free resources.
+
+
+
+
+ Wait for video source has stopped.
+
+
+ Waits for source stopping after it was signalled to stop using
+ method.
+
+
+
+
+ Stop video source.
+
+
+ Stops video source aborting its thread.
+
+ Since the method aborts background thread, its usage is highly not preferred
+ and should be done only if there are no other options. The correct way of stopping camera
+ is signaling it stop and then
+ waiting for background thread's completion.
+
+
+
+
+
+ Free resource.
+
+
+
+
+
+ Display property window for the video capture device providing its configuration
+ capabilities.
+
+
+ Handle of parent window.
+
+ If you pass parent window's handle to this method, then the
+ displayed property page will become modal window and none of the controls from the
+ parent window will be accessible. In order to make it modeless it is required
+ to pass as parent window's handle.
+
+
+
+ The video source does not support configuration property page.
+
+
+
+
+ Display property page of video crossbar (Analog Video Crossbar filter).
+
+
+ Handle of parent window.
+
+ The Analog Video Crossbar filter is modeled after a general switching matrix,
+ with n inputs and m outputs. For example, a video card might have two external connectors:
+ a coaxial connector for TV, and an S-video input. These would be represented as input pins on
+ the filter. The displayed property page allows to configure the crossbar by selecting input
+ of a video card to use.
+
+ This method can be invoked only when video source is running ( is
+ ). Otherwise it generates exception.
+
+ Use method to check if running video source provides
+ crossbar configuration.
+
+
+ The video source must be running in order to display crossbar property page.
+ Crossbar configuration is not supported by currently running video source.
+
+
+
+
+ Check if running video source provides crossbar for configuration.
+
+
+ Returns if crossbar configuration is available or
+ otherwise.
+
+ The method reports if the video source provides crossbar configuration
+ using .
+
+
+
+
+
+ Simulates an external trigger.
+
+
+ The method simulates external trigger for video cameras, which support
+ providing still image snapshots. The effect is equivalent as pressing camera's shutter
+ button - a snapshot will be provided through event.
+
+ The property must be set to
+ to enable receiving snapshots.
+
+
+
+
+
+ Sets a specified property on the camera.
+
+
+ Specifies the property to set.
+ Specifies the new value of the property.
+ Specifies the desired control setting.
+
+ Returns true on sucee or false otherwise.
+
+ Video source is not specified - device moniker is not set.
+ Failed creating device object for moniker.
+ The video source does not support camera control.
+
+
+
+
+ Gets the current setting of a camera property.
+
+
+ Specifies the property to retrieve.
+ Receives the value of the property.
+ Receives the value indicating whether the setting is controlled manually or automatically
+
+ Returns true on sucee or false otherwise.
+
+ Video source is not specified - device moniker is not set.
+ Failed creating device object for moniker.
+ The video source does not support camera control.
+
+
+
+
+ Gets the range and default value of a specified camera property.
+
+
+ Specifies the property to query.
+ Receives the minimum value of the property.
+ Receives the maximum value of the property.
+ Receives the step size for the property.
+ Receives the default value of the property.
+ Receives a member of the enumeration, indicating whether the property is controlled automatically or manually.
+
+ Returns true on sucee or false otherwise.
+
+ Video source is not specified - device moniker is not set.
+ Failed creating device object for moniker.
+ The video source does not support camera control.
+
+
+
+
+ Worker thread.
+
+
+
+
+
+ Notifies clients about new frame.
+
+
+ New frame's image.
+
+
+
+
+ Notifies clients about new snapshot frame.
+
+
+ New snapshot's image.
+
+
+
+
+ Current video input of capture card.
+
+
+ The property specifies video input to use for video devices like capture cards
+ (those which provide crossbar configuration). List of available video inputs can be obtained
+ from property.
+
+ To check if the video device supports crossbar configuration, the
+ method can be used.
+
+ This property can be set as before running video device, as while running it.
+
+ By default this property is set to , which means video input
+ will not be set when running video device, but currently configured will be used. After video device
+ is started this property will be updated anyway to tell current video input.
+
+
+
+
+
+ Available inputs of the video capture card.
+
+
+ The property provides list of video inputs for devices like video capture cards.
+ Such devices usually provide several video inputs, which can be selected using crossbar.
+ If video device represented by the object of this class supports crossbar, then this property
+ will list all video inputs. However if it is a regular USB camera, for example, which does not
+ provide crossbar configuration, the property will provide zero length array.
+
+ Video input to be used can be selected using . See also
+ method, which provides crossbar configuration dialog.
+
+ It is recomended not to call this property immediately after method, since
+ device may not start yet and provide its information. It is better to call the property
+ before starting device or a bit after (but not immediately after).
+
+
+
+
+
+ Specifies if snapshots should be provided or not.
+
+
+ Some USB cameras/devices may have a shutter button, which may result into snapshot if it
+ is pressed. So the property specifies if the video source will try providing snapshots or not - it will
+ check if the camera supports providing still image snapshots. If camera supports snapshots and the property
+ is set to , then snapshots will be provided through
+ event.
+
+ Check supported sizes of snapshots using property and set the
+ desired size using property.
+
+ The property must be set before running the video source to take effect.
+
+ Default value of the property is set to .
+
+
+
+
+
+ New frame event.
+
+
+ Notifies clients about new available frame from video source.
+
+ Since video source may have multiple clients, each client is responsible for
+ making a copy (cloning) of the passed video frame, because the video source disposes its
+ own original copy after notifying of clients.
+
+
+
+
+
+ Snapshot frame event.
+
+
+ Notifies clients about new available snapshot frame - the one which comes when
+ camera's snapshot/shutter button is pressed.
+
+ See documentation to for additional information.
+
+ Since video source may have multiple clients, each client is responsible for
+ making a copy (cloning) of the passed snapshot frame, because the video source disposes its
+ own original copy after notifying of clients.
+
+
+
+
+
+
+
+ Video source error event.
+
+
+ This event is used to notify clients about any type of errors occurred in
+ video source object, for example internal exceptions.
+
+
+
+
+ Video playing finished event.
+
+
+ This event is used to notify clients that the video playing has finished.
+
+
+
+
+
+ Video source.
+
+
+ Video source is represented by moniker string of video capture device.
+
+
+
+
+ Received frames count.
+
+
+ Number of frames the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ Received bytes count.
+
+
+ Number of bytes the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ State of the video source.
+
+
+ Current state of video source object - running or not.
+
+
+
+
+ Obsolete - no longer in use
+
+
+ The property is obsolete. Use property instead.
+ Setting this property does not have any effect.
+
+
+
+
+ Obsolete - no longer in use
+
+
+ The property is obsolete. Use property instead.
+ Setting this property does not have any effect.
+
+
+
+
+ Obsolete - no longer in use.
+
+
+ The property is obsolete. Setting this property does not have any effect.
+
+
+
+
+ Video resolution to set.
+
+
+ The property allows to set one of the video resolutions supported by the camera.
+ Use property to get the list of supported video resolutions.
+
+ The property must be set before camera is started to make any effect.
+
+ Default value of the property is set to , which means default video
+ resolution is used.
+
+
+
+
+
+ Snapshot resolution to set.
+
+
+ The property allows to set one of the snapshot resolutions supported by the camera.
+ Use property to get the list of supported snapshot resolutions.
+
+ The property must be set before camera is started to make any effect.
+
+ Default value of the property is set to , which means default snapshot
+ resolution is used.
+
+
+
+
+
+ Video capabilities of the device.
+
+
+ The property provides list of device's video capabilities.
+
+ It is recomended not to call this property immediately after method, since
+ device may not start yet and provide its information. It is better to call the property
+ before starting device or a bit after (but not immediately after).
+
+
+
+
+
+ Snapshot capabilities of the device.
+
+
+ The property provides list of device's snapshot capabilities.
+
+ If the array has zero length, then it means that this device does not support making
+ snapshots.
+
+ See documentation to for additional information.
+
+ It is recomended not to call this property immediately after method, since
+ device may not start yet and provide its information. It is better to call the property
+ before starting device or a bit after (but not immediately after).
+
+
+
+
+
+
+
+ Source COM object of camera capture device.
+
+
+ The source COM object of camera capture device is exposed for the
+ case when user may need get direct access to the object for making some custom
+ configuration of camera through DirectShow interface, for example.
+
+
+ If camera is not running, the property is set to .
+
+
+
+
+
+ The interface sets properties on the video window.
+
+
+
+
+
+ Sets the video window caption.
+
+
+ Caption.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the video window caption.
+
+
+ Caption.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the window style on the video window.
+
+
+ Window style flags.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the window style on the video window.
+
+
+ Window style flags.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the extended window style on the video window.
+
+
+ Window extended style flags.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the extended window style on the video window.
+
+
+ Window extended style flags.
+
+ Return's HRESULT error code.
+
+
+
+
+ Specifies whether the video renderer automatically shows the video window when it receives video data.
+
+
+ Specifies whether the video renderer automatically shows the video window.
+
+ Return's HRESULT error code.
+
+
+
+
+ Queries whether the video renderer automatically shows the video window when it receives video data.
+
+
+ REceives window auto show flag.
+
+ Return's HRESULT error code.
+
+
+
+
+ Shows, hides, minimizes, or maximizes the video window.
+
+
+ Window state.
+
+ Return's HRESULT error code.
+
+
+
+
+ Queries whether the video window is visible, hidden, minimized, or maximized.
+
+
+ Window state.
+
+ Return's HRESULT error code.
+
+
+
+
+ Specifies whether the video window realizes its palette in the background.
+
+
+ Value that specifies whether the video renderer realizes it palette in the background.
+
+ Return's HRESULT error code.
+
+
+
+
+ Queries whether the video window realizes its palette in the background.
+
+
+ Receives state of background palette flag.
+
+ Return's HRESULT error code.
+
+
+
+
+ Shows or hides the video window.
+
+
+ Value that specifies whether to show or hide the window.
+
+ Return's HRESULT error code.
+
+
+
+
+ Queries whether the video window is visible.
+
+
+ Visibility flag.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the video window's x-coordinate.
+
+
+ Specifies the x-coordinate, in pixels.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the video window's x-coordinate.
+
+
+ x-coordinate, in pixels.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the width of the video window.
+
+
+ Specifies the width, in pixels.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the width of the video window.
+
+
+ Width, in pixels.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the video window's y-coordinate.
+
+
+ Specifies the y-coordinate, in pixels.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the video window's y-coordinate.
+
+
+ y-coordinate, in pixels.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the height of the video window.
+
+
+ Specifies the height, in pixels.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the height of the video window.
+
+
+ Height, in pixels.
+
+ Return's HRESULT error code.
+
+
+
+
+ Specifies a parent window for the video windowю
+
+
+ Specifies a handle to the parent window.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the video window's parent window, if anyю
+
+
+ Parent window's handle.
+
+ Return's HRESULT error code.
+
+
+
+
+ Specifies a window to receive mouse and keyboard messages from the video window.
+
+
+ Specifies a handle to the window.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the window that receives mouse and keyboard messages from the video window, if any.
+
+
+ Window's handle.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the color that appears around the edges of the destination rectangle.
+
+
+ Border's color.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the color that appears around the edges of the destination rectangle.
+
+
+ Specifies the border color.
+
+ Return's HRESULT error code.
+
+
+
+
+ Queries whether the video renderer is in full-screen mode.
+
+
+ Full-screen mode.
+
+ Return's HRESULT error code.
+
+
+
+
+ Enables or disables full-screen mode.
+
+
+ Boolean value that specifies whether to enable or disable full-screen mode.
+
+ Return's HRESULT error code.
+
+
+
+
+ Places the video window at the top of the Z order.
+
+
+ Value that specifies whether to give the window focus.
+
+ Return's HRESULT error code.
+
+
+
+
+ Forwards a message to the video window.
+
+
+ Handle to the window.
+ Specifies the message.
+ Message parameter.
+ Message parameter.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the position of the video windowю
+
+
+ Specifies the x-coordinate, in pixels.
+ Specifies the y-coordinate, in pixels.
+ Specifies the width, in pixels.
+ Specifies the height, in pixels.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the position of the video window.
+
+
+ x-coordinate, in pixels.
+ y-coordinate, in pixels.
+ Width, in pixels.
+ Height, in pixels.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the minimum ideal size for the video image.
+
+
+ Receives the minimum ideal width, in pixels.
+ Receives the minimum ideal height, in pixels.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the maximum ideal size for the video image.
+
+
+ Receives the maximum ideal width, in pixels.
+ Receives the maximum ideal height, in pixels.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the restored window position.
+
+
+ x-coordinate, in pixels.
+ y-coordinate, in pixels.
+ Width, in pixels.
+ Height, in pixels.
+
+ Return's HRESULT error code.
+
+
+
+
+ Hides the cursor.
+
+
+ Specifies whether to hide or display the cursor.
+
+ Return's HRESULT error code.
+
+
+
+
+ Queries whether the cursor is hidden.
+
+
+ Specifies if cursor is hidden or not.
+
+ Return's HRESULT error code.
+
+
+
+
+ The IPropertyBag interface provides an object with a property bag in
+ which the object can persistently save its properties.
+
+
+
+
+
+ Read a property from property bag.
+
+
+ Property name to read.
+ Property value.
+ Caller's error log.
+
+ Return's HRESULT error code.
+
+
+
+
+ Write property to property bag.
+
+
+ Property name to read.
+ Property value.
+
+ Return's HRESULT error code.
+
+
+
+
+ The interface provides methods for controlling the flow of data through the filter graph.
+ It includes methods for running, pausing, and stopping the graph.
+
+
+
+
+
+ This method informs the filter to transition to the new state.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ This method informs the filter to transition to the new state.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ This method informs the filter to transition to the new (running) state. Passes a time value to synchronize independent streams.
+
+
+ Time value of the reference clock. The amount to be added to the IMediaSample time stamp to determine the time at which that sample should be rendered according to the reference clock. That is, it is the reference time at which a sample with a stream time of zero should be rendered.
+
+ Return's HRESULT error code.
+
+
+
+
+ This method determines the filter's state.
+
+
+ Duration of the time-out, in milliseconds. To block indefinitely, pass INFINITE.
+ Returned state of the filter. States include stopped, paused, running, or intermediate (in the process of changing).
+
+ Return's HRESULT error code.
+
+
+
+
+ This method identifies the reference clock to which the filter should synchronize activity.
+
+
+ Pointer to the IReferenceClock interface.
+
+ Return's HRESULT error code.
+
+
+
+
+ This method retrieves the current reference clock in use by this filter.
+
+
+ Pointer to a reference clock; it will be set to the IReferenceClock interface.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ The interface provides methods for controlling the flow of data through the filter graph.
+ It includes methods for running, pausing, and stopping the graph.
+
+
+
+
+
+ Runs all the filters in the filter graph.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Pauses all filters in the filter graph.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Stops all the filters in the filter graph.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the state of the filter graph.
+
+
+ Duration of the time-out, in milliseconds, or INFINITE to specify an infinite time-out.
+ Мariable that receives a member of the FILTER_STATE enumeration.
+
+ Return's HRESULT error code.
+
+
+
+
+ Builds a filter graph that renders the specified file.
+
+
+ Name of the file to render
+
+ Return's HRESULT error code.
+
+
+
+
+ Adds a source filter to the filter graph, for a specified file.
+
+
+ Name of the file containing the source video.
+ Receives interface of filter information object.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves a collection of the filters in the filter graph.
+
+
+ Receives the IAMCollection interface.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves a collection of all the filters listed in the registry.
+
+
+ Receives the IDispatch interface of IAMCollection object.
+
+ Return's HRESULT error code.
+
+
+
+
+ Pauses the filter graph, allowing filters to queue data, and then stops the filter graph.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ This interface extends the and
+ interfaces, which contain methods for building filter graphs.
+
+
+
+
+
+ Adds a filter to the graph and gives it a name.
+
+
+ Filter to add to the graph.
+ Name of the filter.
+
+ Return's HRESULT error code.
+
+
+
+
+ Removes a filter from the graph.
+
+
+ Filter to be removed from the graph.
+
+ Return's HRESULT error code.
+
+
+
+
+ Provides an enumerator for all filters in the graph.
+
+
+ Filter enumerator.
+
+ Return's HRESULT error code.
+
+
+
+
+ Finds a filter that was added with a specified name.
+
+
+ Name of filter to search for.
+ Interface of found filter.
+
+ Return's HRESULT error code.
+
+
+
+
+ Connects two pins directly (without intervening filters).
+
+
+ Output pin.
+ Input pin.
+ Media type to use for the connection.
+
+ Return's HRESULT error code.
+
+
+
+
+ Breaks the existing pin connection and reconnects it to the same pin.
+
+
+ Pin to disconnect and reconnect.
+
+ Return's HRESULT error code.
+
+
+
+
+ Disconnects a specified pin.
+
+
+ Pin to disconnect.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the reference clock to the default clock.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Connects two pins. If they will not connect directly, this method connects them with intervening transforms.
+
+
+ Output pin.
+ Input pin.
+
+ Return's HRESULT error code.
+
+
+
+
+ Adds a chain of filters to a specified output pin to render it.
+
+
+ Output pin.
+
+ Return's HRESULT error code.
+
+
+
+
+ Builds a filter graph that renders the specified file.
+
+
+ Specifies a string that contains file name or device moniker.
+ Reserved.
+
+ Return's HRESULT error code.
+
+
+
+
+ Adds a source filter to the filter graph for a specific file.
+
+
+ Specifies the name of the file to load.
+ Specifies a name for the source filter.
+ Variable that receives the interface of the source filter.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the file for logging actions taken when attempting to perform an operation.
+
+
+ Handle to the log file.
+
+ Return's HRESULT error code.
+
+
+
+
+ Requests that the graph builder return as soon as possible from its current task.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Queries whether the current operation should continue.
+
+
+ Return's HRESULT error code.
+
+
+
+
+
+
+
+ Moniker interface.
+ Bind context interface.
+ Name for the filter.
+ Receives source filter's IBaseFilter interface.
+ The caller must release the interface.
+
+ Return's HRESULT error code.
+
+
+
+
+ Breaks the existing pin connection and reconnects it to the same pin,
+ using a specified media type.
+
+
+ Pin to disconnect and reconnect.
+ Media type to reconnect with.
+
+ Return's HRESULT error code.
+
+
+
+
+ Render an output pin, with an option to use existing renderers only.
+
+
+ Interface of the output pin.
+ Flag that specifies how to render the pin.
+ Reserved.
+
+ Return's HRESULT error code.
+
+
+
+
+ This interface is used by applications or other filters to determine
+ what filters exist in the filter graph.
+
+
+
+
+
+ Retrieves the specified number of filters in the enumeration sequence.
+
+
+ Number of filters to retrieve.
+ Array in which to place interfaces.
+ Actual number of filters placed in the array.
+
+ Return's HRESULT error code.
+
+
+
+
+ Skips a specified number of filters in the enumeration sequence.
+
+
+ Number of filters to skip.
+
+ Return's HRESULT error code.
+
+
+
+
+ Resets the enumeration sequence to the beginning.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Makes a copy of the enumerator with the same enumeration state.
+
+
+ Duplicate of the enumerator.
+
+
+ Return's HRESULT error code.
+
+
+
+
+
+ The ICreateDevEnum interface creates an enumerator for devices within a particular category,
+ such as video capture devices, audio capture devices, video compressors, and so forth.
+
+
+
+
+
+ Creates a class enumerator for a specified device category.
+
+
+ Specifies the class identifier of the device category.
+ Address of a variable that receives an IEnumMoniker interface pointer
+ Bitwise combination of zero or more flags. If zero, the method enumerates every filter in the category.
+
+ Return's HRESULT error code.
+
+
+
+
+ Some Win32 API used internally.
+
+
+
+
+
+ Supplies a pointer to an implementation of IBindCtx (a bind context object).
+ This object stores information about a particular moniker-binding operation.
+
+
+ Reserved for future use; must be zero.
+ Address of IBindCtx* pointer variable that receives the
+ interface pointer to the new bind context object.
+
+ Returns S_OK on success.
+
+
+
+
+ Converts a string into a moniker that identifies the object named by the string.
+
+
+ Pointer to the IBindCtx interface on the bind context object to be used in this binding operation.
+ Pointer to a zero-terminated wide character string containing the display name to be parsed.
+ Pointer to the number of characters of szUserName that were consumed.
+ Address of IMoniker* pointer variable that receives the interface pointer
+ to the moniker that was built from szUserName.
+
+ Returns S_OK on success.
+
+
+
+
+ Copy a block of memory.
+
+
+ Destination pointer.
+ Source pointer.
+ Memory block's length to copy.
+
+ Return's the value of dst - pointer to destination.
+
+
+
+
+ Invokes a new property frame, that is, a property sheet dialog box.
+
+
+ Parent window of property sheet dialog box.
+ Horizontal position for dialog box.
+ Vertical position for dialog box.
+ Dialog box caption.
+ Number of object pointers in ppUnk.
+ Pointer to the objects for property sheet.
+ Number of property pages in lpPageClsID.
+ Array of CLSIDs for each property page.
+ Locale identifier for property sheet locale.
+ Reserved.
+ Reserved.
+
+ Returns S_OK on success.
+
+
+
+
+ The enumeration specifies a setting on a camera.
+
+
+
+
+ Pan control.
+
+
+
+
+ Tilt control.
+
+
+
+
+ Roll control.
+
+
+
+
+ Zoom control.
+
+
+
+
+ Exposure control.
+
+
+
+
+ Iris control.
+
+
+
+
+ Focus control.
+
+
+
+
+ The enumeration defines whether a camera setting is controlled manually or automatically.
+
+
+
+
+ No control flag.
+
+
+
+
+ Auto control Flag.
+
+
+
+
+ Manual control Flag.
+
+
+
+
+ Video input of a capture board.
+
+
+ The class is used to describe video input of devices like video capture boards,
+ which usually provide several inputs.
+
+
+
+
+
+ Index of the video input.
+
+
+
+
+ Type of the video input.
+
+
+
+
+ Default video input. Used to specify that it should not be changed.
+
+
+
+
+ DirectShow filter information.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Filters's moniker string.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Filter's moniker object.
+
+
+
+
+ Compare the object with another instance of this class.
+
+
+ Object to compare with.
+
+ A signed number indicating the relative values of this instance and value.
+
+
+
+
+ Create an instance of the filter.
+
+
+ Filter's moniker string.
+
+ Returns filter's object, which implements IBaseFilter interface.
+
+ The returned filter's object should be released using Marshal.ReleaseComObject().
+
+
+
+
+ Filter name.
+
+
+
+
+ Filters's moniker string.
+
+
+
+
+
+ DirectShow class IDs.
+
+
+
+
+ System device enumerator.
+
+
+ Equals to CLSID_SystemDeviceEnum.
+
+
+
+
+ Filter graph.
+
+
+ Equals to CLSID_FilterGraph.
+
+
+
+
+ Sample grabber.
+
+
+ Equals to CLSID_SampleGrabber.
+
+
+
+
+ Capture graph builder.
+
+
+ Equals to CLSID_CaptureGraphBuilder2.
+
+
+
+
+ Async reader.
+
+
+ Equals to CLSID_AsyncReader.
+
+
+
+
+ DirectShow format types.
+
+
+
+
+
+ VideoInfo.
+
+
+ Equals to FORMAT_VideoInfo.
+
+
+
+
+ VideoInfo2.
+
+
+ Equals to FORMAT_VideoInfo2.
+
+
+
+
+ DirectShow media types.
+
+
+
+
+
+ Video.
+
+
+ Equals to MEDIATYPE_Video.
+
+
+
+
+ Interleaved. Used by Digital Video (DV).
+
+
+ Equals to MEDIATYPE_Interleaved.
+
+
+
+
+ Audio.
+
+
+ Equals to MEDIATYPE_Audio.
+
+
+
+
+ Text.
+
+
+ Equals to MEDIATYPE_Text.
+
+
+
+
+ Byte stream with no time stamps.
+
+
+ Equals to MEDIATYPE_Stream.
+
+
+
+
+ DirectShow media subtypes.
+
+
+
+
+
+ YUY2 (packed 4:2:2).
+
+
+ Equals to MEDIASUBTYPE_YUYV.
+
+
+
+
+ IYUV.
+
+
+ Equals to MEDIASUBTYPE_IYUV.
+
+
+
+
+ A DV encoding format. (FOURCC 'DVSD')
+
+
+ Equals to MEDIASUBTYPE_DVSD.
+
+
+
+
+ RGB, 1 bit per pixel (bpp), palettized.
+
+
+ Equals to MEDIASUBTYPE_RGB1.
+
+
+
+
+ RGB, 4 bpp, palettized.
+
+
+ Equals to MEDIASUBTYPE_RGB4.
+
+
+
+
+ RGB, 8 bpp.
+
+
+ Equals to MEDIASUBTYPE_RGB8.
+
+
+
+
+ RGB 565, 16 bpp.
+
+
+ Equals to MEDIASUBTYPE_RGB565.
+
+
+
+
+ RGB 555, 16 bpp.
+
+
+ Equals to MEDIASUBTYPE_RGB555.
+
+
+
+
+ RGB, 24 bpp.
+
+
+ Equals to MEDIASUBTYPE_RGB24.
+
+
+
+
+ RGB, 32 bpp, no alpha channel.
+
+
+ Equals to MEDIASUBTYPE_RGB32.
+
+
+
+
+ Data from AVI file.
+
+
+ Equals to MEDIASUBTYPE_Avi.
+
+
+
+
+ Advanced Streaming Format (ASF).
+
+
+ Equals to MEDIASUBTYPE_Asf.
+
+
+
+
+ DirectShow pin categories.
+
+
+
+
+
+ Capture pin.
+
+
+ Equals to PIN_CATEGORY_CAPTURE.
+
+
+
+
+ Still image pin.
+
+
+ Equals to PIN_CATEGORY_STILL.
+
+
+
+ Equals to LOOK_UPSTREAM_ONLY.
+
+
+ Equals to LOOK_DOWNSTREAM_ONLY.
+
+
+
+ The IReferenceClock interface provides the reference time for the filter graph.
+
+ Filters that can act as a reference clock can expose this interface. It is also exposed by the System Reference Clock.
+ The filter graph manager uses this interface to synchronize the filter graph. Applications can use this interface to
+ retrieve the current reference time, or to request notification of an elapsed time.
+
+
+
+
+ The GetTime method retrieves the current reference time.
+
+
+ Pointer to a variable that receives the current time, in 100-nanosecond units.
+
+ Return's HRESULT error code.
+
+
+
+
+ The AdviseTime method creates a one-shot advise request.
+
+
+ Base reference time, in 100-nanosecond units. See Remarks.
+ Stream offset time, in 100-nanosecond units. See Remarks.
+ Handle to an event, created by the caller.
+ Pointer to a variable that receives an identifier for the advise request.
+
+ Return's HRESULT error code.
+
+
+
+
+ The AdvisePeriodic method creates a periodic advise request.
+
+
+ Time of the first notification, in 100-nanosecond units. Must be greater than zero and less than MAX_TIME.
+ Time between notifications, in 100-nanosecond units. Must be greater than zero.
+ Handle to a semaphore, created by the caller.
+ Pointer to a variable that receives an identifier for the advise request.
+
+ Return's HRESULT error code.
+
+
+
+
+ The Unadvise method removes a pending advise request.
+
+
+ Identifier of the request to remove. Use the value returned by IReferenceClock::AdviseTime or IReferenceClock::AdvisePeriodic in the pdwAdviseToken parameter.
+
+ Return's HRESULT error code.
+
+
+
+
+ The IAMCrossbar interface routes signals from an analog or digital source to a video capture filter.
+
+
+
+
+ Retrieves the number of input and output pins on the crossbar filter.
+
+
+ Variable that receives the number of output pins.
+ Variable that receives the number of input pins.
+
+ Return's HRESULT error code.
+
+
+
+
+ Queries whether a specified input pin can be routed to a specified output pin.
+
+
+ Specifies the index of the output pin.
+ Specifies the index of input pin.
+
+ Return's HRESULT error code.
+
+
+
+
+ Routes an input pin to an output pin.
+
+
+ Specifies the index of the output pin.
+ Specifies the index of the input pin.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the input pin that is currently routed to the specified output pin.
+
+
+ Specifies the index of the output pin.
+ Variable that receives the index of the input pin, or -1 if no input pin is routed to this output pin.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves information about a specified pin.
+
+
+ Specifies the direction of the pin. Use one of the following values.
+ Specifies the index of the pin.
+ Variable that receives the index of the related pin, or –1 if no pin is related to this pin.
+ Variable that receives a member of the PhysicalConnectorType enumeration, indicating the pin's physical type.
+
+ Return's HRESULT error code.
+
+
+
+
+ The IBaseFilter interface provides methods for controlling a filter.
+ All DirectShow filters expose this interface
+
+
+
+
+
+ Returns the class identifier (CLSID) for the component object.
+
+
+ Points to the location of the CLSID on return.
+
+ Return's HRESULT error code.
+
+
+
+
+ Stops the filter.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Pauses the filter.
+
+
+ Return's HRESULT error code.
+
+
+
+
+ Runs the filter.
+
+
+ Reference time corresponding to stream time 0.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the state of the filter (running, stopped, or paused).
+
+
+ Time-out interval, in milliseconds.
+ Pointer to a variable that receives filter's state.
+
+ Return's HRESULT error code.
+
+
+
+
+ Sets the reference clock for the filter or the filter graph.
+
+
+ Pointer to the clock's IReferenceClock interface, or NULL.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the current reference clock.
+
+
+ Address of a variable that receives a pointer to the clock's IReferenceClock interface.
+
+ Return's HRESULT error code.
+
+
+
+
+ Enumerates the pins on this filter.
+
+
+ Address of a variable that receives a pointer to the IEnumPins interface.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the pin with the specified identifier.
+
+
+ Pointer to a constant wide-character string that identifies the pin.
+ Address of a variable that receives a pointer to the pin's IPin interface.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves information about the filter.
+
+
+ Pointer to FilterInfo structure.
+
+ Return's HRESULT error code.
+
+
+
+
+ Notifies the filter that it has joined or left the filter graph.
+
+
+ Pointer to the Filter Graph Manager's IFilterGraph interface, or NULL
+ if the filter is leaving the graph.
+ String that specifies a name for the filter.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves a string containing vendor information.
+
+
+ Receives a string containing the vendor information.
+
+ Return's HRESULT error code.
+
+
+
+
+ The interface inherits contains methods for retrieving event notifications and for overriding the
+ filter graph's default handling of events.
+
+
+
+
+ Retrieves a handle to a manual-reset event that remains signaled while the queue contains event notifications.
+
+ Pointer to a variable that receives the event handle.
+
+ Return's HRESULT error code.
+
+
+
+
+ Retrieves the next event notification from the event queue.
+
+
+ Variable that receives the event code.
+ Pointer to a variable that receives the first event parameter.
+ Pointer to a variable that receives the second event parameter.
+ Time-out interval, in milliseconds.
+
+ Return's HRESULT error code.
+
+
+
+
+ Waits for the filter graph to render all available data.
+
+
+ Time-out interval, in milliseconds. Pass zero to return immediately.
+ Pointer to a variable that receives an event code.
+
+ Return's HRESULT error code.
+
+
+
+
+ Cancels the Filter Graph Manager's default handling for a specified event.
+
+
+ Event code for which to cancel default handling.
+
+ Return's HRESULT error code.
+
+
+
+
+ Restores the Filter Graph Manager's default handling for a specified event.
+
+ Event code for which to restore default handling.
+
+ Return's HRESULT error code.
+
+
+
+
+ Frees resources associated with the parameters of an event.
+
+ Event code.
+ First event parameter.
+ Second event parameter.
+
+ Return's HRESULT error code.
+
+
+
+
+ Registers a window to process event notifications.
+
+
+ Handle to the window, or to stop receiving event messages.
+ Window message to be passed as the notification.
+ Value to be passed as the lParam parameter for the lMsg message.
+
+ Return's HRESULT error code.
+
+
+
+
+ Enables or disables event notifications.
+
+
+ Value indicating whether to enable or disable event notifications.
+
+ Return's HRESULT error code.
+
+
+
+
+ Determines whether event notifications are enabled.
+
+
+ Variable that receives current notification status.
+
+ Return's HRESULT error code.
+
+
+
+
+ Video source for video files.
+
+
+ The video source provides access to video files. DirectShow is used to access video
+ files.
+
+ Sample usage:
+
+ // create video source
+ FileVideoSource videoSource = new FileVideoSource( fileName );
+ // set NewFrame event handler
+ videoSource.NewFrame += new NewFrameEventHandler( video_NewFrame );
+ // start the video source
+ videoSource.Start( );
+ // ...
+ // signal to stop
+ videoSource.SignalToStop( );
+ // ...
+
+ // New frame event handler, which is invoked on each new available video frame
+ private void video_NewFrame( object sender, NewFrameEventArgs eventArgs )
+ {
+ // get new frame
+ Bitmap bitmap = eventArgs.Frame;
+ // process the frame
+ }
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Video file name.
+
+
+
+
+ Start video source.
+
+
+ Starts video source and return execution to caller. Video source
+ object creates background thread and notifies about new frames with the
+ help of event.
+
+
+
+
+ Signal video source to stop its work.
+
+
+ Signals video source to stop its background thread, stop to
+ provide new frames and free resources.
+
+
+
+
+ Wait for video source has stopped.
+
+
+ Waits for source stopping after it was signalled to stop using
+ method.
+
+
+
+
+ Stop video source.
+
+
+ Stops video source aborting its thread.
+
+ Since the method aborts background thread, its usage is highly not preferred
+ and should be done only if there are no other options. The correct way of stopping camera
+ is signaling it stop and then
+ waiting for background thread's completion.
+
+
+
+
+
+ Free resource.
+
+
+
+
+
+ Worker thread.
+
+
+
+
+
+ Notifies client about new frame.
+
+
+ New frame's image.
+
+
+
+
+ New frame event.
+
+
+ Notifies clients about new available frame from video source.
+
+ Since video source may have multiple clients, each client is responsible for
+ making a copy (cloning) of the passed video frame, because the video source disposes its
+ own original copy after notifying of clients.
+
+
+
+
+
+ Video source error event.
+
+
+ This event is used to notify clients about any type of errors occurred in
+ video source object, for example internal exceptions.
+
+
+
+
+ Video playing finished event.
+
+
+ This event is used to notify clients that the video playing has finished.
+
+
+
+
+
+ Video source.
+
+
+ Video source is represented by video file name.
+
+
+
+
+ Received frames count.
+
+
+ Number of frames the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ Received bytes count.
+
+
+ Number of bytes the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ State of the video source.
+
+
+ Current state of video source object - running or not.
+
+
+
+
+ Prevent video freezing after screen saver and workstation lock or not.
+
+
+
+ The value specifies if the class should prevent video freezing during and
+ after screen saver or workstation lock. To prevent freezing the DirectShow graph
+ should not contain Renderer filter, which is added by Render() method
+ of graph. However, in some cases it may be required to call Render() method of graph, since
+ it may add some more filters, which may be required for playing video. So, the property is
+ a trade off - it is possible to prevent video freezing skipping adding renderer filter or
+ it is possible to keep renderer filter, but video may freeze during screen saver.
+
+ The property may become obsolete in the future when approach to disable freezing
+ and adding all required filters is found.
+
+ The property should be set before calling method
+ of the class to have effect.
+
+ Default value of this property is set to false.
+
+
+
+
+
+
+ Enables/disables reference clock on the graph.
+
+
+ Disabling reference clocks causes DirectShow graph to run as fast as
+ it can process data. When enabled, it will process frames according to presentation
+ time of a video file.
+
+ The property should be set before calling method
+ of the class to have effect.
+
+ Default value of this property is set to true.
+
+
+
+
+
diff --git a/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.FFMPEG.dll b/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.FFMPEG.dll
new file mode 100644
index 0000000..65b58f6
Binary files /dev/null and b/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.FFMPEG.dll differ
diff --git a/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.FFMPEG.xml b/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.FFMPEG.xml
new file mode 100644
index 0000000..e815a00
--- /dev/null
+++ b/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.FFMPEG.xml
@@ -0,0 +1,5761 @@
+
+
+
+ "Video.FFMPEG"
+
+
+
+
+Stop video source.
+
+
+ Stops video source aborting its thread.
+
+ Since the method aborts background thread, its usage is highly not preferred
+and should be done only if there are no other options. The correct way of stopping camera
+is signaling it stop and then
+waiting for background thread's completion.
+
+
+
+
+
+Wait for video source has stopped.
+
+ Waits for source stopping after it was signalled to stop using
+ method.
+
+
+
+Signal video source to stop its work.
+
+ Signals video source to stop its background thread, stop to
+provide new frames and free resources.
+
+
+
+Start video source.
+
+ Starts video source and return execution to caller. Video source
+object creates background thread and notifies about new frames with the
+help of event.
+ Video source is not specified.
+
+
+
+Initializes a new instance of the class.
+
+
+
+
+Get frame interval from source or use manually specified.
+
+
+ The property specifies which frame rate to use for video playing.
+If the property is set to , then video is played
+with original frame rate, which is set in source video file. If the property is
+set to , then custom frame rate is used, which is
+calculated based on the manually specified frame interval.
+ Default value is set to .
+
+
+
+
+Frame interval.
+
+
+ The property sets the interval in milliseconds between frames. If the property is
+set to 100, then the desired frame rate will be 10 frames per second.
+
+ Setting this property to 0 leads to no delay between video frames - frames
+are read as fast as possible.
+
+
+ Setting this property has effect only when
+is set to .
+
+ Default value is set to 0.
+
+
+
+
+State of the video source.
+
+ Current state of video source object - running or not.
+
+
+
+Received bytes count.
+
+ Number of bytes the video source provided from the moment of the last
+access to the property.
+
+
+
+
+Received frames count.
+
+ Number of frames the video source provided from the moment of the last
+access to the property.
+
+
+
+
+Video source.
+
+
+ Video file name to play.
+
+
+
+
+Video playing finished event.
+
+
+ This event is used to notify clients that the video playing has finished.
+
+
+
+
+Video source error event.
+
+ This event is used to notify clients about any type of errors occurred in
+video source object, for example internal exceptions.
+
+
+
+New frame event.
+
+
+ Notifies clients about new available frame from video source.
+
+ Since video source may have multiple clients, each client is responsible for
+making a copy (cloning) of the passed video frame, because the video source disposes its
+own original copy after notifying of clients.
+
+
+
+
+
+Video source for video files.
+
+
+ The video source provides access to video files using FFmpeg library.
+
+ The class provides video only. Sound is not supported.
+
+
+ The class ignores presentation time of video frames while retrieving them from
+video file. Instead it provides video frames according to the FPS rate of the video file
+or the configured .
+
+
+ Make sure you have FFmpeg binaries (DLLs) in the output folder of your application in order
+to use this class successfully. FFmpeg binaries can be found in Externals folder provided with AForge.NET
+framework's distribution.
+
+ Sample usage:
+
+// create video source
+VideoFileSource videoSource = new VideoFileSource( fileName );
+// set NewFrame event handler
+videoSource.NewFrame += new NewFrameEventHandler( video_NewFrame );
+// start the video source
+videoSource.Start( );
+// ...
+
+// New frame event handler, which is invoked on each new available video frame
+private void video_NewFrame( object sender, NewFrameEventArgs eventArgs )
+{
+ // get new frame
+ Bitmap bitmap = eventArgs.Frame;
+ // process the frame
+}
+
+
+
+
+
+Close currently opened video file if any.
+
+
+
+
+Read next video frame of the currently opened video file.
+
+ Returns next video frame of the opened file or if end of
+file was reached. The returned video frame has 24 bpp color format.
+ Thrown if no video file was open.
+ A error occurred while reading next video frame. See exception message.
+
+
+
+Open video file with the specified name.
+
+ Video file name to open.
+ Cannot open video file with the specified name.
+ A error occurred while opening the video file. See exception message.
+
+
+
+Disposes the object and frees its resources.
+
+
+
+
+Initializes a new instance of the class.
+
+
+
+
+Object's finalizer.
+
+
+
+
+The property specifies if a video file is opened or not by this instance of the class.
+
+
+
+
+Name of codec used for encoding the opened video file.
+
+ Thrown if no video file was open.
+
+
+
+Number of video frames in the opened video file.
+
+
+
+
+ Warning: some video file formats may report different value
+from the actual number of video frames in the file (subject to fix/investigate).
+
+
+ Thrown if no video file was open.
+
+
+
+Frame rate of the opened video file.
+
+ Thrown if no video file was open.
+
+
+
+Frame height of the opened video file.
+
+ Thrown if no video file was open.
+
+
+
+Frame width of the opened video file.
+
+ Thrown if no video file was open.
+
+
+
+Class for reading video files utilizing FFmpeg library.
+
+
+ The class allows to read video files using FFmpeg library.
+
+ Make sure you have FFmpeg binaries (DLLs) in the output folder of your application in order
+to use this class successfully. FFmpeg binaries can be found in Externals folder provided with AForge.NET
+framework's distribution.
+
+ Sample usage:
+
+// create instance of video reader
+VideoFileReader reader = new VideoFileReader( );
+// open video file
+reader.Open( "test.avi" );
+// check some of its attributes
+Console.WriteLine( "width: " + reader.Width );
+Console.WriteLine( "height: " + reader.Height );
+Console.WriteLine( "fps: " + reader.FrameRate );
+Console.WriteLine( "codec: " + reader.CodecName );
+// read 100 video frames out of it
+for ( int i = 0; i < 100; i++ )
+{
+ Bitmap videoFrame = reader.ReadVideoFrame( );
+ // process the frame somehow
+ // ...
+
+ // dispose the frame when it is no longer required
+ videoFrame.Dispose( );
+}
+reader.Close( );
+
+
+
+
+ Get the AVClass for swsContext. It can be used in combination with
+ AV_OPT_SEARCH_FAKE_OBJ for examining options.
+
+ @see av_opt_find().
+
+
+
+ Convert an 8-bit paletted frame into a frame with a color depth of 24 bits.
+
+ With the palette format "ABCD", the destination frame ends up with the format "ABC".
+
+ @param src source frame buffer
+ @param dst destination frame buffer
+ @param num_pixels number of pixels to convert
+ @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src
+
+
+
+ Convert an 8-bit paletted frame into a frame with a color depth of 32 bits.
+
+ The output frame will have the same packed format as the palette.
+
+ @param src source frame buffer
+ @param dst destination frame buffer
+ @param num_pixels number of pixels to convert
+ @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src
+
+
+
+Allocate and return a clone of the vector a, that is a vector
+with the same coefficients as a.
+
+
+
+Scale all the coefficients of a so that their sum equals height.
+
+
+
+Scale all the coefficients of a by the scalar value.
+
+
+
+Allocate and return a vector with just one coefficient, with
+value 1.0.
+
+
+
+Allocate and return a vector with length coefficients, all
+with the same value c.
+
+
+
+Return a normalized Gaussian curve used to filter stuff
+quality = 3 is high quality, lower is lower quality.
+
+
+
+Allocate and return an uninitialized vector with length coefficients.
+
+
+
+@return -1 if not supported
+
+
+
+@param inv_table the yuv2rgb coefficients, normally ff_yuv2rgb_coeffs[x]
+@return -1 if not supported
+
+
+
+ Scale the image slice in srcSlice and put the resulting scaled
+ slice in the image in dst. A slice is a sequence of consecutive
+ rows in an image.
+
+ Slices have to be provided in sequential order, either in
+ top-bottom or bottom-top order. If slices are provided in
+ non-sequential order the behavior of the function is undefined.
+
+ @param c the scaling context previously created with
+ sws_getContext()
+ @param srcSlice the array containing the pointers to the planes of
+ the source slice
+ @param srcStride the array containing the strides for each plane of
+ the source image
+ @param srcSliceY the position in the source image of the slice to
+ process, that is the number (counted starting from
+ zero) in the image of the first row of the slice
+ @param srcSliceH the height of the source slice, that is the number
+ of rows in the slice
+ @param dst the array containing the pointers to the planes of
+ the destination image
+ @param dstStride the array containing the strides for each plane of
+ the destination image
+ @return the height of the output slice
+
+
+
+Free the swscaler context swsContext.
+If swsContext is NULL, then does nothing.
+
+
+
+ Initialize the swscaler context sws_context.
+
+ @return zero or positive value on success, a negative value on
+ error
+
+
+
+Allocate an empty SwsContext. This must be filled and passed to
+sws_init_context(). For filling see AVOptions, options.c and
+sws_setColorspaceDetails().
+
+
+ Allocate and return an SwsContext. You need it to perform
+ scaling/conversion operations using sws_scale().
+
+ @param srcW the width of the source image
+ @param srcH the height of the source image
+ @param srcFormat the source image format
+ @param dstW the width of the destination image
+ @param dstH the height of the destination image
+ @param dstFormat the destination image format
+ @param flags specify which algorithm and options to use for rescaling
+ @return a pointer to an allocated context, or NULL in case of error
+ @note this function is to be removed after a saner alternative is
+ written
+ @deprecated Use sws_getCachedContext() instead.
+
+
+ Check if context can be reused, otherwise reallocate a new one.
+
+ If context is NULL, just calls sws_getContext() to get a new
+ context. Otherwise, checks if the parameters are the ones already
+ saved in context. If that is the case, returns the current
+ context. Otherwise, frees context and gets a new context with
+ the new parameters.
+
+ Be warned that srcFilter and dstFilter are not checked, they
+ are assumed to remain the same.
+
+
+
+Return a positive value if pix_fmt is a supported output format, 0
+otherwise.
+
+
+
+Return a positive value if pix_fmt is a supported input format, 0
+otherwise.
+
+
+
+Return the libswscale license.
+
+
+
+Return the libswscale build-time configuration.
+
+
+
+@}
+
+@file
+@brief
+ external api for the swscale stuff
+
+Those FF_API_* defines are not part of public API.
+They may change, break or disappear at any time.
+
+Return the LIBSWSCALE_VERSION_INT constant.
+
+
+
+ Test if the given container can store a codec.
+
+ @param std_compliance standards compliance level, one of FF_COMPLIANCE_*
+
+ @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot.
+ A negative number if this information is not available.
+
+
+
+ Return a positive value if the given filename has one of the given
+ extensions, 0 otherwise.
+
+ @param extensions a comma-separated list of filename extensions
+
+
+
+ Generate an SDP for an RTP session.
+
+ @param ac array of AVFormatContexts describing the RTP streams. If the
+ array is composed by only one context, such context can contain
+ multiple AVStreams (one AVStream per RTP stream). Otherwise,
+ all the contexts in the array (an AVCodecContext per RTP stream)
+ must contain only one AVStream.
+ @param n_files number of AVCodecContexts contained in ac
+ @param buf buffer where the SDP will be stored (must be allocated by
+ the caller)
+ @param size the size of the buffer
+ @return 0 if OK, AVERROR_xxx on error
+
+
+
+ Check whether filename actually is a numbered sequence generator.
+
+ @param filename possible numbered sequence string
+ @return 1 if a valid numbered sequence string, 0 otherwise
+
+
+
+ Return in 'buf' the path with '%d' replaced by a number.
+
+ Also handles the '%0nd' format where 'n' is the total number
+ of digits and '%%'.
+
+ @param buf destination buffer
+ @param buf_size destination buffer size
+ @param path numbered sequence string
+ @param number frame number
+ @return 0 if OK, -1 on format error
+
+
+
+@deprecated use av_find_info_tag in libavutil instead.
+
+
+
+Get the current time in microseconds.
+
+
+
+ Parse datestr and return a corresponding number of microseconds.
+
+ @param datestr String representing a date or a duration.
+ See av_parse_time() for the syntax of the provided string.
+ @deprecated in favor of av_parse_time()
+
+
+
+@deprecated Deprecated in favor of av_dump_format().
+
+
+
+ Split a URL string into components.
+
+ The pointers to buffers for storing individual components may be null,
+ in order to ignore that component. Buffers for components not found are
+ set to empty strings. If the port is not found, it is set to a negative
+ value.
+
+ @param proto the buffer for the protocol
+ @param proto_size the size of the proto buffer
+ @param authorization the buffer for the authorization
+ @param authorization_size the size of the authorization buffer
+ @param hostname the buffer for the host name
+ @param hostname_size the size of the hostname buffer
+ @param port_ptr a pointer to store the port number in
+ @param path the buffer for the path
+ @param path_size the size of the path buffer
+ @param url the URL to split
+
+
+
+ Add an index entry into a sorted list. Update the entry if the list
+ already contains it.
+
+ @param timestamp timestamp in the time base of the given stream
+
+
+
+ Get the codec tag for the given codec id id.
+ If no codec tag is found returns 0.
+
+ @param tags list of supported codec_id-codec_tag pairs, as stored
+ in AVInputFormat.codec_tag and AVOutputFormat.codec_tag
+
+
+
+ Send a nice dump of a packet to the log.
+
+ @param avcl A pointer to an arbitrary struct of which the first field is a
+ pointer to an AVClass struct.
+ @param level The importance level of the message, lower values signifying
+ higher importance.
+ @param pkt packet to dump
+ @param dump_payload True if the payload must be displayed, too.
+ @param st AVStream that the packet belongs to
+
+
+
+ Send a nice dump of a packet to the specified file stream.
+
+ @param f The file stream pointer where the dump should be sent to.
+ @param pkt packet to dump
+ @param dump_payload True if the payload must be displayed, too.
+ @param st AVStream that the packet belongs to
+
+
+
+ Send a nice hexadecimal dump of a buffer to the log.
+
+ @param avcl A pointer to an arbitrary struct of which the first field is a
+ pointer to an AVClass struct.
+ @param level The importance level of the message, lower values signifying
+ higher importance.
+ @param buf buffer
+ @param size buffer size
+
+ @see av_hex_dump, av_pkt_dump2, av_pkt_dump_log2
+
+
+
+@}
+
+ @defgroup lavf_misc Utility functions
+ @ingroup libavf
+ @{
+
+ Miscelaneous utility functions related to both muxing and demuxing
+ (or neither).
+
+ Send a nice hexadecimal dump of a buffer to the specified file stream.
+
+ @param f The file stream pointer where the dump should be sent to.
+ @param buf buffer
+ @param size buffer size
+
+ @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2
+
+
+
+Get timing information for the data currently output.
+The exact meaning of "currently output" depends on the format.
+It is mostly relevant for devices that have an internal buffer and/or
+work in real time.
+@param s media file handle
+@param stream stream in the media file
+@param dts[out] DTS of the last packet output for the stream, in stream
+ time_base units
+@param wall[out] absolute time when that packet whas output,
+ in microsecond
+@return 0 if OK, AVERROR(ENOSYS) if the format does not support it
+Note: some formats or devices may not allow to measure dts and wall
+atomically.
+
+
+
+ Return the output format in the list of registered output formats
+ which best matches the provided parameters, or return NULL if
+ there is no match.
+
+ @param short_name if non-NULL checks if short_name matches with the
+ names of the registered formats
+ @param filename if non-NULL checks if filename terminates with the
+ extensions of the registered formats
+ @param mime_type if non-NULL checks if mime_type matches with the
+ MIME type of the registered formats
+
+
+
+ Write the stream trailer to an output media file and free the
+ file private data.
+
+ May only be called after a successful call to av_write_header.
+
+ @param s media file handle
+ @return 0 if OK, AVERROR_xxx on error
+
+
+
+ Write a packet to an output media file ensuring correct interleaving.
+
+ The packet must contain one audio or video frame.
+ If the packets are already correctly interleaved, the application should
+ call av_write_frame() instead as it is slightly faster. It is also important
+ to keep in mind that completely non-interleaved input will need huge amounts
+ of memory to interleave with this, so it is preferable to interleave at the
+ demuxer level.
+
+ @param s media file handle
+ @param pkt The packet containing the data to be written. Libavformat takes
+ ownership of the data and will free it when it sees fit using the packet's
+ @ref AVPacket.destruct "destruct" field. The caller must not access the data
+ after this function returns, as it may already be freed.
+ Packet's @ref AVPacket.stream_index "stream_index" field must be set to the
+ index of the corresponding stream in @ref AVFormatContext.streams
+ "s.streams".
+ It is very strongly recommended that timing information (@ref AVPacket.pts
+ "pts", @ref AVPacket.dts "dts" @ref AVPacket.duration "duration") is set to
+ correct values.
+
+ @return 0 on success, a negative AVERROR on error.
+
+
+
+ Allocate the stream private data and write the stream header to an
+ output media file.
+ @note: this sets stream time-bases, if possible to stream->codec->time_base
+ but for some formats it might also be some other time base
+
+ @param s media file handle
+ @return 0 if OK, AVERROR_xxx on error
+
+ @deprecated use avformat_write_header.
+
+
+
+@addtogroup lavf_encoding
+@{
+
+ Allocate the stream private data and write the stream header to
+ an output media file.
+
+ @param s Media file handle, must be allocated with avformat_alloc_context().
+ Its oformat field must be set to the desired output format;
+ Its pb field must be set to an already openened AVIOContext.
+ @param options An AVDictionary filled with AVFormatContext and muxer-private options.
+ On return this parameter will be destroyed and replaced with a dict containing
+ options that were not found. May be NULL.
+
+ @return 0 on success, negative AVERROR on failure.
+
+ @see av_opt_find, av_dict_set, avio_open, av_oformat_next.
+
+
+
+@deprecated pass the options to avformat_write_header directly.
+
+
+
+@deprecated this function is not supposed to be called outside of lavf
+
+
+
+@}
+
+ Add a new stream to a media file.
+
+ Can only be called in the read_header() function. If the flag
+ AVFMTCTX_NOHEADER is in the format context, then new streams
+ can be added in read_packet too.
+
+ @param s media file handle
+ @param id file-format-dependent stream ID
+
+
+
+Close an opened input AVFormatContext. Free it and all its contents
+and set *s to NULL.
+
+
+
+ @deprecated use avformat_close_input()
+ Close a media file (but not its codecs).
+
+ @param s media file handle
+
+
+
+Free a AVFormatContext allocated by av_open_input_stream.
+@param s context to free
+@deprecated use av_close_input_file()
+
+
+
+ Pause a network-based stream (e.g. RTSP stream).
+
+ Use av_read_play() to resume it.
+
+
+
+Start playing a network-based stream (e.g. RTSP stream) at the
+current position.
+
+
+
+Seek to the keyframe at timestamp.
+'timestamp' in 'stream_index'.
+@param stream_index If stream_index is (-1), a default
+stream is selected, and timestamp is automatically converted
+from AV_TIME_BASE units to the stream specific time_base.
+@param timestamp Timestamp in AVStream.time_base units
+ or, if no stream is specified, in AV_TIME_BASE units.
+@param flags flags which select direction and seeking mode
+@return >= 0 on success
+
+
+
+ Read a transport packet from a media file.
+
+ This function is obsolete and should never be used.
+ Use av_read_frame() instead.
+
+ @param s media file handle
+ @param pkt is filled
+ @return 0 if OK, AVERROR_xxx on error
+
+
+
+ Find the "best" stream in the file.
+ The best stream is determined according to various heuristics as the most
+ likely to be what the user expects.
+ If the decoder parameter is non-NULL, av_find_best_stream will find the
+ default decoder for the stream's codec; streams for which no decoder can
+ be found are ignored.
+
+ @param ic media file handle
+ @param type stream type: video, audio, subtitles, etc.
+ @param wanted_stream_nb user-requested stream number,
+ or -1 for automatic selection
+ @param related_stream try to find a stream related (eg. in the same
+ program) to this one, or -1 if none
+ @param decoder_ret if non-NULL, returns the decoder for the
+ selected stream
+ @param flags flags; none are currently defined
+ @return the non-negative stream number in case of success,
+ AVERROR_STREAM_NOT_FOUND if no stream with the requested type
+ could be found,
+ AVERROR_DECODER_NOT_FOUND if streams were found but no decoder
+ @note If av_find_best_stream returns successfully and decoder_ret is not
+ NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec.
+
+
+
+ Find the programs which belong to a given stream.
+
+ @param ic media file handle
+ @param last the last found program, the search will start after this
+ program, or from the beginning if it is NULL
+ @param s stream index
+ @return the next program which belongs to s, NULL if no program is found or
+ the last program is not among the programs of ic.
+
+
+
+ Read packets of a media file to get stream information. This
+ is useful for file formats with no headers such as MPEG. This
+ function also computes the real framerate in case of MPEG-2 repeat
+ frame mode.
+ The logical file position is not changed by this function;
+ examined packets may be buffered for later processing.
+
+ @param ic media file handle
+ @param options If non-NULL, an ic.nb_streams long array of pointers to
+ dictionaries, where i-th member contains options for
+ codec corresponding to i-th stream.
+ On return each dictionary will be filled with options that were not found.
+ @return >=0 if OK, AVERROR_xxx on error
+
+ @note this function isn't guaranteed to open all the codecs, so
+ options being non-empty at return is a perfectly normal behavior.
+
+ @todo Let the user decide somehow what information is needed so that
+ we do not waste time getting stuff the user does not need.
+
+
+
+ Read packets of a media file to get stream information. This
+ is useful for file formats with no headers such as MPEG. This
+ function also computes the real framerate in case of MPEG-2 repeat
+ frame mode.
+ The logical file position is not changed by this function;
+ examined packets may be buffered for later processing.
+
+ @param ic media file handle
+ @return >=0 if OK, AVERROR_xxx on error
+ @todo Let the user decide somehow what information is needed so that
+ we do not waste time getting stuff the user does not need.
+
+ @deprecated use avformat_find_stream_info.
+
+
+
+ Open an input stream and read the header. The codecs are not opened.
+ The stream must be closed with av_close_input_file().
+
+ @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context).
+ May be a pointer to NULL, in which case an AVFormatContext is allocated by this
+ function and written into ps.
+ Note that a user-supplied AVFormatContext will be freed on failure.
+ @param filename Name of the stream to open.
+ @param fmt If non-NULL, this parameter forces a specific input format.
+ Otherwise the format is autodetected.
+ @param options A dictionary filled with AVFormatContext and demuxer-private options.
+ On return this parameter will be destroyed and replaced with a dict containing
+ options that were not found. May be NULL.
+
+ @return 0 on success, a negative AVERROR on failure.
+
+ @note If you want to use custom IO, preallocate the format context and set its pb field.
+
+
+
+ Open a media file as input. The codecs are not opened. Only the file
+ header (if present) is read.
+
+ @param ic_ptr The opened media file handle is put here.
+ @param filename filename to open
+ @param fmt If non-NULL, force the file format to use.
+ @param buf_size optional buffer size (zero if default is OK)
+ @param ap Additional parameters needed when opening the file
+ (NULL if default).
+ @return 0 if OK, AVERROR_xxx otherwise
+
+ @deprecated use avformat_open_input instead.
+
+
+
+Allocate all the structures needed to read an input stream.
+ This does not open the needed codecs for decoding the stream[s].
+@deprecated use avformat_open_input instead.
+
+
+
+ Probe a bytestream to determine the input format. Each time a probe returns
+ with a score that is too low, the probe buffer size is increased and another
+ attempt is made. When the maximum probe size is reached, the input format
+ with the highest score is returned.
+
+ @param pb the bytestream to probe
+ @param fmt the input format is put here
+ @param filename the filename of the stream
+ @param logctx the log context
+ @param offset the offset within the bytestream to probe from
+ @param max_probe_size the maximum probe buffer size (zero for default)
+ @return 0 in case of success, a negative value corresponding to an
+ AVERROR code otherwise
+
+
+
+ Guess the file format.
+
+ @param is_opened Whether the file is already opened; determines whether
+ demuxers with or without AVFMT_NOFILE are probed.
+ @param score_ret The score of the best detection.
+
+
+
+ Guess the file format.
+
+ @param is_opened Whether the file is already opened; determines whether
+ demuxers with or without AVFMT_NOFILE are probed.
+
+
+
+@addtogroup lavf_decoding
+@{
+
+Find AVInputFormat based on the short name of the input format.
+
+
+
+ Allocate an AVFormatContext for an output format.
+ avformat_free_context() can be used to free the context and
+ everything allocated by the framework within it.
+
+ @param *ctx is set to the created format context, or to NULL in
+ case of failure
+ @param oformat format to use for allocating the context, if NULL
+ format_name and filename are used instead
+ @param format_name the name of output format to use for allocating the
+ context, if NULL filename is used instead
+ @param filename the name of the filename to use for allocating the
+ context, may be NULL
+ @return >= 0 in case of success, a negative AVERROR code in case of
+ failure
+
+
+
+@deprecated deprecated in favor of avformat_alloc_output_context2()
+
+
+
+ Add a new stream to a media file.
+
+ When demuxing, it is called by the demuxer in read_header(). If the
+ flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also
+ be called in read_packet().
+
+ When muxing, should be called by the user before avformat_write_header().
+
+ @param c If non-NULL, the AVCodecContext corresponding to the new stream
+ will be initialized to use this codec. This is needed for e.g. codec-specific
+ defaults to be set, so codec should be provided if it is known.
+
+ @return newly created stream or NULL on error.
+
+
+
+ Get the AVClass for AVFormatContext. It can be used in combination with
+ AV_OPT_SEARCH_FAKE_OBJ for examining options.
+
+ @see av_opt_find().
+
+
+
+Free an AVFormatContext and all its streams.
+@param s context to free
+
+
+
+Allocate an AVFormatContext.
+avformat_free_context() can be used to free the context and everything
+allocated by the framework within it.
+
+
+
+If f is NULL, returns the first registered output format,
+if f is non-NULL, returns the next registered output format after f
+or NULL if f is the last one.
+
+
+
+If f is NULL, returns the first registered input format,
+if f is non-NULL, returns the next registered input format after f
+or NULL if f is the last one.
+
+
+
+Undo the initialization done by avformat_network_init.
+
+
+
+ Do global initialization of network components. This is optional,
+ but recommended, since it avoids the overhead of implicitly
+ doing the setup for each session.
+
+ Calling this function will become mandatory if using network
+ protocols at some major version bump.
+
+
+
+ Initialize libavformat and register all the muxers, demuxers and
+ protocols. If you do not call this function, then you can select
+ exactly which formats you want to support.
+
+ @see av_register_input_format()
+ @see av_register_output_format()
+ @see av_register_protocol()
+
+
+
+Return the libavformat license.
+
+
+
+Return the libavformat build-time configuration.
+
+
+
+ @defgroup lavf_core Core functions
+ @ingroup libavf
+
+ Functions for querying libavformat capabilities, allocating core structures,
+ etc.
+ @{
+
+Return the LIBAVFORMAT_VERSION_INT constant.
+
+
+
+Max chunk size in bytes
+Note, not all formats support this and unpredictable things may happen if it is used when not supported.
+- encoding: Set by user via AVOptions (NO direct access)
+- decoding: unused
+
+
+
+Max chunk time in microseconds.
+Note, not all formats support this and unpredictable things may happen if it is used when not supported.
+- encoding: Set by user via AVOptions (NO direct access)
+- decoding: unused
+
+
+
+Audio preload in microseconds.
+Note, not all formats support this and unpredictable things may happen if it is used when not supported.
+- encoding: Set by user via AVOptions (NO direct access)
+- decoding: unused
+
+
+
+Transport stream id.
+This will be moved into demuxer private options. Thus no API/ABI compatibility
+
+
+
+ Custom interrupt callbacks for the I/O layer.
+
+ decoding: set by the user before avformat_open_input().
+ encoding: set by the user before avformat_write_header()
+ (mainly useful for AVFMT_NOFILE formats). The callback
+ should also be passed to avio_open2() if it's used to
+ open the file.
+
+
+
+Error recognition; higher values will detect more errors but may
+misdetect some more or less valid parts as errors.
+- encoding: unused
+- decoding: Set by user.
+
+
+
+decoding: number of frames used to probe fps
+
+
+
+Start time of the stream in real world time, in microseconds
+since the unix epoch (00:00 1st January 1970). That is, pts=0
+in the stream was captured at this real world time.
+- encoding: Set by user.
+- decoding: Unused.
+
+
+
+Remaining size available for raw_packet_buffer, in bytes.
+NOT PART OF PUBLIC API
+
+
+
+Flags to enable debugging.
+
+
+
+Maximum amount of memory in bytes to use for buffering frames
+obtained from realtime capture devices.
+
+
+
+Maximum amount of memory in bytes to use for the index of each stream.
+If the index exceeds this size, entries will be discarded as
+needed to maintain a smaller size. This can lead to slower or less
+accurate seeking (depends on demuxer).
+Demuxers for which a full in-memory index is mandatory will ignore
+this.
+muxing : unused
+demuxing: set by user
+
+
+
+decoding: maximum time (in AV_TIME_BASE units) during which the input should
+be analyzed in avformat_find_stream_info().
+
+
+
+decoding: size of data to probe; encoding: unused.
+
+
+
+@deprecated, use the 'loop' img2 demuxer private option.
+
+
+
+ number of times to loop output in formats that support it
+
+ @deprecated use the 'loop' private option in the gif muxer.
+
+
+
+use mpeg muxer private options instead
+
+
+
+Decoding: total stream bitrate in bit/s, 0 if not
+available. Never set it directly if the file_size and the
+duration are known as FFmpeg can compute it automatically.
+
+
+
+decoding: total file size, 0 if unknown
+
+
+
+Decoding: duration of the stream, in AV_TIME_BASE fractional
+seconds. Only set this value if you know none of the individual stream
+durations and also do not set any of them. This is deduced from the
+AVStream values if not set.
+
+
+
+Decoding: position of the first frame of the component, in
+AV_TIME_BASE fractional seconds. NEVER set this value directly:
+It is deduced from the AVStream values.
+
+
+
+@deprecated use 'creation_time' metadata tag instead
+
+
+
+ A list of all streams in the file. New streams are created with
+ avformat_new_stream().
+
+ decoding: streams are created by libavformat in avformat_open_input().
+ If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also
+ appear in av_read_frame().
+ encoding: streams are created by the user before avformat_write_header().
+
+
+
+Format private data. This is an AVOptions-enabled struct
+if and only if iformat/oformat.priv_class is not NULL.
+
+
+
+A class for logging and AVOptions. Set by avformat_alloc_context().
+Exports (de)muxer private options if they exist.
+
+
+
+Format I/O context.
+New fields can be added to the end with minor version bumps.
+Removal, reordering and changes to existing fields require a major
+version bump.
+sizeof(AVFormatContext) must not be used outside libav*, use
+avformat_alloc_context() to create an AVFormatContext.
+
+
+
+New fields can be added to the end with minor version bumps.
+Removal, reordering and changes to existing fields require a major
+version bump.
+sizeof(AVProgram) must not be used outside libav*.
+
+
+
+flag to indicate that probing is requested
+NOT PART OF PUBLIC API
+
+
+
+Stream Identifier
+This is the MPEG-TS stream identifier +1
+0 means unknown
+
+
+
+Number of frames that have been demuxed during av_find_stream_info()
+
+
+
+Average framerate
+
+
+
+last packet in packet_buffer for this stream when muxing.
+Used internally, NOT PART OF PUBLIC API, do not read or
+write from outside of libav*
+
+
+This buffer is only needed when packets were already buffered but
+not decoded, for example to get the codec parameters in MPEG
+streams.
+
+
+Raw packets from the demuxer, prior to parsing and decoding.
+This buffer is used for buffering packets until the codec can
+be identified, as parsing cannot be done without knowing the
+codec.
+
+
+
+Number of packets to buffer for codec probing
+NOT PART OF PUBLIC API
+
+
+
+ Timestamp corresponding to the last dts sync point.
+
+ Initialized when AVCodecParserContext.dts_sync_point >= 0 and
+ a DTS is received from the underlying container. Otherwise set to
+ AV_NOPTS_VALUE by default.
+
+
+
+sample aspect ratio (0 if unknown)
+- encoding: Set by user.
+- decoding: Set by libavformat.
+
+
+
+Decoding: duration of the stream, in stream time base.
+If a source file does not specify a duration, but does specify
+a bitrate, this value will be estimated from bitrate and file size.
+
+
+
+Decoding: pts of the first frame of the stream in presentation order, in stream time base.
+Only set this if you are absolutely 100% sure that the value you set
+it to really is the pts of the first frame.
+This may be undefined (AV_NOPTS_VALUE).
+@note The ASF header does NOT contain a correct start_time the ASF
+demuxer must NOT set this.
+
+
+
+Quality, as it has been removed from AVCodecContext and put in AVVideoFrame.
+MN: dunno if that is the right place for it
+
+
+
+This is the fundamental unit of time (in seconds) in terms
+of which frame timestamps are represented. For fixed-fps content,
+time base should be 1/framerate and timestamp increments should be 1.
+decoding: set by libavformat
+encoding: set by libavformat in av_write_header
+
+
+
+encoding: pts generation when outputting stream
+
+
+
+Real base framerate of the stream.
+This is the lowest framerate with which all timestamps can be
+represented accurately (it is the least common multiple of all
+framerates in the stream). Note, this value is just a guess!
+For example, if the time base is 1/90000 and all frames have either
+approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1.
+
+
+
+Track should be used during playback by default.
+Useful for subtitle track that should be displayed
+even when user did not explicitly ask for subtitles.
+
+Stream structure.
+New fields can be added to the end with minor version bumps.
+Removal, reordering and changes to existing fields require a major
+version bump.
+sizeof(AVStream) must not be used outside libav*.
+
+
+
+@}
+
+
+
+Pause playing - only meaningful if using a network-based format
+(RTSP).
+
+
+
+Start/resume playing - only meaningful if using a network-based format
+(RTSP).
+
+
+
+General purpose read-only value that the format can use.
+
+
+
+If extensions are defined, then no probe is done. You should
+usually not use extension format guessing because it is not
+reliable enough
+
+
+
+Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS,
+AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH,
+AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK.
+
+
+
+Get the next timestamp in stream[stream_index].time_base units.
+@return the timestamp or AV_NOPTS_VALUE if an error occurred
+
+
+
+Seek to a given timestamp relative to the frames in
+stream component stream_index.
+@param stream_index Must not be -1.
+@param flags Selects which direction should be preferred if no exact
+ match is available.
+@return >= 0 on success (but not necessarily the new offset)
+
+
+
+Close the stream. The AVFormatContext and AVStreams are not
+freed by this function
+
+
+
+Read the format header and initialize the AVFormatContext
+structure. Return 0 if OK. 'ap' if non-NULL contains
+additional parameters. Only used in raw format right
+now. 'av_new_stream' should be called to create new streams.
+
+
+
+Tell if a given file has a chance of being parsed as this format.
+The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes
+big so you do not have to check for that unless you need more.
+
+
+
+Size of private data so that it can be allocated in the wrapper.
+
+
+
+Descriptive name for the format, meant to be more human-readable
+than name. You should use the NULL_IF_CONFIG_SMALL() macro
+to define it.
+
+
+
+A comma separated list of short names for the format. New names
+may be appended with a minor bump.
+
+
+
+@}
+
+@addtogroup lavf_decoding
+@{
+
+
+ Can only be iformat or oformat, not both at the same time.
+
+ decoding: set by avformat_open_input().
+ encoding: set by the user.
+
+
+
+ Test if the given codec can be stored in this container.
+
+ @return 1 if the codec is supported, 0 if it is not.
+ A negative number if unknown.
+
+
+
+List of supported codec_id-codec_tag pairs, ordered by "better
+choice first". The arrays are all terminated by CODEC_ID_NONE.
+
+
+
+can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE,
+AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS,
+AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH
+
+
+
+Write a packet. If AVFMT_ALLOW_FLUSH is set in flags,
+pkt can be NULL in order to flush data buffered in the muxer.
+When flushing, return 0 if there still is more data to flush,
+or 1 if everything was flushed and there is no more buffered
+data.
+
+
+
+size of private data so that it can be allocated in the wrapper
+
+
+
+Descriptive name for the format, meant to be more human-readable
+than name. You should use the NULL_IF_CONFIG_SMALL() macro
+to define it.
+
+
+
+Demuxer will use avio_open, no opened file should be provided by the caller.
+@addtogroup lavf_encoding
+@{
+
+
+
+This structure contains the data a format has to probe a file.
+
+
+
+ Read data and append it to the current content of the AVPacket.
+ If pkt->size is 0 this is identical to av_get_packet.
+ Note that this uses av_grow_packet and thus involves a realloc
+ which is inefficient. Thus this function should only be used
+ when there is no reasonable way to know (an upper bound of)
+ the final size.
+
+ @param pkt packet
+ @param size amount of data to read
+ @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data
+ will not be lost even if an error occurs.
+
+
+
+@}
+
+ Allocate and read the payload of a packet and initialize its
+ fields with default values.
+
+ @param pkt packet
+ @param size desired payload size
+ @return >0 (read size) if OK, AVERROR_xxx otherwise
+
+
+
+Free all the memory allocated for an AVDictionary struct.
+
+
+
+Copy metadata from one AVDictionary struct into another.
+@param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL,
+ this function will allocate a struct for you and put it in *dst
+@param src pointer to source AVDictionary struct
+@param flags flags to use when setting metadata in *dst
+@note metadata is read using the AV_DICT_IGNORE_SUFFIX flag
+
+
+
+This function is provided for compatibility reason and currently does nothing.
+
+
+
+ Get a metadata element with matching key.
+
+ @param prev Set to the previous matching element to find the next.
+ If set to NULL the first matching element is returned.
+ @param flags Allows case as well as suffix-insensitive comparisons.
+ @return Found tag or NULL, changing key or value leads to undefined behavior.
+
+
+
+Seek to a given timestamp relative to some component stream.
+Only meaningful if using a network streaming protocol (e.g. MMS.).
+@param stream_index The stream index that the timestamp is relative to.
+ If stream_index is (-1) the timestamp should be in AV_TIME_BASE
+ units from the beginning of the presentation.
+ If a stream_index >= 0 is used and the protocol does not support
+ seeking based on component streams, the call will fail.
+@param timestamp timestamp in AVStream.time_base units
+ or if there is no stream specified then in AV_TIME_BASE units.
+@param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE
+ and AVSEEK_FLAG_ANY. The protocol may silently ignore
+ AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will
+ fail if used and not supported.
+@return >= 0 on success
+@see AVInputFormat::read_seek
+
+
+
+Pause and resume playing - only meaningful if using a network streaming
+protocol (e.g. MMS).
+@param pause 1 for pause, 0 for resume
+
+
+
+ Iterate through names of available protocols.
+ @note it is recommanded to use av_protocol_next() instead of this
+
+ @param opaque A private pointer representing current protocol.
+ It must be a pointer to NULL on first iteration and will
+ be updated by successive calls to avio_enum_protocols.
+ @param output If set to 1, iterate over output protocols,
+ otherwise over input protocols.
+
+ @return A static string containing the name of current protocol or NULL
+
+
+
+ Return the written size and a pointer to the buffer. The buffer
+ must be freed with av_free().
+ Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer.
+
+ @param s IO context
+ @param pbuffer pointer to a byte buffer
+ @return the length of the byte buffer
+
+
+
+ Open a write only memory stream.
+
+ @param s new IO context
+ @return zero if no error.
+
+
+
+ Create and initialize a AVIOContext for accessing the
+ resource indicated by url.
+ @note When the resource indicated by url has been opened in
+ read+write mode, the AVIOContext can be used only for writing.
+
+ @param s Used to return the pointer to the created AVIOContext.
+ In case of failure the pointed to value is set to NULL.
+ @param flags flags which control how the resource indicated by url
+ is to be opened
+ @param int_cb an interrupt callback to be used at the protocols level
+ @param options A dictionary filled with protocol-private options. On return
+ this parameter will be destroyed and replaced with a dict containing options
+ that were not found. May be NULL.
+ @return 0 in case of success, a negative value corresponding to an
+ AVERROR code in case of failure
+
+
+
+@name URL open modes
+The flags argument to avio_open must be one of the following
+constants, optionally ORed with other flags.
+@{
+
+@}
+
+Use non-blocking mode.
+If this flag is set, operations on the context will return
+AVERROR(EAGAIN) if they can not be performed immediately.
+If this flag is not set, operations on the context will never return
+AVERROR(EAGAIN).
+Note that this flag does not affect the opening/connecting of the
+context. Connecting a protocol will always block if necessary (e.g. on
+network protocols) but never hang (e.g. on busy devices).
+Warning: non-blocking protocols is work-in-progress; this flag may be
+silently ignored.
+
+ Create and initialize a AVIOContext for accessing the
+ resource indicated by url.
+ @note When the resource indicated by url has been opened in
+ read+write mode, the AVIOContext can be used only for writing.
+
+ @param s Used to return the pointer to the created AVIOContext.
+ In case of failure the pointed to value is set to NULL.
+ @param flags flags which control how the resource indicated by url
+ is to be opened
+ @return 0 in case of success, a negative value corresponding to an
+ AVERROR code in case of failure
+
+
+
+ @name Functions for reading from AVIOContext
+ @{
+
+ @note return 0 if EOF, so you cannot use it if EOF handling is
+ necessary
+
+
+
+Read size bytes from AVIOContext into buf.
+@return number of bytes read or AVERROR
+
+
+
+@warning currently size is limited
+
+
+feof() equivalent for AVIOContext.
+@return non zero if and only if end of file
+
+
+
+Get the filesize.
+@return filesize or AVERROR
+
+
+
+ftell() equivalent for AVIOContext.
+@return position or AVERROR.
+
+
+
+Skip given number of bytes forward
+@return new position or AVERROR.
+
+
+
+Convert an UTF-8 string to UTF-16LE and write it.
+@return number of bytes written.
+
+
+
+Write a NULL-terminated string.
+@return number of bytes written.
+
+
+
+ Allocate and initialize an AVIOContext for buffered I/O. It must be later
+ freed with av_free().
+
+ @param buffer Memory block for input/output operations via AVIOContext.
+ The buffer must be allocated with av_malloc() and friends.
+ @param buffer_size The buffer size is very important for performance.
+ For protocols with fixed blocksize it should be set to this blocksize.
+ For others a typical size is a cache page, e.g. 4kb.
+ @param write_flag Set to 1 if the buffer should be writable, 0 otherwise.
+ @param opaque An opaque pointer to user-specific data.
+ @param read_packet A function for refilling the buffer, may be NULL.
+ @param write_packet A function for writing the buffer contents, may be NULL.
+ @param seek A function for seeking to specified byte position, may be NULL.
+
+ @return Allocated AVIOContext or NULL on failure.
+
+
+
+The callback is called in blocking functions to test regulary if
+asynchronous interruption is needed. AVERROR_EXIT is returned
+in this case by the interrupted function. 'NULL' means no interrupt
+callback is given.
+@deprecated Use interrupt_callback in AVFormatContext/avio_open2
+ instead.
+
+
+
+ Return AVIO_FLAG_* access flags corresponding to the access permissions
+ of the resource in url, or a negative value corresponding to an
+ AVERROR code in case of failure. The returned access flags are
+ masked by the value in flags.
+
+ @note This function is intrinsically unsafe, in the sense that the
+ checked resource may change its existence or permission status from
+ one call to another. Thus you should not trust the returned value,
+ unless you are sure that no other processes are accessing the
+ checked resource.
+
+
+
+Return a non-zero value if the resource indicated by url
+exists, 0 otherwise.
+@deprecated Use avio_check instead.
+
+
+
+return the written or read size
+
+
+@deprecated use AVIOContext.max_packet_size directly.
+
+
+
+@deprecated Use AVIOContext.seekable field directly.
+
+
+
+@deprecated use avio_get_str instead
+
+
+
+@note unlike fgets, the EOL character is not returned and a whole
+ line is parsed. return NULL if first char read was EOF
+
+
+@}
+
+
+
+@defgroup old_url_f_funcs Old url_f* functions
+The following functions are deprecated, use the "avio_"-prefixed functions instead.
+@{
+@ingroup lavf_io
+
+
+
+@}
+
+
+
+@defgroup old_avio_funcs Old put_/get_*() functions
+The following functions are deprecated. Use the "avio_"-prefixed functions instead.
+@{
+@ingroup lavf_io
+
+
+
+@}
+
+
+
+ Register the URLProtocol protocol.
+
+ @param size the size of the URLProtocol struct referenced
+
+
+
+returns the next registered protocol after the given protocol (the first if
+NULL is given), or NULL if protocol is the last one.
+
+
+
+@defgroup old_url_funcs Old url_* functions
+The following functions are deprecated. Use the buffered API based on #AVIOContext instead.
+@{
+@ingroup lavf_io
+
+
+
+@name URL open modes
+The flags argument to url_open and cosins must be one of the following
+constants, optionally ORed with other flags.
+@{
+
+@}
+
+Use non-blocking mode.
+If this flag is set, operations on the context will return
+AVERROR(EAGAIN) if they can not be performed immediately.
+If this flag is not set, operations on the context will never return
+AVERROR(EAGAIN).
+Note that this flag does not affect the opening/connecting of the
+context. Connecting a protocol will always block if necessary (e.g. on
+network protocols) but never hang (e.g. on busy devices).
+Warning: non-blocking protocols is work-in-progress; this flag may be
+silently ignored.
+
+
+
+@deprecated This struct is to be made private. Use the higher-level
+ AVIOContext-based API instead.
+
+
+
+URL Context.
+New fields can be added to the end with minor version bumps.
+Removal, reordering and changes to existing fields require a major
+version bump.
+sizeof(URLContext) must not be used outside libav*.
+@deprecated This struct will be made private
+
+
+
+
+Close currently opened video file if any.
+
+
+
+
+Write new video frame with a specific timestamp into currently opened video file.
+
+ Bitmap to add as a new video frame.
+ Frame timestamp, total time since recording started.
+
+ The specified bitmap must be either color 24 or 32 bpp image or grayscale 8 bpp (indexed) image.
+
+ The parameter allows user to specify presentation
+time of the frame being saved. However, it is user's responsibility to make sure the value is increasing
+over time.
+
+
+ Thrown if no video file was open.
+ The provided bitmap must be 24 or 32 bpp color image or 8 bpp grayscale image.
+ Bitmap size must be of the same as video size, which was specified on opening video file.
+ A error occurred while writing new video frame. See exception message.
+
+
+
+Write new video frame into currently opened video file.
+
+ Bitmap to add as a new video frame.
+
+ The specified bitmap must be either color 24 or 32 bpp image or grayscale 8 bpp (indexed) image.
+
+ Thrown if no video file was open.
+ The provided bitmap must be 24 or 32 bpp color image or 8 bpp grayscale image.
+ Bitmap size must be of the same as video size, which was specified on opening video file.
+ A error occurred while writing new video frame. See exception message.
+
+
+
+Create video file with the specified name and attributes.
+
+ Video file name to create.
+ Frame width of the video file.
+ Frame height of the video file.
+ Frame rate of the video file.
+ Video codec to use for compression.
+ Bit rate of the video stream.
+
+ The methods creates new video file with the specified name.
+If a file with such name already exists in the file system, it will be overwritten.
+ When adding new video frames using method,
+the video frame must have width and height as specified during file opening.
+
+ The bit rate parameter represents a trade-off value between video quality
+and video file size. Higher bit rate value increase video quality and result in larger
+file size. Smaller values result in opposite – worse quality and small video files.
+
+
+ Video file resolution must be a multiple of two.
+ Invalid video codec is specified.
+ A error occurred while creating new video file. See exception message.
+ Cannot open video file with the specified name.
+
+
+
+Create video file with the specified name and attributes.
+
+ Video file name to create.
+ Frame width of the video file.
+ Frame height of the video file.
+ Frame rate of the video file.
+ Video codec to use for compression.
+
+ The methods creates new video file with the specified name.
+If a file with such name already exists in the file system, it will be overwritten.
+ When adding new video frames using method,
+the video frame must have width and height as specified during file opening.
+
+ Video file resolution must be a multiple of two.
+ Invalid video codec is specified.
+ A error occurred while creating new video file. See exception message.
+ Cannot open video file with the specified name.
+
+
+
+Create video file with the specified name and attributes.
+
+ Video file name to create.
+ Frame width of the video file.
+ Frame height of the video file.
+ Frame rate of the video file.
+
+ See documentation to the
+for more information and the list of possible exceptions.
+
+ The method opens the video file using
+codec.
+
+
+
+
+
+Create video file with the specified name and attributes.
+
+ Video file name to create.
+ Frame width of the video file.
+ Frame height of the video file.
+
+ See documentation to the
+for more information and the list of possible exceptions.
+
+ The method opens the video file using
+codec and 25 fps frame rate.
+
+
+
+
+
+Disposes the object and frees its resources.
+
+
+
+
+Initializes a new instance of the class.
+
+
+
+
+Object's finalizer.
+
+
+
+
+The property specifies if a video file is opened or not by this instance of the class.
+
+
+
+
+Codec to use for the video file.
+
+ Thrown if no video file was open.
+
+
+
+Bit rate of the video stream.
+
+ Thrown if no video file was open.
+
+
+
+Frame rate of the opened video file.
+
+ Thrown if no video file was open.
+
+
+
+Frame height of the opened video file.
+
+ Thrown if no video file was open.
+
+
+
+Frame width of the opened video file.
+
+ Thrown if no video file was open.
+
+
+
+Class for writing video files utilizing FFmpeg library.
+
+
+ The class allows to write video files using FFmpeg library.
+
+ Make sure you have FFmpeg binaries (DLLs) in the output folder of your application in order
+to use this class successfully. FFmpeg binaries can be found in Externals folder provided with AForge.NET
+framework's distribution.
+
+ Sample usage:
+
+int width = 320;
+int height = 240;
+
+// create instance of video writer
+VideoFileWriter writer = new VideoFileWriter( );
+// create new video file
+writer.Open( "test.avi", width, height, 25, VideoCodec.MPEG4 );
+// create a bitmap to save into the video file
+Bitmap image = new Bitmap( width, height, PixelFormat.Format24bppRgb );
+// write 1000 video frames
+for ( int i = 0; i < 1000; i++ )
+{
+ image.SetPixel( i % width, i % height, Color.Red );
+ writer.WriteVideoFrame( image );
+}
+writer.Close( );
+
+
+
+
+ Get the AVClass for AVFrame. It can be used in combination with
+ AV_OPT_SEARCH_FAKE_OBJ for examining options.
+
+ @see av_opt_find().
+
+
+
+ Get the AVClass for AVCodecContext. It can be used in combination with
+ AV_OPT_SEARCH_FAKE_OBJ for examining options.
+
+ @see av_opt_find().
+
+
+
+ Register a user provided lock manager supporting the operations
+ specified by AVLockOp. mutex points to a (void *) where the
+ lockmgr should store/get a pointer to a user allocated mutex. It's
+ NULL upon AV_LOCK_CREATE and != NULL for all other ops.
+
+ @param cb User defined callback. Note: FFmpeg may invoke calls to this
+ callback during the call to av_lockmgr_register().
+ Thus, the application must be prepared to handle that.
+ If cb is set to NULL the lockmgr will be unregistered.
+ Also note that during unregistration the previously registered
+ lockmgr callback may also be invoked.
+
+
+
+Lock operation used by lockmgr
+
+
+
+If hwaccel is NULL, returns the first registered hardware accelerator,
+if hwaccel is non-NULL, returns the next registered hardware accelerator
+after hwaccel, or NULL if hwaccel is the last one.
+
+
+
+Register the hardware accelerator hwaccel.
+
+
+
+Log a generic warning message asking for a sample. This function is
+intended to be used internally by FFmpeg (libavcodec, libavformat, etc.)
+only, and would normally not be used by applications.
+@param[in] avc a pointer to an arbitrary struct of which the first field is
+a pointer to an AVClass struct
+@param[in] msg string containing an optional message, or NULL if no message
+
+
+
+Log a generic warning message about a missing feature. This function is
+intended to be used internally by FFmpeg (libavcodec, libavformat, etc.)
+only, and would normally not be used by applications.
+@param[in] avc a pointer to an arbitrary struct of which the first field is
+a pointer to an AVClass struct
+@param[in] feature string containing the name of the missing feature
+@param[in] want_sample indicates if samples are wanted which exhibit this feature.
+If want_sample is non-zero, additional verbage will be added to the log
+message which tells the user how to report samples to the development
+mailing list.
+
+
+
+ Encode extradata length to a buffer. Used by xiph codecs.
+
+ @param s buffer to write to; must be at least (v/255+1) bytes long
+ @param v size of extradata in bytes
+ @return number of bytes written to the buffer.
+
+
+
+Pad image.
+
+
+
+Crop image top and left side.
+
+
+
+Copy image src to dst. Wraps av_picture_data_copy() above.
+
+
+
+ Same behaviour av_fast_malloc but the buffer has additional
+ FF_INPUT_PADDING_SIZE at the end which will will always be 0.
+
+ In addition the whole buffer will initially and after resizes
+ be 0-initialized so that no uninitialized data will ever appear.
+
+
+
+ Allocate a buffer, reusing the given one if large enough.
+
+ Contrary to av_fast_realloc the current buffer contents might not be
+ preserved and on error the old buffer is freed, thus no special
+ handling to avoid memleaks is necessary.
+
+ @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer
+ @param size size of the buffer *ptr points to
+ @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and
+ *size 0 if an error occurred.
+
+
+
+ Reallocate the given block if it is not large enough, otherwise do nothing.
+
+ @see av_realloc
+
+
+
+Previous frame byte position.
+
+
+
+Byte position of currently parsed frame in stream.
+
+
+
+ Position of the packet in file.
+
+ Analogous to cur_frame_pts/dts
+
+
+
+ Presentation delay of current frame in units of AVCodecContext.time_base.
+
+ Set to INT_MIN when dts_sync_point unused. Otherwise, it must
+ contain valid non-negative timestamp delta (presentation time of a frame
+ must not lie in the past).
+
+ This delay represents the difference between decoding and presentation
+ time of the frame.
+
+ For example, this corresponds to H.264 dpb_output_delay.
+
+
+
+ Offset of the current timestamp against last timestamp sync point in
+ units of AVCodecContext.time_base.
+
+ Set to INT_MIN when dts_sync_point unused. Otherwise, it must
+ contain a valid timestamp offset.
+
+ Note that the timestamp of sync point has usually a nonzero
+ dts_ref_dts_delta, which refers to the previous sync point. Offset of
+ the next frame after timestamp sync point will be usually 1.
+
+ For example, this corresponds to H.264 cpb_removal_delay.
+
+
+
+ Time difference in stream time base units from the pts of this
+ packet to the point at which the output from the decoder has converged
+ independent from the availability of previous frames. That is, the
+ frames are virtually identical no matter if decoding started from
+ the very first frame or from this keyframe.
+ Is AV_NOPTS_VALUE if unknown.
+ This field is not the display duration of the current frame.
+ This field has no meaning if the packet does not have AV_PKT_FLAG_KEY
+ set.
+
+ The purpose of this field is to allow seeking in streams that have no
+ keyframes in the conventional sense. It corresponds to the
+ recovery point SEI in H.264 and match_time_delta in NUT. It is also
+ essential for some types of subtitle streams to ensure that all
+ subtitles are correctly displayed after seeking.
+
+
+
+Set by parser to 1 for key frames and 0 for non-key frames.
+It is initialized to -1, so if the parser doesn't set this flag,
+old-style fallback using AV_PICTURE_TYPE_I picture type as key frames
+will be used.
+
+
+
+Set if the parser has a valid file offset
+
+
+ This field is used for proper frame duration computation in lavf.
+ It signals, how much longer the frame duration of the current frame
+ is compared to normal frame duration.
+
+ frame_duration = (1 + repeat_pict) * time_base
+
+ It is used by codecs like H.264 to display telecined material.
+
+
+
+@deprecated Use av_get_bytes_per_sample() instead.
+
+
+
+ Return codec bits per sample.
+
+ @param[in] codec_id the codec
+ @return Number of bits per sample or zero if unknown for the given codec.
+
+
+
+ Return a single letter to describe the given picture type pict_type.
+
+ @param[in] pict_type the picture type
+ @return A single character representing the picture type.
+ @deprecated Use av_get_picture_type_char() instead.
+
+
+
+Flush buffers, should be called when seeking or when switching to a different stream.
+
+
+
+ Register all the codecs, parsers and bitstream filters which were enabled at
+ configuration time. If you do not call this function you can select exactly
+ which formats you want to support, by using the individual registration
+ functions.
+
+ @see avcodec_register
+ @see av_register_codec_parser
+ @see av_register_bitstream_filter
+
+
+
+ Encode a video frame from pict into buf.
+ The input picture should be
+ stored using a specific format, namely avctx.pix_fmt.
+
+ @param avctx the codec context
+ @param[out] buf the output buffer for the bitstream of encoded frame
+ @param[in] buf_size the size of the output buffer in bytes
+ @param[in] pict the input picture to encode
+ @return On error a negative value is returned, on success zero or the number
+ of bytes used from the output buffer.
+
+
+
+ Fill audio frame data and linesize.
+ AVFrame extended_data channel pointers are allocated if necessary for
+ planar audio.
+
+ @param frame the AVFrame
+ frame->nb_samples must be set prior to calling the
+ function. This function fills in frame->data,
+ frame->extended_data, frame->linesize[0].
+ @param nb_channels channel count
+ @param sample_fmt sample format
+ @param buf buffer to use for frame data
+ @param buf_size size of buffer
+ @param align plane size sample alignment
+ @return 0 on success, negative error code on failure
+
+
+
+ Encode a frame of audio.
+
+ Takes input samples from frame and writes the next output packet, if
+ available, to avpkt. The output packet does not necessarily contain data for
+ the most recent frame, as encoders can delay, split, and combine input frames
+ internally as needed.
+
+ @param avctx codec context
+ @param avpkt output AVPacket.
+ The user can supply an output buffer by setting
+ avpkt->data and avpkt->size prior to calling the
+ function, but if the size of the user-provided data is not
+ large enough, encoding will fail. All other AVPacket fields
+ will be reset by the encoder using av_init_packet(). If
+ avpkt->data is NULL, the encoder will allocate it.
+ The encoder will set avpkt->size to the size of the
+ output packet.
+ @param[in] frame AVFrame containing the raw audio data to be encoded.
+ May be NULL when flushing an encoder that has the
+ CODEC_CAP_DELAY capability set.
+ There are 2 codec capabilities that affect the allowed
+ values of frame->nb_samples.
+ If CODEC_CAP_SMALL_LAST_FRAME is set, then only the final
+ frame may be smaller than avctx->frame_size, and all other
+ frames must be equal to avctx->frame_size.
+ If CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame
+ can have any number of samples.
+ If neither is set, frame->nb_samples must be equal to
+ avctx->frame_size for all frames.
+ @param[out] got_packet_ptr This field is set to 1 by libavcodec if the
+ output packet is non-empty, and to 0 if it is
+ empty. If the function returns an error, the
+ packet can be assumed to be invalid, and the
+ value of got_packet_ptr is undefined and should
+ not be used.
+ @return 0 on success, negative error code on failure
+
+
+
+ Encode an audio frame from samples into buf.
+
+ @deprecated Use avcodec_encode_audio2 instead.
+
+ @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large.
+ However, for codecs with avctx->frame_size equal to 0 (e.g. PCM) the user
+ will know how much space is needed because it depends on the value passed
+ in buf_size as described below. In that case a lower value can be used.
+
+ @param avctx the codec context
+ @param[out] buf the output buffer
+ @param[in] buf_size the output buffer size
+ @param[in] samples the input buffer containing the samples
+ The number of samples read from this buffer is frame_size*channels,
+ both of which are defined in avctx.
+ For codecs which have avctx->frame_size equal to 0 (e.g. PCM) the number of
+ samples read from samples is equal to:
+ buf_size * 8 / (avctx->channels * av_get_bits_per_sample(avctx->codec_id))
+ This also implies that av_get_bits_per_sample() must not return 0 for these
+ codecs.
+ @return On error a negative value is returned, on success zero or the number
+ of bytes used to encode the data read from the input buffer.
+
+
+
+ Free all allocated data in the given subtitle struct.
+
+ @param sub AVSubtitle to free.
+
+
+
+ * Decode a subtitle message.
+ * Return a negative value on error, otherwise return the number of bytes used.
+ * If no subtitle could be decompressed, got_sub_ptr is zero.
+ * Otherwise, the subtitle is stored in *sub.
+ * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for
+ * simplicity, because the performance difference is expect to be negligible
+ * and reusing a get_buffer written for video codecs would probably perform badly
+ * due to a potentially very different allocation pattern.
+ *
+ * @param avctx the codec context
+ * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored, must be
+ freed with avsubtitle_free if *got_sub_ptr is set.
+ * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero.
+ * @param[in] avpkt The input AVPacket containing the input buffer.
+
+
+
+ Decode the audio frame of size avpkt->size from avpkt->data into frame.
+
+ Some decoders may support multiple frames in a single AVPacket. Such
+ decoders would then just decode the first frame. In this case,
+ avcodec_decode_audio4 has to be called again with an AVPacket containing
+ the remaining data in order to decode the second frame, etc...
+ Even if no frames are returned, the packet needs to be fed to the decoder
+ with remaining data until it is completely consumed or an error occurs.
+
+ @warning The input buffer, avpkt->data must be FF_INPUT_BUFFER_PADDING_SIZE
+ larger than the actual read bytes because some optimized bitstream
+ readers read 32 or 64 bits at once and could read over the end.
+
+ @note You might have to align the input buffer. The alignment requirements
+ depend on the CPU and the decoder.
+
+ @param avctx the codec context
+ @param[out] frame The AVFrame in which to store decoded audio samples.
+ Decoders request a buffer of a particular size by setting
+ AVFrame.nb_samples prior to calling get_buffer(). The
+ decoder may, however, only utilize part of the buffer by
+ setting AVFrame.nb_samples to a smaller value in the
+ output frame.
+ @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is
+ non-zero.
+ @param[in] avpkt The input AVPacket containing the input buffer.
+ At least avpkt->data and avpkt->size should be set. Some
+ decoders might also require additional fields to be set.
+ @return A negative error code is returned if an error occurred during
+ decoding, otherwise the number of bytes consumed from the input
+ AVPacket is returned.
+
+
+
+ Wrapper function which calls avcodec_decode_audio4.
+
+ @deprecated Use avcodec_decode_audio4 instead.
+
+ Decode the audio frame of size avpkt->size from avpkt->data into samples.
+ Some decoders may support multiple frames in a single AVPacket, such
+ decoders would then just decode the first frame. In this case,
+ avcodec_decode_audio3 has to be called again with an AVPacket that contains
+ the remaining data in order to decode the second frame etc.
+ If no frame
+ could be outputted, frame_size_ptr is zero. Otherwise, it is the
+ decompressed frame size in bytes.
+
+ @warning You must set frame_size_ptr to the allocated size of the
+ output buffer before calling avcodec_decode_audio3().
+
+ @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than
+ the actual read bytes because some optimized bitstream readers read 32 or 64
+ bits at once and could read over the end.
+
+ @warning The end of the input buffer avpkt->data should be set to 0 to ensure that
+ no overreading happens for damaged MPEG streams.
+
+ @warning You must not provide a custom get_buffer() when using
+ avcodec_decode_audio3(). Doing so will override it with
+ avcodec_default_get_buffer. Use avcodec_decode_audio4() instead,
+ which does allow the application to provide a custom get_buffer().
+
+ @note You might have to align the input buffer avpkt->data and output buffer
+ samples. The alignment requirements depend on the CPU: On some CPUs it isn't
+ necessary at all, on others it won't work at all if not aligned and on others
+ it will work but it will have an impact on performance.
+
+ In practice, avpkt->data should have 4 byte alignment at minimum and
+ samples should be 16 byte aligned unless the CPU doesn't need it
+ (AltiVec and SSE do).
+
+ @note Codecs which have the CODEC_CAP_DELAY capability set have a delay
+ between input and output, these need to be fed with avpkt->data=NULL,
+ avpkt->size=0 at the end to return the remaining frames.
+
+ @param avctx the codec context
+ @param[out] samples the output buffer, sample type in avctx->sample_fmt
+ If the sample format is planar, each channel plane will
+ be the same size, with no padding between channels.
+ @param[in,out] frame_size_ptr the output buffer size in bytes
+ @param[in] avpkt The input AVPacket containing the input buffer.
+ You can create such packet with av_init_packet() and by then setting
+ data and size, some decoders might in addition need other fields.
+ All decoders are designed to use the least fields possible though.
+ @return On error a negative value is returned, otherwise the number of bytes
+ used or zero if no frame data was decompressed (used) from the input AVPacket.
+
+
+
+@deprecated Set s->thread_count before calling avcodec_open2() instead of calling this.
+
+
+
+ Modify width and height values so that they will result in a memory
+ buffer that is acceptable for the codec if you also ensure that all
+ line sizes are a multiple of the respective linesize_align[i].
+
+ May only be used if a codec with CODEC_CAP_DR1 has been opened.
+ If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased
+ according to avcodec_get_edge_width() before.
+
+
+
+ Modify width and height values so that they will result in a memory
+ buffer that is acceptable for the codec if you do not use any horizontal
+ padding.
+
+ May only be used if a codec with CODEC_CAP_DR1 has been opened.
+ If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased
+ according to avcodec_get_edge_width() before.
+
+
+
+ Return the amount of padding in pixels which the get_buffer callback must
+ provide around the edge of the image for codecs which do not have the
+ CODEC_FLAG_EMU_EDGE flag.
+
+ @return Required padding in pixels.
+
+
+
+ Allocate an AVFrame and set its fields to default values. The resulting
+ struct can be deallocated by simply calling av_free().
+
+ @return An AVFrame filled with default values or NULL on failure.
+ @see avcodec_get_frame_defaults
+
+
+
+ Set the fields of the given AVFrame to default values.
+
+ @param pic The AVFrame of which the fields should be set to default values.
+
+
+
+ Copy the settings of the source AVCodecContext into the destination
+ AVCodecContext. The resulting destination codec context will be
+ unopened, i.e. you are required to call avcodec_open2() before you
+ can use this AVCodecContext to decode/encode video/audio data.
+
+ @param dest target codec context, should be initialized with
+ avcodec_alloc_context3(), but otherwise uninitialized
+ @param src source codec context
+ @return AVERROR() on error (e.g. memory allocation error), 0 on success
+
+
+
+ Allocate an AVCodecContext and set its fields to default values. The
+ resulting struct can be deallocated by simply calling av_free().
+
+ @param codec if non-NULL, allocate private data and initialize defaults
+ for the given codec. It is illegal to then call avcodec_open2()
+ with a different codec.
+
+ @return An AVCodecContext filled with default values or NULL on failure.
+ @see avcodec_get_context_defaults
+
+
+
+THIS FUNCTION IS NOT YET PART OF THE PUBLIC API!
+ * we WILL change its arguments and name a few times!
+
+
+ Allocate an AVCodecContext and set its fields to default values. The
+ resulting struct can be deallocated by simply calling av_free().
+
+ @return An AVCodecContext filled with default values or NULL on failure.
+ @see avcodec_get_context_defaults
+
+ @deprecated use avcodec_alloc_context3()
+
+
+
+ Set the fields of the given AVCodecContext to default values corresponding
+ to the given codec (defaults may be codec-dependent).
+
+ Do not call this function if a non-NULL codec has been passed
+ to avcodec_alloc_context3() that allocated this AVCodecContext.
+ If codec is non-NULL, it is illegal to call avcodec_open2() with a
+ different codec on this AVCodecContext.
+
+
+
+THIS FUNCTION IS NOT YET PART OF THE PUBLIC API!
+ * we WILL change its arguments and name a few times!
+
+
+ Set the fields of the given AVCodecContext to default values.
+
+ @param s The AVCodecContext of which the fields should be set to default values.
+ @deprecated use avcodec_get_context_defaults3
+
+
+
+ Return a name for the specified profile, if available.
+
+ @param codec the codec that is searched for the given profile
+ @param profile the profile value for which a name is requested
+ @return A name for the profile if found, NULL otherwise.
+
+
+
+ Find a registered decoder with the specified name.
+
+ @param name name of the requested decoder
+ @return A decoder if one was found, NULL otherwise.
+
+
+
+ Find a registered decoder with a matching codec ID.
+
+ @param id CodecID of the requested decoder
+ @return A decoder if one was found, NULL otherwise.
+
+
+
+ Find a registered encoder with the specified name.
+
+ @param name name of the requested encoder
+ @return An encoder if one was found, NULL otherwise.
+
+
+
+ Find a registered encoder with a matching codec ID.
+
+ @param id CodecID of the requested encoder
+ @return An encoder if one was found, NULL otherwise.
+
+
+
+ Register the codec codec and initialize libavcodec.
+
+ @warning either this function or avcodec_register_all() must be called
+ before any other libavcodec functions.
+
+ @see avcodec_register_all()
+
+
+
+@deprecated this function is called automatically from avcodec_register()
+and avcodec_register_all(), there is no need to call it manually
+
+
+
+Return the libavcodec license.
+
+
+
+Return the libavcodec build-time configuration.
+
+
+
+Return the LIBAVCODEC_VERSION_INT constant.
+
+
+
+If c is NULL, returns the first registered codec,
+if c is non-NULL, returns the next registered codec after c,
+or NULL if c is the last one.
+
+
+
+Tell if an image really has transparent alpha values.
+@return ored mask of FF_ALPHA_xxx constants
+
+
+
+ Compute what kind of losses will occur when converting from one specific
+ pixel format to another.
+ When converting from one pixel format to another, information loss may occur.
+ For example, when converting from RGB24 to GRAY, the color information will
+ be lost. Similarly, other losses occur when converting from some formats to
+ other formats. These losses can involve loss of chroma, but also loss of
+ resolution, loss of color depth, loss due to the color space conversion, loss
+ of the alpha bits or loss due to color quantization.
+ avcodec_get_fix_fmt_loss() informs you about the various types of losses
+ which will occur when converting from one pixel format to another.
+
+ @param[in] dst_pix_fmt destination pixel format
+ @param[in] src_pix_fmt source pixel format
+ @param[in] has_alpha Whether the source pixel format alpha channel is used.
+ @return Combination of flags informing you what kind of losses will occur
+ (maximum loss for an invalid dst_pix_fmt).
+
+
+
+ Put a string representing the codec tag codec_tag in buf.
+
+ @param buf_size size in bytes of buf
+ @return the length of the string that would have been generated if
+ enough space had been available, excluding the trailing null
+
+
+
+Return a value representing the fourCC code associated to the
+pixel format pix_fmt, or 0 if no associated fourCC code can be
+found.
+
+
+
+ Return the short name for a pixel format.
+
+ \see av_get_pix_fmt(), av_get_pix_fmt_string().
+ @deprecated Deprecated in favor of av_get_pix_fmt_name().
+
+
+
+Get the name of a codec.
+@return a static string identifying the codec; never NULL
+
+
+
+ Calculate the size in bytes that a picture of the given width and height
+ would occupy if stored in the given picture format.
+ Note that this returns the size of a compact representation as generated
+ by avpicture_layout(), which can be smaller than the size required for e.g.
+ avpicture_fill().
+
+ @param pix_fmt the given picture format
+ @param width the width of the image
+ @param height the height of the image
+ @return Image data size in bytes or -1 on error (e.g. too large dimensions).
+
+
+
+ Copy pixel data from an AVPicture into a buffer.
+ The data is stored compactly, without any gaps for alignment or padding
+ which may be applied by avpicture_fill().
+
+ @see avpicture_get_size()
+
+ @param[in] src AVPicture containing image data
+ @param[in] pix_fmt The format in which the picture data is stored.
+ @param[in] width the width of the image in pixels.
+ @param[in] height the height of the image in pixels.
+ @param[out] dest A buffer into which picture data will be copied.
+ @param[in] dest_size The size of 'dest'.
+ @return The number of bytes written to dest, or a negative value (error code) on error.
+
+
+
+ Fill in the AVPicture fields.
+ The fields of the given AVPicture are filled in by using the 'ptr' address
+ which points to the image data buffer. Depending on the specified picture
+ format, one or multiple image data pointers and line sizes will be set.
+ If a planar format is specified, several pointers will be set pointing to
+ the different picture planes and the line sizes of the different planes
+ will be stored in the lines_sizes array.
+ Call with ptr == NULL to get the required size for the ptr buffer.
+
+ To allocate the buffer and fill in the AVPicture fields in one call,
+ use avpicture_alloc().
+
+ @param picture AVPicture whose fields are to be filled in
+ @param ptr Buffer which will contain or contains the actual image data
+ @param pix_fmt The format in which the picture data is stored.
+ @param width the width of the image in pixels
+ @param height the height of the image in pixels
+ @return size of the image data in bytes
+
+
+
+ Free a picture previously allocated by avpicture_alloc().
+ The data buffer used by the AVPicture is freed, but the AVPicture structure
+ itself is not.
+
+ @param picture the AVPicture to be freed
+
+
+
+ Allocate memory for a picture. Call avpicture_free() to free it.
+
+ @see avpicture_fill()
+
+ @param picture the picture to be filled in
+ @param pix_fmt the format of the picture
+ @param width the width of the picture
+ @param height the height of the picture
+ @return zero if successful, a negative value if not
+
+
+
+ Compensate samplerate/timestamp drift. The compensation is done by changing
+ the resampler parameters, so no audible clicks or similar distortions occur
+ @param compensation_distance distance in output samples over which the compensation should be performed
+ @param sample_delta number of output samples which should be output less
+
+ example: av_resample_compensate(c, 10, 500)
+ here instead of 510 samples only 500 samples would be output
+
+ note, due to rounding the actual compensation might be slightly different,
+ especially if the compensation_distance is large and the in_rate used during init is small
+
+
+
+Resample an array of samples using a previously configured context.
+@param src an array of unconsumed samples
+@param consumed the number of samples of src which have been consumed are returned here
+@param src_size the number of unconsumed samples available
+@param dst_size the amount of space in samples available in dst
+@param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context.
+@return the number of samples written in dst or -1 if an error occurred
+
+
+
+ * Initialize an audio resampler.
+ * Note, if either rate is not an integer then simply scale both rates up so they are.
+ * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq
+ * @param log2_phase_count log2 of the number of entries in the polyphase filterbank
+ * @param linear If 1 then the used FIR filter will be linearly interpolated
+ between the 2 closest, if 0 the closest will be used
+ * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate
+
+
+
+ Free resample context.
+
+ @param s a non-NULL pointer to a resample context previously
+ created with av_audio_resample_init()
+
+
+
+ * Initialize audio resampling context.
+ *
+ * @param output_channels number of output channels
+ * @param input_channels number of input channels
+ * @param output_rate output sample rate
+ * @param input_rate input sample rate
+ * @param sample_fmt_out requested output sample format
+ * @param sample_fmt_in input sample format
+ * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency
+ * @param log2_phase_count log2 of the number of entries in the polyphase filterbank
+ * @param linear if 1 then the used FIR filter will be linearly interpolated
+ between the 2 closest, if 0 the closest will be used
+ * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate
+ * @return allocated ReSampleContext, NULL if error occurred
+
+
+
+ Get side information from packet.
+
+ @param pkt packet
+ @param type desired side information type
+ @param size pointer for side information size to store (optional)
+ @return pointer to data if present or NULL otherwise
+
+
+
+ Allocate new information of a packet.
+
+ @param pkt packet
+ @param type side information type
+ @param size side information size
+ @return pointer to fresh allocated data or NULL otherwise
+
+
+
+ Free a packet.
+
+ @param pkt packet to free
+
+
+
+@warning This is a hack - the packet memory allocation stuff is broken. The
+packet is allocated if it was not really allocated.
+
+
+
+ Increase packet size, correctly zeroing padding
+
+ @param pkt packet
+ @param grow_by number of bytes by which to increase the size of the packet
+
+
+
+ Reduce packet size, correctly zeroing padding
+
+ @param pkt packet
+ @param size new size
+
+
+
+ Allocate the payload of a packet and initialize its fields with
+ default values.
+
+ @param pkt packet
+ @param size wanted payload size
+ @return 0 if OK, AVERROR_xxx otherwise
+
+
+
+ Initialize optional fields of a packet with default values.
+
+ @param pkt packet
+
+
+
+Default packet destructor.
+
+
+
+@deprecated use NULL instead
+
+
+
+0 terminated ASS/SSA compatible event line.
+The pressentation of this is unaffected by the other values in this
+struct.
+
+
+
+data+linesize for the bitmap of this subtitle.
+can be set for text/ass as well once they where rendered
+
+
+
+Formatted text, the ass field must be set by the decoder and is
+authoritative. pict and text fields may contain approximations.
+
+
+
+Plain text, the text field must be set by the decoder and is
+authoritative. ass and pict fields may contain approximations.
+
+
+
+four components are given, that's all.
+the last component is alpha
+
+
+
+ Size of HW accelerator private data.
+
+ Private data is allocated with av_mallocz() before
+ AVCodecContext.get_buffer() and deallocated after
+ AVCodecContext.release_buffer().
+
+
+
+ Called at the end of each frame or field picture.
+
+ The whole picture is parsed at this point and can now be sent
+ to the hardware accelerator. This function is mandatory.
+
+ @param avctx the codec context
+ @return zero if successful, a negative value otherwise
+
+
+
+ Callback for each slice.
+
+ Meaningful slice information (codec specific) is guaranteed to
+ be parsed at this point. This function is mandatory.
+
+ @param avctx the codec context
+ @param buf the slice data buffer base
+ @param buf_size the size of the slice in bytes
+ @return zero if successful, a negative value otherwise
+
+
+
+ Called at the beginning of each frame or field picture.
+
+ Meaningful frame information (codec specific) is guaranteed to
+ be parsed at this point. This function is mandatory.
+
+ Note that buf can be NULL along with buf_size set to 0.
+ Otherwise, this means the whole frame is available at this point.
+
+ @param avctx the codec context
+ @param buf the frame data buffer base
+ @param buf_size the size of the frame in bytes
+ @return zero if successful, a negative value otherwise
+
+
+
+Hardware accelerated codec capabilities.
+see FF_HWACCEL_CODEC_CAP_*
+
+
+
+ Codec implemented by the hardware accelerator.
+
+ See CODEC_ID_xxx
+
+
+Forced video codec_id.
+Demuxing: Set by user.
+
+
+Forced audio codec_id.
+Demuxing: Set by user.
+
+
+Forced subtitle codec_id.
+Demuxing: Set by user.
+
+
+@}
+
+
+Guess the codec ID based upon muxer and filename.
+
+
+ Get the CodecID for the given codec tag tag.
+ If no codec id is found returns CODEC_ID_NONE.
+
+ @param tags list of supported codec_id-codec_tag pairs, as stored
+ in AVInputFormat.codec_tag and AVOutputFormat.codec_tag
+
+
+
+Name of the hardware accelerated codec.
+The name is globally unique among encoders and among decoders (but an
+encoder and a decoder can share the same name).
+
+
+
+ Encode data to an AVPacket.
+
+ @param avctx codec context
+ @param avpkt output AVPacket (may contain a user-provided buffer)
+ @param[in] frame AVFrame containing the raw data to be encoded
+ @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a
+ non-empty packet was returned in avpkt.
+ @return 0 on success, negative error code on failure
+
+
+
+Initialize codec static data, called from avcodec_register().
+
+
+
+@}
+Private codec-specific defaults.
+
+
+
+ Copy necessary context variables from a previous thread context to the current one.
+ If not defined, the next thread will start automatically; otherwise, the codec
+ must call ff_thread_finish_setup().
+
+ dst and src will (rarely) point to the same context, in which case memcpy should be skipped.
+
+
+
+@name Frame-level threading support functions
+@{
+
+If defined, called on thread contexts when they are created.
+If the codec allocates writable tables in init(), re-allocate them here.
+priv_data will be set to a copy of the original.
+
+
+
+Descriptive name for the codec, meant to be more human readable than name.
+You should use the NULL_IF_CONFIG_SMALL() macro to define it.
+
+
+
+Flush buffers.
+Will be called when seeking
+
+
+
+Codec capabilities.
+see CODEC_CAP_*
+
+
+
+Name of the codec implementation.
+The name is globally unique among encoders and among decoders (but an
+encoder and a decoder can share the same name).
+This is the primary way to find a codec from the user perspective.
+
+
+
+AVCodec.
+
+
+
+AVProfile.
+
+
+
+Current statistics for PTS correction.
+- decoding: maintained and used by libavcodec, not intended to be used by user apps
+- encoding: unused
+
+
+
+Field order
+ * - encoding: set by libavcodec
+ * - decoding: Set by libavcodec
+
+
+
+ Private context used for internal data.
+
+ Unlike priv_data, this is not codec-specific. It is used in general
+ libavcodec functions.
+
+
+
+Error recognition; may misdetect some more or less valid parts as errors.
+- encoding: unused
+- decoding: Set by user.
+
+
+
+Type of service that the audio stream conveys.
+- encoding: Set by user.
+- decoding: Set by libavcodec.
+
+
+
+VBV delay coded in the last frame (in periods of a 27 MHz clock).
+Used for compliant TS muxing.
+- encoding: Set by libavcodec.
+- decoding: unused.
+
+
+
+Set by the client if its custom get_buffer() callback can be called
+from another thread, which allows faster multithreaded decoding.
+draw_horiz_band() will be called from other threads regardless of this setting.
+Ignored if the default get_buffer() is used.
+- encoding: Set by user.
+- decoding: Set by user.
+
+
+
+Which multithreading methods are in use by the codec.
+- encoding: Set by libavcodec.
+- decoding: Set by libavcodec.
+
+
+
+ Which multithreading methods to use.
+ Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread,
+ so clients which cannot provide future frames should not use it.
+
+ - encoding: Set by user, otherwise the default is used.
+ - decoding: Set by user, otherwise the default is used.
+
+
+
+ Whether this is a copy of the context which had init() called on it.
+ This is used by multithreading - shared tables and picture pointers
+ should be freed from the original context only.
+ - encoding: Set by libavcodec.
+ - decoding: Set by libavcodec.
+
+ @deprecated this field has been moved to an internal context
+
+
+
+Current packet as passed into the decoder, to avoid having
+to pass the packet into every function. Currently only valid
+inside lavc and get/release_buffer callbacks.
+- decoding: set by avcodec_decode_*, read by get_buffer() for setting pkt_pts
+- encoding: unused
+
+
+
+Header containing style information for text subtitles.
+For SUBTITLE_ASS subtitle type, it should contain the whole ASS
+[Script Info] and [V4+ Styles] section, plus the [Events] line and
+the Format line following. It shouldn't include any Dialogue line.
+- encoding: Set/allocated/freed by user (before avcodec_open2())
+- decoding: Set/allocated/freed by libavcodec (by avcodec_open2())
+
+
+
+Number of slices.
+Indicates number of picture subdivisions. Used for parallelized
+decoding.
+- encoding: Set by user
+- decoding: unused
+
+
+
+Number of passes to use for Cholesky factorization during LPC analysis
+- encoding: Set by user
+- decoding: unused
+
+
+
+Constant rate factor maximum
+With CRF encoding mode and VBV restrictions enabled, prevents quality from being worse
+than crf_max, even if doing so would violate VBV restrictions.
+- encoding: Set by user.
+- decoding: unused
+
+
+
+RC lookahead
+Number of frames for frametype and ratecontrol lookahead
+- encoding: Set by user
+- decoding: unused
+
+
+
+PSY trellis
+Strength of psychovisual optimization
+- encoding: Set by user
+- decoding: unused
+
+
+
+PSY RD
+Strength of psychovisual optimization
+- encoding: Set by user
+- decoding: unused
+
+
+
+AQ strength
+Reduces blocking and blurring in flat and textured areas.
+- encoding: Set by user
+- decoding: unused
+
+
+
+AQ mode
+0: Disabled
+1: Variance AQ (complexity mask)
+2: Auto-variance AQ (experimental)
+- encoding: Set by user
+- decoding: unused
+
+
+
+explicit P-frame weighted prediction analysis method
+0: off
+1: fast blind weighting (one reference duplicate with -1 offset)
+2: smart weighting (full fade detection analysis)
+- encoding: Set by user.
+- decoding: unused
+
+
+
+MPEG vs JPEG YUV range.
+- encoding: Set by user
+- decoding: Set by libavcodec
+
+
+
+YUV colorspace type.
+- encoding: Set by user
+- decoding: Set by libavcodec
+
+
+
+Color Transfer Characteristic.
+- encoding: Set by user
+- decoding: Set by libavcodec
+
+
+
+Chromaticity coordinates of the source primaries.
+- encoding: Set by user
+- decoding: Set by libavcodec
+
+
+
+Hardware accelerator context.
+For some hardware accelerators, a global context needs to be
+provided by the user. In that case, this holds display-dependent
+data FFmpeg cannot instantiate itself. Please refer to the
+FFmpeg HW accelerator documentation to know how to fill this
+is. e.g. for VA API, this is a struct vaapi_context.
+- encoding: unused
+- decoding: Set by user
+
+
+
+ For some codecs, the time base is closer to the field rate than the frame rate.
+ Most notably, H.264 and MPEG-2 specify time_base as half of frame duration
+ if no telecine is used ...
+
+ Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2.
+
+
+
+Hardware accelerator in use
+- encoding: unused.
+- decoding: Set by libavcodec
+
+
+AVHWAccel.
+
+
+
+Request decoder to use this channel layout if it can (0 for default)
+- encoding: unused
+- decoding: Set by user.
+
+
+
+Audio channel layout.
+- encoding: set by user.
+- decoding: set by user, may be overwritten by libavcodec.
+
+
+
+Bits per sample/pixel of internal libavcodec pixel/sample format.
+- encoding: set by user.
+- decoding: set by libavcodec.
+
+
+
+opaque 64bit number (generally a PTS) that will be reordered and
+output in AVFrame.reordered_opaque
+@deprecated in favor of pkt_pts
+- encoding: unused
+- decoding: Set by user.
+
+
+
+Percentage of dynamic range compression to be applied by the decoder.
+The default value is 1.0, corresponding to full compression.
+- encoding: unused
+- decoding: Set by user.
+@deprecated use AC3 decoder private option instead.
+
+
+
+Decoder should decode to this many channels if it can (0 for default)
+- encoding: unused
+- decoding: Set by user.
+@deprecated Deprecated in favor of request_channel_layout.
+
+
+
+@}
+
+GOP timecode frame start number
+- encoding: Set by user, in non drop frame format
+- decoding: Set by libavcodec (timecode in the 25 bits format, -1 if unset)
+
+
+
+- encoding: Set by user.
+- decoding: unused
+
+
+
+- encoding: Set by user.
+- decoding: unused
+
+
+
+search method for selecting prediction order
+- encoding: Set by user.
+- decoding: unused
+
+
+
+@name FLAC options
+@deprecated Use FLAC encoder private options instead.
+@{
+
+LPC coefficient precision - used by FLAC encoder
+- encoding: Set by user.
+- decoding: unused
+
+
+
+- encoding: Set by user.
+- decoding: unused
+
+
+
+- encoding: Set by user.
+- decoding: unused
+
+
+
+- encoding: Set by user.
+- decoding: unused
+
+
+
+Adjust sensitivity of b_frame_strategy 1.
+- encoding: Set by user.
+- decoding: unused
+
+
+
+
+ Note: Value depends upon the compare function used for fullpel ME.
+ - encoding: Set by user.
+ - decoding: unused
+
+
+
+Multiplied by qscale for each frame and added to scene_change_score.
+- encoding: Set by user.
+- decoding: unused
+
+
+
+Audio cutoff bandwidth (0 means "automatic")
+- encoding: Set by user.
+- decoding: unused
+
+
+
+direct MV prediction mode - 0 (none), 1 (spatial), 2 (temporal), 3 (auto)
+- encoding: Set by user.
+- decoding: unused
+
+
+
+macroblock subpartition sizes to consider - p8x8, p4x4, b8x8, i8x8, i4x4
+- encoding: Set by user.
+- decoding: unused
+
+
+
+in-loop deblocking filter beta parameter
+beta is in the range -6...6
+- encoding: Set by user.
+- decoding: unused
+
+
+
+in-loop deblocking filter alphac0 parameter
+alpha is in the range -6...6
+- encoding: Set by user.
+- decoding: unused
+
+
+
+Reduce fluctuations in qp (before curve compression).
+- encoding: Set by user.
+- decoding: unused
+
+
+
+trellis RD quantization
+- encoding: Set by user.
+- decoding: unused
+
+
+
+Influence how often B-frames are used.
+- encoding: Set by user.
+- decoding: unused
+
+
+
+chroma qp offset from luma
+- encoding: Set by user.
+- decoding: unused
+
+
+
+number of reference frames
+- encoding: Set by user.
+- decoding: Set by lavc.
+
+
+
+minimum GOP size
+- encoding: Set by user.
+- decoding: unused
+
+
+
+constant quantization parameter rate control method
+- encoding: Set by user.
+- decoding: unused
+ @deprecated use 'cqp' libx264 private option
+
+
+
+constant rate factor - quality-based VBR - values ~correspond to qps
+- encoding: Set by user.
+- decoding: unused
+ @deprecated use 'crf' libx264 private option
+
+
+
+
+ - encoding: Set by user.
+ - decoding: unused
+
+
+
+
+ - encoding: Set by user.
+ - decoding: unused
+
+
+
+
+ - encoding: unused
+ - decoding: Set by user.
+
+
+
+ - encoding: unused
+ - decoding: Set by user.
+
+
+
+ - encoding: unused
+ - decoding: Set by user.
+
+
+
+
+ - encoding: Set by user.
+ - decoding: unused
+
+
+
+maximum MB lagrange multipler
+- encoding: Set by user.
+- decoding: unused
+
+
+
+minimum MB lagrange multipler
+- encoding: Set by user.
+- decoding: unused
+
+
+
+Border processing masking, raises the quantizer for mbs on the borders
+of the picture.
+- encoding: Set by user.
+- decoding: unused
+
+
+
+frame skip comparison function
+- encoding: Set by user.
+- decoding: unused
+
+
+
+frame skip exponent
+- encoding: Set by user.
+- decoding: unused
+
+
+
+frame skip factor
+- encoding: Set by user.
+- decoding: unused
+
+
+
+frame skip threshold
+- encoding: Set by user.
+- decoding: unused
+
+
+
+Bitstream width / height, may be different from width/height if lowres enabled.
+- encoding: unused
+- decoding: Set by user before init if known. Codec should override / dynamically change if needed.
+
+
+
+low resolution decoding, 1-> 1/2 size, 2->1/4 size
+- encoding: unused
+- decoding: Set by user.
+
+
+
+level
+- encoding: Set by user.
+- decoding: Set by libavcodec.
+
+
+
+profile
+- encoding: Set by user.
+- decoding: Set by libavcodec.
+
+
+
+Number of macroblock rows at the bottom which are skipped.
+- encoding: unused
+- decoding: Set by user.
+
+
+
+Number of macroblock rows at the top which are skipped.
+- encoding: unused
+- decoding: Set by user.
+
+
+
+noise vs. sse weight for the nsse comparsion function
+- encoding: Set by user.
+- decoding: unused
+
+
+
+precision of the intra DC coefficient - 8
+- encoding: Set by user.
+- decoding: unused
+
+
+
+Macroblock threshold below which the user specified macroblock types will be used.
+- encoding: Set by user.
+- decoding: unused
+
+
+
+ Motion estimation threshold below which no motion estimation is
+ performed, but instead the user specified motion vectors are used.
+
+ - encoding: Set by user.
+ - decoding: unused
+
+
+
+thread opaque
+Can be used by execute() to store some per AVCodecContext stuff.
+- encoding: set by execute()
+- decoding: set by execute()
+
+
+
+The codec may call this to execute several independent things.
+It will return only after finishing all tasks.
+The user may replace this with some multithreaded implementation,
+the default implementation will execute the parts serially.
+@param count the number of things to execute
+- encoding: Set by libavcodec, user can override.
+- decoding: Set by libavcodec, user can override.
+
+
+
+thread count
+is used to decide how many independent tasks should be passed to execute()
+- encoding: Set by user.
+- decoding: Set by user.
+
+
+
+quantizer noise shaping
+- encoding: Set by user.
+- decoding: unused
+
+
+
+MP3 antialias algorithm, see FF_AA_* below.
+- encoding: unused
+- decoding: Set by user.
+
+
+
+Simulates errors in the bitstream to test error concealment.
+- encoding: Set by user.
+- decoding: unused
+
+
+
+CODEC_FLAG2_*
+- encoding: Set by user.
+- decoding: Set by user.
+
+
+
+
+ - encoding: Set by user.
+ - decoding: unused
+
+
+
+Number of bits which should be loaded into the rc buffer before decoding starts.
+- encoding: Set by user.
+- decoding: unused
+
+
+
+Called at the beginning of a frame to get cr buffer for it.
+Buffer type (size, hints) must be the same. libavcodec won't check it.
+libavcodec will pass previous buffer in pic, function should return
+same buffer or new buffer with old frame "painted" into it.
+If pic.data[0] == NULL must behave like get_buffer().
+if CODEC_CAP_DR1 is not set then reget_buffer() must call
+avcodec_default_reget_buffer() instead of providing buffers allocated by
+some other means.
+- encoding: unused
+- decoding: Set by libavcodec, user can override.
+
+
+
+noise reduction strength
+- encoding: Set by user.
+- decoding: unused
+
+
+
+palette control structure
+- encoding: ??? (no palette-enabled encoder yet)
+- decoding: Set by user.
+
+
+ AVPaletteControl
+ This structure defines a method for communicating palette changes
+ between and demuxer and a decoder.
+
+ @deprecated Use AVPacket to send palette changes instead.
+ This is totally broken.
+
+
+
+maximum Lagrange multipler
+- encoding: Set by user.
+- decoding: unused
+
+
+
+minimum Lagrange multipler
+- encoding: Set by user.
+- decoding: unused
+
+
+
+scene change detection threshold
+0 is default, larger means fewer detected scene changes.
+- encoding: Set by user.
+- decoding: unused
+
+
+
+custom inter quantization matrix
+- encoding: Set by user, can be NULL.
+- decoding: Set by libavcodec.
+
+
+
+custom intra quantization matrix
+- encoding: Set by user, can be NULL.
+- decoding: Set by libavcodec.
+
+
+
+macroblock decision mode
+- encoding: Set by user.
+- decoding: unused
+
+
+
+XVideo Motion Acceleration
+- encoding: forbidden
+- decoding: set by decoder
+
+
+
+slice flags
+- encoding: unused
+- decoding: Set by user.
+
+
+
+context model
+- encoding: Set by user.
+- decoding: unused
+
+
+
+coder type
+- encoding: Set by user.
+- decoding: unused
+
+
+
+Global quality for codecs which cannot change it per frame.
+This should be proportional to MPEG-1/2/4 qscale.
+- encoding: Set by user.
+- decoding: unused
+
+
+
+internal_buffers
+Don't touch, used by libavcodec default_get_buffer().
+@deprecated this field was moved to an internal context
+
+
+
+internal_buffer count
+Don't touch, used by libavcodec default_get_buffer().
+@deprecated this field was moved to an internal context
+
+
+
+color table ID
+- encoding: unused
+- decoding: Which clrtable should be used for 8bit RGB images.
+ Tables have to be stored somewhere. FIXME
+
+
+
+inter quantizer bias
+- encoding: Set by user.
+- decoding: unused
+
+
+
+intra quantizer bias
+- encoding: Set by user.
+- decoding: unused
+
+
+
+ maximum motion estimation search range in subpel units
+ If 0 then no limit.
+
+ - encoding: Set by user.
+ - decoding: unused
+
+
+
+ DTG active format information (additional aspect ratio
+ information only used in DVB MPEG-2 transport streams)
+ 0 if not set.
+
+ - encoding: unused
+ - decoding: Set by decoder.
+
+
+
+subpel ME quality
+- encoding: Set by user.
+- decoding: unused
+
+
+
+motion estimation prepass comparison function
+- encoding: Set by user.
+- decoding: unused
+
+
+
+prepass for motion estimation
+- encoding: Set by user.
+- decoding: unused
+
+
+
+amount of previous MV predictors (2a+1 x 2a+1 square)
+- encoding: Set by user.
+- decoding: unused
+
+
+
+interlaced DCT comparison function
+- encoding: Set by user.
+- decoding: unused
+
+
+
+macroblock comparison function (not supported yet)
+- encoding: Set by user.
+- decoding: unused
+
+
+
+subpixel motion estimation comparison function
+- encoding: Set by user.
+- decoding: unused
+
+
+
+motion estimation comparison function
+- encoding: Set by user.
+- decoding: unused
+
+
+
+debug
+- encoding: Set by user.
+- decoding: Set by user.
+
+
+
+debug
+- encoding: Set by user.
+- decoding: Set by user.
+
+
+
+the picture in the bitstream
+- encoding: Set by libavcodec.
+- decoding: Set by libavcodec.
+
+
+
+sample aspect ratio (0 if unknown)
+That is the width of a pixel divided by the height of the pixel.
+Numerator and denominator must be relatively prime and smaller than 256 for some video standards.
+- encoding: Set by user.
+- decoding: Set by libavcodec.
+
+
+
+prediction method (needed for huffyuv)
+- encoding: Set by user.
+- decoding: unused
+
+
+
+bits per sample/pixel from the demuxer (needed for huffyuv).
+- encoding: Set by libavcodec.
+- decoding: Set by user.
+
+
+
+ dsp_mask could be add used to disable unwanted CPU features
+ CPU features (i.e. MMX, SSE. ...)
+
+ With the FORCE flag you may instead enable given CPU features.
+ (Dangerous: Usable in case of misdetection, improper usage however will
+ result into program crash.)
+
+
+
+error concealment flags
+- encoding: unused
+- decoding: Set by user.
+
+
+
+slice offsets in the frame in bytes
+- encoding: Set/allocated by libavcodec.
+- decoding: Set/allocated by user (or NULL).
+
+
+
+slice count
+- encoding: Set by libavcodec.
+- decoding: Set by user (or 0).
+
+
+
+IDCT algorithm, see FF_IDCT_* below.
+- encoding: Set by user.
+- decoding: Set by user.
+
+
+
+darkness masking (0-> disabled)
+- encoding: Set by user.
+- decoding: unused
+
+
+
+p block masking (0-> disabled)
+- encoding: Set by user.
+- decoding: unused
+
+
+
+spatial complexity masking (0-> disabled)
+- encoding: Set by user.
+- decoding: unused
+
+
+
+temporary complexity masking (0-> disabled)
+- encoding: Set by user.
+- decoding: unused
+
+
+
+luminance masking (0-> disabled)
+- encoding: Set by user.
+- decoding: unused
+
+
+
+DCT algorithm, see FF_DCT_* below
+- encoding: Set by user.
+- decoding: unused
+
+
+
+initial complexity for pass1 ratecontrol
+- encoding: Set by user.
+- decoding: unused
+
+
+
+qscale offset between P and I-frames
+- encoding: Set by user.
+- decoding: unused
+
+
+
+decoder bitstream buffer size
+- encoding: Set by user.
+- decoding: unused
+
+
+
+minimum bitrate
+- encoding: Set by user.
+- decoding: unused
+
+
+
+maximum bitrate
+- encoding: Set by user.
+- decoding: unused
+
+
+
+rate control equation
+- encoding: Set by user
+- decoding: unused
+
+
+
+ratecontrol override, see RcOverride
+- encoding: Allocated/set/freed by user.
+- decoding: unused
+
+
+
+ratecontrol qmin qmax limiting method
+0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax.
+- encoding: Set by user.
+- decoding: unused
+
+
+
+pass2 encoding statistics input buffer
+Concatenated stuff from stats_out of pass1 should be placed here.
+- encoding: Allocated/set/freed by user.
+- decoding: unused
+
+
+
+pass1 encoding statistics output buffer
+- encoding: Set by libavcodec.
+- decoding: unused
+
+
+
+0-> h263 quant 1-> mpeg quant
+- encoding: Set by user.
+- decoding: unused
+
+
+
+If true, only parsing is done. The frame data is returned.
+Only MPEG audio decoders support this now.
+- encoding: unused
+- decoding: Set by user
+
+
+
+number of bytes per packet if constant and known or 0
+Used by some WAV based audio codecs.
+
+
+
+Size of the frame reordering buffer in the decoder.
+For MPEG-2 it is 1 IPB or 0 low delay IP.
+- encoding: Set by libavcodec.
+- decoding: Set by libavcodec.
+
+
+
+Called to release buffers which were allocated with get_buffer.
+A released buffer can be reused in get_buffer().
+pic.data[*] must be set to NULL.
+May be called from a different thread if frame multithreading is used,
+but not by more than one thread at once, so does not need to be reentrant.
+- encoding: unused
+- decoding: Set by libavcodec, user can override.
+
+
+
+ Called at the beginning of each frame to get a buffer for it.
+
+ The function will set AVFrame.data[], AVFrame.linesize[].
+ AVFrame.extended_data[] must also be set, but it should be the same as
+ AVFrame.data[] except for planar audio with more channels than can fit
+ in AVFrame.data[]. In that case, AVFrame.data[] shall still contain as
+ many data pointers as it can hold.
+
+ if CODEC_CAP_DR1 is not set then get_buffer() must call
+ avcodec_default_get_buffer() instead of providing buffers allocated by
+ some other means.
+
+ AVFrame.data[] should be 32- or 16-byte-aligned unless the CPU doesn't
+ need it. avcodec_default_get_buffer() aligns the output buffer properly,
+ but if get_buffer() is overridden then alignment considerations should
+ be taken into account.
+
+ @see avcodec_default_get_buffer()
+
+ Video:
+
+ If pic.reference is set then the frame will be read later by libavcodec.
+ avcodec_align_dimensions2() should be used to find the required width and
+ height, as they normally need to be rounded up to the next multiple of 16.
+
+ If frame multithreading is used and thread_safe_callbacks is set,
+ it may be called from a different thread, but not from more than one at
+ once. Does not need to be reentrant.
+
+ @see release_buffer(), reget_buffer()
+ @see avcodec_align_dimensions2()
+
+ Audio:
+
+ Decoders request a buffer of a particular size by setting
+ AVFrame.nb_samples prior to calling get_buffer(). The decoder may,
+ however, utilize only part of the buffer by setting AVFrame.nb_samples
+ to a smaller value in the output frame.
+
+ Decoders cannot use the buffer after returning from
+ avcodec_decode_audio4(), so they will not call release_buffer(), as it
+ is assumed to be released immediately upon return.
+
+ As a convenience, av_samples_get_buffer_size() and
+ av_samples_fill_arrays() in libavutil may be used by custom get_buffer()
+ functions to find the required data size and to fill data pointers and
+ linesize. In AVFrame.linesize, only linesize[0] may be set for audio
+ since all planes must be the same size.
+
+ @see av_samples_get_buffer_size(), av_samples_fill_arrays()
+
+ - encoding: unused
+ - decoding: Set by libavcodec, user can override.
+
+
+
+Error recognition; higher values will detect more errors but may
+misdetect some more or less valid parts as errors.
+- encoding: unused
+- decoding: Set by user.
+
+
+
+qscale offset between IP and B-frames
+- encoding: Set by user.
+- decoding: unused
+
+
+
+strictly follow the standard (MPEG4, ...).
+- encoding: Set by user.
+- decoding: Set by user.
+Setting this to STRICT or higher means the encoder and decoder will
+generally do stupid things, whereas setting it to unofficial or lower
+will mean the encoder might produce output that is not supported by all
+spec-compliant decoders. Decoders don't differentiate between normal,
+unofficial and experimental (that is, they always try to decode things
+when they can) unless they are explicitly asked to behave stupidly
+(=strictly conform to the specs)
+
+
+
+chroma single coeff elimination threshold
+- encoding: Set by user.
+- decoding: unused
+
+
+
+luma single coefficient elimination threshold
+- encoding: Set by user.
+- decoding: unused
+
+
+
+Work around bugs in encoders which sometimes cannot be detected automatically.
+- encoding: Set by user
+- decoding: Set by user
+
+
+
+Private data of the user, can be used to carry app specific stuff.
+- encoding: Set by user.
+- decoding: Set by user.
+
+
+
+number of bits used for the previously encoded frame
+- encoding: Set by libavcodec.
+- decoding: unused
+
+
+
+obsolete FIXME remove
+
+
+maximum number of B-frames between non-B-frames
+Note: The output will be delayed by max_b_frames+1 relative to the input.
+- encoding: Set by user.
+- decoding: unused
+
+
+
+maximum quantizer difference between frames
+- encoding: Set by user.
+- decoding: unused
+
+
+
+maximum quantizer
+- encoding: Set by user.
+- decoding: unused
+
+
+
+minimum quantizer
+- encoding: Set by user.
+- decoding: unused
+
+
+
+Encoding: Number of frames delay there will be from the encoder input to
+ the decoder output. (we assume the decoder matches the spec)
+Decoding: Number of frames delay in addition to what a standard decoder
+ as specified in the spec would produce.
+- encoding: Set by libavcodec.
+- decoding: Set by libavcodec.
+
+
+
+Samples per packet, initialized when calling 'init'.
+
+
+
+If non NULL, 'draw_horiz_band' is called by the libavcodec
+decoder to draw a horizontal band. It improves cache usage. Not
+all codecs can do that. You must check the codec capabilities
+beforehand.
+When multithreading is used, it may be called from multiple threads
+at the same time; threads might draw different parts of the same AVFrame,
+or multiple AVFrames, and there is no guarantee that slices will be drawn
+in order.
+The function is also used by hardware acceleration APIs.
+It is called at least once during frame decoding to pass
+the data needed for hardware render.
+In that mode instead of pixel data, AVFrame points to
+a structure specific to the acceleration API. The application
+reads the structure and can change some fields to indicate progress
+or mark state.
+- encoding: unused
+- decoding: Set by user.
+@param height the height of the slice
+@param y the y position of the slice
+@param type 1->top field, 2->bottom field, 3->frame
+@param offset offset into the AVFrame.data from which the slice should be read
+
+
+
+Pixel format, see PIX_FMT_xxx.
+May be set by the demuxer if known from headers.
+May be overriden by the decoder if it knows better.
+- encoding: Set by user.
+- decoding: Set by user if known, overridden by libavcodec if known
+
+
+callback to negotiate the pixelFormat
+@param fmt is the list of formats which are supported by the codec,
+it is terminated by -1 as 0 is a valid format, the formats are ordered by quality.
+The first is always the native one.
+@return the chosen format
+- encoding: unused
+- decoding: Set by user, if not set the native format will be chosen.
+
+
+ Supported pixel format.
+
+ Only hardware accelerated formats are supported here.
+
+
+
+the number of pictures in a group of pictures, or 0 for intra_only
+- encoding: Set by user.
+- decoding: unused
+
+
+
+picture width / height.
+- encoding: MUST be set by user.
+- decoding: Set by libavcodec.
+Note: For compatibility it is possible to set this instead of
+coded_width/height before decoding.
+
+
+
+This is the fundamental unit of time (in seconds) in terms
+of which frame timestamps are represented. For fixed-fps content,
+timebase should be 1/framerate and timestamp increments should be
+identically 1.
+- encoding: MUST be set by user.
+- decoding: Set by libavcodec.
+
+
+
+some codecs need / can use extradata like Huffman tables.
+mjpeg: Huffman tables
+rv10: additional flags
+mpeg4: global headers (they can be in the bitstream or here)
+The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger
+than extradata_size to avoid prolems if it is read with the bitstream reader.
+The bytewise contents of extradata must not depend on the architecture or CPU endianness.
+- encoding: Set/allocated/freed by libavcodec.
+- decoding: Set/allocated/freed by user.
+
+
+
+Motion estimation algorithm used for video coding.
+1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex),
+8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific]
+- encoding: MUST be set by user.
+- decoding: unused
+
+
+
+Some codecs need additional format info. It is stored here.
+If any muxer uses this then ALL demuxers/parsers AND encoders for the
+specific codec MUST set it correctly otherwise stream copy breaks.
+In general use of this field by muxers is not recommended.
+- encoding: Set by libavcodec.
+- decoding: Set by libavcodec. (FIXME: Is this OK?)
+
+
+
+CODEC_FLAG_*.
+- encoding: Set by user.
+- decoding: Set by user.
+
+
+
+number of bits the bitstream is allowed to diverge from the reference.
+ the reference can be CBR (for CBR pass1) or VBR (for pass2)
+- encoding: Set by user; unused for constant quantizer encoding.
+- decoding: unused
+
+
+
+the average bitrate
+- encoding: Set by user; unused for constant quantizer encoding.
+- decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream.
+
+
+
+information on struct for av_log
+- set by avcodec_alloc_context3
+
+
+
+reordered pos from the last AVPacket that has been input into the decoder
+Code outside libavcodec should access this field using:
+ av_opt_ptr(avcodec_get_frame_class(), frame, "pkt_pos");
+- encoding: unused
+- decoding: Read by user.
+
+
+
+frame timestamp estimated using various heuristics, in stream time base
+Code outside libavcodec should access this field using:
+ av_opt_ptr(avcodec_get_frame_class(), frame, "best_effort_timestamp");
+- encoding: unused
+- decoding: set by libavcodec, read by user.
+
+
+
+format of the frame, -1 if unknown or unset
+Values correspond to enum PixelFormat for video frames,
+enum AVSampleFormat for audio)
+- encoding: unused
+- decoding: Read by user.
+
+
+
+width and height of the video frame
+- encoding: unused
+- decoding: Read by user.
+
+
+
+sample aspect ratio for the video frame, 0/1 if unknown\unspecified
+- encoding: unused
+- decoding: Read by user.
+
+
+
+ pointers to the data planes/channels.
+
+ For video, this should simply point to data[].
+
+ For planar audio, each channel has a separate data pointer, and
+ linesize[0] contains the size of each channel buffer.
+ For packed audio, there is just one data pointer, and linesize[0]
+ contains the total size of the buffer for all channels.
+
+ Note: Both data and extended_data will always be set by get_buffer(),
+ but for planar audio with more channels that can fit in data,
+ extended_data must be used by the decoder in order to access all
+ channels.
+
+ encoding: unused
+ decoding: set by AVCodecContext.get_buffer()
+
+
+
+number of audio samples (per channel) described by this frame
+- encoding: unused
+- decoding: Set by libavcodec
+
+
+
+used by multithreading to store frame-specific info
+- encoding: Set by libavcodec.
+- decoding: Set by libavcodec.
+
+
+
+the AVCodecContext which ff_thread_get_buffer() was last called on
+- encoding: Set by libavcodec.
+- decoding: Set by libavcodec.
+
+
+main external API structure.
+New fields can be added to the end with minor version bumps.
+Removal, reordering and changes to existing fields require a major
+version bump.
+Please use AVOptions (av_opt* / av_set/get*()) to access these fields from user
+applications.
+sizeof(AVCodecContext) must not be used outside libav*.
+
+
+
+dts from the last AVPacket that has been input into the decoder
+- encoding: unused
+- decoding: Read by user.
+
+
+
+reordered pts from the last AVPacket that has been input into the decoder
+- encoding: unused
+- decoding: Read by user.
+
+
+
+hardware accelerator private data (FFmpeg-allocated)
+- encoding: unused
+- decoding: Set by libavcodec
+
+
+
+reordered opaque 64bit (generally an integer or a double precision float
+PTS but can be anything).
+The user sets AVCodecContext.reordered_opaque to represent the input at
+that time,
+the decoder reorders values as needed and sets AVFrame.reordered_opaque
+to exactly one of the values provided by the user through AVCodecContext.reordered_opaque
+@deprecated in favor of pkt_pts
+- encoding: unused
+- decoding: Read by user.
+
+
+
+motion reference frame index
+the order in which these are stored can depend on the codec.
+- encoding: Set by user.
+- decoding: Set by libavcodec.
+
+
+
+DCT coefficients
+- encoding: unused
+- decoding: Set by libavcodec.
+
+
+
+codec suggestion on buffer type if != 0
+- encoding: unused
+- decoding: Set by libavcodec. (before get_buffer() call)).
+
+
+
+Tell user application that palette has changed from previous frame.
+- encoding: ??? (no palette-enabled encoder yet)
+- decoding: Set by libavcodec. (default 0).
+
+
+
+Pan scan.
+- encoding: Set by user.
+- decoding: Set by libavcodec.
+
+
+
+If the content is interlaced, is top field displayed first.
+- encoding: Set by user.
+- decoding: Set by libavcodec.
+
+
+
+The content of the picture is interlaced.
+- encoding: Set by user.
+- decoding: Set by libavcodec. (default 0)
+
+
+
+When decoding, this signals how much the picture must be delayed.
+extra_delay = repeat_pict / (2*fps)
+- encoding: unused
+- decoding: Set by libavcodec.
+
+
+
+for some private data of the user
+- encoding: unused
+- decoding: Set by user.
+
+
+
+log2 of the size of the block which a single vector in motion_val represents:
+(4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2)
+- encoding: unused
+- decoding: Set by libavcodec.
+
+
+
+macroblock type table
+mb_type_base + mb_width + 2
+- encoding: Set by user.
+- decoding: Set by libavcodec.
+
+
+
+mbskip_table[mb]>=1 if MB didn't change
+stride= mb_width = (width+15)>>4
+- encoding: unused
+- decoding: Set by libavcodec.
+
+
+
+QP store stride
+- encoding: unused
+- decoding: Set by libavcodec.
+
+
+
+QP table
+- encoding: unused
+- decoding: Set by libavcodec.
+
+
+
+is this picture used as reference
+The values for this are the same as the MpegEncContext.picture_structure
+variable, that is 1->top field, 2->bottom field, 3->frame/both fields.
+Set to 4 for delayed, non-reference frames.
+- encoding: unused
+- decoding: Set by libavcodec. (before get_buffer() call)).
+
+
+
+@deprecated unused
+
+
+
+quality (between 1 (good) and FF_LAMBDA_MAX (bad))
+- encoding: Set by libavcodec. for coded_picture (and set by user for input).
+- decoding: Set by libavcodec.
+
+
+
+picture number in display order
+- encoding: set by
+- decoding: Set by libavcodec.
+
+
+
+picture number in bitstream order
+- encoding: set by
+- decoding: Set by libavcodec.
+
+
+
+presentation timestamp in time_base units (time when frame should be shown to user)
+If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed.
+- encoding: MUST be set by user.
+- decoding: Set by libavcodec.
+
+
+
+1 -> keyframe, 0-> not
+- encoding: Set by libavcodec.
+- decoding: Set by libavcodec.
+
+
+
+pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer.
+This isn't used by libavcodec unless the default get/release_buffer() is used.
+- encoding:
+- decoding:
+
+
+
+ Size, in bytes, of the data for each picture/channel plane.
+
+ For audio, only linesize[0] may be set. For planar audio, each channel
+ plane must be the same size.
+
+ - encoding: Set by user (video only)
+ - decoding: set by AVCodecContext.get_buffer()
+
+
+
+pointer to the picture/channel planes.
+This might be different from the first allocated byte
+- encoding: Set by user
+- decoding: set by AVCodecContext.get_buffer()
+
+
+
+Audio Video Frame.
+New fields can be added to the end of AVFRAME with minor version
+bumps. Similarly fields that are marked as to be only accessed by
+av_opt_ptr() can be reordered. This allows 2 forks to add fields
+without breaking compatibility with each other.
+Removal, reordering and changes in the remaining cases require
+a major version bump.
+sizeof(AVFrame) must not be used outside libavcodec.
+
+
+
+ Time difference in AVStream->time_base units from the pts of this
+ packet to the point at which the output from the decoder has converged
+ independent from the availability of previous frames. That is, the
+ frames are virtually identical no matter if decoding started from
+ the very first frame or from this keyframe.
+ Is AV_NOPTS_VALUE if unknown.
+ This field is not the display duration of the current packet.
+ This field has no meaning if the packet does not have AV_PKT_FLAG_KEY
+ set.
+
+ The purpose of this field is to allow seeking in streams that have no
+ keyframes in the conventional sense. It corresponds to the
+ recovery point SEI in H.264 and match_time_delta in NUT. It is also
+ essential for some types of subtitle streams to ensure that all
+ subtitles are correctly displayed after seeking.
+
+
+
+Duration of this packet in AVStream->time_base units, 0 if unknown.
+Equals next_pts - this_pts in presentation order.
+
+
+
+A combination of AV_PKT_FLAG values
+
+
+
+Decompression timestamp in AVStream->time_base units; the time at which
+the packet is decompressed.
+Can be AV_NOPTS_VALUE if it is not stored in the file.
+
+
+
+Presentation timestamp in AVStream->time_base units; the time at which
+the decompressed packet will be presented to the user.
+Can be AV_NOPTS_VALUE if it is not stored in the file.
+pts MUST be larger or equal to dts as presentation cannot happen before
+decompression, unless one wants to view hex dumps. Some formats misuse
+the terms dts and pts/cts to mean something different. Such timestamps
+must be converted to true pts/dts before they are stored in AVPacket.
+
+
+
+position of the top left corner in 1/16 pel for up to 3 fields/frames
+- encoding: Set by user.
+- decoding: Set by libavcodec.
+
+
+
+width and height in 1/16 pel
+- encoding: Set by user.
+- decoding: Set by libavcodec.
+
+
+
+id
+- encoding: Set by user.
+- decoding: Set by libavcodec.
+
+
+
+The parent program guarantees that the input for B-frames containing
+streams is not written to for at least s->max_b_frames+1 frames, if
+this is not set the input will be copied.
+
+@defgroup deprecated_flags Deprecated codec flags
+Use corresponding private codec options instead.
+@{
+
+@}
+
+Codec uses get_buffer() for allocating buffers and supports custom allocators.
+If not set, it might not use get_buffer() at all or use operations that
+assume the buffer was allocated by avcodec_default_get_buffer.
+
+ Encoder or decoder requires flushing with NULL input at the end in order to
+ give the complete and correct output.
+
+ NOTE: If this flag is not set, the codec is guaranteed to never be fed with
+ with NULL data. The user can still send NULL data to the public encode
+ or decode function, but libavcodec will not pass it along to the codec
+ unless this flag is set.
+
+ Decoders:
+ The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL,
+ avpkt->size=0 at the end to get the delayed data until the decoder no longer
+ returns frames.
+
+ Encoders:
+ The encoder needs to be fed with NULL data at the end of encoding until the
+ encoder no longer returns data.
+
+ NOTE: For encoders implementing the AVCodec.encode2() function, setting this
+ flag also means that the encoder must set the pts and duration for
+ each output packet. If this flag is not set, the pts and duration will
+ be determined by libavcodec from the input frame.
+
+Codec can be fed a final frame with a smaller size.
+This can be used to prevent truncation of the last audio samples.
+
+Codec can export data for HW decoding (VDPAU).
+
+Codec can output multiple frames per AVPacket
+Normally demuxers return one frame at a time, demuxers which do not do
+are connected to a parser to split what they return into proper frames.
+This flag is reserved to the very rare category of codecs which have a
+bitstream that cannot be split into frames without timeconsuming
+operations like full decoding. Demuxers carring such bitstreams thus
+may return multiple frames in a packet. This has many disadvantages like
+prohibiting stream copy in many cases thus it should only be considered
+as a last resort.
+
+Codec is experimental and is thus avoided in favor of non experimental
+encoders
+
+Codec should fill in channel configuration and samplerate instead of container
+
+Codec is able to deal with negative linesizes
+
+Codec supports frame-level multithreading.
+
+Codec supports slice-based (or partition-based) multithreading.
+
+Codec supports changed parameters at any point.
+
+Codec supports avctx->thread_count == 0 (auto).
+
+Audio encoder supports receiving a different number of samples in each call.
+
+Codec is lossless.
+
+Pan Scan area.
+This specifies the area which should be displayed.
+Note there may be multiple such areas for one frame.
+
+
+
+LPC analysis type
+
+
+Determine which LPC analysis algorithm to use.
+- encoding: Set by user
+- decoding: unused
+
+
+
+X X 3 4 X X are luma samples,
+ 1 2 1-6 are possible chroma positions
+X X 5 6 X 0 is undefined/unknown position
+
+
+This defines the location of chroma samples.
+- encoding: Set by user
+- decoding: Set by libavcodec
+
+
+
+Return default channel layout for a given number of channels.
+
+
+
+Return the number of channels in the channel layout.
+
+
+
+@file
+audio conversion routines
+
+@addtogroup lavu_audio
+@{
+
+@defgroup channel_masks Audio channel masks
+@{
+
+Channel mask value used for AVCodecContext.request_channel_layout
+ to indicate that the user requests the channel order of the decoder output
+ to be the native codec channel order.
+@}
+@defgroup channel_mask_c Audio channel convenience macros
+@{
+
+@}
+
+ * Return a channel layout id that matches name, 0 if no match.
+ * name can be one or several of the following notations,
+ * separated by '+' or '|':
+ * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0,
+ * 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix);
+ * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC,
+ * SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR);
+ * - a number of channels, in decimal, optionnally followed by 'c', yielding
+ * the default channel layout for that number of channels (@see
+ * av_get_default_channel_layout);
+ * - a channel layout mask, in hexadecimal starting with "0x" (see the
+ * AV_CH_* macros).
+ + Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7"
+
+
+
+Free all the memory allocated for an AVDictionary struct
+and all keys and values.
+
+
+
+Copy entries from one AVDictionary struct into another.
+@param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL,
+ this function will allocate a struct for you and put it in *dst
+@param src pointer to source AVDictionary struct
+@param flags flags to use when setting entries in *dst
+@note metadata is read using the AV_DICT_IGNORE_SUFFIX flag
+
+
+
+ Get a dictionary entry with matching key.
+
+ @param prev Set to the previous matching element to find the next.
+ If set to NULL the first matching element is returned.
+ @param flags Allows case as well as suffix-insensitive comparisons.
+ @return Found entry or NULL, changing key or value leads to undefined behavior.
+
+
+
+Disables cpu detection and forces the specified flags.
+
+
+
+Return the flags which specify extensions supported by the CPU.
+
+
+
+ Fill channel data pointers and linesize for samples with sample
+ format sample_fmt.
+
+ The pointers array is filled with the pointers to the samples data:
+ for planar, set the start point of each channel's data within the buffer,
+ for packed, set the start point of the entire buffer only.
+
+ The linesize array is filled with the aligned size of each channel's data
+ buffer for planar layout, or the aligned size of the buffer for all channels
+ for packed layout.
+
+ @param[out] audio_data array to be filled with the pointer for each channel
+ @param[out] linesize calculated linesize
+ @param buf the pointer to a buffer containing the samples
+ @param nb_channels the number of channels
+ @param nb_samples the number of samples in a single channel
+ @param sample_fmt the sample format
+ @param align buffer size alignment (1 = no alignment required)
+ @return 0 on success or a negative error code on failure
+
+
+
+ Get the required buffer size for the given audio parameters.
+
+ @param[out] linesize calculated linesize, may be NULL
+ @param nb_channels the number of channels
+ @param nb_samples the number of samples in a single channel
+ @param sample_fmt the sample format
+ @return required buffer size, or negative error code on failure
+
+
+
+ Check if the sample format is planar.
+
+ @param sample_fmt the sample format to inspect
+ @return 1 if the sample format is planar, 0 if it is interleaved
+
+
+
+ Return number of bytes per sample.
+
+ @param sample_fmt the sample format
+ @return number of bytes per sample or zero if unknown for the given
+ sample format
+
+
+
+@deprecated Use av_get_bytes_per_sample() instead.
+
+
+
+ Generate a string corresponding to the sample format with
+ sample_fmt, or a header if sample_fmt is negative.
+
+ @param buf the buffer where to write the string
+ @param buf_size the size of buf
+ @param sample_fmt the number of the sample format to print the
+ corresponding info string, or a negative value to print the
+ corresponding header.
+ @return the pointer to the filled buffer or NULL if sample_fmt is
+ unknown or in case of other errors
+
+
+
+Return the name of sample_fmt, or NULL if sample_fmt is not
+recognized.
+
+
+
+@}
+@}
+
+all in native-endian format
+
+
+Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE
+on error.
+
+
+audio sample format
+- encoding: Set by user.
+- decoding: Set by libavcodec.
+
+
+desired sample format
+- encoding: Not used.
+- decoding: Set by user.
+Decoder will decode to this format if it can.
+
+
+
+Return x default pointer in case p is NULL.
+
+
+
+av_dlog macros
+Useful to print debug messages that shouldn't get compiled in normally.
+
+Skip repeated messages, this requires the user app to use av_log() instead of
+(f)printf as the 2 would otherwise interfere and lead to
+"Last message repeated x times" messages below (f)printf messages with some
+bad luck.
+Also to receive the last, "last repeated" line if any, the user app must
+call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end
+
+
+
+Format a line of log the same way as the default callback.
+@param line buffer to receive the formated line
+@param line_size size of the buffer
+@param print_prefix used to store whether the prefix must be printed;
+ must point to a persistent integer initially set to 1
+
+
+
+Something went really wrong and we will crash now.
+
+Something went wrong and recovery is not possible.
+For example, no header was found for a format which depends
+on headers or an illegal combination of parameters is used.
+
+Something went wrong and cannot losslessly be recovered.
+However, not all future data is affected.
+
+Something somehow does not look correct. This may or may not
+lead to problems. An example would be the use of '-vstrict -2'.
+
+Stuff which is only useful for libav* developers.
+
+ Send the specified message to the log if the level is less than or equal
+ to the current av_log_level. By default, all logging messages are sent to
+ stderr. This behavior can be altered by setting a different av_vlog callback
+ function.
+
+ @param avcl A pointer to an arbitrary struct of which the first field is a
+ pointer to an AVClass struct.
+ @param level The importance level of the message, lower values signifying
+ higher importance.
+ @param fmt The format string (printf-compatible) that specifies how
+ subsequent arguments are converted to output.
+ @see av_vlog
+
+
+
+ Return an AVClass corresponding to next potential
+ AVOptions-enabled child.
+
+ The difference between child_next and this is that
+ child_next iterates over _already existing_ objects, while
+ child_class_next iterates over _all possible_ children.
+
+
+
+Return next AVOptions-enabled child or NULL
+
+
+
+Offset in the structure where a pointer to the parent context for loging is stored.
+for example a decoder that uses eval.c could pass its AVCodecContext to eval as such
+parent context. And a av_log() implementation could then display the parent context
+can be NULL of course
+
+
+
+Offset in the structure where log_level_offset is stored.
+0 means there is no such variable
+
+
+
+LIBAVUTIL_VERSION with which this structure was created.
+This is used to allow fields to be added without requiring major
+version bumps everywhere.
+
+
+
+ a pointer to the first option specified in the class if any or NULL
+
+ @see av_set_default_options()
+
+
+
+A pointer to a function which returns the name of a context
+instance ctx associated with the class.
+
+
+
+The name of the class; usually it is the same name as the
+context structure type to which the AVClass is associated.
+
+
+
+ Compare 2 integers modulo mod.
+ That is we compare integers a and b for which only the least
+ significant log2(mod) bits are known.
+
+ @param mod must be a power of 2
+ @return a negative value if a is smaller than b
+ a positive value if a is greater than b
+ 0 if a equals b
+
+
+
+Compare 2 timestamps each in its own timebases.
+The result of the function is undefined if one of the timestamps
+is outside the int64_t range when represented in the others timebase.
+@return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position
+
+
+
+Rescale a 64-bit integer by 2 rational numbers.
+
+
+
+Rescale a 64-bit integer with specified rounding.
+A simple a*b/c isn't possible as it can overflow.
+
+
+
+Rescale a 64-bit integer with rounding to nearest.
+A simple a*b/c isn't possible as it can overflow.
+
+
+
+@}
+
+@addtogroup lavu_math
+@{
+
+
+
+Find the nearest value in q_list to q.
+@param q_list an array of rationals terminated by {0, 0}
+@return the index of the nearest value found in the array
+
+
+
+@return 1 if q1 is nearer to q than q2, -1 if q2 is nearer
+than q1, 0 if they have the same distance.
+
+
+
+ Convert a double precision floating point number to a rational.
+ inf is expressed as {1,0} or {-1,0} depending on the sign.
+
+ @param d double to convert
+ @param max the maximum allowed numerator and denominator
+ @return (AVRational) d
+
+
+
+Subtract one rational from another.
+@param b first rational
+@param c second rational
+@return b-c
+
+
+
+Add two rationals.
+@param b first rational
+@param c second rational
+@return b+c
+
+
+
+Divide one rational by another.
+@param b first rational
+@param c second rational
+@return b/c
+
+
+
+Multiply two rationals.
+@param b first rational
+@param c second rational
+@return b*c
+
+
+
+Convert rational to double.
+@param a rational to convert
+@return (double) a
+
+
+
+Set the maximum size that may me allocated in one block.
+
+
+
+Multiply two size_t values checking for overflow.
+@return 0 if success, AVERROR(EINVAL) if overflow.
+
+
+
+ Add an element to a dynamic array.
+
+ @param tab_ptr Pointer to the array.
+ @param nb_ptr Pointer to the number of elements in the array.
+ @param elem Element to be added.
+
+
+
+Free a memory block which has been allocated with av_malloc(z)() or
+av_realloc() and set the pointer pointing to it to NULL.
+@param ptr Pointer to the pointer to the memory block which should
+be freed.
+@see av_free()
+
+
+
+Duplicate the string s.
+@param s string to be duplicated
+@return Pointer to a newly allocated string containing a
+copy of s or NULL if the string cannot be allocated.
+
+
+
+Allocate a block of nmemb * size bytes with alignment suitable for all
+memory accesses (including vectors if available on the CPU) and
+zero all the bytes of the block.
+The allocation will fail if nmemb * size is greater than or equal
+to INT_MAX.
+@param nmemb
+@param size
+@return Pointer to the allocated block, NULL if it cannot be allocated.
+
+
+
+Allocate a block of size bytes with alignment suitable for all
+memory accesses (including vectors if available on the CPU) and
+zero all the bytes of the block.
+@param size Size in bytes for the memory block to be allocated.
+@return Pointer to the allocated block, NULL if it cannot be allocated.
+@see av_malloc()
+
+
+
+Free a memory block which has been allocated with av_malloc(z)() or
+av_realloc().
+@param ptr Pointer to the memory block which should be freed.
+@note ptr = NULL is explicitly allowed.
+@note It is recommended that you use av_freep() instead.
+@see av_freep()
+
+
+
+Allocate or reallocate a block of memory.
+This function does the same thing as av_realloc, except:
+- It takes two arguments and checks the result of the multiplication for
+ integer overflow.
+- It frees the input block in case of failure, thus avoiding the memory
+ leak with the classic "buf = realloc(buf); if (!buf) return -1;".
+
+
+
+Allocate or reallocate a block of memory.
+If ptr is NULL and size > 0, allocate a new block. If
+size is zero, free the memory block pointed to by ptr.
+@param ptr Pointer to a memory block already allocated with
+av_malloc(z)() or av_realloc() or NULL.
+@param size Size in bytes for the memory block to be allocated or
+reallocated.
+@return Pointer to a newly reallocated block or NULL if the block
+cannot be reallocated or the function is used to free the memory block.
+@see av_fast_realloc()
+
+
+
+@}
+
+@addtogroup lavu_mem
+@{
+
+Allocate a block of size bytes with alignment suitable for all
+memory accesses (including vectors if available on the CPU).
+@param size Size in bytes for the memory block to be allocated.
+@return Pointer to the allocated block, NULL if the block cannot
+be allocated.
+@see av_mallocz()
+
+
+
+ Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
+
+ @param val Output value, must be an lvalue of type uint32_t.
+ @param GET_BYTE Expression reading one byte from the input.
+ Evaluated up to 7 times (4 for the currently
+ assigned Unicode range). With a memory buffer
+ input, this could be *ptr++.
+ @param ERROR Expression to be evaluated on invalid input,
+ typically a goto statement.
+
+ Convert a UTF-16 character (2 or 4 bytes) to its 32-bit UCS-4 encoded form.
+
+ @param val Output value, must be an lvalue of type uint32_t.
+ @param GET_16BIT Expression returning two bytes of UTF-16 data converted
+ to native byte order. Evaluated one or two times.
+ @param ERROR Expression to be evaluated on invalid input,
+ typically a goto statement.
+
+@def PUT_UTF8(val, tmp, PUT_BYTE)
+Convert a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long).
+@param val is an input-only argument and should be of type uint32_t. It holds
+a UCS-4 encoded Unicode character that is to be converted to UTF-8. If
+val is given as a function it is executed only once.
+@param tmp is a temporary variable and should be of type uint8_t. It
+represents an intermediate value during conversion that is to be
+output by PUT_BYTE.
+@param PUT_BYTE writes the converted UTF-8 bytes to any proper destination.
+It could be a function or a statement, and uses tmp as the input byte.
+For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be
+executed up to 4 times for values in the valid UTF-8 range and up to
+7 times in the general case, depending on the length of the converted
+Unicode character.
+
+@def PUT_UTF16(val, tmp, PUT_16BIT)
+Convert a 32-bit Unicode character to its UTF-16 encoded form (2 or 4 bytes).
+@param val is an input-only argument and should be of type uint32_t. It holds
+a UCS-4 encoded Unicode character that is to be converted to UTF-16. If
+val is given as a function it is executed only once.
+@param tmp is a temporary variable and should be of type uint16_t. It
+represents an intermediate value during conversion that is to be
+output by PUT_16BIT.
+@param PUT_16BIT writes the converted UTF-16 data to any proper destination
+in desired endianness. It could be a function or a statement, and uses tmp
+as the input byte. For example, PUT_BYTE could be "*output++ = tmp;"
+PUT_BYTE will be executed 1 or 2 times depending on input character.
+
+@file
+memory handling functions
+
+@file
+Macro definitions for various function/variable attributes
+
+@file
+error code definitions
+
+ @addtogroup lavu_error
+
+ @{
+
+This is semantically identical to AVERROR_BUG
+it has been introduced in Libav after our AVERROR_BUG and with a modified value.
+
+ Put a description of the AVERROR code errnum in errbuf.
+ In case of failure the global variable errno is set to indicate the
+ error. Even in case of failure av_strerror() will print a generic
+ error message indicating the errnum provided to errbuf.
+
+ @param errnum error code to describe
+ @param errbuf buffer to which description is written
+ @param errbuf_size the size in bytes of errbuf
+ @return 0 on success, a negative value if a description for errnum
+ cannot be found
+
+
+
+Count number of bits set to one in x
+@param x value to count bits of
+@return the number of bits set to one in x
+
+
+
+Count number of bits set to one in x
+@param x value to count bits of
+@return the number of bits set to one in x
+
+
+
+Compute ceil(log2(x)).
+ * @param x value used to compute ceil(log2(x))
+ * @return computed ceiling of log2(x)
+
+
+
+Clip a float value into the amin-amax range.
+@param a value to clip
+@param amin minimum value of the clip range
+@param amax maximum value of the clip range
+@return clipped value
+
+
+
+Clip a signed integer to an unsigned power of two range.
+@param a value to clip
+@param p bit position to clip at
+@return clipped value
+
+
+
+Clip a signed 64-bit integer value into the -2147483648,2147483647 range.
+@param a value to clip
+@return clipped value
+
+
+
+Clip a signed integer value into the -32768,32767 range.
+@param a value to clip
+@return clipped value
+
+
+
+Clip a signed integer value into the 0-65535 range.
+@param a value to clip
+@return clipped value
+
+
+
+Clip a signed integer value into the -128,127 range.
+@param a value to clip
+@return clipped value
+
+
+
+Clip a signed integer value into the 0-255 range.
+@param a value to clip
+@return clipped value
+
+
+
+@file
+common internal and external API header
+
+Clip a signed integer value into the amin-amax range.
+@param a value to clip
+@param amin minimum value of the clip range
+@param amax maximum value of the clip range
+@return clipped value
+
+
+
+@file
+Macro definitions for various function/variable attributes
+
+Disable warnings about deprecated features
+This is useful for sections of code kept for backward compatibility and
+scheduled for removal.
+
+Mark a variable as used and prevent the compiler from optimizing it
+away. This is useful for variables accessed only from inline
+assembler without the compiler being aware.
+
+
+
+@}
+
+@file
+common internal and external API header
+
+
+
+ Return a single letter to describe the given picture type
+ pict_type.
+
+ @param[in] pict_type the picture type @return a single character
+ representing the picture type, '?' if pict_type is unknown
+
+
+
+ @defgroup lavu_const Constants
+ @{
+
+ @defgroup lavu_enc Encoding specific
+
+ @note those definition should move to avcodec
+ @{
+
+ @}
+ @defgroup lavu_time Timestamp specific
+
+ FFmpeg internal timebase and timestamp definitions
+
+ @{
+
+ @brief Undefined timestamp value
+
+ Usually reported by demuxer that work on containers that do not provide
+ either pts or dts.
+
+Internal time base represented as integer
+
+Internal time base represented as fractional value
+
+ @}
+ @}
+ @defgroup lavu_picture Image related
+
+ AVPicture types, pixel formats and basic image planes manipulation.
+
+ @{
+
+
+Picture type of the frame, see ?_TYPE below.
+- encoding: Set by libavcodec. for coded_picture (and set by user for input).
+- decoding: Set by libavcodec.
+
+
+
+Return a string describing the media_type enum, NULL if media_type
+is unknown.
+
+
+
+@}
+
+@addtogroup lavu_media Media Type
+@brief Media Type
+
+
+ Type of codec implemented by the hardware accelerator.
+
+ See AVMEDIA_TYPE_xxx
+
+
+Get the type of the given codec.
+
+
+
+Return the libavutil license.
+
+
+
+Return the libavutil build-time configuration.
+
+
+
+@file
+external API header
+
+ @mainpage
+
+ @section libav_intro Introduction
+
+ This document describe the usage of the different libraries
+ provided by FFmpeg.
+
+ @li @ref libavc "libavcodec" encoding/decoding library
+ @li @subpage libavfilter graph based frame editing library
+ @li @ref libavf "libavformat" I/O and muxing/demuxing library
+ @li @ref lavd "libavdevice" special devices muxing/demuxing library
+ @li @ref lavu "libavutil" common utility library
+ @li @subpage libpostproc post processing library
+ @li @subpage libswscale color conversion and scaling library
+
+
+ @defgroup lavu Common utility functions
+
+ @brief
+ libavutil contains the code shared across all the other FFmpeg
+ libraries
+
+ @note In order to use the functions provided by avutil you must include
+ the specific header.
+
+ @{
+
+ @defgroup lavu_crypto Crypto and Hashing
+
+ @{
+ @}
+
+ @defgroup lavu_math Maths
+ @{
+
+ @}
+
+ @defgroup lavu_string String Manipulation
+
+ @{
+
+ @}
+
+ @defgroup lavu_mem Memory Management
+
+ @{
+
+ @}
+
+ @defgroup lavu_data Data Structures
+ @{
+
+ @}
+
+ @defgroup lavu_audio Audio related
+
+ @{
+
+ @}
+
+ @defgroup lavu_error Error Codes
+
+ @{
+
+ @}
+
+ @defgroup lavu_misc Other
+
+ @{
+
+ @defgroup lavu_internal Internal
+
+ Not exported functions, for internal usage only
+
+ @{
+
+ @}
+
+ @defgroup preproc_misc Preprocessor String Macros
+
+ String manipulation macros
+
+ @{
+
+@}
+
+ @defgroup version_utils Library Version Macros
+
+ Useful to check and match library version in order to maintain
+ backward compatibility.
+
+ @{
+
+ @}
+
+ @defgroup lavu_ver Version and Build diagnostics
+
+ Macros and function useful to check at compiletime and at runtime
+ which version of libavutil is in use.
+
+ @{
+
+ @}
+
+ @defgroup depr_guards Deprecation guards
+ Those FF_API_* defines are not part of public API.
+ They may change, break or disappear at any time.
+
+ They are used mostly internally to mark code that will be removed
+ on the next major version.
+
+ @{
+
+@}
+
+@addtogroup lavu_ver
+@{
+
+Return the LIBAVUTIL_VERSION_INT constant.
+
+
+
+
+Enumeration of some video codecs from FFmpeg library, which are available for writing video files.
+
+
+
+
+Raw (uncompressed) video.
+
+
+
+
+MPEG-2 part 2.
+
+
+
+
+Flash Video (FLV) / Sorenson Spark / Sorenson H.263.
+
+
+
+
+H.263+ / H.263-1998 / H.263 version 2.
+
+
+
+
+MPEG-4 part 2 Microsoft variant version 3.
+
+
+
+
+MPEG-4 part 2 Microsoft variant version 2.
+
+
+
+
+Windows Media Video 8.
+
+
+
+
+Windows Media Video 7.
+
+
+
+
+MPEG-4 part 2.
+
+
+
+
+Default video codec, which FFmpeg library selects for the specified file format.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.Kinect.dll b/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.Kinect.dll
new file mode 100644
index 0000000..350e553
Binary files /dev/null and b/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.Kinect.dll differ
diff --git a/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.Kinect.xml b/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.Kinect.xml
new file mode 100644
index 0000000..a7b31d6
--- /dev/null
+++ b/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.Kinect.xml
@@ -0,0 +1,604 @@
+
+
+
+ AForge.Video.Kinect
+
+
+
+
+ Kinect's LED color options.
+
+
+
+
+ The LED is off.
+
+
+
+
+ The LED is on and has green color.
+
+
+
+
+ The LED is on and has red color.
+
+
+
+
+ The LED is on and has yellow color.
+
+
+
+
+ The LED is blinking with green color.
+
+
+
+
+ The LED is blinking from red to yellow color.
+
+
+
+
+ Kinect's resolutions of video and depth cameras.
+
+
+
+
+ Low resolution.
+
+
+
+
+ Medium resolution.
+
+
+
+
+ Hight resolution.
+
+
+
+
+ Video source for Microsoft Kinect's depth sensor.
+
+
+ The video source captures depth data from Microsoft Kinect
+ depth sensor, which is aimed originally as a gaming device for XBox 360 platform.
+
+ Prior to using the class, make sure you've installed Kinect's drivers
+ as described on Open Kinect
+ project's page.
+
+ In order to run correctly the class requires freenect.dll library
+ to be put into solution's output folder. This can be found within the AForge.NET framework's
+ distribution in Externals folder.
+
+ Sample usage:
+
+ // create video source
+ KinectDepthCamera videoSource = new KinectDepthCamera( 0 );
+ // set NewFrame event handler
+ videoSource.NewFrame += new NewFrameEventHandler( video_NewFrame );
+ // start the video source
+ videoSource.Start( );
+ // ...
+
+ private void video_NewFrame( object sender, NewFrameEventArgs eventArgs )
+ {
+ // get new frame
+ Bitmap bitmap = eventArgs.Frame;
+ // process the frame
+ }
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Kinect's device ID (index) to connect to.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Kinect's device ID (index) to connect to.
+ Resolution of depth sensor to set.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Kinect's device ID (index) to connect to.
+ Resolution of depth sensor to set.
+ Provide original depth image or colored depth map
+ (see property).
+
+
+
+
+ Start video source.
+
+
+ Starts video source and returns execution to caller. Video camera will be started
+ and will provide new video frames through the event.
+
+ The specified resolution is not supported for the selected
+ mode of the Kinect depth sensor.
+ Could not connect to Kinect's depth sensor.
+ Another connection to the specified depth sensor is already running.
+
+
+
+
+ Signal video source to stop its work.
+
+
+ Calling this method is equivalent to calling
+ for Kinect video camera.
+
+
+
+
+ Wait for video source has stopped.
+
+
+ Calling this method is equivalent to calling
+ for Kinect video camera.
+
+
+
+
+ Stop video source.
+
+
+ The method stop the video source, so it no longer provides new video frames
+ and does not consume any resources.
+
+
+
+
+
+ New frame event.
+
+
+ Notifies clients about new available frames from the video source.
+
+ Since video source may have multiple clients, each client is responsible for
+ making a copy (cloning) of the passed video frame, because the video source disposes its
+ own original copy after notifying of clients.
+
+
+
+
+
+ Video source error event.
+
+
+ This event is used to notify clients about any type of errors occurred in
+ video source object, for example internal exceptions.
+
+
+
+
+ Video playing finished event.
+
+
+ This event is used to notify clients that the video playing has finished.
+
+
+
+
+
+ Provide original depth image or colored depth map.
+
+
+ The property specifies if the video source should provide original data
+ provided by Kinect's depth sensor or provide colored depth map. If the property is set to
+ , then the video source will provide 16 bpp grayscale images, where
+ 11 least significant bits represent data provided by the sensor. If the property is
+ set to , then the video source will provide 24 bpp color images,
+ which represents depth map. In this case depth is encoded by color gradient:
+ white->red->yellow->green->cyan->blue->black. So colors which are closer to white represent
+ objects which are closer to the Kinect sensor, but colors which are closer to black represent
+ objects which are further away from Kinect.
+
+ The property must be set before running the video source to take effect.
+
+ Default value is set to .
+
+
+
+
+
+ Resolution of depth sensor to set.
+
+
+ The property must be set before running the video source to take effect.
+
+ Default value of the property is set to .
+
+
+
+
+
+ A string identifying the video source.
+
+
+
+
+
+ State of the video source.
+
+
+ Current state of video source object - running or not.
+
+
+
+
+ Received bytes count.
+
+
+ Number of bytes the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ Received frames count.
+
+
+ Number of frames the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ The class provides access to Microsoft's Xbox Kinect
+ controller.
+
+
+ The class allows to manipulate Kinec device by changing its LED color, setting motor's
+ tilt value and accessing its camera. See and
+ classes, which provide access to actual video.
+
+
+
+ In order to run correctly the class requires freenect.dll library
+ to be put into solution's output folder. This can be found within the AForge.NET framework's
+ distribution in Externals folder.
+
+ Sample usage:
+
+ // get Kinect device
+ Kinect kinectDevice = Kinect.GetDevice( 0 );
+ // change LED color
+ kinectDevice.LedColor = LedColorOption.Yellow;
+ // set motor tilt angle to -10 degrees
+ kinectDevice.SetMotorTilt( -10 );
+ // get video camera
+ KinectVideoCamera videoCamera = kinectDevice.GetVideoCamera( );
+
+ // see example for video camera also
+
+
+
+
+
+
+ Get initialized instance of the Kinect device.
+
+
+ ID of the Kinect device to get instance of, [0, ),
+
+ Returns initialized Kinect device. Use method
+ when the device is no longer required.
+
+ There is no Kinect device with specified ID connected to the system.
+ Failed connecting to the Kinect device specified ID.
+
+
+
+
+ Object finalizer/destructor makes sure unmanaged resource are freed if user did not call .
+
+
+
+
+ Dispose device freeing all associated unmanaged resources.
+
+
+
+
+ Set color of Kinect's LED.
+
+
+ LED color to set.
+
+ Some error occurred with the device. Check error message.
+
+
+
+
+ Set motor's tilt value.
+
+
+ Tilt value to set, [-31, 30] degrees.
+
+ Motor tilt has to be in the [-31, 31] range.
+ Some error occurred with the device. Check error message.
+
+
+
+
+ Get accelerometer values for 3 axes.
+
+
+ X axis value on the accelerometer.
+ Y axis value on the accelerometer.
+ Z axis value on the accelerometer.
+
+ Units of all 3 values are m/s2. The g value used
+ for calculations is taken as 9.80665 m/s2.
+
+
+
+
+ Get Kinect's video camera.
+
+
+ Returns Kinect's video camera.
+
+ The method simply creates instance of the class
+ by calling its appropriate constructor. Use method
+ to start the video then.
+
+
+
+
+ Get Kinect's depth camera.
+
+
+ Returns Kinect's depth camera.
+
+ The method simply creates instance of the class
+ by calling its appropriate constructor. Use method
+ to start the video then.
+
+
+
+
+ ID of the opened Kinect device.
+
+
+
+
+
+ Number of Kinect devices available in the system.
+
+
+
+
+ Enumeration of video camera modes for the .
+
+
+
+
+ 24 bit per pixel RGB mode.
+
+
+
+
+ 8 bit per pixel Bayer mode.
+
+
+
+
+ 8 bit per pixel Infra Red mode.
+
+
+
+
+ Video source for Microsoft Kinect's video camera.
+
+
+ The video source captures video data from Microsoft Kinect
+ video camera, which is aimed originally as a gaming device for XBox 360 platform.
+
+ Prior to using the class, make sure you've installed Kinect's drivers
+ as described on Open Kinect
+ project's page.
+
+ In order to run correctly the class requires freenect.dll library
+ to be put into solution's output folder. This can be found within the AForge.NET framework's
+ distribution in Externals folder.
+
+ Sample usage:
+
+ // create video source
+ KinectVideoCamera videoSource = new KinectVideoCamera( 0 );
+ // set NewFrame event handler
+ videoSource.NewFrame += new NewFrameEventHandler( video_NewFrame );
+ // start the video source
+ videoSource.Start( );
+ // ...
+
+ private void video_NewFrame( object sender, NewFrameEventArgs eventArgs )
+ {
+ // get new frame
+ Bitmap bitmap = eventArgs.Frame;
+ // process the frame
+ }
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Kinect's device ID (index) to connect to.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Kinect's device ID (index) to connect to.
+ Resolution of video camera to set.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Kinect's device ID (index) to connect to.
+ Resolution of video camera to set.
+ Sets video camera mode.
+
+
+
+
+ Start video source.
+
+
+ Starts video source and returns execution to caller. Video camera will be started
+ and will provide new video frames through the event.
+
+ The specified resolution is not supported for the selected
+ mode of the Kinect video camera.
+ Could not connect to Kinect's video camera.
+ Another connection to the specified video camera is already running.
+
+
+
+
+ Signal video source to stop its work.
+
+
+ Calling this method is equivalent to calling
+ for Kinect video camera.
+
+
+
+
+ Wait for video source has stopped.
+
+
+ Calling this method is equivalent to calling
+ for Kinect video camera.
+
+
+
+
+ Stop video source.
+
+
+ The method stops the video source, so it no longer provides new video frames
+ and does not consume any resources.
+
+
+
+
+
+ New frame event.
+
+
+ Notifies clients about new available frames from the video source.
+
+ Since video source may have multiple clients, each client is responsible for
+ making a copy (cloning) of the passed video frame, because the video source disposes its
+ own original copy after notifying of clients.
+
+
+
+
+
+ Video source error event.
+
+
+ This event is used to notify clients about any type of errors occurred in
+ video source object, for example internal exceptions.
+
+
+
+
+ Video playing finished event.
+
+
+ This event is used to notify clients that the video playing has finished.
+
+
+
+
+
+ Specifies video mode for the camera.
+
+
+
+ The property must be set before running the video source to take effect.
+
+ Default value of the property is set to .
+
+
+
+
+
+ Resolution of video camera to set.
+
+
+ The property must be set before running the video source to take effect.
+
+ Default value of the property is set to .
+
+
+
+
+
+ A string identifying the video source.
+
+
+
+
+
+ State of the video source.
+
+
+ Current state of video source object - running or not.
+
+
+
+
+ Received bytes count.
+
+
+ Number of bytes the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ Received frames count.
+
+
+ Number of frames the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
diff --git a/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.VFW.dll b/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.VFW.dll
new file mode 100644
index 0000000..fa8884a
Binary files /dev/null and b/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.VFW.dll differ
diff --git a/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.VFW.xml b/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.VFW.xml
new file mode 100644
index 0000000..b1364fb
--- /dev/null
+++ b/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.VFW.xml
@@ -0,0 +1,1098 @@
+
+
+
+ AForge.Video.VFW
+
+
+
+
+ AVI files writing using Video for Windows interface.
+
+
+ The class allows to write AVI files using Video for Windows API.
+
+ Sample usage:
+
+ // instantiate AVI writer, use WMV3 codec
+ AVIWriter writer = new AVIWriter( "wmv3" );
+ // create new AVI file and open it
+ writer.Open( "test.avi", 320, 240 );
+ // create frame image
+ Bitmap image = new Bitmap( 320, 240 );
+
+ for ( int i = 0; i < 240; i++ )
+ {
+ // update image
+ image.SetPixel( i, i, Color.Red );
+ // add the image as a new frame of video file
+ writer.AddFrame( image );
+ }
+ writer.Close( );
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Initializes Video for Windows library.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Codec to use for compression.
+
+ Initializes Video for Windows library.
+
+
+
+
+ Destroys the instance of the class.
+
+
+
+
+
+ Dispose the object.
+
+
+ Frees unmanaged resources used by the object. The object becomes unusable
+ after that.
+
+
+
+
+ Dispose the object.
+
+
+ Indicates if disposing was initiated manually.
+
+
+
+
+ Create new AVI file and open it for writing.
+
+
+ AVI file name to create.
+ Video width.
+ Video height.
+
+ The method opens (creates) a video files, configure video codec and prepares
+ the stream for saving video frames with a help of method.
+
+ Failed opening the specified file.
+ A error occurred while creating new video file. See exception message.
+ Insufficient memory for internal buffer.
+ Video file resolution must be a multiple of two.
+
+
+
+
+ Close video file.
+
+
+
+
+
+ Add new frame to the AVI file.
+
+
+ New frame image.
+
+ The method adds new video frame to an opened video file. The width and heights
+ of the frame should be the same as it was specified in method
+ (see and properties).
+
+ Thrown if no video file was open.
+ Bitmap size must be of the same as video size, which was specified on opening video file.
+ A error occurred while writing new video frame. See exception message.
+
+
+
+
+ Width of video frames.
+
+
+ The property specifies the width of video frames, which are acceptable
+ by method for saving, which is set in
+ method.
+
+
+
+
+ Height of video frames.
+
+
+ The property specifies the height of video frames, which are acceptable
+ by method for saving, which is set in
+ method.
+
+
+
+
+ Current position in video stream.
+
+
+ The property tell current position in video stream, which actually equals
+ to the amount of frames added using method.
+
+
+
+
+ Desired playing frame rate.
+
+
+ The property sets the video frame rate, which should be use during playing
+ of the video to be saved.
+
+ The property should be set befor opening new file to take effect.
+
+ Default frame rate is set to 25.
+
+
+
+
+ Codec used for video compression.
+
+
+ The property sets the FOURCC code of video compression codec, which needs to
+ be used for video encoding.
+
+ The property should be set befor opening new file to take effect.
+
+ Default video codec is set "DIB ", which means no compression.
+
+
+
+
+ Compression video quality.
+
+
+ The property sets video quality used by codec in order to balance compression rate
+ and image quality. The quality is measured usually in the [0, 100] range.
+
+ The property should be set befor opening new file to take effect.
+
+ Default value is set to -1 - default compression quality of the codec.
+
+
+
+
+ AVI files reading using Video for Windows.
+
+
+ The class allows to read AVI files using Video for Windows API.
+
+ Sample usage:
+
+ // instantiate AVI reader
+ AVIReader reader = new AVIReader( );
+ // open video file
+ reader.Open( "test.avi" );
+ // read the video file
+ while ( reader.Position - reader.Start < reader.Length )
+ {
+ // get next frame
+ Bitmap image = reader.GetNextFrame( );
+ // .. process the frame somehow or display it
+ }
+ reader.Close( );
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Initializes Video for Windows library.
+
+
+
+
+ Destroys the instance of the class.
+
+
+
+
+
+ Dispose the object.
+
+
+ Frees unmanaged resources used by the object. The object becomes unusable
+ after that.
+
+
+
+
+ Dispose the object.
+
+
+ Indicates if disposing was initiated manually.
+
+
+
+
+ Open AVI file.
+
+
+ AVI file name to open.
+
+ The method opens a video file and prepares the stream and decoder for
+ reading video frames with the help of method.
+
+
+ Failed opening the specified file.
+ A error occurred while opening the video file. See exception message.
+
+
+
+
+
+ Close video file.
+
+
+
+
+
+ Get next frame of opened video stream.
+
+
+ Returns next frame as a bitmap.
+
+ The method reads and returns the next video frame in the opened video stream
+ at the position, which is set in property.
+
+ Thrown if no video file was open.
+ A error occurred while reading next video frame. See exception message.
+
+
+
+
+ Width of video frames.
+
+
+ The property specifies the width of video frames within the opened video
+ file.
+
+
+
+
+ Height of video frames.
+
+
+ The property specifies the height of video frames within the opened video
+ file.
+
+
+
+
+ Current position in video stream.
+
+
+ Setting position outside of video range, will lead to reseting position to the start.
+
+
+
+
+ Starting position of video stream.
+
+
+
+
+
+ Video stream length.
+
+
+
+
+
+ Desired playing frame rate.
+
+
+ The property specifies the frame rate, which should be used to play the opened video
+ file.
+
+
+
+
+ Codec used for video compression.
+
+
+ The property tells about which codec was used to encode the opened video file.
+
+
+
+
+ AVI file video source.
+
+
+ The video source reads AVI files using Video for Windows.
+
+ Sample usage:
+
+ // create AVI file video source
+ AVIFileVideoSource source = new AVIFileVideoSource( "some file" );
+ // set event handlers
+ source.NewFrame += new NewFrameEventHandler( video_NewFrame );
+ // start the video source
+ source.Start( );
+ // ...
+ // signal to stop
+ source.SignalToStop( );
+
+ // New frame event handler, which is invoked on each new available video frame
+ private void video_NewFrame( object sender, NewFrameEventArgs eventArgs )
+ {
+ // get new frame
+ Bitmap bitmap = eventArgs.Frame;
+ // process the frame
+ }
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Video file name.
+
+
+
+
+ Start video source.
+
+
+ Starts video source and return execution to caller. Video source
+ object creates background thread and notifies about new frames with the
+ help of event.
+
+ Video source is not specified.
+
+
+
+
+ Signal video source to stop its work.
+
+
+ Signals video source to stop its background thread, stop to
+ provide new frames and free resources.
+
+
+
+
+ Wait for video source has stopped.
+
+
+ Waits for source stopping after it was signalled to stop using
+ method.
+
+
+
+
+ Stop video source.
+
+
+ Stops video source aborting its thread.
+
+ Since the method aborts background thread, its usage is highly not preferred
+ and should be done only if there are no other options. The correct way of stopping camera
+ is signaling it stop and then
+ waiting for background thread's completion.
+
+
+
+
+
+ Free resource.
+
+
+
+
+
+ Worker thread.
+
+
+
+
+
+ New frame event.
+
+
+ Notifies clients about new available frame from video source.
+
+ Since video source may have multiple clients, each client is responsible for
+ making a copy (cloning) of the passed video frame, because the video source disposes its
+ own original copy after notifying of clients.
+
+
+
+
+
+ Video source error event.
+
+
+ This event is used to notify clients about any type of errors occurred in
+ video source object, for example internal exceptions.
+
+
+
+
+ Video playing finished event.
+
+
+ This event is used to notify clients that the video playing has finished.
+
+
+
+
+
+ Frame interval.
+
+
+ The property sets the interval in milliseconds between frames. If the property is
+ set to 100, then the desired frame rate will be 10 frames per second.
+
+ Setting this property to 0 leads to no delay between video frames - frames
+ are read as fast as possible.
+
+ Default value is set to 0.
+
+
+
+
+
+ Get frame interval from source or use manually specified.
+
+
+ The property specifies which frame rate to use for video playing.
+ If the property is set to , then video is played
+ with original frame rate, which is set in source AVI file. If the property is
+ set to , then custom frame rate is used, which is
+ calculated based on the manually specified frame interval.
+
+ Default value is set to .
+
+
+
+
+
+ Video source.
+
+
+ Video file name to play.
+
+
+
+
+ Received frames count.
+
+
+ Number of frames the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ Received bytes count.
+
+
+ Number of bytes the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ State of the video source.
+
+
+ Current state of video source object - running or not.
+
+
+
+
+ Windows API functions and structures.
+
+
+ The class provides Video for Windows and some other Win32 functions and structurs.
+
+
+
+
+ Copy a block of memory.
+
+
+ Destination pointer.
+ Source pointer.
+ Memory block's length to copy.
+
+ Return's the value of dst - pointer to destination.
+
+
+
+
+ Initialize the AVIFile library.
+
+
+
+
+
+ Exit the AVIFile library.
+
+
+
+
+ Open an AVI file.
+
+
+ Opened AVI file interface.
+ AVI file name.
+ Opening mode (see ).
+ Handler to use (null to use default).
+
+ Returns zero on success or error code otherwise.
+
+
+
+
+ Release an open AVI stream.
+
+
+ Open AVI file interface.
+
+ Returns the reference count of the file.
+
+
+
+
+ Get stream interface that is associated with a specified AVI file
+
+
+ Handler to an open AVI file.
+ Stream interface.
+ Stream type to open.
+ Count of the stream type. Identifies which occurrence of the specified stream type to access.
+
+
+
+
+
+
+ Create a new stream in an existing file and creates an interface to the new stream.
+
+
+ Handler to an open AVI file.
+ Stream interface.
+ Pointer to a structure containing information about the new stream.
+
+ Returns zero if successful or an error otherwise.
+
+
+
+
+ Release an open AVI stream.
+
+
+ Handle to an open stream.
+
+ Returns the current reference count of the stream.
+
+
+
+
+ Set the format of a stream at the specified position.
+
+
+ Handle to an open stream.
+ Position in the stream to receive the format.
+ Pointer to a structure containing the new format.
+ Size, in bytes, of the block of memory referenced by format.
+
+ Returns zero if successful or an error otherwise.
+
+
+
+
+ Get the starting sample number for the stream.
+
+
+ Handle to an open stream.
+
+ Returns the number if successful or – 1 otherwise.
+
+
+
+
+ Get the length of the stream.
+
+
+ Handle to an open stream.
+
+ Returns the stream's length, in samples, if successful or -1 otherwise.
+
+
+
+
+ Obtain stream header information.
+
+
+ Handle to an open stream.
+ Pointer to a structure to contain the stream information.
+ Size, in bytes, of the structure used for streamInfo.
+
+ Returns zero if successful or an error otherwise.
+
+
+
+
+ Prepare to decompress video frames from the specified video stream
+
+
+ Pointer to the video stream used as the video source.
+ Pointer to a structure that defines the desired video format. Specify NULL to use a default format.
+
+ Returns an object that can be used with the function.
+
+
+
+
+ Prepare to decompress video frames from the specified video stream.
+
+
+ Pointer to the video stream used as the video source.
+ Pointer to a structure that defines the desired video format. Specify NULL to use a default format.
+
+ Returns a GetFrame object that can be used with the function.
+
+
+
+
+ Releases resources used to decompress video frames.
+
+
+ Handle returned from the function.
+
+ Returns zero if successful or an error otherwise.
+
+
+
+
+ Return the address of a decompressed video frame.
+
+
+ Pointer to a GetFrame object.
+ Position, in samples, within the stream of the desired frame.
+
+ Returns a pointer to the frame data if successful or NULL otherwise.
+
+
+
+
+ Write data to a stream.
+
+
+ Handle to an open stream.
+ First sample to write.
+ Number of samples to write.
+ Pointer to a buffer containing the data to write.
+ Size of the buffer referenced by buffer.
+ Flag associated with this data.
+ Pointer to a buffer that receives the number of samples written. This can be set to NULL.
+ Pointer to a buffer that receives the number of bytes written. This can be set to NULL.
+
+ Returns zero if successful or an error otherwise.
+
+
+
+
+ Retrieve the save options for a file and returns them in a buffer.
+
+
+ Handle to the parent window for the Compression Options dialog box.
+ Flags for displaying the Compression Options dialog box.
+ Number of streams that have their options set by the dialog box.
+ Pointer to an array of stream interface pointers.
+ Pointer to an array of pointers to AVICOMPRESSOPTIONS structures.
+
+ Returns TRUE if the user pressed OK, FALSE for CANCEL, or an error otherwise.
+
+
+
+
+ Free the resources allocated by the AVISaveOptions function.
+
+
+ Count of the AVICOMPRESSOPTIONS structures referenced in options.
+ Pointer to an array of pointers to AVICOMPRESSOPTIONS structures.
+
+ Returns 0.
+
+
+
+
+ Create a compressed stream from an uncompressed stream and a
+ compression filter, and returns the address of a pointer to
+ the compressed stream.
+
+
+ Pointer to a buffer that receives the compressed stream pointer.
+ Pointer to the stream to be compressed.
+ Pointer to a structure that identifies the type of compression to use and the options to apply.
+ Pointer to a class identifier used to create the stream.
+
+ Returns 0 if successful or an error otherwise.
+
+
+
+
+ .NET replacement of mmioFOURCC macros. Converts four characters to code.
+
+
+ Four characters string.
+
+ Returns the code created from provided characters.
+
+
+
+
+ Inverse to . Converts code to fout characters string.
+
+
+ Code to convert.
+
+ Returns four characters string.
+
+
+
+
+ Version of for one stream only.
+
+
+ Stream to configure.
+ Stream options.
+
+ Returns TRUE if the user pressed OK, FALSE for CANCEL, or an error otherwise.
+
+
+
+
+ Structure to define the coordinates of the upper-left and
+ lower-right corners of a rectangle.
+
+
+
+
+
+ x-coordinate of the upper-left corner of the rectangle.
+
+
+
+
+
+ y-coordinate of the upper-left corner of the rectangle.
+
+
+
+
+
+ x-coordinate of the bottom-right corner of the rectangle.
+
+
+
+
+
+ y-coordinate of the bottom-right corner of the rectangle.
+
+
+
+
+
+ Structure, which contains information for a single stream .
+
+
+
+
+
+ Four-character code indicating the stream type.
+
+
+
+
+
+ Four-character code of the compressor handler that will compress this video stream when it is saved.
+
+
+
+
+
+ Applicable flags for the stream.
+
+
+
+
+
+ Capability flags; currently unused.
+
+
+
+
+
+ Priority of the stream.
+
+
+
+
+
+ Language of the stream.
+
+
+
+
+
+ Time scale applicable for the stream.
+
+
+ Dividing rate by scale gives the playback rate in number of samples per second.
+
+
+
+
+ Rate in an integer format.
+
+
+
+
+
+ Sample number of the first frame of the AVI file.
+
+
+
+
+
+ Length of this stream.
+
+
+ The units are defined by rate and scale.
+
+
+
+
+ Audio skew. This member specifies how much to skew the audio data ahead of the video frames in interleaved files.
+
+
+
+
+
+ Recommended buffer size, in bytes, for the stream.
+
+
+
+
+
+ Quality indicator of the video data in the stream.
+
+
+ Quality is represented as a number between 0 and 10,000.
+
+
+
+
+ Size, in bytes, of a single data sample.
+
+
+
+
+
+ Dimensions of the video destination rectangle.
+
+
+
+
+
+ Number of times the stream has been edited.
+
+
+
+
+
+ Number of times the stream format has changed.
+
+
+
+
+
+ Description of the stream.
+
+
+
+
+
+ Structure, which contains information about the dimensions and color format of a DIB.
+
+
+
+
+
+ Specifies the number of bytes required by the structure.
+
+
+
+
+
+ Specifies the width of the bitmap, in pixels.
+
+
+
+
+
+ Specifies the height of the bitmap, in pixels.
+
+
+ If height is positive, the bitmap is a bottom-up DIB and its origin is
+ the lower-left corner. If height is negative, the bitmap is a top-down DIB and its
+ origin is the upper-left corner.
+
+
+
+
+ Specifies the number of planes for the target device. This value must be set to 1.
+
+
+
+
+
+ Specifies the number of bits-per-pixel.
+
+
+
+
+
+ Specifies the type of compression for a compressed bottom-up bitmap (top-down DIBs cannot be compressed).
+
+
+
+
+
+ Specifies the size, in bytes, of the image.
+
+
+
+
+
+ Specifies the horizontal resolution, in pixels-per-meter, of the target device for the bitmap.
+
+
+
+
+
+ Specifies the vertical resolution, in pixels-per-meter, of the target device for the bitmap.
+
+
+
+
+
+ Specifies the number of color indexes in the color table that are actually used by the bitmap.
+
+
+
+
+
+ Specifies the number of color indexes that are required for displaying the bitmap.
+
+
+
+
+
+ Structure, which contains information about a stream and how it is compressed and saved.
+
+
+
+
+
+ Four-character code indicating the stream type.
+
+
+
+
+
+ Four-character code for the compressor handler that will compress this video stream when it is saved.
+
+
+
+
+
+ Maximum period between video key frames.
+
+
+
+
+
+ Quality value passed to a video compressor.
+
+
+
+
+
+ Video compressor data rate.
+
+
+
+
+
+ Flags used for compression.
+
+
+
+
+
+ Pointer to a structure defining the data format.
+
+
+
+
+
+ Size, in bytes, of the data referenced by format.
+
+
+
+
+
+ Video-compressor-specific data; used internally.
+
+
+
+
+
+ Size, in bytes, of the data referenced by parameters.
+
+
+
+
+ Interleave factor for interspersing stream data with data from the first stream.
+
+
+
+
+
+ File access modes.
+
+
+
+
+
diff --git a/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.Ximea.dll b/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.Ximea.dll
new file mode 100644
index 0000000..0376a67
Binary files /dev/null and b/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.Ximea.dll differ
diff --git a/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.Ximea.xml b/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.Ximea.xml
new file mode 100644
index 0000000..688d30f
--- /dev/null
+++ b/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.Ximea.xml
@@ -0,0 +1,1122 @@
+
+
+
+ AForge.Video.Ximea
+
+
+
+
+ XIMEA camera's LED state options.
+
+
+
+
+ Blink if link is ok (led 1), heartbeat mode (led 2).
+
+
+
+
+ Blink led if trigger detected.
+
+
+
+
+ Blink led if external signal detected.
+
+
+
+
+ Blink led during data streaming.
+
+
+
+
+ Blink led during sensor integration time.
+
+
+
+
+ Blink if device busy/not busy.
+
+
+
+
+ Blink led if link is OK.
+
+
+
+
+ Turn off LED.
+
+
+
+
+ Turn on LED.
+
+
+
+
+ Enumeration of image formats supported by XIMEA cameras.
+
+
+
+
+ 8 bits per pixel.
+
+
+
+
+ 16 bits per pixel.
+
+
+
+
+ RGB data format.
+
+
+
+
+ RGBA data format.
+
+
+
+
+ XIMEA camera's GPI port modes.
+
+
+
+
+ Input is off.
+
+
+
+
+ Trigger input.
+
+
+
+
+ External signal input.
+
+
+
+
+ Set of available configuration options for XIMEA cameras.
+
+
+ The class defines list of parameters, which are available
+ to set/get using corresponding methods of and
+ classes.
+
+
+
+
+ Get camera model name. Type string.
+
+
+
+
+ Get device serial number in decimal format. Type string, integer, float
+
+
+
+
+ Returns device type (1394, USB2.0, CURRERA…..). Type string.
+
+
+
+
+ Set/Get exposure time in microseconds. Type integer.
+
+
+
+
+ Get longest possible exposure to be set on camera in microseconds. Type integer.
+
+
+
+
+ Get shortest possible exposure to be set on camera in microseconds. Type integer.
+
+
+
+
+ Set/Get camera gain in dB. Type float.
+
+
+
+
+ Get highest possible camera gain in dB. Type float.
+
+
+
+
+ Get lowest possible camera gain in dB. Type float.
+
+
+
+
+ Set/Get width of the image provided by the camera (in pixels). Type integer.
+
+
+
+
+ Get maximal image width provided by the camera (in pixels). Type integer.
+
+
+
+
+ Get minimum image width provided by the camera (in pixels). Type integer.
+
+
+
+
+ Set/Get height of the image provided by the camera (in pixels). Type integer.
+
+
+
+
+ Get maximal image height provided by the camera (in pixels). Type integer.
+
+
+
+
+ Get minimum image height provided by the camera (in pixels). Type integer.
+
+
+
+
+ Set/Get image resolution by binning or skipping. Type integer.
+
+
+
+
+ Get highest value for binning or skipping. Type integer.
+
+
+
+
+ Get lowest value for binning or skipping. Type integer.
+
+
+
+
+ Get frames per second. Type float.
+
+
+
+
+ Get highest possible framerate for current camera settings. Type float.
+
+
+
+
+ Get lowest framerate for current camera settings. Type float.
+
+
+
+
+ Set/Get horizontal offset from the origin to the area of interest (in pixels). Type integer.
+
+
+
+
+ Get maximum horizontal offset from the origin to the area of interest (in pixels). Type integer.
+
+
+
+
+ Get minimum horizontal offset from the origin to the area of interest (in pixels). Type integer.
+
+
+
+
+ Set/Get vertical offset from the origin to the area of interest (in pixels). Type integer.
+
+
+
+
+ Get maximum vertical offset from the origin to the area of interest (in pixels). Type integer.
+
+
+
+
+ Get minimal vertical offset from the origin to the area of interest (in pixels). Type integer.
+
+
+
+
+ Set/Get white balance blue coefficient. Type float.
+
+
+
+
+ Set/Get white balance red coefficient. Type float.
+
+
+
+
+ Set/Get white balance green coefficient. Type float.
+
+
+
+
+ Set/Get sharpness strenght. Type float.
+
+
+
+
+ Set/Get luminosity gamma value. Type float. By default 1.0.
+
+
+
+
+ Set/Get chromaticity gamma value. Type float. By default 0.
+
+
+
+
+ Set default color correction matrx.
+
+
+
+
+ Set/Get image format provided by the camera. Type integer. Use
+ enumeraton for possible values.
+
+
+
+
+ Set/Get camera's trigger mode. Type integer. Use
+ enumeration for possible values.
+
+
+
+
+ Generates an internal trigger. must be set to .
+ Type integer.
+
+
+
+
+ Calculates white balance. Takes white balance from image center (should be white/grey object
+ in the center of scene). Type integer.
+
+
+
+
+ Enable/disable automatic white balance. Type integer. By default 0.
+
+
+ Set 0 to disable automatic white balance or 1 to enable.
+
+
+
+
+ Enable/disable bad pixels correction. Type integer. By default 0.
+
+
+ Set 0 to disable bad pixels correction or 1 to enable.
+
+
+
+
+ Set/Get acquisition buffer size in bytes. Type integer. By default 53248000.
+
+
+ Defines acquisition buffer size in bytes. This buffer contains images'
+ data from sensor. This parameter can be set only when acquisition is stopped.
+
+ See for additional information.
+
+
+
+
+
+ Set/Get maximum number of images to store in queue. Type integer. By default 4.
+
+
+
+
+
+ See also for additional information.
+
+
+
+
+
+ Set of configuration options to configure Automatic Exposure/Gain (AEAG) parameters.
+
+
+
+
+ Enable/disable automatic exposure/gain control. Type integer. By default 0.
+
+
+ Set 0 to disable automatic exposure/gain control or 1 to enable.
+
+
+
+
+ Set/Get maximum limit of exposure in AEAG procedure. Type integer. By default 100. Units - ms.
+
+
+
+
+ Set/Get maximum limit of gain in AEAG procedure. Type float. Default depends on camera type. Units - dB.
+
+
+
+
+ Set/Get exposure priority, [0, 1]. Type float. By default 0.8.
+
+
+ Setting the value to 0.5, for example, set exposure priority to 50%
+ and gain priority to 50%.
+
+
+
+
+ Set/Get average intensity of output signal AEAG should achieve (in %). Type float. By default 40.
+
+
+
+
+ Set of configuration options to configure camera's LEDs. Currently supported only for Currera-R cameras.
+
+
+
+
+ Selects camera LED to be used. Type integer.
+
+
+
+
+ Get highest LED number on camera. Type integer.
+
+
+
+
+ Get lowest LED number on camera. Type integer.
+
+
+
+
+ Set/Get LED functionality. Select LED by using parameter.
+ Use enumeration for possible parameter values. Type integer.
+
+
+
+
+ Set of configuration options to configure GPO (General Purpose Output) ports.
+
+
+
+
+ Select camera GPO port. Type integer.
+
+
+
+
+ Get highest GPO port number on camera. Type integer.
+
+
+
+
+ Get lowest GPO port number on camera. Type integer
+
+
+
+
+ Set/Get GPO port functionality. Select port by using parameter.
+ Use enumeration to set mode. Type integer.
+
+
+
+
+ Set of configuration options to access/configure GPI (General Purpose Input) ports.
+
+
+
+
+ Select camera GPI port. Type integer.
+
+
+
+
+ Get highest GPI port number on camera. Type integer.
+
+
+
+
+ Get lowest GPI port number on camera. Type integer
+
+
+
+
+ Set/Get GPI port functionality. Select port by using parameter.
+ Use enumeration to set mode. Type integer.
+
+
+
+
+ Get current GPI level. Type integer.
+
+
+
+
+ Set of configuration options to configure camera's LUT - Look-Up-Table.
+ Currently available only for Currera-R cameras.
+
+
+
+
+ Enable/Disable LUT. Type integer. Default 0.
+
+
+ Set 0 to disable LUT - sensor pixels are transferred directly.
+ Set 1 to enable LUT - sensor pixels are mapped through LUT.
+
+
+
+
+ Set/Get the index (offset) of the coefficient to access in the LUT. Type integer.
+
+
+
+
+ Get lowest LUT index (offset) of the coefficient to access in the LUT. Type integer.
+
+
+
+
+ Get highest LUT index (offset) of the coefficient to access in the LUT. Type integer.
+
+
+
+
+ Set/Get value in the LUT. Index of the value must be selected using
+ parameter. Type integer.
+
+
+
+
+ Get highest value to be set in LUT. Type integer.
+
+
+
+
+ Get lowest value to be set in LUT. Type integer.
+
+
+
+
+ Set of configuration options to access elements of Color Correction Matrix.
+
+
+
+
+
+ Set/Get color correction matrix element [0][0]. Type float. By default 1.0.
+
+
+
+
+ Set/Get color correction matrix element [0][1]. Type float. By default 0.0.
+
+
+
+
+ Set/Get color correction matrix element [0][2]. Type float. By default 0.0.
+
+
+
+
+ Set/Get color correction matrix element [0][3]. Type float. By default 0.0.
+
+
+
+
+ Set/Get color correction matrix element [1][0]. Type float. By default 0.0.
+
+
+
+
+ Set/Get color correction matrix element [1][1]. Type float. By default 1.0.
+
+
+
+
+ Set/Get color correction matrix element [1][2]. Type float. By default 0.0.
+
+
+
+
+ Set/Get color correction matrix element [1][3]. Type float. By default 0.0.
+
+
+
+
+ Set/Get color correction matrix element [2][0]. Type float. By default 0.0.
+
+
+
+
+ Set/Get color correction matrix element [2][1]. Type float. By default 0.0.
+
+
+
+
+ Set/Get color correction matrix element [2][2]. Type float. By default 1.0.
+
+
+
+
+ Set/Get color correction matrix element [2][3]. Type float. By default 0.0.
+
+
+
+
+ Set/Get color correction matrix element [3][0]. Type float. By default 0.0.
+
+
+
+
+ Set/Get color correction matrix element [3][1]. Type float. By default 0.0.
+
+
+
+
+ Set/Get color correction matrix element [3][2]. Type float. By default 0.0.
+
+
+
+
+ Set/Get color correction matrix element [3][3]. Type float. By default 1.0.
+
+
+
+
+ XIMEA camera's GPO port modes.
+
+
+
+
+ Output off.
+
+
+
+
+ Logical level.
+
+
+
+
+ High during exposure (integration) time + readout time + data transfer time.
+
+
+
+
+ Low during exposure (integration) time + readout time + data trasnfer time.
+
+
+
+
+ High during exposure(integration) time.
+
+
+
+
+ Low during exposure(integration) time.
+
+
+
+
+ The class provides access to XIMEA cameras.
+
+
+ The class allows to perform image acquisition from XIMEA cameras.
+ It wraps XIMEA'a xiAPI, which means that users of this class will also require m3api.dll and a correct
+ TM file for the camera model connected to the system (both are provided with XIMEA API software package).
+
+ Sample usage:
+
+ XimeaCamera camera = new XimeaCamera( );
+
+ // open camera and start data acquisition
+ camera.Open( 0 );
+ camera.StartAcquisition( );
+
+ // set exposure time to 10 milliseconds
+ camera.SetParam( CameraParameter.Exposure, 10 * 1000 );
+
+ // get image from the camera
+ Bitmap bitmap = camera.GetImage( );
+ // process the image
+ // ...
+
+ // dispose the image when it is no longer needed
+ bitmap.Dispose( );
+
+ // stop data acquisition and close the camera
+ camera.StopAcquisition( );
+ camera.Close( );
+
+
+
+
+
+
+
+
+ Open XIMEA camera.
+
+
+ Camera ID to open.
+
+ Opens the specified XIMEA camera preparing it for starting video acquisition
+ which is done using method. The
+ property can be used at any time to find if a camera was opened or not.
+
+ An error occurred while communicating with a camera. See error
+ message for additional information.
+
+
+
+
+ Close opened camera (if any) and release allocated resources.
+
+
+ The method also calls method if it was not
+ done by user.
+
+ An error occurred while communicating with a camera. See error
+ message for additional information.
+
+
+
+
+ Begin camera's work cycle and start data acquisition from it.
+
+
+ The property can be used at any time to find if the
+ acquisition was started or not.
+
+ An error occurred while communicating with a camera. See error
+ message for additional information.
+ No camera was opened, so can not access its methods.
+
+
+
+
+ End camera's work cycle and stops data acquisition.
+
+
+ An error occurred while communicating with a camera. See error
+ message for additional information.
+ No camera was opened, so can not access its methods.
+
+
+
+
+ Set camera's parameter.
+
+
+ Parameter name.
+ Integer parameter value.
+
+ The method allows to control different camera's parameters, like exposure time, gain value, etc.
+ See class for the list of some possible configuration parameters. See
+ XIMEA documentation for the complete list of supported parameters.
+
+
+ An error occurred while communicating with a camera. See error
+ message for additional information.
+ No camera was opened, so can not access its methods.
+
+
+
+
+ Set camera's parameter.
+
+
+ Parameter name.
+ Float parameter value.
+
+ The method allows to control different camera's parameters, like exposure time, gain value, etc.
+ See class for the list of some possible configuration parameters. See
+ XIMEA documentation for the complete list of supported parameters.
+
+
+ An error occurred while communicating with a camera. See error
+ message for additional information.
+ No camera was opened, so can not access its methods.
+
+
+
+
+ Get camera's parameter as integer value.
+
+
+ Parameter name to get from camera.
+
+ Returns integer value of the requested parameter.
+
+ See class for the list of some possible configuration parameters. See
+ XIMEA documentation for the complete list of supported parameters.
+
+ An error occurred while communicating with a camera. See error
+ message for additional information.
+ No camera was opened, so can not access its methods.
+
+
+
+
+ Get camera's parameter as float value.
+
+
+ Parameter name to get from camera.
+
+ Returns float value of the requested parameter.
+
+ See class for the list of some possible configuration parameters. See
+ XIMEA documentation for the complete list of supported parameters.
+
+ An error occurred while communicating with a camera. See error
+ message for additional information.
+ No camera was opened, so can not access its methods.
+
+
+
+
+ Get camera's parameter as string value.
+
+
+ Parameter name to get from camera.
+
+ Returns string value of the requested parameter.
+
+ See class for the list of some possible configuration parameters. See
+ XIMEA documentation for the complete list of supported parameters.
+
+ An error occurred while communicating with a camera. See error
+ message for additional information.
+ No camera was opened, so can not access its methods.
+
+
+
+
+ Get image from the opened XIMEA camera.
+
+
+ Returns image retrieved from the camera.
+
+ The method calls method specifying 5000 as the timeout
+ value.
+
+
+
+
+ Get image from the opened XIMEA camera.
+
+
+ Maximum time to wait in milliseconds till image becomes available.
+
+ Returns image retrieved from the camera.
+
+ The method calls method specifying
+ the makeCopy parameter.
+
+
+
+
+ Get image from the opened XIMEA camera.
+
+
+ Maximum time to wait in milliseconds till image becomes available.
+ Make a copy of the camera's image or not.
+
+ Returns image retrieved from the camera.
+
+ If the is set to , then the method
+ creates a managed copy of the camera's image, so the managed image stays valid even when the camera
+ is closed. However, setting this parameter to creates a managed image which is
+ just a wrapper around camera's unmanaged image. So if camera is closed and its resources are freed, the
+ managed image becomes no longer valid and accessing it will generate an exception.
+
+ An error occurred while communicating with a camera. See error
+ message for additional information.
+ No camera was opened, so can not access its methods.
+ Time out value reached - no image is available within specified time value.
+
+
+
+
+ Get number of XIMEA camera connected to the system.
+
+
+
+
+ Specifies if camera's data acquisition is currently active for the opened camera (if any).
+
+
+
+
+ Specifies if a camera is currently opened by the instance of the class.
+
+
+
+
+ ID of the the recently opened XIMEA camera.
+
+
+
+
+ Enumeration of camera's trigger modes.
+
+
+
+
+ Camera works in free run mode.
+
+
+
+
+ External trigger (rising edge).
+
+
+
+
+ External trigger (falling edge).
+
+
+
+
+ Software (manual) trigger.
+
+
+
+
+ The class provides continues access to XIMEA cameras.
+
+
+ The video source class is aimed to provide continues access to XIMEA camera, when
+ images are continuosly acquired from camera and provided throw the event.
+ It just creates a background thread and gets new images from XIMEA camera
+ keeping the specified time interval between image acquisition.
+ Essentially it is a wrapper class around providing interface.
+
+ Sample usage:
+
+ // create video source for the XIMEA camera with ID 0
+ XimeaVideoSource videoSource = new XimeaVideoSource( 0 );
+ // set event handlers
+ videoSource.NewFrame += new NewFrameEventHandler( video_NewFrame );
+ // start the video source
+ videoSource.Start( );
+
+ // set exposure time to 10 milliseconds
+ videoSource.SetParam( CameraParameter.Exposure, 10 * 1000 );
+
+ // ...
+
+ // New frame event handler, which is invoked on each new available video frame
+ private void video_NewFrame( object sender, NewFrameEventArgs eventArgs )
+ {
+ // get new frame
+ Bitmap bitmap = eventArgs.Frame;
+ // process the frame
+ }
+
+
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ XIMEA camera ID (index) to connect to.
+
+
+
+
+ Start video source.
+
+
+ Starts video source and returns execution to caller. Video camera will be started
+ and will provide new video frames through the event.
+
+ There is no XIMEA camera with specified ID connected to the system.
+ An error occurred while communicating with a camera. See error
+ message for additional information.
+
+
+
+
+ Signal video source to stop its work.
+
+
+
+
+
+
+
+ Wait for video source has stopped.
+
+
+
+
+
+
+
+ Stop video source.
+
+
+ The method stops the video source, so it no longer provides new video frames
+ and does not consume any resources.
+
+
+
+
+
+ Set camera's parameter.
+
+
+ Parameter name.
+ Integer parameter value.
+
+ The call is redirected to .
+
+
+
+
+ Set camera's parameter.
+
+
+ Parameter name.
+ Float parameter value.
+
+ The call is redirected to .
+
+
+
+
+ Get camera's parameter as integer value.
+
+
+ Parameter name to get from camera.
+
+ Returns integer value of the requested parameter.
+
+ The call is redirected to .
+
+
+
+
+ Get camera's parameter as float value.
+
+
+ Parameter name to get from camera.
+
+ Returns float value of the requested parameter.
+
+ The call is redirected to .
+
+
+
+
+ Get camera's parameter as string value.
+
+
+ Parameter name to get from camera.
+
+ Returns string value of the requested parameter.
+
+ The call is redirected to .
+
+
+
+
+ New frame event.
+
+
+ Notifies clients about new available frames from the video source.
+
+ Since video source may have multiple clients, each client is responsible for
+ making a copy (cloning) of the passed video frame, because the video source disposes its
+ own original copy after notifying of clients.
+
+
+
+
+
+ Video source error event.
+
+
+ This event is used to notify clients about any type of errors occurred in
+ video source object, for example internal exceptions.
+
+
+
+
+ Video playing finished event.
+
+
+ This event is used to notify clients that the video playing has finished.
+
+
+
+
+
+ A string identifying the video source.
+
+
+
+
+
+ State of the video source.
+
+
+ Current state of video source object - running or not.
+
+
+
+
+ Received bytes count.
+
+
+ Number of bytes the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ Received frames count.
+
+
+ Number of frames the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ Time interval between frames.
+
+
+ The property sets the interval in milliseconds between getting new frames from the camera.
+ If the property is set to 100, then the desired frame rate should be about 10 frames per second.
+
+ Setting this property to 0 leads to no delay between video frames - frames
+ are read as fast as possible.
+
+ Default value is set to 200.
+
+
+
+
+
diff --git a/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.dll b/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.dll
new file mode 100644
index 0000000..dc67243
Binary files /dev/null and b/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.dll differ
diff --git a/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.xml b/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.xml
new file mode 100644
index 0000000..bde9a52
--- /dev/null
+++ b/Part 2 - Take a Snapshot/bin/Debug/AForge.Video.xml
@@ -0,0 +1,1190 @@
+
+
+
+ AForge.Video
+
+
+
+
+ Proxy video source for asynchronous processing of another nested video source.
+
+
+ The class represents a simple proxy, which wraps the specified
+ with the aim of asynchronous processing of received video frames. The class intercepts
+ event from the nested video source and fires it to clients from its own thread, which is different from the thread
+ used by nested video source for video acquisition. This allows clients to perform processing of video frames
+ without blocking video acquisition thread, which continue to run and acquire next video frame while current is still
+ processed.
+
+ For example, let’s suppose that it takes 100 ms for the nested video source to acquire single frame, so the original
+ frame rate is 10 frames per second. Also let’s assume that we have an image processing routine, which also takes
+ 100 ms to process a single frame. If the acquisition and processing are done sequentially, then resulting
+ frame rate will drop to 5 frames per second. However, if doing both in parallel, then there is a good chance to
+ keep resulting frame rate equal (or close) to the original frame rate.
+
+ The class provides a bonus side effect - easer debugging of image processing routines, which are put into
+ event handler. In many cases video source classes fire their
+ event from a try/catch block, which makes it very hard to spot error made in user's code - the catch block simply
+ hides exception raised in user’s code. The does not have any try/catch blocks around
+ firing of event, so always user gets exception in the case it comes from his code. At the same time
+ nested video source is not affected by the user's exception, since it runs in different thread.
+
+ Sample usage:
+
+ // usage of AsyncVideoSource is the same as usage of any
+ // other video source class, so code change is very little
+
+ // create nested video source, for example JPEGStream
+ JPEGStream stream = new JPEGStream( "some url" );
+ // create async video source
+ AsyncVideoSource asyncSource = new AsyncVideoSource( stream );
+ // set NewFrame event handler
+ asyncSource.NewFrame += new NewFrameEventHandler( video_NewFrame );
+ // start the video source
+ asyncSource.Start( );
+ // ...
+
+ private void video_NewFrame( object sender, NewFrameEventArgs eventArgs )
+ {
+ // get new frame
+ Bitmap bitmap = eventArgs.Frame;
+ // process the frame
+ }
+
+
+
+
+
+
+ Video source interface.
+
+
+ The interface describes common methods for different type of video sources.
+
+
+
+
+ Start video source.
+
+
+ Starts video source and return execution to caller. Video source
+ object creates background thread and notifies about new frames with the
+ help of event.
+
+
+
+
+ Signal video source to stop its work.
+
+
+ Signals video source to stop its background thread, stop to
+ provide new frames and free resources.
+
+
+
+
+ Wait for video source has stopped.
+
+
+ Waits for video source stopping after it was signalled to stop using
+ method.
+
+
+
+
+ Stop video source.
+
+
+ Stops video source aborting its thread.
+
+
+
+
+ New frame event.
+
+
+ This event is used to notify clients about new available video frame.
+
+ Since video source may have multiple clients, each client is responsible for
+ making a copy (cloning) of the passed video frame, but video source is responsible for
+ disposing its own original copy after notifying of clients.
+
+
+
+
+
+ Video source error event.
+
+
+ This event is used to notify clients about any type of errors occurred in
+ video source object, for example internal exceptions.
+
+
+
+
+ Video playing finished event.
+
+
+ This event is used to notify clients that the video playing has finished.
+
+
+
+
+
+ Video source.
+
+
+ The meaning of the property depends on particular video source.
+ Depending on video source it may be a file name, URL or any other string
+ describing the video source.
+
+
+
+
+ Received frames count.
+
+
+ Number of frames the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ Received bytes count.
+
+
+ Number of bytes the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ State of the video source.
+
+
+ Current state of video source object - running or not.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Nested video source which is the target for asynchronous processing.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Nested video source which is the target for asynchronous processing.
+ Specifies if the object should skip frames from the nested video source
+ in the case if it is still busy processing the previous video frame.
+
+
+
+
+ Start video source.
+
+
+ Starts the nested video source and returns execution to caller. This object creates
+ an extra thread which is used to fire events, so the image processing could be
+ done on another thread without blocking video acquisition thread.
+
+
+
+
+ Signal video source to stop its work.
+
+
+ Signals video source to stop its background thread, stop to
+ provide new frames and free resources.
+
+
+
+
+ Wait for video source has stopped.
+
+
+ Waits for video source stopping after it was signalled to stop using
+ method.
+
+
+
+
+ Stop video source.
+
+
+ Stops nested video source by calling its method.
+ See documentation of the particular video source for additional details.
+
+
+
+
+ New frame event.
+
+
+ Notifies clients about new available frame from video source.
+
+ This event is fired from a different thread other than the video acquisition thread created
+ by . This allows nested video frame to continue acquisition of the next
+ video frame while clients perform processing of the current video frame.
+
+ Since video source may have multiple clients, each client is responsible for
+ making a copy (cloning) of the passed video frame, because the video source disposes its
+ own original copy after notifying of clients.
+
+
+
+
+
+ Video source error event.
+
+
+ This event is used to notify clients about any type of errors occurred in
+ video source object, for example internal exceptions.
+
+ Unlike event, this event is simply redirected to the corresponding
+ event of the , so it is fired from the thread of the nested video source.
+
+
+
+
+
+ Video playing finished event.
+
+
+ This event is used to notify clients that the video playing has finished.
+
+ Unlike event, this event is simply redirected to the corresponding
+ event of the , so it is fired from the thread of the nested video source.
+
+
+
+
+
+ Nested video source which is the target for asynchronous processing.
+
+
+ The property is set through the class constructor.
+
+ All calls to this object are actually redirected to the nested video source. The only
+ exception is the event, which is handled differently. This object gets
+ event from the nested class and then fires another
+ event, but from a different thread.
+
+
+
+
+
+ Specifies if the object should skip frames from the nested video source when it is busy.
+
+
+ Specifies if the object should skip frames from the nested video source
+ in the case if it is still busy processing the previous video frame in its own thread.
+
+ Default value is set to .
+
+
+
+
+ Video source string.
+
+
+ The property is redirected to the corresponding property of ,
+ so check its documentation to find what it means.
+
+
+
+
+ Received frames count.
+
+
+ Number of frames the nested video source received from
+ the moment of the last access to the property.
+
+
+
+
+
+ Received bytes count.
+
+
+ Number of bytes the nested video source received from
+ the moment of the last access to the property.
+
+
+
+
+ Processed frames count.
+
+
+ The property keeps the number of processed video frames since the last access to this property.
+
+
+ The value of this property equals to in most cases if the
+ property is set to - every received frame gets processed
+ sooner or later. However, if the property is set to ,
+ then value of this property may be lower than the value of the property, which
+ means that nested video source performs acquisition faster than client perform processing of the received frame
+ and some frame are skipped from processing.
+
+
+
+
+
+ State of the video source.
+
+
+ Current state of the video source object - running or not.
+
+
+
+
+ Screen capture video source.
+
+
+ The video source constantly captures the desktop screen.
+
+ Sample usage:
+
+ // get entire desktop area size
+ Rectangle screenArea = Rectangle.Empty;
+ foreach ( System.Windows.Forms.Screen screen in
+ System.Windows.Forms.Screen.AllScreens )
+ {
+ screenArea = Rectangle.Union( screenArea, screen.Bounds );
+ }
+
+ // create screen capture video source
+ ScreenCaptureStream stream = new ScreenCaptureStream( screenArea );
+
+ // set NewFrame event handler
+ stream.NewFrame += new NewFrameEventHandler( video_NewFrame );
+
+ // start the video source
+ stream.Start( );
+
+ // ...
+ // signal to stop
+ stream.SignalToStop( );
+ // ...
+
+ private void video_NewFrame( object sender, NewFrameEventArgs eventArgs )
+ {
+ // get new frame
+ Bitmap bitmap = eventArgs.Frame;
+ // process the frame
+ }
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Screen's rectangle to capture (the rectangle may cover multiple displays).
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Screen's rectangle to capture (the rectangle may cover multiple displays).
+ Time interval between making screen shots, ms.
+
+
+
+
+ Start video source.
+
+
+ Starts video source and return execution to caller. Video source
+ object creates background thread and notifies about new frames with the
+ help of event.
+
+ Video source is not specified.
+
+
+
+
+ Signal video source to stop its work.
+
+
+ Signals video source to stop its background thread, stop to
+ provide new frames and free resources.
+
+
+
+
+ Wait for video source has stopped.
+
+
+ Waits for source stopping after it was signalled to stop using
+ method.
+
+
+
+
+ Stop video source.
+
+
+ Stops video source aborting its thread.
+
+ Since the method aborts background thread, its usage is highly not preferred
+ and should be done only if there are no other options. The correct way of stopping camera
+ is signaling it stop and then
+ waiting for background thread's completion.
+
+
+
+
+
+ Free resource.
+
+
+
+
+
+ New frame event.
+
+
+ Notifies clients about new available frame from video source.
+
+ Since video source may have multiple clients, each client is responsible for
+ making a copy (cloning) of the passed video frame, because the video source disposes its
+ own original copy after notifying of clients.
+
+
+
+
+
+ Video source error event.
+
+
+ This event is used to notify clients about any type of errors occurred in
+ video source object, for example internal exceptions.
+
+
+
+
+ Video playing finished event.
+
+
+ This event is used to notify clients that the video playing has finished.
+
+
+
+
+
+ Video source.
+
+
+
+
+
+ Gets or sets the screen capture region.
+
+
+ This property specifies which region (rectangle) of the screen to capture. It may cover multiple displays
+ if those are available in the system.
+
+ The property must be set before starting video source to have any effect.
+
+
+
+
+
+ Time interval between making screen shots, ms.
+
+
+ The property specifies time interval in milliseconds between consequent screen captures.
+ Expected frame rate of the stream should be approximately 1000/FrameInteval.
+
+ If the property is set to 0, then the stream will capture screen as fast as the system allows.
+
+ Default value is set to 100.
+
+
+
+
+
+ Received frames count.
+
+
+ Number of frames the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ Received bytes count.
+
+
+ The property is not implemented for this video source and always returns 0.
+
+
+
+
+
+ State of the video source.
+
+
+ Current state of video source object - running or not.
+
+
+
+
+ MJPEG video source.
+
+
+ The video source downloads JPEG images from the specified URL, which represents
+ MJPEG stream.
+
+ Sample usage:
+
+ // create MJPEG video source
+ MJPEGStream stream = new MJPEGStream( "some url" );
+ // set event handlers
+ stream.NewFrame += new NewFrameEventHandler( video_NewFrame );
+ // start the video source
+ stream.Start( );
+ // ...
+
+
+ Some cameras produce HTTP header, which does not conform strictly to
+ standard, what leads to .NET exception. To avoid this exception the useUnsafeHeaderParsing
+ configuration option of httpWebRequest should be set, what may be done using application
+ configuration file.
+
+ <configuration>
+ <system.net>
+ <settings>
+ <httpWebRequest useUnsafeHeaderParsing="true" />
+ </settings>
+ </system.net>
+ </configuration>
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ URL, which provides MJPEG stream.
+
+
+
+
+ Start video source.
+
+
+ Starts video source and return execution to caller. Video source
+ object creates background thread and notifies about new frames with the
+ help of event.
+
+ Video source is not specified.
+
+
+
+
+ Signal video source to stop its work.
+
+
+ Signals video source to stop its background thread, stop to
+ provide new frames and free resources.
+
+
+
+
+ Wait for video source has stopped.
+
+
+ Waits for source stopping after it was signalled to stop using
+ method.
+
+
+
+
+ Stop video source.
+
+
+ Stops video source aborting its thread.
+
+ Since the method aborts background thread, its usage is highly not preferred
+ and should be done only if there are no other options. The correct way of stopping camera
+ is signaling it stop and then
+ waiting for background thread's completion.
+
+
+
+
+
+ Free resource.
+
+
+
+
+
+ New frame event.
+
+
+ Notifies clients about new available frame from video source.
+
+ Since video source may have multiple clients, each client is responsible for
+ making a copy (cloning) of the passed video frame, because the video source disposes its
+ own original copy after notifying of clients.
+
+
+
+
+
+ Video source error event.
+
+
+ This event is used to notify clients about any type of errors occurred in
+ video source object, for example internal exceptions.
+
+
+
+
+ Video playing finished event.
+
+
+ This event is used to notify clients that the video playing has finished.
+
+
+
+
+
+ Use or not separate connection group.
+
+
+ The property indicates to open web request in separate connection group.
+
+
+
+
+ Video source.
+
+
+ URL, which provides MJPEG stream.
+
+
+
+
+ Login value.
+
+
+ Login required to access video source.
+
+
+
+
+ Password value.
+
+
+ Password required to access video source.
+
+
+
+
+ Gets or sets proxy information for the request.
+
+
+ The local computer or application config file may specify that a default
+ proxy to be used. If the Proxy property is specified, then the proxy settings from the Proxy
+ property overridea the local computer or application config file and the instance will use
+ the proxy settings specified. If no proxy is specified in a config file
+ and the Proxy property is unspecified, the request uses the proxy settings
+ inherited from Internet Explorer on the local computer. If there are no proxy settings
+ in Internet Explorer, the request is sent directly to the server.
+
+
+
+
+
+ User agent to specify in HTTP request header.
+
+
+ Some IP cameras check what is the requesting user agent and depending
+ on it they provide video in different formats or do not provide it at all. The property
+ sets the value of user agent string, which is sent to camera in request header.
+
+
+ Default value is set to "Mozilla/5.0". If the value is set to ,
+ the user agent string is not sent in request header.
+
+
+
+
+
+ Received frames count.
+
+
+ Number of frames the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ Received bytes count.
+
+
+ Number of bytes the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ Request timeout value.
+
+
+ The property sets timeout value in milliseconds for web requests.
+ Default value is 10000 milliseconds.
+
+
+
+
+ State of the video source.
+
+
+ Current state of video source object - running or not.
+
+
+
+
+ Force using of basic authentication when connecting to the video source.
+
+
+ For some IP cameras (TrendNET IP cameras, for example) using standard .NET's authentication via credentials
+ does not seem to be working (seems like camera does not request for authentication, but expects corresponding headers to be
+ present on connection request). So this property allows to force basic authentication by adding required HTTP headers when
+ request is sent.
+
+ Default value is set to .
+
+
+
+
+
+ Video related exception.
+
+
+ The exception is thrown in the case of some video related issues, like
+ failure of initializing codec, compression, etc.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Exception's message.
+
+
+
+
+ Delegate for new frame event handler.
+
+
+ Sender object.
+ Event arguments.
+
+
+
+
+ Delegate for video source error event handler.
+
+
+ Sender object.
+ Event arguments.
+
+
+
+
+ Delegate for playing finished event handler.
+
+
+ Sender object.
+ Reason of finishing video playing.
+
+
+
+
+ Reason of finishing video playing.
+
+
+ When video source class fire the event, they
+ need to specify reason of finishing video playing. For example, it may be end of stream reached.
+
+
+
+
+ Video playing has finished because it end was reached.
+
+
+
+
+ Video playing has finished because it was stopped by user.
+
+
+
+
+ Video playing has finished because the device was lost (unplugged).
+
+
+
+
+ Video playing has finished because of some error happened the video source (camera, stream, file, etc.).
+ A error reporting event usually is fired to provide error information.
+
+
+
+
+ Arguments for new frame event from video source.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ New frame.
+
+
+
+
+ New frame from video source.
+
+
+
+
+
+ Arguments for video source error event from video source.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Error description.
+
+
+
+
+ Video source error description.
+
+
+
+
+
+ JPEG video source.
+
+
+ The video source constantly downloads JPEG files from the specified URL.
+
+ Sample usage:
+
+ // create JPEG video source
+ JPEGStream stream = new JPEGStream( "some url" );
+ // set NewFrame event handler
+ stream.NewFrame += new NewFrameEventHandler( video_NewFrame );
+ // start the video source
+ stream.Start( );
+ // ...
+ // signal to stop
+ stream.SignalToStop( );
+ // ...
+
+ private void video_NewFrame( object sender, NewFrameEventArgs eventArgs )
+ {
+ // get new frame
+ Bitmap bitmap = eventArgs.Frame;
+ // process the frame
+ }
+
+
+ Some cameras produce HTTP header, which does not conform strictly to
+ standard, what leads to .NET exception. To avoid this exception the useUnsafeHeaderParsing
+ configuration option of httpWebRequest should be set, what may be done using application
+ configuration file.
+
+ <configuration>
+ <system.net>
+ <settings>
+ <httpWebRequest useUnsafeHeaderParsing="true" />
+ </settings>
+ </system.net>
+ </configuration>
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ URL, which provides JPEG files.
+
+
+
+
+ Start video source.
+
+
+ Starts video source and return execution to caller. Video source
+ object creates background thread and notifies about new frames with the
+ help of event.
+
+ Video source is not specified.
+
+
+
+
+ Signal video source to stop its work.
+
+
+ Signals video source to stop its background thread, stop to
+ provide new frames and free resources.
+
+
+
+
+ Wait for video source has stopped.
+
+
+ Waits for source stopping after it was signalled to stop using
+ method.
+
+
+
+
+ Stop video source.
+
+
+ Stops video source aborting its thread.
+
+ Since the method aborts background thread, its usage is highly not preferred
+ and should be done only if there are no other options. The correct way of stopping camera
+ is signaling it stop and then
+ waiting for background thread's completion.
+
+
+
+
+
+ Free resource.
+
+
+
+
+
+ New frame event.
+
+
+ Notifies clients about new available frame from video source.
+
+ Since video source may have multiple clients, each client is responsible for
+ making a copy (cloning) of the passed video frame, because the video source disposes its
+ own original copy after notifying of clients.
+
+
+
+
+
+ Video source error event.
+
+
+ This event is used to notify clients about any type of errors occurred in
+ video source object, for example internal exceptions.
+
+
+
+
+ Video playing finished event.
+
+
+ This event is used to notify clients that the video playing has finished.
+
+
+
+
+
+ Use or not separate connection group.
+
+
+ The property indicates to open web request in separate connection group.
+
+
+
+
+ Use or not caching.
+
+
+ If the property is set to true, then a fake random parameter will be added
+ to URL to prevent caching. It's required for clients, who are behind proxy server.
+
+
+
+
+ Frame interval.
+
+
+ The property sets the interval in milliseconds betwen frames. If the property is
+ set to 100, then the desired frame rate will be 10 frames per second. Default value is 0 -
+ get new frames as fast as possible.
+
+
+
+
+ Video source.
+
+
+ URL, which provides JPEG files.
+
+
+
+
+ Login value.
+
+
+ Login required to access video source.
+
+
+
+
+ Password value.
+
+
+ Password required to access video source.
+
+
+
+
+ Gets or sets proxy information for the request.
+
+
+ The local computer or application config file may specify that a default
+ proxy to be used. If the Proxy property is specified, then the proxy settings from the Proxy
+ property overridea the local computer or application config file and the instance will use
+ the proxy settings specified. If no proxy is specified in a config file
+ and the Proxy property is unspecified, the request uses the proxy settings
+ inherited from Internet Explorer on the local computer. If there are no proxy settings
+ in Internet Explorer, the request is sent directly to the server.
+
+
+
+
+
+ Received frames count.
+
+
+ Number of frames the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ Received bytes count.
+
+
+ Number of bytes the video source provided from the moment of the last
+ access to the property.
+
+
+
+
+
+ Request timeout value.
+
+
+ The property sets timeout value in milliseconds for web requests.
+
+ Default value is set 10000 milliseconds.
+
+
+
+
+ State of the video source.
+
+
+ Current state of video source object - running or not.
+
+
+
+
+ Force using of basic authentication when connecting to the video source.
+
+
+ For some IP cameras (TrendNET IP cameras, for example) using standard .NET's authentication via credentials
+ does not seem to be working (seems like camera does not request for authentication, but expects corresponding headers to be
+ present on connection request). So this property allows to force basic authentication by adding required HTTP headers when
+ request is sent.
+
+ Default value is set to .
+
+
+
+
+
+ Some internal utilities for handling arrays.
+
+
+
+
+
+ Check if the array contains needle at specified position.
+
+
+ Source array to check for needle.
+ Needle we are searching for.
+ Start index in source array.
+
+ Returns true if the source array contains the needle at
+ the specified index. Otherwise it returns false.
+
+
+
+
+ Find subarray in the source array.
+
+
+ Source array to search for needle.
+ Needle we are searching for.
+ Start index in source array.
+ Number of bytes in source array, where the needle is searched for.
+
+ Returns starting position of the needle if it was found or -1 otherwise.
+
+
+
+
diff --git a/Part 2 - Take a Snapshot/bin/Debug/AForge.dll b/Part 2 - Take a Snapshot/bin/Debug/AForge.dll
new file mode 100644
index 0000000..311cfe5
Binary files /dev/null and b/Part 2 - Take a Snapshot/bin/Debug/AForge.dll differ
diff --git a/Part 2 - Take a Snapshot/bin/Debug/AForge.xml b/Part 2 - Take a Snapshot/bin/Debug/AForge.xml
new file mode 100644
index 0000000..4413847
--- /dev/null
+++ b/Part 2 - Take a Snapshot/bin/Debug/AForge.xml
@@ -0,0 +1,1795 @@
+
+
+
+ AForge
+
+
+
+
+ Event arguments holding a buffer sent or received during some communication process.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Message being transfered during communication process.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Buffer containing the message being transferred during communication process.
+ Starting index of the message within the buffer.
+ Length of the message within the buffer.
+
+
+
+
+ Get the transfered message.
+
+
+ Returns copy of the transfered message.
+
+
+
+
+ Get the transferred message as string.
+
+
+ Returns string encoding the transferred message.
+
+
+
+
+ Length of the transfered message.
+
+
+
+
+ Structure for representing a pair of coordinates of integer type.
+
+
+ The structure is used to store a pair of integer coordinates.
+
+ Sample usage:
+
+ // assigning coordinates in the constructor
+ IntPoint p1 = new IntPoint( 10, 20 );
+ // creating a point and assigning coordinates later
+ IntPoint p2;
+ p2.X = 30;
+ p2.Y = 40;
+ // calculating distance between two points
+ float distance = p1.DistanceTo( p2 );
+
+
+
+
+
+
+ X coordinate.
+
+
+
+
+
+ Y coordinate.
+
+
+
+
+
+ Initializes a new instance of the structure.
+
+
+ X axis coordinate.
+ Y axis coordinate.
+
+
+
+
+ Calculate Euclidean distance between two points.
+
+
+ Point to calculate distance to.
+
+ Returns Euclidean distance between this point and
+ points.
+
+
+
+
+ Calculate squared Euclidean distance between two points.
+
+
+ Point to calculate distance to.
+
+ Returns squared Euclidean distance between this point and
+ points.
+
+
+
+
+ Addition operator - adds values of two points.
+
+
+ First point for addition.
+ Second point for addition.
+
+ Returns new point which coordinates equal to sum of corresponding
+ coordinates of specified points.
+
+
+
+
+ Addition operator - adds values of two points.
+
+
+ First point for addition.
+ Second point for addition.
+
+ Returns new point which coordinates equal to sum of corresponding
+ coordinates of specified points.
+
+
+
+
+ Subtraction operator - subtracts values of two points.
+
+
+ Point to subtract from.
+ Point to subtract.
+
+ Returns new point which coordinates equal to difference of corresponding
+ coordinates of specified points.
+
+
+
+
+ Subtraction operator - subtracts values of two points.
+
+
+ Point to subtract from.
+ Point to subtract.
+
+ Returns new point which coordinates equal to difference of corresponding
+ coordinates of specified points.
+
+
+
+
+ Addition operator - adds scalar to the specified point.
+
+
+ Point to increase coordinates of.
+ Value to add to coordinates of the specified point.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point increased by specified value.
+
+
+
+
+ Addition operator - adds scalar to the specified point.
+
+
+ Point to increase coordinates of.
+ Value to add to coordinates of the specified point.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point increased by specified value.
+
+
+
+
+ Subtraction operator - subtracts scalar from the specified point.
+
+
+ Point to decrease coordinates of.
+ Value to subtract from coordinates of the specified point.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point decreased by specified value.
+
+
+
+
+ Subtraction operator - subtracts scalar from the specified point.
+
+
+ Point to decrease coordinates of.
+ Value to subtract from coordinates of the specified point.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point decreased by specified value.
+
+
+
+
+ Multiplication operator - multiplies coordinates of the specified point by scalar value.
+
+
+ Point to multiply coordinates of.
+ Multiplication factor.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point multiplied by specified value.
+
+
+
+
+ Multiplication operator - multiplies coordinates of the specified point by scalar value.
+
+
+ Point to multiply coordinates of.
+ Multiplication factor.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point multiplied by specified value.
+
+
+
+
+ Division operator - divides coordinates of the specified point by scalar value.
+
+
+ Point to divide coordinates of.
+ Division factor.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point divided by specified value.
+
+
+
+
+ Division operator - divides coordinates of the specified point by scalar value.
+
+
+ Point to divide coordinates of.
+ Division factor.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point divided by specified value.
+
+
+
+
+ Equality operator - checks if two points have equal coordinates.
+
+
+ First point to check.
+ Second point to check.
+
+ Returns if coordinates of specified
+ points are equal.
+
+
+
+
+ Inequality operator - checks if two points have different coordinates.
+
+
+ First point to check.
+ Second point to check.
+
+ Returns if coordinates of specified
+ points are not equal.
+
+
+
+
+ Check if this instance of equal to the specified one.
+
+
+ Another point to check equalty to.
+
+ Return if objects are equal.
+
+
+
+
+ Get hash code for this instance.
+
+
+ Returns the hash code for this instance.
+
+
+
+
+ Implicit conversion to .
+
+
+ Integer point to convert to single precision point.
+
+ Returns new single precision point which coordinates are implicitly converted
+ to floats from coordinates of the specified integer point.
+
+
+
+
+ Implicit conversion to .
+
+
+ Integer point to convert to double precision point.
+
+ Returns new double precision point which coordinates are implicitly converted
+ to doubles from coordinates of the specified integer point.
+
+
+
+
+ Get string representation of the class.
+
+
+ Returns string, which contains values of the point in readable form.
+
+
+
+
+ Calculate Euclidean norm of the vector comprised of the point's
+ coordinates - distance from (0, 0) in other words.
+
+
+ Returns point's distance from (0, 0) point.
+
+
+
+
+ Evaluator of expressions written in reverse polish notation.
+
+
+ The class evaluates expressions writen in reverse postfix polish notation.
+
+ The list of supported functuins is:
+
+ - Arithmetic functions: +, -, *, /;
+ - sin - sine;
+ - cos - cosine;
+ - ln - natural logarithm;
+ - exp - exponent;
+ - sqrt - square root.
+
+
+ Arguments for these functions could be as usual constants, written as numbers, as variables,
+ writen as $<var_number> ($2, for example). The variable number is zero based index
+ of variables array.
+
+ Sample usage:
+
+ // expression written in polish notation
+ string expression = "2 $0 / 3 $1 * +";
+ // variables for the expression
+ double[] vars = new double[] { 3, 4 };
+ // expression evaluation
+ double result = PolishExpression.Evaluate( expression, vars );
+
+
+
+
+
+
+ Evaluates specified expression.
+
+
+ Expression written in postfix polish notation.
+ Variables for the expression.
+
+ Evaluated value of the expression.
+
+ Unsupported function is used in the expression.
+ Incorrect postfix polish expression.
+
+
+
+
+ Represents a double range with minimum and maximum values.
+
+
+
+ The class represents a double range with inclusive limits -
+ both minimum and maximum values of the range are included into it.
+ Mathematical notation of such range is [min, max].
+
+ Sample usage:
+
+ // create [0.25, 1.5] range
+ DoubleRange range1 = new DoubleRange( 0.25, 1.5 );
+ // create [1.00, 2.25] range
+ DoubleRange range2 = new DoubleRange( 1.00, 2.25 );
+ // check if values is inside of the first range
+ if ( range1.IsInside( 0.75 ) )
+ {
+ // ...
+ }
+ // check if the second range is inside of the first range
+ if ( range1.IsInside( range2 ) )
+ {
+ // ...
+ }
+ // check if two ranges overlap
+ if ( range1.IsOverlapping( range2 ) )
+ {
+ // ...
+ }
+
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Minimum value of the range.
+ Maximum value of the range.
+
+
+
+
+ Check if the specified value is inside of the range.
+
+
+ Value to check.
+
+ True if the specified value is inside of the range or
+ false otherwise.
+
+
+
+
+ Check if the specified range is inside of the range.
+
+
+ Range to check.
+
+ True if the specified range is inside of the range or
+ false otherwise.
+
+
+
+
+ Check if the specified range overlaps with the range.
+
+
+ Range to check for overlapping.
+
+ True if the specified range overlaps with the range or
+ false otherwise.
+
+
+
+
+ Convert the signle precision range to integer range.
+
+
+ Specifies if inner integer range must be returned or outer range.
+
+ Returns integer version of the range.
+
+ If is set to , then the
+ returned integer range will always fit inside of the current single precision range.
+ If it is set to , then current single precision range will always
+ fit into the returned integer range.
+
+
+
+
+ Equality operator - checks if two ranges have equal min/max values.
+
+
+ First range to check.
+ Second range to check.
+
+ Returns if min/max values of specified
+ ranges are equal.
+
+
+
+
+ Inequality operator - checks if two ranges have different min/max values.
+
+
+ First range to check.
+ Second range to check.
+
+ Returns if min/max values of specified
+ ranges are not equal.
+
+
+
+
+ Check if this instance of equal to the specified one.
+
+
+ Another range to check equalty to.
+
+ Return if objects are equal.
+
+
+
+
+ Get hash code for this instance.
+
+
+ Returns the hash code for this instance.
+
+
+
+
+ Get string representation of the class.
+
+
+ Returns string, which contains min/max values of the range in readable form.
+
+
+
+
+ Minimum value of the range.
+
+
+ The property represents minimum value (left side limit) or the range -
+ [min, max].
+
+
+
+
+ Maximum value of the range.
+
+
+ The property represents maximum value (right side limit) or the range -
+ [min, max].
+
+
+
+
+ Length of the range (deffirence between maximum and minimum values).
+
+
+
+
+ A delegate which is used by events notifying abount sent/received message.
+
+
+ Event sender.
+ Event arguments containing details about the transferred message.
+
+
+
+
+ Structure for representing a pair of coordinates of float type.
+
+
+ The structure is used to store a pair of floating point
+ coordinates with single precision.
+
+ Sample usage:
+
+ // assigning coordinates in the constructor
+ Point p1 = new Point( 10, 20 );
+ // creating a point and assigning coordinates later
+ Point p2;
+ p2.X = 30;
+ p2.Y = 40;
+ // calculating distance between two points
+ float distance = p1.DistanceTo( p2 );
+
+
+
+
+
+
+ X coordinate.
+
+
+
+
+
+ Y coordinate.
+
+
+
+
+
+ Initializes a new instance of the structure.
+
+
+ X axis coordinate.
+ Y axis coordinate.
+
+
+
+
+ Calculate Euclidean distance between two points.
+
+
+ Point to calculate distance to.
+
+ Returns Euclidean distance between this point and
+ points.
+
+
+
+
+ Calculate squared Euclidean distance between two points.
+
+
+ Point to calculate distance to.
+
+ Returns squared Euclidean distance between this point and
+ points.
+
+
+
+
+ Addition operator - adds values of two points.
+
+
+ First point for addition.
+ Second point for addition.
+
+ Returns new point which coordinates equal to sum of corresponding
+ coordinates of specified points.
+
+
+
+
+ Addition operator - adds values of two points.
+
+
+ First point for addition.
+ Second point for addition.
+
+ Returns new point which coordinates equal to sum of corresponding
+ coordinates of specified points.
+
+
+
+
+ Subtraction operator - subtracts values of two points.
+
+
+ Point to subtract from.
+ Point to subtract.
+
+ Returns new point which coordinates equal to difference of corresponding
+ coordinates of specified points.
+
+
+
+
+ Subtraction operator - subtracts values of two points.
+
+
+ Point to subtract from.
+ Point to subtract.
+
+ Returns new point which coordinates equal to difference of corresponding
+ coordinates of specified points.
+
+
+
+
+ Addition operator - adds scalar to the specified point.
+
+
+ Point to increase coordinates of.
+ Value to add to coordinates of the specified point.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point increased by specified value.
+
+
+
+
+ Addition operator - adds scalar to the specified point.
+
+
+ Point to increase coordinates of.
+ Value to add to coordinates of the specified point.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point increased by specified value.
+
+
+
+
+ Subtraction operator - subtracts scalar from the specified point.
+
+
+ Point to decrease coordinates of.
+ Value to subtract from coordinates of the specified point.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point decreased by specified value.
+
+
+
+
+ Subtraction operator - subtracts scalar from the specified point.
+
+
+ Point to decrease coordinates of.
+ Value to subtract from coordinates of the specified point.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point decreased by specified value.
+
+
+
+
+ Multiplication operator - multiplies coordinates of the specified point by scalar value.
+
+
+ Point to multiply coordinates of.
+ Multiplication factor.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point multiplied by specified value.
+
+
+
+
+ Multiplication operator - multiplies coordinates of the specified point by scalar value.
+
+
+ Point to multiply coordinates of.
+ Multiplication factor.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point multiplied by specified value.
+
+
+
+
+ Division operator - divides coordinates of the specified point by scalar value.
+
+
+ Point to divide coordinates of.
+ Division factor.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point divided by specified value.
+
+
+
+
+ Division operator - divides coordinates of the specified point by scalar value.
+
+
+ Point to divide coordinates of.
+ Division factor.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point divided by specified value.
+
+
+
+
+ Equality operator - checks if two points have equal coordinates.
+
+
+ First point to check.
+ Second point to check.
+
+ Returns if coordinates of specified
+ points are equal.
+
+
+
+
+ Inequality operator - checks if two points have different coordinates.
+
+
+ First point to check.
+ Second point to check.
+
+ Returns if coordinates of specified
+ points are not equal.
+
+
+
+
+ Check if this instance of equal to the specified one.
+
+
+ Another point to check equalty to.
+
+ Return if objects are equal.
+
+
+
+
+ Get hash code for this instance.
+
+
+ Returns the hash code for this instance.
+
+
+
+
+ Explicit conversion to .
+
+
+ Single precision point to convert to integer point.
+
+ Returns new integer point which coordinates are explicitly converted
+ to integers from coordinates of the specified single precision point by
+ casting float values to integers value.
+
+
+
+
+ Implicit conversion to .
+
+
+ Single precision point to convert to double precision point.
+
+ Returns new double precision point which coordinates are implicitly converted
+ to doubles from coordinates of the specified single precision point.
+
+
+
+
+ Rounds the single precision point.
+
+
+ Returns new integer point, which coordinates equal to whole numbers
+ nearest to the corresponding coordinates of the single precision point.
+
+
+
+
+ Get string representation of the class.
+
+
+ Returns string, which contains values of the point in readable form.
+
+
+
+
+ Calculate Euclidean norm of the vector comprised of the point's
+ coordinates - distance from (0, 0) in other words.
+
+
+ Returns point's distance from (0, 0) point.
+
+
+
+
+ Represents an integer range with minimum and maximum values.
+
+
+
+ The class represents an integer range with inclusive limits -
+ both minimum and maximum values of the range are included into it.
+ Mathematical notation of such range is [min, max].
+
+ Sample usage:
+
+ // create [1, 10] range
+ IntRange range1 = new IntRange( 1, 10 );
+ // create [5, 15] range
+ IntRange range2 = new IntRange( 5, 15 );
+ // check if values is inside of the first range
+ if ( range1.IsInside( 7 ) )
+ {
+ // ...
+ }
+ // check if the second range is inside of the first range
+ if ( range1.IsInside( range2 ) )
+ {
+ // ...
+ }
+ // check if two ranges overlap
+ if ( range1.IsOverlapping( range2 ) )
+ {
+ // ...
+ }
+
+
+
+
+
+
+ Initializes a new instance of the structure.
+
+
+ Minimum value of the range.
+ Maximum value of the range.
+
+
+
+
+ Check if the specified value is inside of the range.
+
+
+ Value to check.
+
+ True if the specified value is inside of the range or
+ false otherwise.
+
+
+
+
+ Check if the specified range is inside of the range.
+
+
+ Range to check.
+
+ True if the specified range is inside of the range or
+ false otherwise.
+
+
+
+
+ Check if the specified range overlaps with the range.
+
+
+ Range to check for overlapping.
+
+ True if the specified range overlaps with the range or
+ false otherwise.
+
+
+
+
+ Implicit conversion to .
+
+
+ Integer range to convert to single precision range.
+
+ Returns new single precision range which min/max values are implicitly converted
+ to floats from min/max values of the specified integer range.
+
+
+
+
+ Equality operator - checks if two ranges have equal min/max values.
+
+
+ First range to check.
+ Second range to check.
+
+ Returns if min/max values of specified
+ ranges are equal.
+
+
+
+
+ Inequality operator - checks if two ranges have different min/max values.
+
+
+ First range to check.
+ Second range to check.
+
+ Returns if min/max values of specified
+ ranges are not equal.
+
+
+
+
+ Check if this instance of equal to the specified one.
+
+
+ Another range to check equalty to.
+
+ Return if objects are equal.
+
+
+
+
+ Get hash code for this instance.
+
+
+ Returns the hash code for this instance.
+
+
+
+
+ Get string representation of the class.
+
+
+ Returns string, which contains min/max values of the range in readable form.
+
+
+
+
+ Minimum value of the range.
+
+
+ The property represents minimum value (left side limit) or the range -
+ [min, max].
+
+
+
+
+ Maximum value of the range.
+
+
+ The property represents maximum value (right side limit) or the range -
+ [min, max].
+
+
+
+
+ Length of the range (deffirence between maximum and minimum values).
+
+
+
+
+ Thread safe version of the class.
+
+
+ The class inherits the and overrides
+ its random numbers generation methods providing thread safety by guarding call
+ to the base class with a lock. See documentation to for
+ additional information about the base class.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ See for more information.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ A number used to calculate a starting value for the pseudo-random number sequence.
+ If a negative number is specified, the absolute value of the number is used.
+
+
+ See for more information.
+
+
+
+
+ Returns a nonnegative random number.
+
+
+ Returns a 32-bit signed integer greater than or equal to zero and less than
+ .
+
+ See for more information.
+
+
+
+
+ Returns a nonnegative random number less than the specified maximum.
+
+
+ The exclusive upper bound of the random number to be generated.
+ must be greater than or equal to zero.
+
+ Returns a 32-bit signed integer greater than or equal to zero, and less than ;
+ that is, the range of return values ordinarily includes zero but not .
+
+ See for more information.
+
+
+
+
+ Returns a random number within a specified range.
+
+
+ The inclusive lower bound of the random number returned.
+ The exclusive upper bound of the random number returned.
+ must be greater than or equal to .
+
+ Returns a 32-bit signed integer greater than or equal to and less
+ than ; that is, the range of return values includes
+ but not .
+
+ See for more information.
+
+
+
+
+ Fills the elements of a specified array of bytes with random numbers.
+
+
+ An array of bytes to contain random numbers.
+
+ See for more information.
+
+
+
+
+ Returns a random number between 0.0 and 1.0.
+
+
+ Returns a double-precision floating point number greater than or equal to 0.0, and less than 1.0.
+
+ See for more information.
+
+
+
+
+ Represents a range with minimum and maximum values, which are single precision numbers (floats).
+
+
+
+ The class represents a single precision range with inclusive limits -
+ both minimum and maximum values of the range are included into it.
+ Mathematical notation of such range is [min, max].
+
+ Sample usage:
+
+ // create [0.25, 1.5] range
+ Range range1 = new Range( 0.25f, 1.5f );
+ // create [1.00, 2.25] range
+ Range range2 = new Range( 1.00f, 2.25f );
+ // check if values is inside of the first range
+ if ( range1.IsInside( 0.75f ) )
+ {
+ // ...
+ }
+ // check if the second range is inside of the first range
+ if ( range1.IsInside( range2 ) )
+ {
+ // ...
+ }
+ // check if two ranges overlap
+ if ( range1.IsOverlapping( range2 ) )
+ {
+ // ...
+ }
+
+
+
+
+
+
+ Initializes a new instance of the structure.
+
+
+ Minimum value of the range.
+ Maximum value of the range.
+
+
+
+
+ Check if the specified value is inside of the range.
+
+
+ Value to check.
+
+ True if the specified value is inside of the range or
+ false otherwise.
+
+
+
+
+ Check if the specified range is inside of the range.
+
+
+ Range to check.
+
+ True if the specified range is inside of the range or
+ false otherwise.
+
+
+
+
+ Check if the specified range overlaps with the range.
+
+
+ Range to check for overlapping.
+
+ True if the specified range overlaps with the range or
+ false otherwise.
+
+
+
+
+ Convert the signle precision range to integer range.
+
+
+ Specifies if inner integer range must be returned or outer range.
+
+ Returns integer version of the range.
+
+ If is set to , then the
+ returned integer range will always fit inside of the current single precision range.
+ If it is set to , then current single precision range will always
+ fit into the returned integer range.
+
+
+
+
+ Equality operator - checks if two ranges have equal min/max values.
+
+
+ First range to check.
+ Second range to check.
+
+ Returns if min/max values of specified
+ ranges are equal.
+
+
+
+
+ Inequality operator - checks if two ranges have different min/max values.
+
+
+ First range to check.
+ Second range to check.
+
+ Returns if min/max values of specified
+ ranges are not equal.
+
+
+
+
+ Check if this instance of equal to the specified one.
+
+
+ Another range to check equalty to.
+
+ Return if objects are equal.
+
+
+
+
+ Get hash code for this instance.
+
+
+ Returns the hash code for this instance.
+
+
+
+
+ Get string representation of the class.
+
+
+ Returns string, which contains min/max values of the range in readable form.
+
+
+
+
+ Minimum value of the range.
+
+
+ The property represents minimum value (left side limit) or the range -
+ [min, max].
+
+
+
+
+ Maximum value of the range.
+
+
+ The property represents maximum value (right side limit) or the range -
+ [min, max].
+
+
+
+
+ Length of the range (deffirence between maximum and minimum values).
+
+
+
+
+ The class provides support for parallel computations, paralleling loop's iterations.
+
+
+ The class allows to parallel loop's iteration computing them in separate threads,
+ what allows their simultaneous execution on multiple CPUs/cores.
+
+
+
+
+
+ Executes a for-loop in which iterations may run in parallel.
+
+
+ Loop's start index.
+ Loop's stop index.
+ Loop's body.
+
+ The method is used to parallel for-loop running its iterations in
+ different threads. The start and stop parameters define loop's
+ starting and ending loop's indexes. The number of iterations is equal to stop - start.
+
+
+ Sample usage:
+
+ Parallel.For( 0, 20, delegate( int i )
+ // which is equivalent to
+ // for ( int i = 0; i < 20; i++ )
+ {
+ System.Diagnostics.Debug.WriteLine( "Iteration: " + i );
+ // ...
+ } );
+
+
+
+
+
+
+ Number of threads used for parallel computations.
+
+
+ The property sets how many worker threads are created for paralleling
+ loops' computations.
+
+ By default the property is set to number of CPU's in the system
+ (see ).
+
+
+
+
+
+ Delegate defining for-loop's body.
+
+
+ Loop's index.
+
+
+
+
+ Set of systems tools.
+
+
+ The class is a container of different system tools, which are used
+ across the framework. Some of these tools are platform specific, so their
+ implementation is different on different platform, like .NET and Mono.
+
+
+
+
+
+ Copy block of unmanaged memory.
+
+
+ Destination pointer.
+ Source pointer.
+ Memory block's length to copy.
+
+ Return's value of - pointer to destination.
+
+ This function is required because of the fact that .NET does
+ not provide any way to copy unmanaged blocks, but provides only methods to
+ copy from unmanaged memory to managed memory and vise versa.
+
+
+
+
+ Copy block of unmanaged memory.
+
+
+ Destination pointer.
+ Source pointer.
+ Memory block's length to copy.
+
+ Return's value of - pointer to destination.
+
+ This function is required because of the fact that .NET does
+ not provide any way to copy unmanaged blocks, but provides only methods to
+ copy from unmanaged memory to managed memory and vise versa.
+
+
+
+
+ Fill memory region with specified value.
+
+
+ Destination pointer.
+ Filler byte's value.
+ Memory block's length to fill.
+
+ Return's value of - pointer to destination.
+
+
+
+
+ Fill memory region with specified value.
+
+
+ Destination pointer.
+ Filler byte's value.
+ Memory block's length to fill.
+
+ Return's value of - pointer to destination.
+
+
+
+
+ Connection failed exception.
+
+
+ The exception is thrown in the case if connection to device
+ has failed.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Exception's message.
+
+
+
+
+ Connection lost exception.
+
+
+ The exception is thrown in the case if connection to device
+ is lost. When the exception is caught, user may need to reconnect to the device.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Exception's message.
+
+
+
+
+ Not connected exception.
+
+
+ The exception is thrown in the case if connection to device
+ is not established, but user requests for its services.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Exception's message.
+
+
+
+
+ Device busy exception.
+
+
+ The exception is thrown in the case if access to certain device
+ is not available due to the fact that it is currently busy handling other request/connection.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Exception's message.
+
+
+
+
+ Device error exception.
+
+
+ The exception is thrown in the case if some error happens with a device, which
+ may need to be reported to user.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+ Exception's message.
+
+
+
+
+ Structure for representing a pair of coordinates of double type.
+
+
+ The structure is used to store a pair of floating point
+ coordinates with double precision.
+
+ Sample usage:
+
+ // assigning coordinates in the constructor
+ DoublePoint p1 = new DoublePoint( 10, 20 );
+ // creating a point and assigning coordinates later
+ DoublePoint p2;
+ p2.X = 30;
+ p2.Y = 40;
+ // calculating distance between two points
+ double distance = p1.DistanceTo( p2 );
+
+
+
+
+
+
+ X coordinate.
+
+
+
+
+
+ Y coordinate.
+
+
+
+
+
+ Initializes a new instance of the structure.
+
+
+ X axis coordinate.
+ Y axis coordinate.
+
+
+
+
+ Calculate Euclidean distance between two points.
+
+
+ Point to calculate distance to.
+
+ Returns Euclidean distance between this point and
+ points.
+
+
+
+
+ Calculate squared Euclidean distance between two points.
+
+
+ Point to calculate distance to.
+
+ Returns squared Euclidean distance between this point and
+ points.
+
+
+
+
+ Addition operator - adds values of two points.
+
+
+ First point for addition.
+ Second point for addition.
+
+ Returns new point which coordinates equal to sum of corresponding
+ coordinates of specified points.
+
+
+
+
+ Addition operator - adds values of two points.
+
+
+ First point for addition.
+ Second point for addition.
+
+ Returns new point which coordinates equal to sum of corresponding
+ coordinates of specified points.
+
+
+
+
+ Subtraction operator - subtracts values of two points.
+
+
+ Point to subtract from.
+ Point to subtract.
+
+ Returns new point which coordinates equal to difference of corresponding
+ coordinates of specified points.
+
+
+
+
+ Subtraction operator - subtracts values of two points.
+
+
+ Point to subtract from.
+ Point to subtract.
+
+ Returns new point which coordinates equal to difference of corresponding
+ coordinates of specified points.
+
+
+
+
+ Addition operator - adds scalar to the specified point.
+
+
+ Point to increase coordinates of.
+ Value to add to coordinates of the specified point.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point increased by specified value.
+
+
+
+
+ Addition operator - adds scalar to the specified point.
+
+
+ Point to increase coordinates of.
+ Value to add to coordinates of the specified point.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point increased by specified value.
+
+
+
+
+ Subtraction operator - subtracts scalar from the specified point.
+
+
+ Point to decrease coordinates of.
+ Value to subtract from coordinates of the specified point.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point decreased by specified value.
+
+
+
+
+ Subtraction operator - subtracts scalar from the specified point.
+
+
+ Point to decrease coordinates of.
+ Value to subtract from coordinates of the specified point.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point decreased by specified value.
+
+
+
+
+ Multiplication operator - multiplies coordinates of the specified point by scalar value.
+
+
+ Point to multiply coordinates of.
+ Multiplication factor.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point multiplied by specified value.
+
+
+
+
+ Multiplication operator - multiplies coordinates of the specified point by scalar value.
+
+
+ Point to multiply coordinates of.
+ Multiplication factor.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point multiplied by specified value.
+
+
+
+
+ Division operator - divides coordinates of the specified point by scalar value.
+
+
+ Point to divide coordinates of.
+ Division factor.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point divided by specified value.
+
+
+
+
+ Division operator - divides coordinates of the specified point by scalar value.
+
+
+ Point to divide coordinates of.
+ Division factor.
+
+ Returns new point which coordinates equal to coordinates of
+ the specified point divided by specified value.
+
+
+
+
+ Equality operator - checks if two points have equal coordinates.
+
+
+ First point to check.
+ Second point to check.
+
+ Returns if coordinates of specified
+ points are equal.
+
+
+
+
+ Inequality operator - checks if two points have different coordinates.
+
+
+ First point to check.
+ Second point to check.
+
+ Returns if coordinates of specified
+ points are not equal.
+
+
+
+
+ Check if this instance of equal to the specified one.
+
+
+ Another point to check equalty to.
+
+ Return if objects are equal.
+
+
+
+
+ Get hash code for this instance.
+
+
+ Returns the hash code for this instance.
+
+
+
+
+ Explicit conversion to .
+
+
+ Double precision point to convert to integer point.
+
+ Returns new integer point which coordinates are explicitly converted
+ to integers from coordinates of the specified double precision point by
+ casting double values to integers value.
+
+
+
+
+ Explicit conversion to .
+
+
+ Double precision point to convert to single precision point.
+
+ Returns new single precision point which coordinates are explicitly converted
+ to floats from coordinates of the specified double precision point by
+ casting double values to float value.
+
+
+
+
+ Rounds the double precision point.
+
+
+ Returns new integer point, which coordinates equal to whole numbers
+ nearest to the corresponding coordinates of the double precision point.
+
+
+
+
+ Get string representation of the class.
+
+
+ Returns string, which contains values of the point in readable form.
+
+
+
+
+ Calculate Euclidean norm of the vector comprised of the point's
+ coordinates - distance from (0, 0) in other words.
+
+
+ Returns point's distance from (0, 0) point.
+
+
+
+
diff --git a/Part 2 - Take a Snapshot/bin/Debug/HCI Assignment 2.exe b/Part 2 - Take a Snapshot/bin/Debug/HCI Assignment 2.exe
new file mode 100644
index 0000000..6269f47
Binary files /dev/null and b/Part 2 - Take a Snapshot/bin/Debug/HCI Assignment 2.exe differ
diff --git a/Part 2 - Take a Snapshot/bin/Debug/HCI Assignment 2.exe.config b/Part 2 - Take a Snapshot/bin/Debug/HCI Assignment 2.exe.config
new file mode 100644
index 0000000..9c05822
--- /dev/null
+++ b/Part 2 - Take a Snapshot/bin/Debug/HCI Assignment 2.exe.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Part 2 - Take a Snapshot/bin/Debug/HCI Assignment 2.pdb b/Part 2 - Take a Snapshot/bin/Debug/HCI Assignment 2.pdb
new file mode 100644
index 0000000..d245d04
Binary files /dev/null and b/Part 2 - Take a Snapshot/bin/Debug/HCI Assignment 2.pdb differ
diff --git a/Part 2 - Take a Snapshot/bin/Debug/HCI Assignment 2.vshost.exe b/Part 2 - Take a Snapshot/bin/Debug/HCI Assignment 2.vshost.exe
new file mode 100644
index 0000000..666c0af
Binary files /dev/null and b/Part 2 - Take a Snapshot/bin/Debug/HCI Assignment 2.vshost.exe differ
diff --git a/Part 2 - Take a Snapshot/bin/Debug/HCI Assignment 2.vshost.exe.config b/Part 2 - Take a Snapshot/bin/Debug/HCI Assignment 2.vshost.exe.config
new file mode 100644
index 0000000..9c05822
--- /dev/null
+++ b/Part 2 - Take a Snapshot/bin/Debug/HCI Assignment 2.vshost.exe.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Part 2 - Take a Snapshot/bin/Debug/HCI Assignment 2.vshost.exe.manifest b/Part 2 - Take a Snapshot/bin/Debug/HCI Assignment 2.vshost.exe.manifest
new file mode 100644
index 0000000..061c9ca
--- /dev/null
+++ b/Part 2 - Take a Snapshot/bin/Debug/HCI Assignment 2.vshost.exe.manifest
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Part 2 - Take a Snapshot/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/Part 2 - Take a Snapshot/obj/Debug/DesignTimeResolveAssemblyReferences.cache
new file mode 100644
index 0000000..0bde688
Binary files /dev/null and b/Part 2 - Take a Snapshot/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ
diff --git a/Part 2 - Take a Snapshot/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/Part 2 - Take a Snapshot/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..5828271
Binary files /dev/null and b/Part 2 - Take a Snapshot/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/Part 2 - Take a Snapshot/obj/Debug/HCI Assignment 2.csproj.FileListAbsolute.txt b/Part 2 - Take a Snapshot/obj/Debug/HCI Assignment 2.csproj.FileListAbsolute.txt
new file mode 100644
index 0000000..397909a
--- /dev/null
+++ b/Part 2 - Take a Snapshot/obj/Debug/HCI Assignment 2.csproj.FileListAbsolute.txt
@@ -0,0 +1,27 @@
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\HCI Assignment 2.exe.config
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\HCI Assignment 2.exe
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\HCI Assignment 2.pdb
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Video.DirectShow.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Video.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Video.FFMPEG.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Video.Kinect.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Video.VFW.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Video.Ximea.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Imaging.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Math.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Video.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Video.DirectShow.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Video.FFMPEG.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Video.Kinect.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Video.VFW.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Video.Ximea.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Imaging.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Math.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\obj\Debug\HCI Assignment 2.csprojResolveAssemblyReference.cache
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\obj\Debug\HCI_Assignment_2.GetFrame.resources
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\obj\Debug\HCI_Assignment_2.Properties.Resources.resources
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\obj\Debug\HCI Assignment 2.csproj.GenerateResource.Cache
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\obj\Debug\HCI Assignment 2.exe
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\obj\Debug\HCI Assignment 2.pdb
diff --git a/Part 2 - Take a Snapshot/obj/Debug/HCI Assignment 2.csproj.GenerateResource.Cache b/Part 2 - Take a Snapshot/obj/Debug/HCI Assignment 2.csproj.GenerateResource.Cache
new file mode 100644
index 0000000..f4d2ad9
Binary files /dev/null and b/Part 2 - Take a Snapshot/obj/Debug/HCI Assignment 2.csproj.GenerateResource.Cache differ
diff --git a/Part 2 - Take a Snapshot/obj/Debug/HCI Assignment 2.csprojResolveAssemblyReference.cache b/Part 2 - Take a Snapshot/obj/Debug/HCI Assignment 2.csprojResolveAssemblyReference.cache
new file mode 100644
index 0000000..c2d018a
Binary files /dev/null and b/Part 2 - Take a Snapshot/obj/Debug/HCI Assignment 2.csprojResolveAssemblyReference.cache differ
diff --git a/Part 2 - Take a Snapshot/obj/Debug/HCI Assignment 2.exe b/Part 2 - Take a Snapshot/obj/Debug/HCI Assignment 2.exe
new file mode 100644
index 0000000..6269f47
Binary files /dev/null and b/Part 2 - Take a Snapshot/obj/Debug/HCI Assignment 2.exe differ
diff --git a/Part 2 - Take a Snapshot/obj/Debug/HCI Assignment 2.pdb b/Part 2 - Take a Snapshot/obj/Debug/HCI Assignment 2.pdb
new file mode 100644
index 0000000..d245d04
Binary files /dev/null and b/Part 2 - Take a Snapshot/obj/Debug/HCI Assignment 2.pdb differ
diff --git a/Part 2 - Take a Snapshot/obj/Debug/HCI_Assignment_2.GetFrame.resources b/Part 2 - Take a Snapshot/obj/Debug/HCI_Assignment_2.GetFrame.resources
new file mode 100644
index 0000000..6c05a97
Binary files /dev/null and b/Part 2 - Take a Snapshot/obj/Debug/HCI_Assignment_2.GetFrame.resources differ
diff --git a/Part 2 - Take a Snapshot/obj/Debug/HCI_Assignment_2.Properties.Resources.resources b/Part 2 - Take a Snapshot/obj/Debug/HCI_Assignment_2.Properties.Resources.resources
new file mode 100644
index 0000000..6c05a97
Binary files /dev/null and b/Part 2 - Take a Snapshot/obj/Debug/HCI_Assignment_2.Properties.Resources.resources differ
diff --git a/Part 2 - Take a Snapshot/obj/Debug/HCI_Assignment_2.Snapshot.resources b/Part 2 - Take a Snapshot/obj/Debug/HCI_Assignment_2.Snapshot.resources
new file mode 100644
index 0000000..6c05a97
Binary files /dev/null and b/Part 2 - Take a Snapshot/obj/Debug/HCI_Assignment_2.Snapshot.resources differ
diff --git a/Part 2 - Take a Snapshot/obj/Debug/Part 2 - Take a Snapshot.csproj.FileListAbsolute.txt b/Part 2 - Take a Snapshot/obj/Debug/Part 2 - Take a Snapshot.csproj.FileListAbsolute.txt
new file mode 100644
index 0000000..e02edeb
--- /dev/null
+++ b/Part 2 - Take a Snapshot/obj/Debug/Part 2 - Take a Snapshot.csproj.FileListAbsolute.txt
@@ -0,0 +1,54 @@
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\HCI Assignment 2.exe.config
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\HCI Assignment 2.exe
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\HCI Assignment 2.pdb
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Video.DirectShow.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Video.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Video.FFMPEG.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Video.Kinect.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Video.VFW.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Video.Ximea.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Imaging.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Math.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Video.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Video.DirectShow.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Video.FFMPEG.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Video.Kinect.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Video.VFW.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Video.Ximea.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Imaging.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\bin\Debug\AForge.Math.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\obj\Debug\Part 2 - Take a Snapshot.csprojResolveAssemblyReference.cache
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\obj\Debug\HCI_Assignment_2.GetFrame.resources
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\obj\Debug\HCI_Assignment_2.Properties.Resources.resources
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\obj\Debug\Part 2 - Take a Snapshot.csproj.GenerateResource.Cache
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\obj\Debug\HCI Assignment 2.exe
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\HCI Assignment 2\obj\Debug\HCI Assignment 2.pdb
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 2 - Take a Snapshot\bin\Debug\HCI Assignment 2.exe.config
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 2 - Take a Snapshot\bin\Debug\HCI Assignment 2.exe
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 2 - Take a Snapshot\bin\Debug\HCI Assignment 2.pdb
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 2 - Take a Snapshot\bin\Debug\AForge.Video.DirectShow.dll
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 2 - Take a Snapshot\bin\Debug\AForge.Video.dll
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 2 - Take a Snapshot\bin\Debug\AForge.Video.FFMPEG.dll
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 2 - Take a Snapshot\bin\Debug\AForge.Video.Kinect.dll
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 2 - Take a Snapshot\bin\Debug\AForge.Video.VFW.dll
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 2 - Take a Snapshot\bin\Debug\AForge.Video.Ximea.dll
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 2 - Take a Snapshot\bin\Debug\AForge.dll
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 2 - Take a Snapshot\bin\Debug\AForge.Imaging.dll
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 2 - Take a Snapshot\bin\Debug\AForge.Math.dll
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 2 - Take a Snapshot\bin\Debug\AForge.Video.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 2 - Take a Snapshot\bin\Debug\AForge.Video.DirectShow.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 2 - Take a Snapshot\bin\Debug\AForge.Video.FFMPEG.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 2 - Take a Snapshot\bin\Debug\AForge.Video.Kinect.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 2 - Take a Snapshot\bin\Debug\AForge.Video.VFW.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 2 - Take a Snapshot\bin\Debug\AForge.Video.Ximea.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 2 - Take a Snapshot\bin\Debug\AForge.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 2 - Take a Snapshot\bin\Debug\AForge.Imaging.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 2 - Take a Snapshot\bin\Debug\AForge.Math.xml
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 2 - Take a Snapshot\obj\Debug\HCI_Assignment_2.GetFrame.resources
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 2 - Take a Snapshot\obj\Debug\HCI_Assignment_2.Properties.Resources.resources
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 2 - Take a Snapshot\obj\Debug\HCI_Assignment_2.Snapshot.resources
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 2 - Take a Snapshot\obj\Debug\Part 2 - Take a Snapshot.csproj.GenerateResource.Cache
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 2 - Take a Snapshot\obj\Debug\HCI Assignment 2.exe
+C:\Users\AnnJanu\Documents\Visual Studio 2013\Projects\HCI Assignment 1\Part 2 - Take a Snapshot\obj\Debug\HCI Assignment 2.pdb
diff --git a/Part 2 - Take a Snapshot/obj/Debug/Part 2 - Take a Snapshot.csproj.GenerateResource.Cache b/Part 2 - Take a Snapshot/obj/Debug/Part 2 - Take a Snapshot.csproj.GenerateResource.Cache
new file mode 100644
index 0000000..49935db
Binary files /dev/null and b/Part 2 - Take a Snapshot/obj/Debug/Part 2 - Take a Snapshot.csproj.GenerateResource.Cache differ
diff --git a/Part 2 - Take a Snapshot/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs b/Part 2 - Take a Snapshot/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
new file mode 100644
index 0000000..e69de29
diff --git a/Part 2 - Take a Snapshot/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs b/Part 2 - Take a Snapshot/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
new file mode 100644
index 0000000..e69de29
diff --git a/Part 2 - Take a Snapshot/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs b/Part 2 - Take a Snapshot/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
new file mode 100644
index 0000000..e69de29
diff --git a/Part 3 - Movement Detection/App.config b/Part 3 - Movement Detection/App.config
new file mode 100644
index 0000000..9c05822
--- /dev/null
+++ b/Part 3 - Movement Detection/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Part 3 - Movement Detection/MovementDetection.Designer.cs b/Part 3 - Movement Detection/MovementDetection.Designer.cs
new file mode 100644
index 0000000..74045ef
--- /dev/null
+++ b/Part 3 - Movement Detection/MovementDetection.Designer.cs
@@ -0,0 +1,146 @@
+namespace Part_3___Movemet_Detection
+{
+ partial class MovementDetection
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.label1 = new System.Windows.Forms.Label();
+ this.dataGridView1 = new System.Windows.Forms.DataGridView();
+ this.XCoordinate = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.YCoordinate = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.SelectVideoFile = new System.Windows.Forms.Button();
+ this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
+ this.label2 = new System.Windows.Forms.Label();
+ this.linkLabel1 = new System.Windows.Forms.LinkLabel();
+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
+ this.SuspendLayout();
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.ForeColor = System.Drawing.Color.Red;
+ this.label1.Location = new System.Drawing.Point(12, 39);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(129, 13);
+ this.label1.TabIndex = 0;
+ this.label1.Text = "Co-ordinates for Red Pixel";
+ //
+ // dataGridView1
+ //
+ this.dataGridView1.AllowUserToDeleteRows = false;
+ this.dataGridView1.AllowUserToResizeColumns = false;
+ this.dataGridView1.AllowUserToResizeRows = false;
+ this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
+ this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+ this.XCoordinate,
+ this.YCoordinate});
+ this.dataGridView1.Location = new System.Drawing.Point(12, 55);
+ this.dataGridView1.Name = "dataGridView1";
+ this.dataGridView1.ReadOnly = true;
+ this.dataGridView1.Size = new System.Drawing.Size(265, 316);
+ this.dataGridView1.TabIndex = 1;
+ //
+ // XCoordinate
+ //
+ this.XCoordinate.HeaderText = "X Co-ordinate";
+ this.XCoordinate.Name = "XCoordinate";
+ this.XCoordinate.ReadOnly = true;
+ //
+ // YCoordinate
+ //
+ this.YCoordinate.HeaderText = "Y Co-ordinate";
+ this.YCoordinate.Name = "YCoordinate";
+ this.YCoordinate.ReadOnly = true;
+ //
+ // SelectVideoFile
+ //
+ this.SelectVideoFile.Location = new System.Drawing.Point(12, 13);
+ this.SelectVideoFile.Name = "SelectVideoFile";
+ this.SelectVideoFile.Size = new System.Drawing.Size(75, 23);
+ this.SelectVideoFile.TabIndex = 2;
+ this.SelectVideoFile.Text = "Select Video";
+ this.SelectVideoFile.UseVisualStyleBackColor = true;
+ this.SelectVideoFile.Click += new System.EventHandler(this.SelectVideoFile_Click);
+ //
+ // openFileDialog1
+ //
+ this.openFileDialog1.FileName = "openFileDialog1";
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(93, 18);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(0, 13);
+ this.label2.TabIndex = 3;
+ //
+ // linkLabel1
+ //
+ this.linkLabel1.AutoSize = true;
+ this.linkLabel1.Location = new System.Drawing.Point(159, 39);
+ this.linkLabel1.Name = "linkLabel1";
+ this.linkLabel1.Size = new System.Drawing.Size(118, 13);
+ this.linkLabel1.TabIndex = 4;
+ this.linkLabel1.TabStop = true;
+ this.linkLabel1.Text = "Click to get coordinates";
+ this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
+ //
+ // MovementDetection
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(289, 382);
+ this.Controls.Add(this.linkLabel1);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.SelectVideoFile);
+ this.Controls.Add(this.dataGridView1);
+ this.Controls.Add(this.label1);
+ this.MaximizeBox = false;
+ this.MaximumSize = new System.Drawing.Size(305, 421);
+ this.MinimumSize = new System.Drawing.Size(305, 421);
+ this.Name = "MovementDetection";
+ this.Text = "Pixel Movement";
+ this.Load += new System.EventHandler(this.Form1_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.DataGridView dataGridView1;
+ private System.Windows.Forms.DataGridViewTextBoxColumn XCoordinate;
+ private System.Windows.Forms.DataGridViewTextBoxColumn YCoordinate;
+ private System.Windows.Forms.Button SelectVideoFile;
+ private System.Windows.Forms.OpenFileDialog openFileDialog1;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.LinkLabel linkLabel1;
+ }
+}
+
diff --git a/Part 3 - Movement Detection/MovementDetection.cs b/Part 3 - Movement Detection/MovementDetection.cs
new file mode 100644
index 0000000..75f79fb
--- /dev/null
+++ b/Part 3 - Movement Detection/MovementDetection.cs
@@ -0,0 +1,113 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using AForge.Video;
+using AForge.Video.DirectShow;
+using AForge.Video.FFMPEG;
+using AForge.Video.Kinect;
+using AForge.Video.VFW;
+
+namespace Part_3___Movemet_Detection
+{
+ public partial class MovementDetection : Form
+ {
+ string videoFilePath = null;
+ AVIReader sampleVid = null;
+ Bitmap sampleImg = null;
+ string coordInfo = null;
+
+ public MovementDetection()
+ {
+ InitializeComponent();
+ }
+
+ private void Form1_Load(object sender, EventArgs e)
+ {
+ linkLabel1.Enabled = false;
+ }
+ private void recordVideo()
+ {
+ AVIWriter writer = new AVIWriter("wmv3");
+ writer.Open("test.avi", 320, 240);
+ Bitmap image = new Bitmap(320, 240);
+
+ for (int i = 0; i < 240; i = i + 5)
+ {
+ if (i == 235)
+ break;
+ if (i > 4)
+ {
+ image.SetPixel(i - 1, i - 1, Color.Black);
+ image.SetPixel(i - 2, i - 2, Color.Black);
+ image.SetPixel(i - 3, i - 3, Color.Black);
+ image.SetPixel(i - 4, i - 4, Color.Black);
+ image.SetPixel(i - 5, i - 5, Color.Black);
+ }
+
+ image.SetPixel(i, i, Color.Red);
+ image.SetPixel(i + 1, i + 1, Color.Red);
+ image.SetPixel(i + 2, i + 2, Color.Red);
+ image.SetPixel(i + 3, i + 3, Color.Red);
+ image.SetPixel(i + 4, i + 4, Color.Red);
+
+ writer.AddFrame(image);
+ }
+ writer.Close();
+
+ }
+
+ private void SelectVideoFile_Click(object sender, EventArgs e)
+ {
+ openFileDialog1.Title = "Select an .avi Video File!";
+ openFileDialog1.FileName = "";
+ openFileDialog1.Filter = "*.avi|*.avi";
+ openFileDialog1.Multiselect = false;
+ openFileDialog1.ShowDialog();
+ if (openFileDialog1.FileName != "")
+ {
+ videoFilePath = openFileDialog1.FileName;
+ label2.Text = " A file is selected!";
+ linkLabel1.Enabled = true;
+ }
+ }
+
+ private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
+ {
+ if (videoFilePath != null)
+ {
+ sampleVid = new AVIReader();
+ sampleVid.Open(videoFilePath);
+ linkLabel1.Enabled = false;
+ for (int k = 0; k < sampleVid.Length; k++)
+ {
+ sampleImg = sampleVid.GetNextFrame();
+ for (int i = 0; i < sampleImg.Width; i++)
+ {
+ for (int j = 0; j < sampleImg.Height; j++)
+ {
+ Color pixel = sampleImg.GetPixel(i, j);
+
+ if (pixel.R >= 130)
+ {
+ this.dataGridView1.Rows.Insert((this.dataGridView1.Rows.Count) - 1, i.ToString(), j.ToString());
+ coordInfo += "(" + i.ToString() + " , " + j.ToString() + ") \n\r ";
+ break;
+
+ }
+ }
+ }
+ }
+
+ System.IO.File.WriteAllText("RedDotCoordinateInfo.txt", coordInfo);
+ }
+ else
+ label2.Text = "Select a .avi file first!";
+ }
+ }
+}
diff --git a/Part 3 - Movement Detection/MovementDetection.resx b/Part 3 - Movement Detection/MovementDetection.resx
new file mode 100644
index 0000000..f33975f
--- /dev/null
+++ b/Part 3 - Movement Detection/MovementDetection.resx
@@ -0,0 +1,135 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ True
+
+
+ True
+
+
+ True
+
+
+ True
+
+
+ 17, 17
+
+
\ No newline at end of file
diff --git a/Part 3 - Movement Detection/Part 3 - Movement Detection.csproj b/Part 3 - Movement Detection/Part 3 - Movement Detection.csproj
new file mode 100644
index 0000000..dde286a
--- /dev/null
+++ b/Part 3 - Movement Detection/Part 3 - Movement Detection.csproj
@@ -0,0 +1,107 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {F2B1E967-D7EB-4410-AE1A-7CC3110255B6}
+ WinExe
+ Properties
+ Part_3___Movemet_Detection
+ Part 3 - Movemet Detection
+ v4.5.1
+ 512
+ true
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ E:\University\ANAS 6\Human Computer Interaction\AForge.NET Framework-2.2.5\Release\AForge.Video.dll
+
+
+ E:\University\ANAS 6\Human Computer Interaction\AForge.NET Framework-2.2.5\Release\AForge.Video.DirectShow.dll
+
+
+ E:\University\ANAS 6\Human Computer Interaction\AForge.NET Framework-2.2.5\Release\AForge.Video.FFMPEG.dll
+
+
+ E:\University\ANAS 6\Human Computer Interaction\AForge.NET Framework-2.2.5\Release\AForge.Video.Kinect.dll
+
+
+ E:\University\ANAS 6\Human Computer Interaction\AForge.NET Framework-2.2.5\Release\AForge.Video.VFW.dll
+
+
+ E:\University\ANAS 6\Human Computer Interaction\AForge.NET Framework-2.2.5\Release\AForge.Video.Ximea.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Form
+
+
+ MovementDetection.cs
+
+
+
+
+ MovementDetection.cs
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+
+ True
+ Resources.resx
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ True
+ Settings.settings
+ True
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Part 3 - Movement Detection/Program.cs b/Part 3 - Movement Detection/Program.cs
new file mode 100644
index 0000000..e568f68
--- /dev/null
+++ b/Part 3 - Movement Detection/Program.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace Part_3___Movemet_Detection
+{
+ static class Program
+ {
+ ///
+ /// The main entry point for the application.
+ ///
+ [STAThread]
+ static void Main()
+ {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new MovementDetection());
+
+ }
+ }
+}
diff --git a/Part 3 - Movement Detection/Properties/AssemblyInfo.cs b/Part 3 - Movement Detection/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..67dbba6
--- /dev/null
+++ b/Part 3 - Movement Detection/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Part 3 - Movemet Detection")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Part 3 - Movemet Detection")]
+[assembly: AssemblyCopyright("Copyright © 2016")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("5158034a-a627-451a-900d-121366cf6510")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Part 3 - Movement Detection/Properties/Resources.Designer.cs b/Part 3 - Movement Detection/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..a2c3bb0
--- /dev/null
+++ b/Part 3 - Movement Detection/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Part_3___Movemet_Detection.Properties
+{
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Part_3___Movemet_Detection.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/Part 3 - Movement Detection/Properties/Resources.resx b/Part 3 - Movement Detection/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/Part 3 - Movement Detection/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Part 3 - Movement Detection/Properties/Settings.Designer.cs b/Part 3 - Movement Detection/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..8370f8d
--- /dev/null
+++ b/Part 3 - Movement Detection/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Part_3___Movemet_Detection.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/Part 3 - Movement Detection/Properties/Settings.settings b/Part 3 - Movement Detection/Properties/Settings.settings
new file mode 100644
index 0000000..3964565
--- /dev/null
+++ b/Part 3 - Movement Detection/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/Part 3 - Movement Detection/bin/Debug/Part 3 - Movemet Detection.vshost.exe b/Part 3 - Movement Detection/bin/Debug/Part 3 - Movemet Detection.vshost.exe
new file mode 100644
index 0000000..666c0af
Binary files /dev/null and b/Part 3 - Movement Detection/bin/Debug/Part 3 - Movemet Detection.vshost.exe differ
diff --git a/Part 3 - Movement Detection/bin/Debug/Part 3 - Movemet Detection.vshost.exe.config b/Part 3 - Movement Detection/bin/Debug/Part 3 - Movemet Detection.vshost.exe.config
new file mode 100644
index 0000000..9c05822
--- /dev/null
+++ b/Part 3 - Movement Detection/bin/Debug/Part 3 - Movemet Detection.vshost.exe.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Part 3 - Movement Detection/bin/Debug/Part 3 - Movemet Detection.vshost.exe.manifest b/Part 3 - Movement Detection/bin/Debug/Part 3 - Movemet Detection.vshost.exe.manifest
new file mode 100644
index 0000000..061c9ca
--- /dev/null
+++ b/Part 3 - Movement Detection/bin/Debug/Part 3 - Movemet Detection.vshost.exe.manifest
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Part 3 - Movement Detection/bin/Debug/RedDotCoordinateInfo.txt b/Part 3 - Movement Detection/bin/Debug/RedDotCoordinateInfo.txt
new file mode 100644
index 0000000..352d7ba
--- /dev/null
+++ b/Part 3 - Movement Detection/bin/Debug/RedDotCoordinateInfo.txt
@@ -0,0 +1,237 @@
+(0 , 0)
+
(1 , 0)
+
(2 , 2)
+
(3 , 2)
+
(4 , 4)
+
(5 , 4)
+
(6 , 6)
+
(7 , 6)
+
(8 , 8)
+
(9 , 8)
+
(10 , 10)
+
(11 , 10)
+
(12 , 12)
+
(13 , 12)
+
(14 , 14)
+
(15 , 14)
+
(16 , 16)
+
(17 , 16)
+
(18 , 18)
+
(19 , 18)
+
(20 , 20)
+
(21 , 20)
+
(22 , 22)
+
(23 , 22)
+
(24 , 24)
+
(25 , 24)
+
(26 , 26)
+
(27 , 26)
+
(28 , 28)
+
(29 , 28)
+
(30 , 30)
+
(31 , 30)
+
(32 , 32)
+
(33 , 32)
+
(34 , 34)
+
(35 , 34)
+
(36 , 36)
+
(37 , 36)
+
(38 , 38)
+
(39 , 38)
+
(40 , 40)
+
(41 , 40)
+
(42 , 42)
+
(43 , 42)
+
(44 , 44)
+
(45 , 44)
+
(46 , 46)
+
(47 , 46)
+
(48 , 48)
+
(49 , 48)
+
(50 , 50)
+
(51 , 50)
+
(52 , 52)
+
(53 , 52)
+
(54 , 54)
+
(55 , 54)
+
(56 , 56)
+
(57 , 56)
+
(58 , 58)
+
(59 , 58)
+
(60 , 60)
+
(61 , 60)
+
(62 , 62)
+
(63 , 62)
+
(64 , 64)
+
(65 , 64)
+
(66 , 66)
+
(67 , 66)
+
(68 , 68)
+
(69 , 68)
+
(70 , 70)
+
(71 , 70)
+
(72 , 72)
+
(73 , 72)
+
(74 , 74)
+
(75 , 74)
+
(76 , 76)
+
(77 , 76)
+
(78 , 78)
+
(79 , 78)
+
(80 , 80)
+
(81 , 80)
+
(82 , 82)
+
(83 , 82)
+
(84 , 84)
+
(85 , 84)
+
(86 , 86)
+
(87 , 86)
+
(88 , 88)
+
(89 , 88)
+
(90 , 90)
+
(91 , 90)
+
(92 , 92)
+
(93 , 92)
+
(94 , 94)
+
(95 , 94)
+
(96 , 96)
+
(97 , 96)
+
(98 , 98)
+
(99 , 98)
+
(100 , 100)
+
(101 , 100)
+
(102 , 102)
+
(103 , 102)
+
(104 , 104)
+
(105 , 104)
+
(106 , 106)
+
(107 , 106)
+
(108 , 108)
+
(109 , 108)
+
(110 , 110)
+
(111 , 110)
+
(112 , 112)
+
(113 , 112)
+
(114 , 114)
+
(115 , 114)
+
(116 , 116)
+
(117 , 116)
+
(118 , 118)
+
(119 , 118)
+
(120 , 120)
+
(121 , 120)
+
(122 , 122)
+
(123 , 122)
+
(124 , 124)
+
(125 , 124)
+
(126 , 126)
+
(127 , 126)
+
(128 , 128)
+
(129 , 128)
+
(130 , 130)
+
(131 , 130)
+
(132 , 132)
+
(133 , 132)
+
(134 , 134)
+
(135 , 134)
+
(136 , 136)
+
(137 , 136)
+
(138 , 138)
+
(139 , 138)
+
(140 , 140)
+
(141 , 140)
+
(142 , 142)
+
(143 , 142)
+
(144 , 144)
+
(145 , 144)
+
(146 , 146)
+
(147 , 146)
+
(148 , 148)
+
(149 , 148)
+
(150 , 150)
+
(151 , 150)
+
(152 , 152)
+
(153 , 152)
+
(154 , 154)
+
(155 , 154)
+
(156 , 156)
+
(157 , 156)
+
(158 , 158)
+
(159 , 158)
+
(160 , 160)
+
(161 , 160)
+
(162 , 162)
+
(163 , 162)
+
(164 , 164)
+
(165 , 164)
+
(166 , 166)
+
(167 , 166)
+
(168 , 168)
+
(169 , 168)
+
(170 , 170)
+
(171 , 170)
+
(172 , 172)
+
(173 , 172)
+
(174 , 174)
+
(175 , 174)
+
(176 , 176)
+
(177 , 176)
+
(178 , 178)
+
(179 , 178)
+
(180 , 180)
+
(181 , 180)
+
(182 , 182)
+
(183 , 182)
+
(184 , 184)
+
(185 , 184)
+
(186 , 186)
+
(187 , 186)
+
(188 , 188)
+
(189 , 188)
+
(190 , 190)
+
(191 , 190)
+
(192 , 192)
+
(193 , 192)
+
(194 , 194)
+
(195 , 194)
+
(196 , 196)
+
(197 , 196)
+
(198 , 198)
+
(199 , 198)
+
(200 , 200)
+
(201 , 200)
+
(202 , 202)
+
(203 , 202)
+
(204 , 204)
+
(205 , 204)
+
(206 , 206)
+
(207 , 206)
+
(208 , 208)
+
(209 , 208)
+
(210 , 210)
+
(211 , 210)
+
(212 , 212)
+
(213 , 212)
+
(214 , 214)
+
(215 , 214)
+
(216 , 216)
+
(217 , 216)
+
(218 , 218)
+
(219 , 218)
+
(220 , 220)
+
(221 , 220)
+
(222 , 222)
+
(223 , 222)
+
(224 , 224)
+
(225 , 224)
+
(226 , 226)
+
(227 , 226)
+
(228 , 228)
+
(229 , 228)
+
(230 , 230)
+
(231 , 230)
+
(232 , 232)
+
(233 , 232)
+
(234 , 234)
+
(235 , 234)
+
\ No newline at end of file
diff --git a/Part 3 - Movement Detection/bin/Debug/test.avi b/Part 3 - Movement Detection/bin/Debug/test.avi
new file mode 100644
index 0000000..5cb6400
Binary files /dev/null and b/Part 3 - Movement Detection/bin/Debug/test.avi differ
diff --git a/Part 3 - Movement Detection/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/Part 3 - Movement Detection/obj/Debug/DesignTimeResolveAssemblyReferences.cache
new file mode 100644
index 0000000..0bde688
Binary files /dev/null and b/Part 3 - Movement Detection/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ
diff --git a/Part 3 - Movement Detection/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/Part 3 - Movement Detection/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..ae83f3b
Binary files /dev/null and b/Part 3 - Movement Detection/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/Part 3 - Movement Detection/obj/Debug/Part 3 - Movement Detection.csproj.FileListAbsolute.txt b/Part 3 - Movement Detection/obj/Debug/Part 3 - Movement Detection.csproj.FileListAbsolute.txt
new file mode 100644
index 0000000..2b09599
--- /dev/null
+++ b/Part 3 - Movement Detection/obj/Debug/Part 3 - Movement Detection.csproj.FileListAbsolute.txt
@@ -0,0 +1,26 @@
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\Part 3 - Movemet Detection.exe.config
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\obj\Debug\Part 3 - Movemet Detection.exe
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\obj\Debug\Part 3 - Movemet Detection.pdb
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\Part 3 - Movemet Detection.exe
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\Part 3 - Movemet Detection.pdb
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Video.DirectShow.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Video.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Video.FFMPEG.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Video.Kinect.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Video.VFW.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Video.Ximea.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Imaging.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Math.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Video.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Video.DirectShow.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Video.FFMPEG.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Video.Kinect.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Video.VFW.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Video.Ximea.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Imaging.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Math.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\obj\Debug\Part_3___Movemet_Detection.MovementDetection.resources
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\obj\Debug\Part_3___Movemet_Detection.Properties.Resources.resources
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\obj\Debug\Part 3 - Movement Detection.csproj.GenerateResource.Cache
diff --git a/Part 3 - Movement Detection/obj/Debug/Part 3 - Movemet Detection.csproj.FileListAbsolute.txt b/Part 3 - Movement Detection/obj/Debug/Part 3 - Movemet Detection.csproj.FileListAbsolute.txt
new file mode 100644
index 0000000..60eec4b
--- /dev/null
+++ b/Part 3 - Movement Detection/obj/Debug/Part 3 - Movemet Detection.csproj.FileListAbsolute.txt
@@ -0,0 +1,27 @@
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\Part 3 - Movemet Detection.exe.config
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\Part 3 - Movemet Detection.exe
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\Part 3 - Movemet Detection.pdb
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\obj\Debug\Part_3___Movemet_Detection.Properties.Resources.resources
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\obj\Debug\Part 3 - Movemet Detection.csproj.GenerateResource.Cache
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\obj\Debug\Part 3 - Movemet Detection.exe
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\obj\Debug\Part 3 - Movemet Detection.pdb
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\obj\Debug\Part 3 - Movemet Detection.csprojResolveAssemblyReference.cache
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\obj\Debug\Part_3___Movemet_Detection.MovementDetection.resources
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Video.DirectShow.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Video.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Video.FFMPEG.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Video.Kinect.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Video.VFW.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Video.Ximea.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Imaging.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Math.dll
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Video.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Video.DirectShow.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Video.FFMPEG.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Video.Kinect.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Video.VFW.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Video.Ximea.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Imaging.xml
+C:\Users\AnnJanu\documents\visual studio 2013\Projects\HCI Assignment 1\Part 3 - Movemet Detection\bin\Debug\AForge.Math.xml
diff --git a/Part 3 - Movement Detection/obj/Debug/Part 3 - Movemet Detection.csproj.GenerateResource.Cache b/Part 3 - Movement Detection/obj/Debug/Part 3 - Movemet Detection.csproj.GenerateResource.Cache
new file mode 100644
index 0000000..991121e
Binary files /dev/null and b/Part 3 - Movement Detection/obj/Debug/Part 3 - Movemet Detection.csproj.GenerateResource.Cache differ
diff --git a/Part 3 - Movement Detection/obj/Debug/Part 3 - Movemet Detection.csprojResolveAssemblyReference.cache b/Part 3 - Movement Detection/obj/Debug/Part 3 - Movemet Detection.csprojResolveAssemblyReference.cache
new file mode 100644
index 0000000..c2d018a
Binary files /dev/null and b/Part 3 - Movement Detection/obj/Debug/Part 3 - Movemet Detection.csprojResolveAssemblyReference.cache differ
diff --git a/Part 3 - Movement Detection/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs b/Part 3 - Movement Detection/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
new file mode 100644
index 0000000..e69de29
diff --git a/Part 3 - Movement Detection/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs b/Part 3 - Movement Detection/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
new file mode 100644
index 0000000..e69de29
diff --git a/Part 3 - Movement Detection/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs b/Part 3 - Movement Detection/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
new file mode 100644
index 0000000..e69de29
diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..2564ad7
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,13 @@
+To just use all the applications you can look into the folder named "Data" it contains all the built exe files of all the three projects.
+
+The "Data" folder also contains two video files one recorded from the application that has been made in part 1 of the assignment, named "video.avi" and also a sample video file for the movement detection of red pixel in it, named "part3-test.avi"
+
+This part is important to record the video in part 1 and to read the video file in part 2 I have used a video decoder named "wmv9VCMsetup.exe", it is also present in Data folder and must be installed in order to record the video or to take a snapshot in a video.
+
+I've used the .avi the format to write or read a video so all the video input must be in .avi format.
+
+In case of building this project:-
+
+After the recording of the video the video file is saved in bin\Debug folder of the project with the name of "video.avi".
+Similarly, the snapshot file in part 2 of the assignment is also stored in bin\Debug folder of the socond project with the name of "snapshot.jpg".
+The part 3 of the project both displays and stores the co-ordinated of the pixel. It saves the co-ordinates in the file named "RedDotCoordinateInfo.txt"
\ No newline at end of file