--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+ <meta http-equiv="X-UA-Compatible" content="IE=9" />
+ <link rel="stylesheet" type="text/css" href="../../../css/styles.css" />
+ <link rel="stylesheet" type="text/css" href="../../../css/snippet.css" />
+ <script type="text/javascript" src="../../../scripts/snippet.js"></script>
+ <script type="text/javascript" src="../../../scripts/jquery.util.js" charset="utf-8"></script>
+ <script type="text/javascript" src="../../../scripts/common.js" charset="utf-8"></script>
+ <script type="text/javascript" src="../../../scripts/core.js" charset="utf-8"></script>
+ <script type="text/javascript" src="../../../scripts/search.js" charset="utf-8"></script>
+ <title>Face Detection, Recognition, and Tracking</title>
+ </head>
+ <body onload="prettyPrint()" style="overflow: auto;">
+
+ <div id="toc-navigation">
+ <div id="toc_border"><div id="toc">
+ <p class="toc-title">Dependencies</p>
+ <ul class="toc">
+ <li>Tizen 4.0 and Higher</li>
+ </ul>
+ <p class="toc-title">Content</p>
+ <ul class="toc">
+ <li><a href="#prerequisites">Prerequisites</a></li>
+ <li><a href="#detect">Detecting Faces</a></li>
+ <li><a href="#recognize">Recognizing Faces</a></li>
+ <li><a href="#track">Tracking Faces</a></li>
+ </ul>
+ <p class="toc-title">Related Info</p>
+ <ul class="toc">
+ <li><a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1FaceDetector.html">Tizen.Multimedia.FaceDetector Class</a></li>
+ <li><a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1FaceRecognizer.html">Tizen.Multimedia.FaceRecognizer Class</a></li>
+ <li><a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1FaceTracker.html">Tizen.Multimedia.FaceTracker Class</a></li>
+ </ul>
+ </div></div>
+</div>
+
+<div id="container"><div id="contents"><div class="content">
+
+<h1>Face Detection, Recognition, and Tracking</h1>
+
+<p>You can detect a face in an image, or track a face in the device camera preview.</p>
+
+<p>The main face detection, recognition, and tracking features include:</p>
+
+<ul>
+ <li>Detecting faces
+ <p>You can decode an image file and <a href="#detect">detect faces</a> on it.</p>
+ </li>
+ <li>Recognizing faces
+ <p>You can <a href="#recognize">recognize faces</a> in an image with a set of example faces.</p>
+ </li>
+ <li>Tracking faces
+ <p>You can <a href="#track">track faces</a> using the camera preview images, starting from a specific location in the image.</p>
+ </li>
+</ul>
+
+<h2 id="prerequisites">Prerequisites</h2>
+
+<p>To enable your application to use the face detection, recognition, and tracking functionality:</p>
+<ol>
+ <li>Install the Nuget packages for Media Vision and Camera.</li>
+ <li>To use the methods and properties of the face detection, tracking, and recognition classes and to handle camera preview, include the <a href="https://developer.tizen.org/dev-guide/csapi/namespaceTizen_1_1Multimedia.html">Tizen.Multimedia</a> namespace in your application:
+<pre class="prettyprint">
+using Tizen.Multimedia;
+</pre>
+ </li>
+ <li>Define the configuration settings:
+ <ul>
+ <li>For face detection, create an instance of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1FaceDetectionConfiguration.html">Tizen.Multimedia.FaceDetectionConfiguration</a> class and set its properties accordingly:
+<pre class="prettyprint">
+static FaceDetectionConfiguration configDetection = new FaceDetectionConfiguration();
+
+/// Set a model path if you want to save your own model in a certain place
+configDetection.ModelFilePath = "app_path/your_own_model";
+
+/// Set a minimum face size if you want to detect only larger faces
+configDetection.MinWidth = 50;
+configDetection.MinHeight = 50;
+
+/// Set a region of interest if you want to detect in a specific region
+configDetection.Roi = new Rectangle(10, 10, 20, 30);
+</pre>
+ </li>
+ <li>For face recognition, create an instance of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1FaceRecognitionConfiguration.html">Tizen.Multimedia.FaceRecognitionConfiguration</a> class and set its properties accordingly:
+<pre class="prettyprint">
+static FaceRecognitionConfiguration configRecog = new FaceRecognitionConfiguration();
+
+/// Set the face recognition learning model algorithm to one of the
+/// values of the <a href="https://developer.tizen.org/dev-guide/csapi/namespaceTizen_1_1Multimedia.html#a8feaf5681562b4094d6b065ec71294b4">Tizen.Multimedia.FaceRecognitionModelType</a> enumeration
+configRecog.ModelType = FaceRecognitionModelType.lbph;
+</pre>
+ </li>
+ <li>For face tracking, no configuration is needed.</li>
+ </ul>
+ </li>
+</ol>
+
+<h2 id="detect">Detecting Faces</h2>
+
+<p>To detect faces:</p>
+
+<ol>
+ <li>Create an instance of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1MediaVisionSource.html">Tizen.Multimedia.MediaVisionSource</a> class with raw image buffer data and its corresponding width, height, and color space parameters:
+<pre class="prettyprint">
+/// Assume that there is a decoded raw data buffer of the byte[] type, and
+/// it has 640x480 resolution with an RGB888 color space
+
+MediaVisionSource source = new MediaVisionSource(bytes, width, height, ColorSpace.Rgb888);
+</pre>
+ </li>
+ <li>To detect faces, use the <code>DetectAsync()</code> method of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1FaceDetector.html">Tizen.Multimedia.FaceDetector</a> class:
+<pre class="prettyprint">
+var faceLists = await FaceDetector.DetectAsync(source);
+
+/// If you want to change the face detection configuration, use an instance
+/// of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1FaceDetectionConfiguration.html">Tizen.Multimedia.FaceDetectionConfiguration</a> class as a
+/// parameter for the DetectAsync() method
+/// For example,
+/// var faceLists = await FaceDetector.DetectAsync(source, configDetection);
+
+foreach (Rectangle location in faceLists)
+{
+ Log.Info("Face detection sample", $"location is {location}");
+}
+</pre>
+</li>
+</ol>
+
+<h2 id="recognize">Recognizing Faces</h2>
+
+<p>To recognize faces:</p>
+
+<ol>
+ <li>Create an instance of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1FaceRecognitionModel.html">Tizen.Multimedia.FaceRecognitionModel</a> class and add face examples to it with the <code>Add()</code> method.
+ <p>Face examples need to be of the same person but captured at different angles. The example assumes that 10 face samples are used and that the face area in each example covers approximately 95~100% of the image. The face to be recognized is given the label "1".</p>
+<pre class="prettyprint">
+static FaceRecognitionModel model = new FaceRecognitionModel();
+
+/// faceExamples contains 10 face examples as instances
+/// of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1MediaVisionSource.html">Tizen.Multimedia.MediaVisionSource</a> class
+foreach (MediaVisionSource example in faceExamples)
+{
+ model.add(example, 1);
+}
+</pre>
+ </li>
+ <li>Learn the face recognition model based on the provided examples with the <code>Learn()</code> method:
+<pre class="prettyprint">
+model.Learn();
+</pre>
+ </li>
+ <li>To recognize a face, use the <code>RecognizeAsync()</code> method of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1FaceRecognizer.html">Tizen.Multimedia.FaceRecognizer</a> class:
+<pre class="prettyprint">
+/// whoFaceSource is an instance of the Tizen.Multimedia.MediaVisionSource class
+/// that contains the face to be recognized
+/// whoFaceRoi is an instance of the <a href="https://developer.tizen.org/dev-guide/csapi/structTizen_1_1Multimedia_1_1Rectangle.html">Tizen.Multimedia.Rectangle</a> struct that defines
+/// a region of interest containing the face to be recognized
+var result = await FaceRecognizer.RecognizeAsync(whoFaceSource, model, whoFaceRoi);
+
+Log.Info("Face recognition sample", $"confidence is {result.Confidence}");
+Log.Info("Face recognition sample", $"success is {result.Success}");
+if (result.Success)
+{
+ Log.info("Face recognition sample", $"label is {result.Label}");
+}
+</pre>
+ </li>
+</ol>
+
+<h2 id="track">Tracking Faces</h2>
+
+<p>To track faces:</p>
+
+<ol>
+ <li>Prepare the camera:
+ <ol type="a">
+ <li>Define a camera preview event handler for the <code>Preview</code> event of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1Camera.html">Tizen.Multimedia.Camera</a> class and create an instance of that class:
+<pre class="prettyprint">
+/// Define a camera preview event handler
+static void PreviewCallback(object sender, PreviewEventArgs e)
+{
+ PreviewData preview = e.Preview;
+
+ SinglePlane singlePlane = (SinglePlane)preview.Plane;
+ if (preview.Format == CameraPixelFormat.Rgb888)
+ {
+ MediaVisionSource source = new MediaVisionSource(singlePlane.Data, preview.width, preview.height, ColorSpace.Rgb888);
+ }
+}
+
+/// Create the Tizen.Multimedia.Camera instance
+static Camera camera = null;
+try
+{
+ camera = new Camera(CameraDevice.Rear);
+}
+catch (NotSupportedException)
+{
+ Log.Info("Face Detection Sample", "NotSupported");
+}
+</pre>
+ </li>
+ <li>Set the camera display, register the camera preview event handler, and start the camera preview with the <code>StartPreview()</code> method of the <code>Tizen.Multimedia.Camera</code> class:
+<pre class="prettyprint">
+/// Set the camera display
+camera.Display = new Display(new Window("Preview"));
+
+/// Register the camera preview event handler
+camera.Preview += PreviewCallback;
+
+IList previewFormats = camera.Feature.SupportedPreviewPixelFormats.ToList();
+foreach (CameraPixelFormat previewFormat in previewFormats)
+{
+ camera.Setting.PreviewPixelFormat = previewFormat;
+ break;
+}
+
+/// Start the camera preview
+camera.StartPreview();
+</pre>
+ </li>
+ </ol>
+ </li>
+ <li>Manage face tracking:
+ <ol type="a">
+ <li>Set the initial tracking location.
+ <p>In the following example, the <code>DetectAsync()</code> method of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1FaceDetector.html">Tizen.Multimedia.FaceDetector</a> class is used to detect a face and provide its initial location:</p>
+<pre class="prettyprint">
+var faceLocation = await FaceDetector.DetectAsync(source);
+
+Point[] initialPoint =
+{
+ new Point(faceLocation.Left, FaceLocation.Top),
+ new Point(faceLocation.Right, FaceLocation.Top),
+ new Point(faceLocation.Right, FaceLocation.Bottom),
+ new Point(faceLocation.Left, FaceLocation.Bottom)
+};
+</pre>
+ </li>
+ <li>Create an instance of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1FaceTrackingModel.html">Tizen.Multimedia.FaceTrackingModel</a> class and prepare the model with the initial location:
+<pre class="prettyprint">
+Quadrangle faceLocation = new Quadrangle(initialPoint);
+
+static FaceTrackingModel model = new FaceTrackingModel();
+
+model.Prepare(source, faceLocation);
+</pre>
+ </li>
+ <li>To track the face, use the <code>TrackAsync()</code> method of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1FaceTracker.html">Tizen.Multimedia.FaceTracker</a> class:
+<pre class="prettyprint">
+var result = await FaceTracker.TrackAsync(source, model, false);
+if (result.Region != null)
+{
+ Log.Info("Face tracking sample", $"location is {result.Region}");
+}
+</pre>
+ </li>
+ <li>When face tracking is no longer needed, deregister the camera preview event handler, stop the camera preview, and destroy the camera instance:
+<pre class="prettyprint">
+camera.Preview -= PreviewCallback;
+
+camera.StopPreview();
+camera.Dispose();
+</pre>
+ </li>
+ </ol>
+ </li>
+</ol>
+
+<script type="text/javascript" src="../../../scripts/jquery.zclip.min.js"></script>
+<script type="text/javascript" src="../../../scripts/showhide.js"></script>
+</div></div></div>
+
+<a class="top sms" href="#"><img src="../../../images/btn_top.gif" alt="Go to top" /></a>
+
+<div id="footer">
+<p class="footer">Except as noted, this content - excluding the Code Examples - is licensed under <a href="http://creativecommons.org/licenses/by/3.0/legalcode" target="_blank">Creative Commons Attribution 3.0</a> and all of the Code Examples contained herein are licensed under <a href="https://www.tizen.org/bsd-3-clause-license" target="_blank">BSD-3-Clause</a>.<br/>For details, see the <a href="https://www.tizen.org/content-license" target="_blank">Content License</a>.</p>
+</div>
+
+<script type="text/javascript">
+var _gaq = _gaq || [];
+_gaq.push(['_setAccount', 'UA-25976949-1']);
+_gaq.push(['_trackPageview']);
+(function() {
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
+</script>
+
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+ <meta http-equiv="X-UA-Compatible" content="IE=9" />
+ <link rel="stylesheet" type="text/css" href="../../../css/styles.css" />
+ <link rel="stylesheet" type="text/css" href="../../../css/snippet.css" />
+ <script type="text/javascript" src="../../../scripts/snippet.js"></script>
+ <script type="text/javascript" src="../../../scripts/jquery.util.js" charset="utf-8"></script>
+ <script type="text/javascript" src="../../../scripts/common.js" charset="utf-8"></script>
+ <script type="text/javascript" src="../../../scripts/core.js" charset="utf-8"></script>
+ <script type="text/javascript" src="../../../scripts/search.js" charset="utf-8"></script>
+ <title>Barcode Detection and Generation</title>
+ </head>
+ <body onload="prettyPrint()" style="overflow: auto;">
+
+ <div id="toc-navigation">
+ <div id="toc_border"><div id="toc">
+ <p class="toc-title">Dependencies</p>
+ <ul class="toc">
+ <li>Tizen 4.0 and Higher</li>
+ </ul>
+ <p class="toc-title">Content</p>
+ <ul class="toc">
+ <li><a href="#prerequisites">Prerequisites</a></li>
+ <li><a href="#prepare">Preparing the Barcode Engines</a></li>
+ <li><a href="#detect">Detecting Barcodes</a></li>
+ <li><a href="#generate">Generating Barcodes</a></li>
+ <li><a href="#spec">Barcode Specifications</a></li>
+ </ul>
+ <p class="toc-title">Related Info</p>
+ <ul class="toc">
+ <li><a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1Barcode.html">Tizen.Multimedia.Barcode Class</a></li>
+ <li><a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1BarcodeDetector.html">Tizen.Multimedia.BarcodeDetector Class</a></li>
+ <li><a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1BarcodeGenerator.html">Tizen.Multimedia.BarcodeGenerator Class</a></li>
+ </ul>
+ </div></div>
+</div>
+
+<div id="container"><div id="contents"><div class="content">
+
+<h1>Barcode Detection and Generation</h1>
+
+<p>You can perceive and understand an image or extract information from images in your application.</p>
+
+<p>The main barcode detection and generation features include:</p>
+
+<ul>
+ <li>Handling images
+ <p>You can handle images with the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1MediaVisionSource.html">Tizen.Multimedia.MediaVisionSource</a> class. You can <a href="#prepare">create the source instance</a> using raw buffer data or an instance of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1MediaPacket.html">Tizen.Multimedia.MediaPacket</a> class.</p>
+ </li>
+ <li>Detecting barcodes
+ <p>You can <a href="#detect">detect barcodes</a> in an image or from camera preview streams, and then decrypt them to display messages to the user.</p>
+ <p>Before detecting a barcode, you must define the barcode detection target as a value of the <a href="https://developer.tizen.org/dev-guide/csapi/namespaceTizen_1_1Multimedia.html#a332ff1e49e431ddf608fbbb0b0a6980d">Tizen.Multimedia.BarcodeDetectionTarget</a> enumeration:</p>
+ <ul>
+ <li>Detect both 1D and 2D barcodes</li>
+ <li>Detect 1D barcodes only</li>
+ <li>Detect 2D barcodes only</li>
+ </ul>
+ </li>
+ <li>Generating barcodes
+ <p>You can encrypt a given message, <a href="#generate">generate a barcode</a> from it, and save it in a memory or as an image file.</p>
+ <p>Before generating a barcode, you must define the text visibility as a value of the <a href="https://developer.tizen.org/dev-guide/csapi/namespaceTizen_1_1Multimedia.html#a87f1d82babf489f0f6488414ad04e14d">Tizen.Multimedia.Visibility</a> enumeration:</p>
+ <ul>
+ <li>Generate barcode without an input message</li>
+ <li>Generate barcode with an input message (supports only 1D barcodes)</li>
+ </ul>
+ <p>You must also define the following <a href="#spec">barcode specifications</a>:</p>
+ <ul>
+ <li><a href="#barcode">Barcode type</a></li>
+ <li><a href="#qrcode">QR code specification</a> (if the QR code barcode type is used)</li>
+ <li>Image format (if the barcode is saved as a file)
+ <ul>
+ <li>JPEG</li>
+ <li>BMP</li>
+ <li>PNG</li>
+ </ul>
+ </li>
+ </ul>
+ <p>Optionally, you can change foreground or background color for the barcode by setting the <code>ForegroundColor</code> or <code>BackgroundColor</code> properties of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1BarcodeGenerationConfiguration.html">Tizen.Multimedia.BarcodeGenerationConfiguration</a> class. Their default values are black and white, respectively.</p>
+</li>
+</ul>
+
+<h2 id="prerequisites">Prerequisites</h2>
+
+<p>To enable your application to use the barcode detection and generation functionality:</p>
+<ol>
+ <li>Install the Nuget packages for Media Vision and Camera.</li>
+ <li>To use the methods and properties of the barcode detection and generation classes and to handle camera preview, include the <a href="https://developer.tizen.org/dev-guide/csapi/namespaceTizen_1_1Multimedia.html">Tizen.Multimedia</a> namespace in your application:
+<pre class="prettyprint">
+using Tizen.Multimedia;
+</pre>
+ </li>
+</ol>
+
+
+<h2 id="prepare">Preparing the Barcode Engines</h2>
+
+<p>To initialize the barcode detection and generation engines for use:</p>
+
+<ul>
+ <li>For barcode detection:
+ <ol>
+ <li>Create an instance of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1BarcodeDetectionConfiguration.html">Tizen.Multimedia.BarcodeDetectionConfiguration</a> class and set the <code>Target</code> property as a value of the <a href="https://developer.tizen.org/dev-guide/csapi/namespaceTizen_1_1Multimedia.html#a332ff1e49e431ddf608fbbb0b0a6980d">Tizen.Multimedia.BarcodeDetectionTarget</a> enumeration:
+<pre class="prettyprint">
+static BarcodeDetectionConfiguration configDetection = new BarcodeDetectionConfiguration();
+
+/// To detect all barcode types
+configDetection.Target = BarcodeDetectionTarget.All;
+
+/// To detect only 1D barcodes
+/// configDetection.Target = BarcodeDetectionTarget.Barcode1D;
+/// To detect only 2D barcodes (QR codes)
+/// configDetection.Target = BarcodeDetectionTarget.Barcode2D;
+</pre>
+ </li>
+ <li>Create an instance of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1MediaVisionSource.html">Tizen.Multimedia.MediaVisionSource</a> class with raw image buffer data and its corresponding width, height, and color space:
+<pre class="prettyprint">
+/// Assume that there is a decoded raw data buffer of the byte[] type, and
+/// it has 640x480 resolution with an RGB888 color space
+MediaVisionSource source = new MediaVisionSource(bytes, width, height, ColorSpace.Rgb888);
+</pre>
+ <p>The source stores the barcode to be detected and all related data.</p>
+ </li>
+ <li>To provide camera preview images, define a camera preview event handler for the <code>Preview</code> event of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1Camera.html">Tizen.Multimedia.Camera</a> class and create an instance of that class:
+<pre class="prettyprint">
+/// Define a camera preview event handler
+static void PreviewCallback(object sender, PreviewEventArgs e)
+{
+ PreviewData preview = e.Preview;
+
+ SinglePlane singlePlane = (SinglePlane)preview.Plane;
+ if (preview.Format == CameraPixelFormat.Rgb888)
+ {
+ MediaVisionSource source = new MediaVisionSource(singlePlane.Data, preview.width, preview.height, ColorSpace.Rgb888);
+ }
+}
+
+/// Create the Tizen.Multimedia.Camera instance
+static Camera camera = null;
+try
+{
+ camera = new Camera(CameraDevice.Rear);
+}
+catch (NotSupportedException)
+{
+ Log.Info("Barcode Sample", "NotSupported");
+}
+</pre>
+ </li>
+ <li>Set the camera display, register the camera preview event handler, and start the camera preview with the <code>StartPreview()</code> method:
+<pre class="prettyprint">
+/// Set the camera display
+camera.Display = new Display(new Window("Preview"));
+
+/// Register the camera preview event handler
+camera.Preview += PreviewCallback;
+
+IList previewFormats = camera.Feature.SupportedPreviewPixelFormats.ToList();
+foreach (CameraPixelFormat previewFormat in previewFormats)
+{
+ camera.Setting.PreviewPixelFormat = previewFormat;
+ break;
+}
+
+/// Start the camera preview
+camera.StartPreview();
+</pre>
+ </li>
+ </ol>
+ </li>
+ <li>For barcode generation, create an instance of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1BarcodeGenerationConfiguration.html">Tizen.Multimedia.BarcodeGenerationConfiguration</a> class and set its properties:
+<pre class="prettyprint">
+static BarcodeGenerationConfiguration configGeneration = new BarcodeGenerationConfiguration();
+
+/// To show message on the generated barcode image
+configGeneration.TextVisibility = Visibility.Visible;
+
+/// To hide message on the generated barcode image
+/// configGeneration.TextVisibility = Visibility.Invisible;
+
+/// To change the foreground or background color
+/// For this example, the foreground and background are set as black and white, respectively
+configGeneration.ForegroundColor = Color.Black;
+configGeneration.BackgroundColor = Color.White;
+</pre>
+ </li>
+</ul>
+
+<h2 id="detect">Detecting Barcodes</h2>
+
+<p>To detect barcodes:</p>
+
+<ol>
+ <li>To access the camera preview data from which to detect barcodes, create a new instance of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1MediaVisionSource.html">Tizen.Multimedia.MediaVisionSource</a> class in the camera preview event handler:
+<pre class="prettyprint">
+static void PreviewCallback(object sender, PreviewEventArgs e)
+{
+ PreviewData preview = e.Preview;
+
+ SinglePlane singlePlane = (SinglePlane)preview.Plane;
+ if (preview.Format == CameraPixelFormat.Rgb888)
+ {
+ MediaVisionSource source = new MediaVisionSource(singlePlane.Data, preview.width, preview.height, ColorSpace.Rgb888);
+ }
+</pre>
+ </li>
+ <li>Detect barcodes in the image using the <code>DetectAsync()</code> method of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1BarcodeDetector.html">Tizen.Multimedia.BarcodeDetector</a> class:
+<pre class="prettyprint">
+ Point point = new Point(0,0);
+ Size size = new Size((int)source.Width, (int)source.Height);
+
+ Rectangle roi = new Rectangle(point, size);
+
+ var barcodeLists = await BarcodeDetector.DetectAsync(source, roi, configDetection);
+
+ foreach (Barcode barcode in barcodeLists)
+ {
+ Log.Info("Barcode sample", $"Barcode type is {barcode.Type}");
+ Log.Info("Barcode sample", $"Barcode message is {barcode.Message}");
+ }
+}
+</pre>
+ <p>The ROI (region of interest) feature allows you to define a rectangular region of the image in which to detect barcodes. In the above example, the whole image is set as the ROI.</p>
+ </li>
+ <li>When barcode detection is no longer needed, deregister the camera preview event handler, stop the camera preview, and destroy the camera instance:
+<pre class="prettyprint">
+camera.Preview -= PreviewCallback;
+
+camera.StopPreview();
+camera.Dispose();
+</pre>
+ <p>For more information, see the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1Camera.html">Tizen.Multimedia.Camera</a> class.</p>
+ </li>
+</ol>
+
+<h2 id="generate">Generating Barcodes</h2>
+
+<p>To generate a barcode:</p>
+
+<ul>
+ <li>To generate the barcode into memory:
+ <ul>
+ <li>To generate a 1D barcode, create a source instance using the <code>GenerateSource()</code> method of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1BarcodeGenerator.html">Tizen.Multimedia.BarcodeGenerator</a> class with a message and a <a href="#barcode">barcode type</a>:
+<pre class="prettyprint">
+string message = "0123455";
+
+/// For a Code 128 type barcode
+var source = BarcodeGenerator.GenerateSource(message, BarcodeType.Code128);
+
+/// If you want to change the barcode color or change the visibility of the text, give an instance
+/// of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1BarcodeGenerationConfiguration.html">Tizen.Multimedia.BarcodeGenerationConfiguration</a> class as an additional parameter:
+/// var source = BarcodeGenerator.GenerateSource(message, BarcodeType.code128, configGeneration);
+</pre>
+ </li>
+ <li>To generate a QR code:
+ <ol>
+ <li>To create the QR code configuration, create an instance of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1QrConfiguration.html">Tizen.Multimedia.QrConfiguration</a> class with the QR code encoding mode as a value of the <a href="https://developer.tizen.org/dev-guide/csapi/namespaceTizen_1_1Multimedia.html#a0ef6ac2b6eb68c52f08785d5fa7d2810">Tizen.Multimedia.QrMode</a> enumeration, the QR code error correction level as a value of the <a href="https://developer.tizen.org/dev-guide/csapi/namespaceTizen_1_1Multimedia.html#a7b9c4e26a98f758b00c575b0e7d9b6c3">Tizen.Multimedia.ErrorCorrectionLevel</a> enumeration, and the QR code version:
+<pre class="prettyprint">
+string message = "Tizen QR";
+
+/// For the UTF8 encoding type
+QrConfiguration qrConfig = new QrConfiguration(QrMode.Utf8, ErrorCorrectionLevel.Medium, 30);
+</pre>
+ </li>
+ <li>Create a source instance using the <code>GenerateSource()</code> method of the <code>Tizen.Multimedia.BarcodeGenerator</code> class with a message and the QR code configuration:
+<pre class="prettyprint">
+var source = BarcodeGenerator.GenerateSource(message, qrConfig);
+
+/// If you want to change the QR code color, give an instance
+/// of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1BarcodeGenerationConfiguration.html">Tizen.Multimedia.BarcodeGenerationConfiguration</a> class as an additional parameter:
+/// var source = BarcodeGenerator.GenerateSource(message, qrConfig, configGeneration);
+</pre>
+ </li>
+ </ol>
+ </li>
+ </ul>
+ </li>
+ <li>To generate the barcode into a file:
+ <ul>
+ <li>To generate a 1D barcode:
+ <ol>
+ <li>Create an instance of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1BarcodeImageConfiguration.html">Tizen.Multimedia.BarcodeImageConfiguration</a> class with the file format as a value of the <a href="https://developer.tizen.org/dev-guide/csapi/namespaceTizen_1_1Multimedia.html#af3083af9b324e4f7644a03316fa2beb5">Tizen.Multimedia.BarcodeImageFormat</a> enumeration, the image file resolution, and a path where the file is to be saved:
+<pre class="prettyprint">
+int width = 300;
+int height = 100;
+BarcodeImageFormat format = BarcodeImageFormat.Jpeg;
+string path = "/tmp/tizen_barcode.jpg";
+BarcodeImageConfiguration imageConfig = new BarcodeImageConfiguration(width, height, path, format);
+</pre>
+ </li>
+ <li>Generate the barcode using the <code>GenerateImage()</code> method of the <code>Tizen.Multimedia.BarcodeGenerator</code> class:
+<pre class="prettyprint">
+string message = "0123455";
+BarcodeType type = BarcodeType.Code128;
+BarcodeGenerator.GenerateImage(message, type, imageConfig);
+</pre>
+ </li>
+ </ol>
+ </li>
+ <li>To generate a QR code, create instances of the <code>Tizen.Multimedia.BarcodeImageConfiguration</code> and <code>Tizen.Multimedia.QrConfiguration</code> classes as above, and generate the QR code using the <code>GenerateImage()</code> method of the <code>Tizen.Multimedia.BarcodeGenerator</code> class:
+<pre class="prettyprint">
+int width = 300;
+int height = 300;
+BarcodeImageFormat format = BarcodeImageFormat.Jpeg;
+string path = "/tmp/tizen_qr.jpg";
+BarcodeImageConfiguration imageConfig = new BarcodeImageConfiguration(width, height, path, format);
+Qrconfiguration qrConfig = new QrConfiguration(QrMode.Utf8, ErrorCorrectionLevel.Medium, 30);
+
+string message = "Tizen QR"
+BarcodeGenerator.GenerateImage(message, qrConfig, imageConfig);
+</pre>
+ </li>
+ </ul>
+ </li>
+</ul>
+
+<h2 id="spec">Barcode Specifications</h2>
+
+<p>The following tables provide more information on the barcode generation specifications.</p>
+ <p align="center" class="Table"><strong>Table: Supported barcode types</strong></p>
+<table id="barcode">
+ <tbody>
+ <tr>
+ <th>1D or 2D</th>
+ <th>Type</th>
+ <th>Description</th>
+ <th>Example</th>
+ </tr>
+ <tr>
+ <td rowspan="7">1-D</td>
+ <td>UPC-A</td>
+ <td>Universal product code with numeric 12-digit</td>
+ <td><p align="center"><img alt="UPC-A" src="../../../images/mediavision_upc_a.png" /></p> </td>
+ </tr>
+ <tr>
+ <td>UPC-E</td>
+ <td>Universal product code with numeric 6-digit</td>
+ <td><p align="center"><img alt="UPC-E" src="../../../images/mediavision_upc_e.png" /></p></td>
+ </tr>
+ <tr>
+ <td>EAN-8</td>
+ <td>International article number with numeric 8-digit</td>
+ <td><p align="center"><img alt="EAN-8" src="../../../images/mediavision_ean_8.png" /></p></td>
+ </tr>
+ <tr>
+ <td>EAN-13</td>
+ <td>International article number with numeric 13-digit</td>
+ <td><p align="center"><img alt="EAN-13" src="../../../images/mediavision_ean_13.png" /></p></td>
+ </tr>
+ <tr>
+ <td>CODE-128</td>
+ <td>Code 128; supports alphanumeric or numeric-only</td>
+ <td><p align="center"><img alt="CODE-128" src="../../../images/mediavision_code_128.png" /></p></td>
+ </tr>
+ <tr>
+ <td>CODE-39</td>
+ <td>Code 39; supports 34 characters consisting of uppercase letters (A to Z), numeric digits (0 to 9), and special characters (-, ., $, /, %, space)</td>
+ <td><p align="center"><img alt="CODE-39" src="../../../images/mediavision_code_39.png" /></p></td>
+ </tr>
+ <tr>
+ <td>INTERLEAVED 2 of 5</td>
+ <td>Interleaved 2 of 5 with numeric digits</td>
+ <td><p align="center"><img alt="UPC-A" src="../../../images/mediavision_interleaved_2_5.png" /></p></td>
+ </tr>
+ <tr>
+ <td>2-D</td>
+ <td>QR code</td>
+ <td>Quick Response code</td>
+ <td><p align="center"><img alt="UPC-A" src="../../../images/mediavision_qr.png" /></p></td>
+ </tr>
+ </tbody>
+ </table>
+
+ <p align="center" class="Table"><strong>Table: Supported QR code specifications</strong></p>
+ <table id="qrcode">
+ <tbody>
+ <tr>
+ <th>Specification</th>
+ <th>Support type</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td rowspan="4">Error Correction Code (ECC) Level</td>
+ <td>ECC Low</td>
+ <td>Recovery up to 7% damage</td>
+ </tr>
+ <tr>
+ <td>ECC Medium</td>
+ <td>Recovery up to 15% damage</td>
+ </tr>
+ <tr>
+ <td>ECC Quartile</td>
+ <td>Recovery up 25% damage</td>
+ </tr>
+ <tr>
+ <td>ECC High</td>
+ <td>Recovery up to 30% damage</td>
+ </tr>
+ <tr>
+ <td rowspan="4">Encoding mode</td>
+ <td>Numeric</td>
+ <td>Numeric digits ('0', '1', ..., '9')</td>
+ </tr>
+ <tr>
+ <td>Alphanumeric</td>
+ <td>Alphanumeric characters: numeric (0, 1, ..., 9), characters (A, B, ..., Z), and punctuation (' ', $, %, *, +, -, '.', /, ':')</td>
+ </tr>
+ <tr>
+ <td>Byte 8-bit</td>
+ <td>Raw 8-bit bytes</td>
+ </tr>
+ <tr>
+ <td>UTF-8</td>
+ <td>Universal character set and Transformation Format 8-bit, encoding characters</td>
+ </tr>
+ </tbody>
+ </table>
+
+<script type="text/javascript" src="../../../scripts/jquery.zclip.min.js"></script>
+<script type="text/javascript" src="../../../scripts/showhide.js"></script>
+</div></div></div>
+
+<a class="top sms" href="#"><img src="../../../images/btn_top.gif" alt="Go to top" /></a>
+
+<div id="footer">
+<p class="footer">Except as noted, this content - excluding the Code Examples - is licensed under <a href="http://creativecommons.org/licenses/by/3.0/legalcode" target="_blank">Creative Commons Attribution 3.0</a> and all of the Code Examples contained herein are licensed under <a href="https://www.tizen.org/bsd-3-clause-license" target="_blank">BSD-3-Clause</a>.<br/>For details, see the <a href="https://www.tizen.org/content-license" target="_blank">Content License</a>.</p>
+</div>
+
+<script type="text/javascript">
+var _gaq = _gaq || [];
+_gaq.push(['_setAccount', 'UA-25976949-1']);
+_gaq.push(['_trackPageview']);
+(function() {
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
+</script>
+
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+ <meta http-equiv="X-UA-Compatible" content="IE=9" />
+ <link rel="stylesheet" type="text/css" href="../../../css/styles.css" />
+ <link rel="stylesheet" type="text/css" href="../../../css/snippet.css" />
+ <script type="text/javascript" src="../../../scripts/snippet.js"></script>
+ <script type="text/javascript" src="../../../scripts/jquery.util.js" charset="utf-8"></script>
+ <script type="text/javascript" src="../../../scripts/common.js" charset="utf-8"></script>
+ <script type="text/javascript" src="../../../scripts/core.js" charset="utf-8"></script>
+ <script type="text/javascript" src="../../../scripts/search.js" charset="utf-8"></script>
+ <title>Image Recognition and Tracking</title>
+ </head>
+ <body onload="prettyPrint()" style="overflow: auto;">
+
+ <div id="toc-navigation">
+ <div id="toc_border"><div id="toc">
+ <p class="toc-title">Dependencies</p>
+ <ul class="toc">
+ <li>Tizen 4.0 and Higher</li>
+ </ul>
+ <p class="toc-title">Content</p>
+ <ul class="toc">
+ <li><a href="#prerequisites">Prerequisites</a></li>
+ <li><a href="#recognize">Recognizing Images</a></li>
+ <li><a href="#track">Tracking Images</a></li>
+ </ul>
+ <p class="toc-title">Related Info</p>
+ <ul class="toc">
+ <li><a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1ImageRecognizer.html">Tizen.Multimedia.ImageRecognizer Class</a></li>
+ <li><a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1ImageTracker.html">Tizen.Multimedia.ImageTracker Class</a></li>
+ </ul>
+ </div></div>
+</div>
+
+<div id="container"><div id="contents"><div class="content">
+
+<h1>Image Recognition and Tracking</h1>
+
+<p>You can extract features of an image object and recognize it from specific images. You can also track the image object in your application.</p>
+
+<p>The main image recognition and tracking features include:</p>
+
+<ul>
+ <li>Recognizing images
+ <p>You can <a href="#recognize">recognize image objects</a> in specific images, and extract image object features.</p>
+ </li>
+ <li>Tracking images
+ <p>You can <a href="#track">track image objects</a> using the camera preview images and a specific image tracking model.</p>
+ </li>
+</ul>
+
+<h2 id="prerequisites">Prerequisites</h2>
+
+<p>To enable your application to use the image recognition and tracking functionality:</p>
+ <ol>
+ <li>Install the Nuget packages for Media Vision and Camera.</li>
+ <li>To use the methods and properties of the image recognition and tracking classes and to handle camera preview, include the <a href="https://developer.tizen.org/dev-guide/csapi/namespaceTizen_1_1Multimedia.html">Tizen.Multimedia</a> namespace in your application:
+<pre class="prettyprint">
+using Tizen.Multimedia;
+</pre>
+ </li>
+ <li>Define the configuration settings:
+ <ul>
+ <li>For configuring image object and feature extraction, create an instance of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1ImageFillConfiguration.html">Tizen.Multimedia.ImageFillConfiguration</a> class and set its attributes accordingly:
+<pre class="prettyprint">
+static ImageFillConfiguration configFill = new ImageFillConfiguration();
+
+/// Set the scale factor of the image being recognized
+configFill.ObjectScaleFactor = 1.2;
+
+/// Set the maximum amount of image key points to be detected
+configFill.ObjectMaxKeyPoints = 1000;
+</pre>
+ </li>
+ <li>For image recognition, create an instance of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1ImageRecognitionConfiguration.html">Tizen.Multimedia.ImageRecognitionConfiguration</a> class and set its attributes accordingly:
+<pre class="prettyprint">
+static ImageRecognitionConfiguration configRecog = new ImageRecognitionConfiguration();
+
+/// Set the scene scale factor
+configRecog.SceneScaleFactor = 1.2;
+
+/// Set the maximum amount of key points to be detected in a scene
+configRecog.SceneMaxKeyPoints = 3000;
+</pre>
+ </li>
+ <li>For image tracking, create an instance of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1ImageTrackingConfiguration.html">Tizen.Multimedia.ImageTrackingConfiguration</a> class and set its attributes accordingly:
+<pre class="prettyprint">
+static ImageTrackingConfiguration configTrack = new ImageTrackingConfiguration();
+
+/// Set the history amount
+configTrack.HistroyAmount = 5;
+
+/// Set the expected offset
+configTrack.ExpectedOffset = 0.5;
+</pre>
+ </li>
+ </ul>
+ </li>
+ </ol>
+
+<h2 id="recognize">Recognizing Images</h2>
+
+<p>To recognize an image (the target) in another (the scene):</p>
+
+<ol>
+ <li>To prepare the target image being recognized, create an instance of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1MediaVisionSource.html">Tizen.Multimedia.MediaVisionSource</a> class with raw image buffer data and its corresponding width, height, and color space parameters:
+<pre class="prettyprint">
+/// Assume that there is a decoded raw data buffer of the byte[] type, and
+/// it has 640x480 resolution with an RGB888 color space
+
+MediaVisionSource sourceTarget = new MediaVisionSource(bytes, width, height, ColorSpace.Rgb888);
+</pre>
+ </li>
+ <li>Create an instance of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1ImageObject.html">Tizen.Multimedia.ImageObject</a> class and use its <code>Fill()</code> method to fill it with the <code>Tizen.Multimedia.MediaVisionSource</code> instance:
+<pre class="prettyprint">
+static ImageObject obj = new ImageObject();
+
+obj.Fill(sourceTarget);
+
+/// If you want to apply configuration options to the fill operation:
+/// obj.Fill(sourceTarget, configFill);
+
+/// If you want a specific label for the ImageObject instance, set it manually
+/// Otherwise the label automatically increments with each fill operation
+obj.setLabel(1);
+</pre>
+ </li>
+ <li>To prepare the scene where the target image is to be recognized, create a <code>Tizen.Multimedia.MediaVisionSource</code> instance which stores the scene:
+<pre class="prettyprint">
+/// Assume that there is a decoded raw data buffer of the byte[] type, and
+/// it has 640x480 resolution with an RGB888 color space
+
+MediaVisionSource sourceScene = new MediaVisionSource(bytes, width, height, ColorSpace.Rgb888);
+</pre>
+ </li>
+ <li>To recognize the target inside the scene, use the <code>RecognizeAsync()</code> method of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1ImageRecognizer.html">Tizen.Multimedia.ImageRecognizer</a> class:
+<pre class="prettyprint">
+/// You can recognize multiple targets
+ImageObject[] targets = new ImageObject[1] (obj);
+
+var results = await ImageRecognizer.RecognizeAsync(sourceScene, targets);
+
+foreach (ImageRecognitionResult imageResult in results)
+{
+ if (imageResult.Success)
+ Log.info(LogUtils.TAG, imageResult, Region.ToString();
+ else
+ Log.info(LogUtils.Tag, "ImageRecognition: + imageResult.Success.ToString()");
+}
+</pre>
+ </li>
+</ol>
+
+<h2 id="track">Tracking Images</h2>
+
+<p>To track images:</p>
+
+<ol>
+ <li>To prepare the camera and create an image tracking model:
+ <ol type="a">
+ <li>Define a camera preview event handler for the <code>Preview</code> event of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1Camera.html">Tizen.Multimedia.Camera</a> class and create an instance of that class:
+<pre class="prettyprint">
+/// Define a camera preview event handler
+static void PreviewCallback(object sender, PreviewEventArgs e)
+{
+ PreviewData preview = e.Preview;
+
+ SinglePlane singlePlane = (SinglePlane)preview.Plane;
+ if (preview.Format == CameraPixelFormat.Rgb888)
+ {
+ MediaVisionSource source = new MediaVisionSource(singlePlane.Data, preview.width, preview.height, ColorSpace.Rgb888);
+ }
+}
+
+/// Create the Tizen.Multimedia.Camera instance
+static Camera camera = null;
+try
+{
+ camera = new Camera(CameraDevice.Rear);
+}
+catch (NotSupportedException)
+{
+ Log.Info("Image Tracking Sample", "NotSupported");
+}
+</pre>
+ </li>
+ <li>Set the camera display, register the camera preview event handler, and start the camera preview with the <code>StartPreview()</code> method:
+<pre class="prettyprint">
+/// Set the camera display
+camera.Display = new Display(new Window("Preview"));
+
+/// Register the camera preview event handler
+camera.Preview += PreviewCallback;
+
+IList previewFormats = camera.Feature.SupportedPreviewPixelFormats.ToList();
+foreach (CameraPixelFormat previewFormat in previewFormats)
+{
+ camera.Setting.PreviewPixelFormat = previewFormat;
+ break;
+}
+
+/// Start the camera preview
+camera.StartPreview();
+</pre>
+ </li>
+ <li>Create the image tracking model as an instance of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1ImageTrackingModel.html">Tizen.Multimedia.ImageTrackingModel</a> class:
+<pre class="prettyprint">
+static ImageTrackingModel model = new ImageTrackingModel();
+</pre>
+ </li>
+ </ol>
+ </li>
+ <li>Create a target image as an instance of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1MediaVisionSource.html">Tizen.Multimedia.MediaVisionSource</a> class.
+ <p>Create an instance of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1ImageObject.html">Tizen.Multimedia.ImageObject</a> class and use its <code>Fill()</code> method to fill it with the target image.</p>
+<pre class="prettyprint">
+static MediaVisionSource sourceTarget = new MediaVisionSource(bytes, width, height, ColorSpace.Rgb888);
+
+static ImageObject obj = new ImageObject();
+obj.Fill(sourceTarget);
+</pre>
+ </li>
+ <li>Set the target of the image tracking model with the <code>SetTarget()</code> method of the <code>Tizen.Multimedia.ImageTrackingModel</code> class, which takes the <code>Tizen.Multimedia.ImageObject</code> instance as its parameter:
+<pre class="prettyprint">
+model.SetTarget(obj)
+</pre>
+</li>
+
+<li>To track the target, use the <code>TrackAsync()</code> method of the <a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Multimedia_1_1ImageTracker.html">Tizen.Multimedia.ImageTracker</a> class:
+<pre class="prettyprint">
+/// Assume that "frames" contains a sequence of decoded images as
+/// Tizen.Multimedia.MediaVisionSource instances
+
+foreach (MediaVisionSource frame in frames)
+{
+ var result = await ImageTracker.TrackAsync(frame, model);
+
+ /// If you want to apply configuration options to the tracking operation:
+ /// var result = await ImageTracker.TrackAsync(frame, model, configTrack);
+
+ if (result == null)
+ {
+ continue;
+ }
+}
+</pre>
+</li>
+
+<li>
+<p>When image tracking is no longer needed, deregister the camera preview event handler, stop the camera preview, and destroy the camera instance:</p>
+<pre class="prettyprint">
+camera.Preview -= PreviewCallback;
+
+camera.StopPreview();
+camera.Dispose();
+</pre>
+</li>
+</ol>
+
+<script type="text/javascript" src="../../../scripts/jquery.zclip.min.js"></script>
+<script type="text/javascript" src="../../../scripts/showhide.js"></script>
+</div></div></div>
+
+<a class="top sms" href="#"><img src="../../../images/btn_top.gif" alt="Go to top" /></a>
+
+<div id="footer">
+<p class="footer">Except as noted, this content - excluding the Code Examples - is licensed under <a href="http://creativecommons.org/licenses/by/3.0/legalcode" target="_blank">Creative Commons Attribution 3.0</a> and all of the Code Examples contained herein are licensed under <a href="https://www.tizen.org/bsd-3-clause-license" target="_blank">BSD-3-Clause</a>.<br/>For details, see the <a href="https://www.tizen.org/content-license" target="_blank">Content License</a>.</p>
+</div>
+
+<script type="text/javascript">
+var _gaq = _gaq || [];
+_gaq.push(['_setAccount', 'UA-25976949-1']);
+_gaq.push(['_trackPageview']);
+(function() {
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
+</script>
+
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+ <meta http-equiv="X-UA-Compatible" content="IE=9" />
+ <link rel="stylesheet" type="text/css" href="../../../css/styles.css" />
+ <link rel="stylesheet" type="text/css" href="../../../css/snippet.css" />
+ <script type="text/javascript" src="../../../scripts/snippet.js"></script>
+ <script type="text/javascript" src="../../../scripts/jquery.util.js" charset="utf-8"></script>
+ <script type="text/javascript" src="../../../scripts/common.js" charset="utf-8"></script>
+ <script type="text/javascript" src="../../../scripts/core.js" charset="utf-8"></script>
+ <script type="text/javascript" src="../../../scripts/search.js" charset="utf-8"></script>
+
+ <title>Visual Detection and Recognition</title>
+</head>
+
+<body onload="prettyPrint()" style="overflow: auto;">
+
+<div id="toc-navigation">
+ <div id="toc_border"><div id="toc">
+ <p class="toc-title">Dependencies</p>
+ <ul class="toc">
+ <li>Tizen 4.0 and Higher</li>
+ </ul>
+ </div></div>
+</div>
+
+<div id="container"><div id="contents"><div class="content">
+<h1>Visual Detection and Recognition</h1>
+
+<p>You can perform various visual detection and recognition tasks in your application. You can detect or generate barcodes. In addition, you can track how faces or image objects move as well as detect and recognize faces or objects.</p>
+
+<p>You can use the following visual detection and recognition features in your .NET applications:</p>
+
+<ul>
+<li><a href="image_barcode_cs.htm">Barcode Detection and Generation</a>
+
+<p>You can handle images containing barcodes. You can encrypt a message by generating a barcode from it, and you can also detect barcodes in an image or from a camera preview stream.</p></li>
+
+<li><a href="face_detection_cs.htm">Face Detection, Recognition, and Tracking</a>
+
+<p>You can detect a face from an image, and recognize a face with a set of examples. You can also track a face within the camera preview stream.</p></li>
+
+<li><a href="image_recognition_cs.htm">Image Recognition and Tracking</a>
+
+<p>You can extract features of an image object and recognize it from specific images. You can also track the image object within the camera preview stream.</p></li>
+</ul>
+
+<script type="text/javascript" src="../../../scripts/jquery.zclip.min.js"></script>
+<script type="text/javascript" src="../../../scripts/showhide.js"></script>
+</div></div></div>
+
+<a class="top sms" href="#"><img src="../../../images/btn_top.gif" alt="Go to top" /></a>
+
+<div id="footer">
+<p class="footer">Except as noted, this content - excluding the Code Examples - is licensed under <a href="http://creativecommons.org/licenses/by/3.0/legalcode" target="_blank">Creative Commons Attribution 3.0</a> and all of the Code Examples contained herein are licensed under <a href="https://www.tizen.org/bsd-3-clause-license" target="_blank">BSD-3-Clause</a>.<br/>For details, see the <a href="https://www.tizen.org/content-license" target="_blank">Content License</a>.</p>
+</div>
+
+<script type="text/javascript">
+var _gaq = _gaq || [];
+_gaq.push(['_setAccount', 'UA-25976949-1']);
+_gaq.push(['_trackPageview']);
+(function() {
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
+</script>
+
+</body>
+</html>
+