[Jderobot-admin] jderobot-r952 - trunk/src/components/kinectViewer

frivas en jderobot.org frivas en jderobot.org
Mie Jul 24 10:36:13 CEST 2013


Author: frivas
Date: 2013-07-24 10:35:13 +0200 (Wed, 24 Jul 2013)
New Revision: 952

Modified:
   trunk/src/components/kinectViewer/kinectViewer.cfg
   trunk/src/components/kinectViewer/kinectViewergui.cpp
Log:
arreglado peque?\195?\177o bug de kinectviewer a la hora de visualizar imagenes


Modified: trunk/src/components/kinectViewer/kinectViewer.cfg
===================================================================
--- trunk/src/components/kinectViewer/kinectViewer.cfg	2013-07-23 13:57:40 UTC (rev 951)
+++ trunk/src/components/kinectViewer/kinectViewer.cfg	2013-07-24 08:35:13 UTC (rev 952)
@@ -1,19 +1,16 @@
 kinectViewer.CameraRGBActive=1
-kinectViewer.CameraRGB.Fps=10
-kinectViewer.CameraRGB.Proxy=cameraA:tcp -h localhost -p 9998
+kinectViewer.CameraRGB.Proxy=cameraA:tcp -h 127.0.0.1 -p 9999
 kinectViewer.CameraDEPTHActive=1
-kinectViewer.CameraDEPTH.Fps=10
-kinectViewer.CameraDEPTH.Proxy=cameraB:tcp -h localhost -p 9998
-kinectViewer.pointCloudActive=0
-kinectViewer.pointCloud.Fps=10
-kinectViewer.pointCloud.Proxy=pointcloud1:tcp -h localhost -p 9998
+kinectViewer.CameraDEPTH.Proxy=cameraB:tcp -h 127.0.0.1 -p 9999
+kinectViewer.pointCloudActive=1
+kinectViewer.pointCloud.Proxy=pointcloud1:tcp -h 127.0.0.1 -p 9999
 kinectViewer.Pose3DMotorsActive=0
-kinectViewer.Pose3DMotors.Proxy=Pose3DMotors1:tcp -h localhost -p 9999
+kinectViewer.Pose3DMotors.Proxy=Pose3DMotors1:tcp -h 127.0.0.1 -p 9998
 kinectViewer.KinectLedsActive=0
-kinectViewer.KinectLeds.Proxy=kinectleds1:tcp -h localhost -p 9999
+kinectViewer.KinectLeds.Proxy=kinectleds1:tcp -h 127.0.0.1 -p 9998
 kinectViewer.WorldFile=./config/lambecom.cfg
-#kinectViewer.camRGB=./config/camera-0.cfg
-#kinectViewer.camIR=./config/camera-0.cfg
+#kinectViewer.camRGB=./config/camRGB
+#kinectViewer.camIR=./config/camRGB
 kinectViewer.Height=240
 kinectViewer.Width=320
 kinectViewer.Fps=15

Modified: trunk/src/components/kinectViewer/kinectViewergui.cpp
===================================================================
--- trunk/src/components/kinectViewer/kinectViewergui.cpp	2013-07-23 13:57:40 UTC (rev 951)
+++ trunk/src/components/kinectViewer/kinectViewergui.cpp	2013-07-24 08:35:13 UTC (rev 952)
@@ -148,7 +148,10 @@
 void 
 kinectViewergui::updateAll( cv::Mat imageRGB, cv::Mat imageDEPTH, std::vector<jderobot::RGBPoint> cloud )
 {
+		std::cout << imageRGB.rows << std::endl;
+
 		cv::Mat distance(imageRGB.rows, imageRGB.cols, CV_32FC1);
+		cv::Mat colorDepth(imageDEPTH.size(),imageDEPTH.type());
 		CvPoint pt1,pt2;
 			if (w_toggle_rgb->get_active()){
 				Glib::RefPtr<Gdk::Pixbuf> imgBuff =  Gdk::Pixbuf::create_from_data((const guint8*) imageRGB.data,Gdk::COLORSPACE_RGB,false,8,imageRGB.cols,imageRGB.rows,imageRGB.step);
@@ -158,13 +161,15 @@
 					util->draw_room(imageRGB,0, world->lines, world->numlines);
 				}
 	    		w_imageRGB->set(imgBuff);
+	    		while (gtkmain.events_pending())
+	    		      	gtkmain.iteration();
 			}
 			if (w_toggle_depth->get_active()||((reconstruct_depth_activate)&&(reconstructMode==0))){
 	
 				/*split channels to separate distance from image*/
 				std::vector<cv::Mat> layers;
 				cv::split(imageDEPTH, layers);
-				cv::Mat colorDepth(imageDEPTH.size(),imageDEPTH.type());
+
 				cv::cvtColor(layers[0],colorDepth,CV_GRAY2RGB);
 				/*cv::imshow("color", colorDepth);
 				cv::waitKey(1);*/
@@ -175,7 +180,8 @@
 				}
 
 				if (w_toggle_depth->get_active()){
-					Glib::RefPtr<Gdk::Pixbuf> imgBuff =  Gdk::Pixbuf::create_from_data((const guint8*) colorDepth.data,Gdk::COLORSPACE_RGB,false,8,colorDepth.cols,colorDepth.rows,colorDepth.step);
+					cv::Mat localDepth;
+										Glib::RefPtr<Gdk::Pixbuf> imgBuff =  Gdk::Pixbuf::create_from_data((const guint8*) colorDepth.data,Gdk::COLORSPACE_RGB,false,8,colorDepth.cols,colorDepth.rows,colorDepth.step);
 					w_imageDEPTH->clear();
 					if (lines_depth_active){
 						util->draw_room(colorDepth,1, world->lines, world->numlines);



More information about the Jderobot-admin mailing list