{"id":273531,"date":"2016-02-03T18:43:02","date_gmt":"2016-02-03T15:43:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=273531"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=273531","title":{"rendered":"\u0420\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0435\u043c \u044d\u043c\u043e\u0446\u0438\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 UWP \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e API Project Oxford"},"content":{"rendered":"<p>       <a href=\"http:\/\/habrahabr.ru\/post\/276411\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/cb6\/d65\/93e\/cb6d6593e4624cef964576c91d0de556.PNG\" \/><\/div>\n<p><\/a><\/p>\n<p>  \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0432\u044b \u0441\u043b\u044b\u0448\u0430\u043b\u0438 \u0445\u043e\u0442\u044c \u0440\u0430\u0437 \u043f\u0440\u043e \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u043e\u0442 Microsoft, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u043f\u043e \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438 \u044d\u043c\u043e\u0446\u0438\u0438 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430.<\/p>\n<p>  \u0421\u0435\u0440\u0432\u0438\u0441 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u044d\u043c\u043e\u0446\u0438\u0439 \u043d\u0430\u0440\u044f\u0434\u0443 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c\u0438 \u0438 \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u043c\u0430\u043b\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c\u0438 \u0448\u0438\u0440\u043e\u043a\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u043b\u0438\u0446, \u0440\u0435\u0447\u0438 \u0438 \u0442\u0435\u043a\u0441\u0442\u0430 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <a href=\"https:\/\/www.projectoxford.ai\/\">Oxford<\/a>.<\/p>\n<p>  \u041f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0442\u044c \u044d\u043c\u043e\u0446\u0438\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0441\u044b\u043b\u043a\u0435: <a href=\"https:\/\/www.projectoxford.ai\/demo\/emotion\">Emotion Recognition<\/a><br \/>  \u0414\u043e\u0441\u0442\u0443\u043f\u043d\u043e 8 \u044d\u043c\u043e\u0446\u0438\u0439: \u0421\u0447\u0430\u0441\u0442\u044c\u0435, \u0413\u0440\u0443\u0441\u0442\u044c, \u0421\u0442\u0440\u0430\u0445, \u041d\u0435\u0439\u0442\u0440\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0413\u043d\u0435\u0432, \u041e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435, \u041f\u0440\u0435\u0437\u0440\u0435\u043d\u0438\u0435, \u0423\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u0435.<\/p>\n<p>  \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c C#\/XAML \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 Windows 10, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c API \u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u044d\u043c\u043e\u0446\u0438\u0438 \u043f\u043e \u0441\u043d\u0438\u043c\u043a\u0443 \u0441 \u043a\u0430\u043c\u0435\u0440\u044b. <br \/>  <a name=\"habracut\"><\/a><br \/>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c SDK \u0441 <a href=\"https:\/\/www.projectoxford.ai\/SDK\">\u0441\u0430\u0439\u0442\u0430<\/a>.<br \/>  \u041d\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u043f\u0430\u043f\u043a\u0435 Emotion \u043f\u0440\u043e\u0435\u043a\u0442 ClientLibrary. <br \/>  \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0438 \u0441\u0442\u0440\u043e\u0438\u043c. \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u0441\u044b\u043b\u043a\u0438. \u0415\u0441\u043b\u0438 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0435 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438\u0441\u044c \u0438 \u0432\u043e\u0437\u043d\u0438\u043a \u0437\u0430\u043f\u0440\u043e\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u044e\u0449\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0438\u0437 NuGet, \u0442\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0432\u0440\u0443\u0447\u043d\u0443\u044e. \u0417\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Windows. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 ClientLibrary \u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0433\u043e UWP \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043d\u0435\u0433\u043e (\u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 Microsoft.ProjectOxford.Emotion). \u0421\u0442\u0440\u043e\u0438\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043b\u044e\u0447 \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u0430. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0443\u044e \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0443 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u00abEmotion API \u2013 Free\u00bb, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u043c\u0435\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f: 20 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0439 \u0432 \u043c\u0438\u043d\u0443\u0442\u0443 \u0438 10000 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0439 \u0432 \u043c\u0435\u0441\u044f\u0446. <\/p>\n<p>  \u0417\u0430\u0445\u043e\u0434\u0438\u043c \u043d\u0430 \u0441\u0430\u0439\u0442 <a href=\"https:\/\/www.projectoxford.ai\">\u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a>, \u0432\u0445\u043e\u0434\u0438\u043c \u0441 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u043e\u043c Microsoft, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 <a href=\"https:\/\/www.projectoxford.ai\/emotion\">Emotion APIs<\/a> \u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u00abTry for free\u00bb, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043f\u043e\u0434\u043f\u0438\u0441\u043e\u043a. \u0417\u0434\u0435\u0441\u044c \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u00abRequest New Keys\u00bb \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0443 \u00abEmotion API \u2013 Free\u00bb. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c Primary Key. \u0411\u0435\u0437 \u043d\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c64\/bd9\/529\/c64bd952944e43f6b6a1e59c2739229c.PNG\"\/><\/p>\n<p>  \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 UWP \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438: \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442 (\u043a\u043b\u0438\u0435\u043d\u0442 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440), \u0412\u0435\u0431-\u043a\u0430\u043c\u0435\u0440\u0430. \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u043a\u0430\u043a \u0432 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435, \u0442\u0430\u043a \u0438 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0434, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0442\u044d\u0433\u0438:<\/p>\n<pre><code class=\"xml\">  &lt;Capabilities&gt;     &lt;Capability Name=&quot;internetClientServer&quot; \/&gt;     &lt;DeviceCapability Name=&quot;webcam&quot; \/&gt;   &lt;\/Capabilities&gt; <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c XAML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u0432 MainPage:<\/p>\n<pre><code class=\"xml\">    &lt;ScrollViewer&gt;         &lt;StackPanel Orientation=&quot;Vertical&quot; HorizontalAlignment=&quot;Center&quot;&gt;                          &lt;StackPanel Orientation=&quot;Horizontal&quot; HorizontalAlignment=&quot;Center&quot; Margin=&quot;0,10,0,10&quot;&gt;             &lt;Button x:Name=&quot;btnStartPreview&quot; Background=&quot;Gray&quot;                                             Click=&quot;btnStartPreview_Click&quot; Margin=&quot;0,0,0,0&quot; Content=&quot;Start preview&quot;\/&gt;             &lt;Button x:Name=&quot;btnTakePhoto&quot; Background=&quot;Gray&quot;                                            Click=&quot;btnTakePhoto_Click&quot; Margin=&quot;10,0,0,0&quot; Content=&quot;Take a photo&quot;\/&gt;             &lt;ProgressRing x:Name=&quot;progring&quot; IsActive=&quot;False&quot; Width=&quot;25&quot; Height=&quot;25&quot; Margin=&quot;10,0,0,0&quot; \/&gt;         &lt;\/StackPanel&gt;         &lt;Grid&gt;           &lt;Image x:Name=&quot;captureImage&quot; Width=&quot;400&quot; Height=&quot;400&quot; Visibility=&quot;Visible&quot;\/&gt;           &lt;CaptureElement x:Name=&quot;previewElement&quot; Width=&quot;400&quot; Height=&quot;400&quot; Visibility=&quot;Visible&quot;\/&gt;         &lt;\/Grid&gt;          &lt;\/StackPanel&gt;     &lt;\/ScrollViewer&gt; <\/code><\/pre>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u043d\u0435 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0443\u043c\u0435\u0441\u0442\u0438\u0442\u0441\u044f \u0432\u0441\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0442\u043e \u044f \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043b \u0435\u0433\u043e \u0432 ScrollViewer, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u044e\u0442 2 \u043a\u043d\u043e\u043f\u043a\u0438 \u0438 Grid, \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u044b \u0434\u0440\u0443\u0433 \u043d\u0430 \u0434\u0440\u0443\u0433\u0430 2 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u2013 Image \u0438 CaptureElement. \u0422\u043e \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u0438\u0434\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0438\u0445. \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e, \u0447\u0442\u043e \u0438\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442 ProgressRing.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043a\u043e\u0434\u0443 C#. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043d\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u043d \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u0438\u0445:<\/p>\n<pre><code class=\"cs\">using System.Threading.Tasks; using Windows.Media.Capture; using Windows.UI.Xaml.Media.Imaging; using Windows.Media.MediaProperties; using Windows.Storage.Streams;  using Microsoft.ProjectOxford.Emotion; using Microsoft.ProjectOxford.Emotion.Contract; <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u043b\u0430\u0441\u0441\u0430:<\/p>\n<pre><code class=\"cs\">        MediaCapture mediaCapture;         bool isPreviewing = false;         Emotion[] emotionResult;         public System.Collections.ObjectModel.ObservableCollection&lt;Emotion&gt; emo =                                             new System.Collections.ObjectModel.ObservableCollection&lt;Emotion&gt;(); <\/code><\/pre>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 mediaCapture \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u043d\u0438\u043c\u0430\u0442\u044c \u0432\u0438\u0434\u0435\u043e \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c preview. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f isPreviewing \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430. \u041c\u0430\u0441\u0441\u0438\u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u0430 Emotion \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u0430. \u041f\u043e\u0442\u043e\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u044d\u0442\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 ObservableCollection. ObservableCollection \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. \u041f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043a \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435, \u0447\u0435\u043c \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c \u043a \u043c\u0430\u0441\u0441\u0438\u0432\u0443.<\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 XAML \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 Loaded \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 async (\u0442\u0430\u043a \u043a\u0430\u043a \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 mediaCapture \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e):<\/p>\n<pre><code class=\"cs\">        private async void Page_Loaded(object sender, RoutedEventArgs e)         {             MediaCaptureInitializationSettings set = new MediaCaptureInitializationSettings();             set.StreamingCaptureMode = StreamingCaptureMode.Video;             mediaCapture = new MediaCapture();             await mediaCapture.InitializeAsync(set);         } <\/code><\/pre>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u043b\u0438 \u0432 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u043d\u0430, \u0442\u043e \u0440\u0435\u0436\u0438\u043c\u043e\u043c \u0437\u0430\u0445\u0432\u0430\u0442\u0430 mediaCapture \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0445\u0432\u0430\u0442 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 StreamingCaptureMode.Video.<\/p>\n<p>  \u0412 \u043a\u043e\u0434\u0435 XAML \u0443 \u043d\u0430\u0441 2 \u043a\u043d\u043e\u043f\u043a\u0438. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043a\u043b\u0438\u043a\u0430 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043d\u0438\u0445:<\/p>\n<pre><code class=\"cs\">        private async void btnStartPreview_Click(object sender, RoutedEventArgs e)         {             if (isPreviewing == false)             {                 previewElement.Source = mediaCapture;                 await mediaCapture.StartPreviewAsync();                 isPreviewing = true;             }             previewElement.Visibility = Visibility.Visible;         } <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0432\u0441\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u2013 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0441 \u043a\u0430\u043c\u0435\u0440\u044b \u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435 previewElement. \u041e\u043f\u044f\u0442\u044c \u0436\u0435, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c async \u043a \u0441\u043e\u0431\u044b\u0442\u0438\u044e, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e. \u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043d\u0430 \u0432\u0442\u043e\u0440\u0443\u044e \u043a\u043d\u043e\u043f\u043a\u0443, \u0445\u043e\u0447\u0443 \u043d\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 emo. \u042d\u0442\u0443 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u043c\u044b \u043f\u0440\u0438\u0432\u044f\u0436\u0435\u043c \u043a \u043d\u0430\u0448\u0435\u043c\u0443 XAML \u0432 \u0442\u0430\u043a\u043e\u0439 \u0432\u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0435:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0414\u043b\u0438\u043d\u043d\u044b\u0439 \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b\u0439 XAML \u043a\u043e\u0434 \u0441 \u0431\u0438\u043d\u0434\u0438\u043d\u0433\u0430\u043c\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">                &lt;Grid HorizontalAlignment=&quot;Center&quot;&gt;                 &lt;Grid.RowDefinitions&gt;                     &lt;RowDefinition \/&gt;                     &lt;RowDefinition \/&gt;                     &lt;RowDefinition \/&gt;                     &lt;RowDefinition \/&gt;                     &lt;RowDefinition \/&gt;                     &lt;RowDefinition \/&gt;                     &lt;RowDefinition \/&gt;                     &lt;RowDefinition \/&gt;                 &lt;\/Grid.RowDefinitions&gt;                 &lt;Grid.ColumnDefinitions&gt;                     &lt;ColumnDefinition \/&gt;                     &lt;ColumnDefinition \/&gt;                 &lt;\/Grid.ColumnDefinitions&gt;                  &lt;TextBlock Grid.Row=&quot;0&quot; Grid.Column=&quot;0&quot; Foreground=&quot;Black&quot; FontSize=&quot;14&quot; TextAlignment=&quot;Right&quot;                             Margin=&quot;0,0,5,0&quot;&gt;Happiness&lt;\/TextBlock&gt;                 &lt;ProgressBar Grid.Row=&quot;0&quot; Grid.Column=&quot;1&quot; IsIndeterminate=&quot;False&quot; Width=&quot;200&quot; Maximum=&quot;1&quot;                               SmallChange=&quot;0.0001&quot; LargeChange=&quot;0.1&quot; Value=&quot;{Binding Scores.Happiness, Mode=OneWay}&quot;  \/&gt;                  &lt;TextBlock Grid.Row=&quot;1&quot; Grid.Column=&quot;0&quot; Foreground=&quot;Black&quot; FontSize=&quot;14&quot; TextAlignment=&quot;Right&quot;                             Margin=&quot;0,0,5,0&quot;&gt;Anger&lt;\/TextBlock&gt;                 &lt;ProgressBar Grid.Row=&quot;1&quot; Grid.Column=&quot;1&quot; IsIndeterminate=&quot;False&quot; Width=&quot;200&quot; Maximum=&quot;1&quot;                               SmallChange=&quot;0.0001&quot; LargeChange=&quot;0.1&quot; Value=&quot;{Binding Scores.Anger, Mode=OneWay}&quot;  \/&gt;                  &lt;TextBlock Grid.Row=&quot;2&quot; Grid.Column=&quot;0&quot; Foreground=&quot;Black&quot; FontSize=&quot;14&quot; TextAlignment=&quot;Right&quot;                             Margin=&quot;0,0,5,0&quot;&gt;Contempt&lt;\/TextBlock&gt;                 &lt;ProgressBar Grid.Row=&quot;2&quot; Grid.Column=&quot;1&quot; IsIndeterminate=&quot;False&quot; Width=&quot;200&quot; Maximum=&quot;1&quot;                               SmallChange=&quot;0.0001&quot; LargeChange=&quot;0.1&quot; Value=&quot;{Binding Scores.Contempt, Mode=OneWay}&quot;  \/&gt;                  &lt;TextBlock Grid.Row=&quot;3&quot; Grid.Column=&quot;0&quot; Foreground=&quot;Black&quot; FontSize=&quot;14&quot; TextAlignment=&quot;Right&quot;                             Margin=&quot;0,0,5,0&quot;&gt;Disgust&lt;\/TextBlock&gt;                 &lt;ProgressBar Grid.Row=&quot;3&quot; Grid.Column=&quot;1&quot; IsIndeterminate=&quot;False&quot; Width=&quot;200&quot; Maximum=&quot;1&quot;                               SmallChange=&quot;0.0001&quot; LargeChange=&quot;0.1&quot; Value=&quot;{Binding Scores.Disgust, Mode=OneWay}&quot;  \/&gt;                  &lt;TextBlock Grid.Row=&quot;4&quot; Grid.Column=&quot;0&quot; Foreground=&quot;Black&quot; FontSize=&quot;14&quot; TextAlignment=&quot;Right&quot;                             Margin=&quot;0,0,5,0&quot;&gt;Fear&lt;\/TextBlock&gt;                 &lt;ProgressBar Grid.Row=&quot;4&quot; Grid.Column=&quot;1&quot; IsIndeterminate=&quot;False&quot; Width=&quot;200&quot; Maximum=&quot;1&quot;                               SmallChange=&quot;0.0001&quot; LargeChange=&quot;0.1&quot; Value=&quot;{Binding Scores.Fear, Mode=OneWay}&quot;  \/&gt;                  &lt;TextBlock Grid.Row=&quot;5&quot; Grid.Column=&quot;0&quot; Foreground=&quot;Black&quot; FontSize=&quot;14&quot; TextAlignment=&quot;Right&quot;                             Margin=&quot;0,0,5,0&quot;&gt;Neutral&lt;\/TextBlock&gt;                 &lt;ProgressBar Grid.Row=&quot;5&quot; Grid.Column=&quot;1&quot; IsIndeterminate=&quot;False&quot; Width=&quot;200&quot; Maximum=&quot;1&quot;                               SmallChange=&quot;0.0001&quot; LargeChange=&quot;0.1&quot; Value=&quot;{Binding Scores.Neutral, Mode=OneWay}&quot;  \/&gt;                  &lt;TextBlock Grid.Row=&quot;6&quot; Grid.Column=&quot;0&quot; Foreground=&quot;Black&quot; FontSize=&quot;14&quot; TextAlignment=&quot;Right&quot;                             Margin=&quot;0,0,5,0&quot;&gt;Sadness&lt;\/TextBlock&gt;                 &lt;ProgressBar Grid.Row=&quot;6&quot; Grid.Column=&quot;1&quot; IsIndeterminate=&quot;False&quot; Width=&quot;200&quot; Maximum=&quot;1&quot;                               SmallChange=&quot;0.0001&quot; LargeChange=&quot;0.1&quot; Value=&quot;{Binding Scores.Sadness, Mode=OneWay}&quot;  \/&gt;                  &lt;TextBlock Grid.Row=&quot;7&quot; Grid.Column=&quot;0&quot; Foreground=&quot;Black&quot; FontSize=&quot;14&quot; TextAlignment=&quot;Right&quot;                             Margin=&quot;0,0,5,0&quot;&gt;Surprise&lt;\/TextBlock&gt;                 &lt;ProgressBar Grid.Row=&quot;7&quot; Grid.Column=&quot;1&quot; IsIndeterminate=&quot;False&quot; Width=&quot;200&quot; Maximum=&quot;1&quot;                               SmallChange=&quot;0.0001&quot; LargeChange=&quot;0.1&quot; Value=&quot;{Binding Scores.Surprise, Mode=OneWay}&quot;  \/&gt;              &lt;\/Grid&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  8 \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b\u0445 \u043f\u0430\u0440 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 Grid-\u0430. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f ProgressBar-\u043e\u0432 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e {Binding Scores.Surprise} \u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 emo.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043f\u043e \u0448\u0430\u0433\u0430\u043c \u043a\u043e\u0434 \u0441\u043e\u0431\u044b\u0442\u0438\u044f btnTakePhoto_Click<br \/>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0438 \u0438 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0441 \u043f\u043e\u0442\u043e\u043a\u0430 \u043a\u0430\u043c\u0435\u0440\u044b, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0438 \u0441\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u0435\u0434\u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0432\u0438\u0434\u0435\u043e. \u0412 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e st \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043e\u0442\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441\u0443 \u043d\u0430 \u0430\u043d\u0430\u043b\u0438\u0437:<\/p>\n<pre><code class=\"cs\">            btnTakePhoto.IsEnabled = false;             btnStartPreview.IsEnabled = false;              InMemoryRandomAccessStream stream = new InMemoryRandomAccessStream();             await mediaCapture.CapturePhotoToStreamAsync(ImageEncodingProperties.CreateJpeg(), stream);              stream.Seek(0); \/\/ \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u043f\u043e\u0442\u043e\u043a\u0430 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0432 0             BitmapImage bitmap = new BitmapImage();             bitmap.SetSource(stream);             captureImage.Source = bitmap;              stream.Seek(0); \/\/ \u0435\u0449\u0435 \u0440\u0430\u0437 \u043f\u0435\u0440\u0435\u0433\u043e\u043d\u044f\u0435\u043c \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u043f\u043e\u0442\u043e\u043a\u0430 \u0432 0             Stream st = stream.AsStream(); \/\/ \u0438\u0437 InMemoryRandomAccessStream \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c System.IO.Stream              if (isPreviewing == true) await mediaCapture.StopPreviewAsync();             isPreviewing = false;            previewElement.Visibility = Visibility.Collapsed; <\/code><\/pre>\n<p>  \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u0442\u043e\u043a \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 (\u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e, \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f):<\/p>\n<pre><code class=\"cs\">             progring.IsActive = true;  await Task.Run(async () =&gt;             {                 try                 {                     EmotionServiceClient emotionServiceClient =                              new EmotionServiceClient(&quot;12345678901234567890123456789012&quot;);                     emotionResult = await emotionServiceClient.RecognizeAsync(st);                 }                 catch { }             });             progring.IsActive = false; <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0432\u043c\u0435\u0441\u0442\u043e \u00ab12345678901234567890123456789012\u00bb \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u0432\u043e\u0439 \u043a\u043b\u044e\u0447, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0440\u0430\u043d\u0435\u0435 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435.<br \/>  \u0414\u0430\u043b\u0435\u0435 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 (\u0435\u0441\u043b\u0438 \u043e\u043d \u0435\u0441\u0442\u044c) \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e emo \u0438 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u043c \u043a\u043d\u043e\u043f\u043e\u0447\u043a\u0438:<\/p>\n<pre><code class=\"cs\">            if ((emotionResult != null) && (emotionResult.Length &gt; 0))             {                 emo.Clear();                 emo.Add(emotionResult[0]);                 this.DataContext = emo.ElementAt(0);             }             btnStartPreview.IsEnabled = true;            btnTakePhoto.IsEnabled = true; <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a DataContext \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 emo, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f ProgressBar-\u043e\u0432 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438. \u041a\u0441\u0442\u0430\u0442\u0438, \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0435\u0449\u0435 \u0440\u0430\u0437 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u041b\u0438\u0446 \u043d\u0430 \u0444\u043e\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 emotionResult[0] \u0442\u043e\u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e. \u041a\u0440\u043e\u043c\u0435 \u044d\u043c\u043e\u0446\u0438\u0439, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0445\u0441\u044f \u0432 Score, \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0435\u0449\u0435 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\/\u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043b\u0438\u0446 \u043a\u043b\u0430\u0441\u0441\u0430 Rectangle.<\/p>\n<p>  \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0433\u043e\u0442\u043e\u0432\u043e. \u041c\u043e\u0436\u043d\u043e <s>\u043f\u043e\u0434\u0430\u0432\u0430\u0442\u044c \u043a \u0441\u0442\u043e\u043b\u0443<\/s> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b, \u0441\u0442\u0438\u043b\u0438, \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0432\u043e\u0439 \u0432\u043a\u0443\u0441 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445.<br \/>  \u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 <a href=\"https:\/\/github.com\/programmersommer\/Project_Oxford_Emotions_UWP\">GitHub<\/a>.<\/p>\n<p>  \u042f \u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u0438 \u0432\u043e\u0442 \u0447\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/8d5\/1c9\/f2e\/8d51c9f2ec684e7da120afa69661e503.JPG\"\/><\/p>\n<p>  \u041a\u0441\u0442\u0430\u0442\u0438, \u0435\u0441\u0442\u044c \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0441\u043d\u0438\u043c\u043e\u043a \u0441 \u043a\u0430\u043c\u0435\u0440\u044b \u0432 \u0444\u0430\u0439\u043b \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cs\">\/\/ \u0432 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439             Windows.Storage.StorageFile photoFile = await Windows.Storage.KnownFolders.PicturesLibrary.CreateFileAsync(                      &quot;lastphoto.jpeg&quot;, Windows.Storage.CreationCollisionOption.ReplaceExisting);              await mediaCapture.CapturePhotoToStorageFileAsync(ImageEncodingProperties.CreateJpeg(), photoFile);              IRandomAccessStream photoStream = await photoFile.OpenReadAsync();             BitmapImage bitmap = new BitmapImage();             bitmap.SetSource(photoStream);             captureImage.Source = bitmap;              photoStream.Seek(0); \/\/ \u0435\u0449\u0435 \u0440\u0430\u0437 \u043f\u0435\u0440\u0435\u0433\u043e\u043d\u044f\u0435\u043c \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u043f\u043e\u0442\u043e\u043a\u0430 \u0432 0             Stream st = photoStream.AsStream(); \/\/ \u0438\u0437 IRandomAccessStream \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c System.IO.Stream <\/code><\/pre>\n<p>  \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b, \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435, \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u0441\u0435\u0440\u0432\u0438\u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u044d\u043c\u043e\u0446\u0438\u0439.<\/p>\n<p>  \u0421\u0435\u0440\u0432\u0438\u0441 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u0438 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u0447\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435. \u0414\u043b\u044f \u043b\u044e\u0434\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d \u0438\u043b\u0438 \u043f\u043b\u0430\u043d\u0448\u0435\u0442, \u0445\u043e\u0447\u0443 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043b\u0438\u0446\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043d\u0430 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438 \u0432 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u043d\u0438\u043c\u0435\u0442\u0435 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044e \u043f\u043e\u0434 \u0443\u0433\u043b\u043e\u043c 90 \u0433\u0440\u0430\u0434\u0443\u0441\u043e\u0432, \u0442\u043e \u0432\u0430\u0448\u0438 \u044d\u043c\u043e\u0446\u0438\u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d\u044b \u043d\u0435 \u0431\u0443\u0434\u0443\u0442.<\/p>\n<p>  \u041a\u0430\u043a\u0438\u0435 \u0438\u0434\u0435\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0443 \u043c\u0435\u043d\u044f \u0441\u0440\u0430\u0437\u0443 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0438? \u041c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0443 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f \u043f\u043e\u043a\u0443\u043f\u0430\u0442\u0435\u043b\u044f (\u0431\u043b\u044d\u043a\u0434\u0436\u0435\u043a\u043e\u043c?). \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0446\u0435\u043d\u043a\u0443 \u044d\u043c\u043e\u0446\u0438\u0439 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u044f (\u0437\u0430 \u0441\u0430\u043c\u044b\u0439 \u0441\u043c\u0435\u0448\u043d\u043e\u0439 \u0430\u043d\u0435\u043a\u0434\u043e\u0442, \u0437\u0430 \u0441\u0430\u043c\u0443\u044e \u043a\u0440\u0430\u0441\u0438\u0432\u0443\u044e \u0434\u0435\u0432\u0443\u0448\u043a\u0443 \u0438\u043b\u0438 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044e \u0438 \u0442.\u043f.). \u041a\u0430\u043a \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u2014 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0433\u0440\u0443 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u0443\u044e \u044d\u043c\u043e\u0446\u0438\u044e \u0438\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0440\u0435\u043d\u0430\u0436\u0435\u0440 \u0434\u043b\u044f \u0430\u0440\u0442\u0438\u0441\u0442\u043e\u0432. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u0430\u043c \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u043f\u0440\u0438\u0434\u0435\u0442 \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0437\u0430\u0431\u0430\u0432\u043d\u0430\u044f \u0438\u043b\u0438 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Oxford Emotions API.<\/p>\n<p>  \u0421\u0435\u0440\u0432\u0438\u0441 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0439 \u0438 \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434 UWP. \u0412 Microsoft Garage \u0434\u0430\u0436\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 Android \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <a href=\"https:\/\/www.microsoft.com\/en-us\/garage\/workbench-apps-details\/Mimicker-Alarm\/MimickerAlarm.aspx\">Mimicker Alarm<\/a>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442 \u0437\u0432\u043e\u043d\u043e\u043a \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u0432\u044b \u0438\u0437\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u044d\u043c\u043e\u0446\u0438\u044e.<br \/>  \u0425\u043e\u0442\u044f \u043c\u043d\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u043b\u043e\u0436\u043d\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0441\u0447\u0430\u0441\u0442\u044c\u0435 \u0432 6 \u0443\u0442\u0440\u0430.               <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/276411\/\"> https:\/\/habrahabr.ru\/post\/276411\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       <a href=\"http:\/\/habrahabr.ru\/post\/276411\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/cb6\/d65\/93e\/cb6d6593e4624cef964576c91d0de556.PNG\" \/><\/div>\n<p><\/a><\/p>\n<p>  \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0432\u044b \u0441\u043b\u044b\u0448\u0430\u043b\u0438 \u0445\u043e\u0442\u044c \u0440\u0430\u0437 \u043f\u0440\u043e \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u043e\u0442 Microsoft, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u043f\u043e \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438 \u044d\u043c\u043e\u0446\u0438\u0438 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430.<\/p>\n<p>  \u0421\u0435\u0440\u0432\u0438\u0441 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u044d\u043c\u043e\u0446\u0438\u0439 \u043d\u0430\u0440\u044f\u0434\u0443 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c\u0438 \u0438 \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u043c\u0430\u043b\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c\u0438 \u0448\u0438\u0440\u043e\u043a\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u043b\u0438\u0446, \u0440\u0435\u0447\u0438 \u0438 \u0442\u0435\u043a\u0441\u0442\u0430 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <a href=\"https:\/\/www.projectoxford.ai\/\">Oxford<\/a>.<\/p>\n<p>  \u041f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0442\u044c \u044d\u043c\u043e\u0446\u0438\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0441\u044b\u043b\u043a\u0435: <a href=\"https:\/\/www.projectoxford.ai\/demo\/emotion\">Emotion Recognition<\/a><br \/>  \u0414\u043e\u0441\u0442\u0443\u043f\u043d\u043e 8 \u044d\u043c\u043e\u0446\u0438\u0439: \u0421\u0447\u0430\u0441\u0442\u044c\u0435, \u0413\u0440\u0443\u0441\u0442\u044c, \u0421\u0442\u0440\u0430\u0445, \u041d\u0435\u0439\u0442\u0440\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0413\u043d\u0435\u0432, \u041e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435, \u041f\u0440\u0435\u0437\u0440\u0435\u043d\u0438\u0435, \u0423\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u0435.<\/p>\n<p>  \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c C#\/XAML \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 Windows 10, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c API \u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u044d\u043c\u043e\u0446\u0438\u0438 \u043f\u043e \u0441\u043d\u0438\u043c\u043a\u0443 \u0441 \u043a\u0430\u043c\u0435\u0440\u044b.   <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-273531","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/273531","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=273531"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/273531\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=273531"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=273531"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=273531"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}