<?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 Interpreting PXCPointF32 coordinates? R200 Person Tracking in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Interpreting-PXCPointF32-coordinates-R200-Person-Tracking/m-p/1109396#M71548</link>
    <description>&lt;P&gt;Hello everybody,&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;i have trouble interpreting the coordinates x, y from a PXCPointF32 Format. What does it mean? It ranges from.. 10^-18 to somewhat ..10^+38.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Here is a sample code showing what i currently do:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;int main() {
	
	PXCSenseManager *sm = PXCSenseManager::CreateInstance();
	sm-&amp;gt;EnableStream(PXCCapture::STREAM_TYPE_COLOR, 640, 480, 30);
	sm-&amp;gt;EnableStream(PXCCapture::STREAM_TYPE_DEPTH, 320, 240, 30,PXCCapture::Device::STREAM_OPTION_DEPTH_PRECALCULATE_UVMAP);
	
	pxcStatus sts = sm-&amp;gt;EnablePersonTracking();
	PXCPersonTrackingModule *ptm = sm-&amp;gt;QueryPersonTracking();
	PXCPersonTrackingConfiguration *ptc = ptm-&amp;gt;QueryConfiguration();
	ptc-&amp;gt;SetTrackedAngles(PXCPersonTrackingConfiguration::TRACKING_ANGLES_ALL);
	PXCPersonTrackingData *ptData;
	sm-&amp;gt;Init();

	
	namedWindow("rgb", 1);
	PXCCapture::Sample *sample;
	Mat rgb, depth;

	while (sm-&amp;gt;AcquireFrame(true) &amp;gt;= PXC_STATUS_NO_ERROR)
	{
		//acquire the sample from the camera
		sample = sm-&amp;gt;QuerySample();

		//if there is any color sample, convert it to cv::Mat
		if (sample-&amp;gt;color) {
			rgb = PXCImage2CVMat(sample-&amp;gt;color, PXCImage::PIXEL_FORMAT_RGB24);
		}

		ptData = ptm-&amp;gt;QueryOutput(); // get person tracking module output

		pxcI32 persons = ptData-&amp;gt;QueryNumberOfPeople();  // how many people are detected

		//iterate over each detected person
		for (pxcI32 i = 0; i &amp;lt; persons; ++i) {
			//get the person itself
			PXCPersonTrackingData::Person *person =  ptData-&amp;gt;QueryPersonData(PXCPersonTrackingData::AccessOrderType::ACCESS_ORDER_BY_ID, i);
			PXCPersonTrackingData::PersonTracking *pTrack = person-&amp;gt;QueryTracking(); 
			//get person bounding box
			PXCPersonTrackingData::BoundingBox2D personBox = pTrack-&amp;gt;Query2DBoundingBox();

			//not really needed, just to clarify
			int centerX = personBox.rect.x;
			int centerY = personBox.rect.y;
			int personWidth = personBox.rect.w;
			int personHeight = personBox.rect.h;
			//make opencv box 
			Rect box = Rect(centerX,centerY,personWidth,personHeight);
			//draw the box
			rectangle(rgb, box, Scalar(255, 0, 0), 3, 8, 0);
			//output to console
			//cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; to_string(centerX) &amp;lt;&amp;lt; "/" &amp;lt;&amp;lt; to_string(centerY) &amp;lt;&amp;lt; " " &amp;lt;&amp;lt; personWidth &amp;lt;&amp;lt; "x" &amp;lt;&amp;lt; personHeight;
			//put ID above the box
			putText(rgb, to_string(pTrack-&amp;gt;QueryId()), Point(centerX, centerY), FONT_HERSHEY_PLAIN, 2.0, Scalar(255, 255, 0));

			//now the joints, get them all from the currently selected(iterated) person
			PXCPersonTrackingData::PersonJoints *joints =  ptData-&amp;gt;QueryPersonData(PXCPersonTrackingData::AccessOrderType::ACCESS_ORDER_BY_ID, i)-&amp;gt;QuerySkeletonJoints();

			pxcI32 nJoints = joints-&amp;gt;QueryNumJoints(); 
&amp;nbsp;                        //This is from documentation example, but there is no JointPoint member of PXCPersonTrackingData
			//PXCPersonTrackingData::JointPoint *points = new PXCPersonTrackingData::JointPoint[njoints];
			PXCPersonTrackingData::PersonJoints::SkeletonPoint * points  = new PXCPersonTrackingData::PersonJoints::SkeletonPoint[nJoints];
			joints-&amp;gt;QueryJoints(points);
			cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; sizeof(joints) &amp;lt;&amp;lt; endl;
			for (int k = 0; k &amp;lt; sizeof(joints); ++k) {
				PXCPointF32 tmp =  points&lt;K&gt;.image;
				
				cout &amp;lt;&amp;lt; tmp.x &amp;lt;&amp;lt; " , " &amp;lt;&amp;lt; tmp.y &amp;lt;&amp;lt;endl;
				circle(rgb, Point(tmp.x, tmp.y), 5, Scalar(255, 125, 50), 3, 8, 0);
				string s = to_string(tmp.x*640) + "\n" + to_string(tmp.y*480);
				putText(rgb, s, Point(10, 400), FONT_HERSHEY_PLAIN, 1.0, Scalar(0, 255, 255), 4, 8, false);
			}
			
			delete[] points;
		}

		//cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; "detecting " &amp;lt;&amp;lt; persons &amp;lt;&amp;lt; " people" &amp;lt;&amp;lt; endl;
		imshow("rgb", rgb);
		char c = waitKey(20); 
		sm-&amp;gt;ReleaseFrame();
	}
	
	sm-&amp;gt;Release();

	cout &amp;lt;&amp;lt;endl &amp;lt;&amp;lt;"error level : " &amp;lt;&amp;lt;  sts &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; "should be : " &amp;lt;&amp;lt; PXC_STATUS_NO_ERROR &amp;lt;&amp;lt; endl;
	system("pause");
	return 0;
}&lt;/K&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;the problem is in line 67. I expected the X and Y coordinates to be integers in range from 0 ... 639 &amp;nbsp;* 0 ... 479 and not a floating point number.&lt;/P&gt;

&lt;P&gt;What am i doing wrong?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
    <pubDate>Wed, 24 Aug 2016 11:41:04 GMT</pubDate>
    <dc:creator>Johannes_V_</dc:creator>
    <dc:date>2016-08-24T11:41:04Z</dc:date>
    <item>
      <title>Interpreting PXCPointF32 coordinates? R200 Person Tracking</title>
      <link>https://community.intel.com/t5/Software-Archive/Interpreting-PXCPointF32-coordinates-R200-Person-Tracking/m-p/1109396#M71548</link>
      <description>&lt;P&gt;Hello everybody,&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;i have trouble interpreting the coordinates x, y from a PXCPointF32 Format. What does it mean? It ranges from.. 10^-18 to somewhat ..10^+38.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Here is a sample code showing what i currently do:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;int main() {
	
	PXCSenseManager *sm = PXCSenseManager::CreateInstance();
	sm-&amp;gt;EnableStream(PXCCapture::STREAM_TYPE_COLOR, 640, 480, 30);
	sm-&amp;gt;EnableStream(PXCCapture::STREAM_TYPE_DEPTH, 320, 240, 30,PXCCapture::Device::STREAM_OPTION_DEPTH_PRECALCULATE_UVMAP);
	
	pxcStatus sts = sm-&amp;gt;EnablePersonTracking();
	PXCPersonTrackingModule *ptm = sm-&amp;gt;QueryPersonTracking();
	PXCPersonTrackingConfiguration *ptc = ptm-&amp;gt;QueryConfiguration();
	ptc-&amp;gt;SetTrackedAngles(PXCPersonTrackingConfiguration::TRACKING_ANGLES_ALL);
	PXCPersonTrackingData *ptData;
	sm-&amp;gt;Init();

	
	namedWindow("rgb", 1);
	PXCCapture::Sample *sample;
	Mat rgb, depth;

	while (sm-&amp;gt;AcquireFrame(true) &amp;gt;= PXC_STATUS_NO_ERROR)
	{
		//acquire the sample from the camera
		sample = sm-&amp;gt;QuerySample();

		//if there is any color sample, convert it to cv::Mat
		if (sample-&amp;gt;color) {
			rgb = PXCImage2CVMat(sample-&amp;gt;color, PXCImage::PIXEL_FORMAT_RGB24);
		}

		ptData = ptm-&amp;gt;QueryOutput(); // get person tracking module output

		pxcI32 persons = ptData-&amp;gt;QueryNumberOfPeople();  // how many people are detected

		//iterate over each detected person
		for (pxcI32 i = 0; i &amp;lt; persons; ++i) {
			//get the person itself
			PXCPersonTrackingData::Person *person =  ptData-&amp;gt;QueryPersonData(PXCPersonTrackingData::AccessOrderType::ACCESS_ORDER_BY_ID, i);
			PXCPersonTrackingData::PersonTracking *pTrack = person-&amp;gt;QueryTracking(); 
			//get person bounding box
			PXCPersonTrackingData::BoundingBox2D personBox = pTrack-&amp;gt;Query2DBoundingBox();

			//not really needed, just to clarify
			int centerX = personBox.rect.x;
			int centerY = personBox.rect.y;
			int personWidth = personBox.rect.w;
			int personHeight = personBox.rect.h;
			//make opencv box 
			Rect box = Rect(centerX,centerY,personWidth,personHeight);
			//draw the box
			rectangle(rgb, box, Scalar(255, 0, 0), 3, 8, 0);
			//output to console
			//cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; to_string(centerX) &amp;lt;&amp;lt; "/" &amp;lt;&amp;lt; to_string(centerY) &amp;lt;&amp;lt; " " &amp;lt;&amp;lt; personWidth &amp;lt;&amp;lt; "x" &amp;lt;&amp;lt; personHeight;
			//put ID above the box
			putText(rgb, to_string(pTrack-&amp;gt;QueryId()), Point(centerX, centerY), FONT_HERSHEY_PLAIN, 2.0, Scalar(255, 255, 0));

			//now the joints, get them all from the currently selected(iterated) person
			PXCPersonTrackingData::PersonJoints *joints =  ptData-&amp;gt;QueryPersonData(PXCPersonTrackingData::AccessOrderType::ACCESS_ORDER_BY_ID, i)-&amp;gt;QuerySkeletonJoints();

			pxcI32 nJoints = joints-&amp;gt;QueryNumJoints(); 
&amp;nbsp;                        //This is from documentation example, but there is no JointPoint member of PXCPersonTrackingData
			//PXCPersonTrackingData::JointPoint *points = new PXCPersonTrackingData::JointPoint[njoints];
			PXCPersonTrackingData::PersonJoints::SkeletonPoint * points  = new PXCPersonTrackingData::PersonJoints::SkeletonPoint[nJoints];
			joints-&amp;gt;QueryJoints(points);
			cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; sizeof(joints) &amp;lt;&amp;lt; endl;
			for (int k = 0; k &amp;lt; sizeof(joints); ++k) {
				PXCPointF32 tmp =  points&lt;K&gt;.image;
				
				cout &amp;lt;&amp;lt; tmp.x &amp;lt;&amp;lt; " , " &amp;lt;&amp;lt; tmp.y &amp;lt;&amp;lt;endl;
				circle(rgb, Point(tmp.x, tmp.y), 5, Scalar(255, 125, 50), 3, 8, 0);
				string s = to_string(tmp.x*640) + "\n" + to_string(tmp.y*480);
				putText(rgb, s, Point(10, 400), FONT_HERSHEY_PLAIN, 1.0, Scalar(0, 255, 255), 4, 8, false);
			}
			
			delete[] points;
		}

		//cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; "detecting " &amp;lt;&amp;lt; persons &amp;lt;&amp;lt; " people" &amp;lt;&amp;lt; endl;
		imshow("rgb", rgb);
		char c = waitKey(20); 
		sm-&amp;gt;ReleaseFrame();
	}
	
	sm-&amp;gt;Release();

	cout &amp;lt;&amp;lt;endl &amp;lt;&amp;lt;"error level : " &amp;lt;&amp;lt;  sts &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; "should be : " &amp;lt;&amp;lt; PXC_STATUS_NO_ERROR &amp;lt;&amp;lt; endl;
	system("pause");
	return 0;
}&lt;/K&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;the problem is in line 67. I expected the X and Y coordinates to be integers in range from 0 ... 639 &amp;nbsp;* 0 ... 479 and not a floating point number.&lt;/P&gt;

&lt;P&gt;What am i doing wrong?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 11:41:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Interpreting-PXCPointF32-coordinates-R200-Person-Tracking/m-p/1109396#M71548</guid>
      <dc:creator>Johannes_V_</dc:creator>
      <dc:date>2016-08-24T11:41:04Z</dc:date>
    </item>
  </channel>
</rss>

