<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic #include &amp;lt;Windows.h&amp;gt; in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Blob-Tracking-Issue/m-p/1065744#M56106</link>
    <description>&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;

&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;

&lt;DIV&gt;
	&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;David Lu (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

	&lt;P&gt;Have you looked at our sample code @C:\Program Files (x86)\Intel\RSSDK\sample\DF_BlobViewer? What the image did you get? Thanks!&lt;/P&gt;

	&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

	&lt;P&gt;Yes I have tried the sample for the BlobViewer and I got the image attached:&lt;span class="lia-inline-image-display-wrapper" image-alt="Captura de pantalla 2016-03-31 a las 11.03.11 a.m..png"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/8690i607BF7B998E30A14/image-size/large?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="Captura de pantalla 2016-03-31 a las 11.03.11 a.m..png" alt="Captura de pantalla 2016-03-31 a las 11.03.11 a.m..png" /&gt;&lt;/span&gt;&amp;nbsp;It works perfectly, I based my code on this and it didn't work. I talked to a colleague and he passed me his code to track the Blobs is using OpenCV to send out how many blobs it detects. I will include it so if anyone encounters the same problem as me. Also do you know how the BlobData is managed, in order to detect if a blob is in a particular area of the image?&lt;/P&gt;

	&lt;P&gt;Thank you so much!&lt;/P&gt;

	&lt;P&gt;Sofia G.&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;

&lt;PRE class="brush:cpp;"&gt;#include &amp;lt;Windows.h&amp;gt;
#include "pxcsensemanager.h"
#include "pxcblobmodule.h"
#include "util_cmdline.h"
#include "util_render.h"
#include &amp;lt;conio.h&amp;gt;
#include &amp;lt;inttypes.h&amp;gt;
#include &amp;lt;iostream&amp;gt;
#include &amp;lt;opencv2/opencv.hpp&amp;gt;

using namespace std;
using namespace cv;


int maxBlobToShow;

int main(int argc, char* argv[]) {
	wprintf_s(L"Prueba RealSense\n");
	pxcStatus sts;


	PXCSenseManager *psm = 0;
	psm = PXCSenseManager::CreateInstance();

	if (!psm) {
		wprintf_s(L"Unable to create the PXCSenseManager\n");
		return 1;
	}

	wprintf_s(L"Creando Session\n");

	//get capture manager instance if file record is set to true (m_brecord)

	PXCCaptureManager *captureManager = psm-&amp;gt;QueryCaptureManager();


	//BLOB DATA 
	sts = psm-&amp;gt;EnableBlob(0);
	if (sts &amp;lt; PXC_STATUS_NO_ERROR) {
		wprintf_s(L"Unable to enable Blob Analysis \n");
		return 2;
	}

	PXCBlobModule*blobAnalyzer = psm-&amp;gt;QueryBlob();
	if (!psm) {
		return 3;
	}


	PXCVideoModule::DataDesc streams = {};
	if (captureManager-&amp;gt;QueryCapture()) {
		captureManager-&amp;gt;QueryCapture()-&amp;gt;QueryDeviceInfo(0, &amp;amp;streams.deviceInfo);
	}
	else {
		streams.deviceInfo.streams = PXCCapture::STREAM_TYPE_COLOR | PXCCapture::STREAM_TYPE_DEPTH;
		streams.deviceInfo.streams = PXCCapture::STREAM_TYPE_DEPTH;
	}

	psm-&amp;gt;EnableStreams(&amp;amp;streams);

	//initialize pipeline
	sts = psm-&amp;gt;Init();

	if (sts &amp;lt; PXC_STATUS_NO_ERROR) {
		wprintf_s(L"Failed to locate any video stream(s)\n");
		psm-&amp;gt;Release();
		return sts;
	}
	PXCBlobData*outputBlob = blobAnalyzer-&amp;gt;CreateOutput();
	PXCBlobConfiguration*configblob = blobAnalyzer-&amp;gt;CreateActiveConfiguration();
	configblob-&amp;gt;SetMaxBlobs(pxcI32(4));
	configblob-&amp;gt;SetBlobSmoothing(pxcI32(0.4));
	configblob-&amp;gt;ApplyChanges();

	PXCBlobData::AccessOrderType accessOrder = PXCBlobData::ACCESS_ORDER_NEAR_TO_FAR;

	UtilRender renderc(L"Color");
	UtilRender renderd(L"Depth");


	wprintf_s(L"Streaming Data\n");
	wprintf_s(L"To quit press 'ESC' or 'Q'\n");
	//stream data
	bool keepRunning = true;
	while (keepRunning) {
		outputBlob-&amp;gt;Update();
		//wait until new frame is availaible and locks it
		sts = psm-&amp;gt;AcquireFrame(); // decia false

		if (sts &amp;lt; PXC_STATUS_NO_ERROR) {
			if (sts == PXC_STATUS_STREAM_CONFIG_CHANGED) {
				wprintf_s(L"Stream Config changed. Reinitializing\n");
				psm-&amp;gt;Close();
			}
			break;
		}
		//Render streams
		const PXCCapture::Sample *sample = psm-&amp;gt;QuerySample();
		if (sample) {
			if (sample-&amp;gt;depth &amp;amp;&amp;amp; !renderd.RenderFrame(sample-&amp;gt;depth)) break;
			if (sample-&amp;gt;color &amp;amp;&amp;amp; !renderc.RenderFrame(sample-&amp;gt;color)) break;
		}

		// BLOB------------------------------

		pxcI32 numOfBlobs = outputBlob-&amp;gt;QueryNumberOfBlobs();
		cout &amp;lt;&amp;lt; numOfBlobs &amp;lt;&amp;lt; endl;

		psm-&amp;gt;ReleaseFrame();
		
		//check for keystroke press
		if (_kbhit()) {
			int key = _getch() &amp;amp; 255;
			if (key == 27 || key == 'q' || key == 'Q') {
				break;
			}
		}

	} while (sts == PXC_STATUS_STREAM_CONFIG_CHANGED);

	wprintf_s(L"Exiting");

	psm-&amp;gt;Release();
	return 0;

}&lt;/PRE&gt;</description>
    <pubDate>Thu, 31 Mar 2016 19:01:28 GMT</pubDate>
    <dc:creator>Sofia_G_</dc:creator>
    <dc:date>2016-03-31T19:01:28Z</dc:date>
    <item>
      <title>Blob Tracking Issue</title>
      <link>https://community.intel.com/t5/Software-Archive/Blob-Tracking-Issue/m-p/1065742#M56104</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Hello,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;I'm trying out the blob tracking algorithm using the R200 RealSense, I followed the steps in the manual and looked at how the sample in the SDK uses the algorithm to get the blobs but I can't seem to get it right. I don't think I got my image right, does anyone have any suggestions? Or in that matter have an simple example using the blob tracking in c++ I could look at to get an idea of what I'm doing wrong. It's for a school project, I'm doing a system that could help the visually impaired detect objects with all Intel technology. Also I'm not a computer science mayor so sorry if my code is messy.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;

&lt;P&gt;Sofía G.&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#include &amp;lt;Windows.h&amp;gt;
#include &amp;lt;iostream&amp;gt;
#include &amp;lt;wchar.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;

#include "pxcsensemanager.h"
#include "pxccapture.h"
#include "pxcvideomodule.h"
#include "utilities/pxcmaskutils.h"
#include "pxcblobmodule.h"
#include "pxcblobconfiguration.h"
#include "pxcblobdata.h"

#include "pxcsession.h"
#include "pxccapture.h"
#include "util_cmdline.h"
#include "util_render.h"
#include &amp;lt;conio.h&amp;gt;


#define NFRAMES 500
int maxBlobToShow;

int wmain(int argc, WCHAR* argv[]) {
	wprintf_s(L"Hello, World!\n");

	PXCSenseManager *session = PXCSenseManager::CreateInstance();

	if (!session) {
		wprintf_s(L"Unable to create the PXCSenseManager\n");
		return 3;
	}

	wprintf_s(L"Creating Session\n");
	//get capture manager instance if file record is set to true (m_brecord)
	PXCCaptureManager *captureManager = session-&amp;gt;QueryCaptureManager();

	
	//BLOB DATA CODE &amp;amp; CONFIGURATION
	session-&amp;gt;EnableBlob(0);
	PXCBlobModule*blobModule = session-&amp;gt;QueryBlob();


	PXCBlobData*blobData=blobModule-&amp;gt;CreateOutput();
	maxBlobToShow = 4;
	int numOfBlobs = blobData-&amp;gt;QueryNumberOfBlobs();
	if (maxBlobToShow&amp;gt;numOfBlobs)
	{
		maxBlobToShow = numOfBlobs;
	}
	PXCBlobData::AccessOrderType accessOrder = PXCBlobData::ACCESS_ORDER_NEAR_TO_FAR;


	UtilRender renderc(L"Color");
	UtilRender renderd(L"Depth");

	pxcStatus status;

	PXCVideoModule::DataDesc streams = {};
	if (captureManager-&amp;gt;QueryCapture()) {
		captureManager-&amp;gt;QueryCapture()-&amp;gt;QueryDeviceInfo(0, &amp;amp;streams.deviceInfo);
	}
	else {
		streams.deviceInfo.streams = PXCCapture::STREAM_TYPE_COLOR | PXCCapture::STREAM_TYPE_DEPTH;
		streams.deviceInfo.streams = PXCCapture::STREAM_TYPE_DEPTH;
	}

	session-&amp;gt;EnableStreams(&amp;amp;streams);

	//initialize pipeline
	status = session-&amp;gt;Init();
	


	if (status &amp;lt; PXC_STATUS_NO_ERROR) {
		wprintf_s(L"Failed to locate any video stream(s)\n");
		session-&amp;gt;Release();
		return status;
	}


	wprintf_s(L"Streaming Data\n");
	//stream data

	for (int nframes = 0; nframes &amp;lt; NFRAMES; nframes++) {
		//wait until new frame is availaible and locks it
		status = session-&amp;gt;AcquireFrame(false);
		

		if (status &amp;lt; PXC_STATUS_NO_ERROR) {
			if (status == PXC_STATUS_STREAM_CONFIG_CHANGED) {
				wprintf_s(L"Stream Config changed. Reinitializing\n");
				session-&amp;gt;Close();
			}
			break;
		}
		wprintf_s(L"Rendering Streams\n");
		//Render streams
		const PXCCapture::Sample *sample = session-&amp;gt;QuerySample();
		if (sample) {
			if (sample-&amp;gt;depth &amp;amp;&amp;amp; !renderd.RenderFrame(sample-&amp;gt;depth)) break;
			if (sample-&amp;gt;color &amp;amp;&amp;amp; !renderc.RenderFrame(sample-&amp;gt;color)) break;
		}

		 // BLOB EXTRACTION TO IMAGE
		
		pxcI32 iBlobsNum = blobData-&amp;gt;QueryNumberOfBlobs();
		for (int i = 0; i &amp;lt; iBlobsNum; i++) {
			PXCBlobData::IBlob * pBlob = NULL;
			//blobData-&amp;gt;QueryBlob(); THIS LINE DOESN'T SEEM TO WORK, SHOULD I ADD THE PXCBLOBEXTRACTION??

			// handle extracted blob data
			pxcI32 nContours = pBlob-&amp;gt;QueryNumberOfContours();
		}
		

		// IMAGE PROCESSING USING PIXEL DATA IN THE IMAGE TO FIND OBJECTS AND LOCATE THEM EITHER IN THE RIGHT,CENTER, OR LEFT POSITION OF THE IMAGE. STILL IN DEVELOPMENT IF YOU HAVE ANY SUGGESTIONS I WOULD APPRECIATE THEM
		
		//release frame
		session-&amp;gt;ReleaseFrame();
		wprintf_s(L"To quit press e\n");
		//check for keystroke press
		if (_kbhit()) {
			int key = _getch() &amp;amp; 255;
			if (key == 27 || key == 'q' || key == 'Q') {
				break;
			}
		}
		if (nframes=499){
			nframes = 0;
		}
	} while (status == PXC_STATUS_STREAM_CONFIG_CHANGED);

	wprintf_s(L"Exiting");

	blobData-&amp;gt;Release();
	return 0;

	session-&amp;gt;Release();
	return 0;

	system("pause");
	return 0;
}
&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2016 03:55:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Blob-Tracking-Issue/m-p/1065742#M56104</guid>
      <dc:creator>Sofia_G_</dc:creator>
      <dc:date>2016-03-30T03:55:01Z</dc:date>
    </item>
    <item>
      <title>Have you looked at our sample</title>
      <link>https://community.intel.com/t5/Software-Archive/Blob-Tracking-Issue/m-p/1065743#M56105</link>
      <description>&lt;P&gt;Have you looked at our sample code @C:\Program Files (x86)\Intel\RSSDK\sample\DF_BlobViewer? What the image did you get? Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2016 20:48:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Blob-Tracking-Issue/m-p/1065743#M56105</guid>
      <dc:creator>Xusheng_L_Intel</dc:creator>
      <dc:date>2016-03-30T20:48:35Z</dc:date>
    </item>
    <item>
      <title>#include &lt;Windows.h&gt;</title>
      <link>https://community.intel.com/t5/Software-Archive/Blob-Tracking-Issue/m-p/1065744#M56106</link>
      <description>&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;

&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;

&lt;DIV&gt;
	&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;David Lu (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

	&lt;P&gt;Have you looked at our sample code @C:\Program Files (x86)\Intel\RSSDK\sample\DF_BlobViewer? What the image did you get? Thanks!&lt;/P&gt;

	&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

	&lt;P&gt;Yes I have tried the sample for the BlobViewer and I got the image attached:&lt;span class="lia-inline-image-display-wrapper" image-alt="Captura de pantalla 2016-03-31 a las 11.03.11 a.m..png"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/8690i607BF7B998E30A14/image-size/large?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="Captura de pantalla 2016-03-31 a las 11.03.11 a.m..png" alt="Captura de pantalla 2016-03-31 a las 11.03.11 a.m..png" /&gt;&lt;/span&gt;&amp;nbsp;It works perfectly, I based my code on this and it didn't work. I talked to a colleague and he passed me his code to track the Blobs is using OpenCV to send out how many blobs it detects. I will include it so if anyone encounters the same problem as me. Also do you know how the BlobData is managed, in order to detect if a blob is in a particular area of the image?&lt;/P&gt;

	&lt;P&gt;Thank you so much!&lt;/P&gt;

	&lt;P&gt;Sofia G.&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;

&lt;PRE class="brush:cpp;"&gt;#include &amp;lt;Windows.h&amp;gt;
#include "pxcsensemanager.h"
#include "pxcblobmodule.h"
#include "util_cmdline.h"
#include "util_render.h"
#include &amp;lt;conio.h&amp;gt;
#include &amp;lt;inttypes.h&amp;gt;
#include &amp;lt;iostream&amp;gt;
#include &amp;lt;opencv2/opencv.hpp&amp;gt;

using namespace std;
using namespace cv;


int maxBlobToShow;

int main(int argc, char* argv[]) {
	wprintf_s(L"Prueba RealSense\n");
	pxcStatus sts;


	PXCSenseManager *psm = 0;
	psm = PXCSenseManager::CreateInstance();

	if (!psm) {
		wprintf_s(L"Unable to create the PXCSenseManager\n");
		return 1;
	}

	wprintf_s(L"Creando Session\n");

	//get capture manager instance if file record is set to true (m_brecord)

	PXCCaptureManager *captureManager = psm-&amp;gt;QueryCaptureManager();


	//BLOB DATA 
	sts = psm-&amp;gt;EnableBlob(0);
	if (sts &amp;lt; PXC_STATUS_NO_ERROR) {
		wprintf_s(L"Unable to enable Blob Analysis \n");
		return 2;
	}

	PXCBlobModule*blobAnalyzer = psm-&amp;gt;QueryBlob();
	if (!psm) {
		return 3;
	}


	PXCVideoModule::DataDesc streams = {};
	if (captureManager-&amp;gt;QueryCapture()) {
		captureManager-&amp;gt;QueryCapture()-&amp;gt;QueryDeviceInfo(0, &amp;amp;streams.deviceInfo);
	}
	else {
		streams.deviceInfo.streams = PXCCapture::STREAM_TYPE_COLOR | PXCCapture::STREAM_TYPE_DEPTH;
		streams.deviceInfo.streams = PXCCapture::STREAM_TYPE_DEPTH;
	}

	psm-&amp;gt;EnableStreams(&amp;amp;streams);

	//initialize pipeline
	sts = psm-&amp;gt;Init();

	if (sts &amp;lt; PXC_STATUS_NO_ERROR) {
		wprintf_s(L"Failed to locate any video stream(s)\n");
		psm-&amp;gt;Release();
		return sts;
	}
	PXCBlobData*outputBlob = blobAnalyzer-&amp;gt;CreateOutput();
	PXCBlobConfiguration*configblob = blobAnalyzer-&amp;gt;CreateActiveConfiguration();
	configblob-&amp;gt;SetMaxBlobs(pxcI32(4));
	configblob-&amp;gt;SetBlobSmoothing(pxcI32(0.4));
	configblob-&amp;gt;ApplyChanges();

	PXCBlobData::AccessOrderType accessOrder = PXCBlobData::ACCESS_ORDER_NEAR_TO_FAR;

	UtilRender renderc(L"Color");
	UtilRender renderd(L"Depth");


	wprintf_s(L"Streaming Data\n");
	wprintf_s(L"To quit press 'ESC' or 'Q'\n");
	//stream data
	bool keepRunning = true;
	while (keepRunning) {
		outputBlob-&amp;gt;Update();
		//wait until new frame is availaible and locks it
		sts = psm-&amp;gt;AcquireFrame(); // decia false

		if (sts &amp;lt; PXC_STATUS_NO_ERROR) {
			if (sts == PXC_STATUS_STREAM_CONFIG_CHANGED) {
				wprintf_s(L"Stream Config changed. Reinitializing\n");
				psm-&amp;gt;Close();
			}
			break;
		}
		//Render streams
		const PXCCapture::Sample *sample = psm-&amp;gt;QuerySample();
		if (sample) {
			if (sample-&amp;gt;depth &amp;amp;&amp;amp; !renderd.RenderFrame(sample-&amp;gt;depth)) break;
			if (sample-&amp;gt;color &amp;amp;&amp;amp; !renderc.RenderFrame(sample-&amp;gt;color)) break;
		}

		// BLOB------------------------------

		pxcI32 numOfBlobs = outputBlob-&amp;gt;QueryNumberOfBlobs();
		cout &amp;lt;&amp;lt; numOfBlobs &amp;lt;&amp;lt; endl;

		psm-&amp;gt;ReleaseFrame();
		
		//check for keystroke press
		if (_kbhit()) {
			int key = _getch() &amp;amp; 255;
			if (key == 27 || key == 'q' || key == 'Q') {
				break;
			}
		}

	} while (sts == PXC_STATUS_STREAM_CONFIG_CHANGED);

	wprintf_s(L"Exiting");

	psm-&amp;gt;Release();
	return 0;

}&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 Mar 2016 19:01:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Blob-Tracking-Issue/m-p/1065744#M56106</guid>
      <dc:creator>Sofia_G_</dc:creator>
      <dc:date>2016-03-31T19:01:28Z</dc:date>
    </item>
  </channel>
</rss>

