當前位置: 首頁>>代碼示例>>Java>>正文


Java UtilOpenKinect.getWidth方法代碼示例

本文整理匯總了Java中boofcv.openkinect.UtilOpenKinect.getWidth方法的典型用法代碼示例。如果您正苦於以下問題:Java UtilOpenKinect.getWidth方法的具體用法?Java UtilOpenKinect.getWidth怎麽用?Java UtilOpenKinect.getWidth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在boofcv.openkinect.UtilOpenKinect的用法示例。


在下文中一共展示了UtilOpenKinect.getWidth方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: process

import boofcv.openkinect.UtilOpenKinect; //導入方法依賴的package包/類
public void process() throws IOException {

		logFile = new DataOutputStream(new FileOutputStream("log/timestamps.txt"));
		logFile.write("# Time stamps for rgb and depth cameras.\n".getBytes());

		int w = UtilOpenKinect.getWidth(resolution);
		int h = UtilOpenKinect.getHeight(resolution);

		buffRgb = new BufferedImage(w,h,BufferedImage.TYPE_INT_RGB);

		if( showImage ) {
			gui = ShowImages.showWindow(buffRgb,"Kinect RGB");
		}

		StreamOpenKinectRgbDepth stream = new StreamOpenKinectRgbDepth();
		Context kinect = Freenect.createContext();

		if( kinect.numDevices() < 0 )
			throw new RuntimeException("No kinect found!");

		Device device = kinect.openDevice(0);

		stream.start(device,resolution,this);

		if( maxImages > 0 ) {
			while( frameNumber < maxImages ) {
				System.out.printf("Total saved %d\n",frameNumber);
				BoofMiscOps.pause(100);
			}
			stream.stop();
			System.out.println("Exceeded max images");
			System.exit(0);
		}
	}
 
開發者ID:intrack,項目名稱:BoofCV-master,代碼行數:35,代碼來源:LogKinectDataApp.java

示例2: process

import boofcv.openkinect.UtilOpenKinect; //導入方法依賴的package包/類
public void process() {

    int w = UtilOpenKinect.getWidth(resolution);
    int h = UtilOpenKinect.getHeight(resolution);

    buffRgb = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
    buffDepth = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);

    gui = ShowImages.showWindow(buffRgb, "Kinect Overlay");

    StreamOpenKinectRgbDepth stream = new StreamOpenKinectRgbDepth();
    Context kinect = Freenect.createContext();

    if (kinect.numDevices() < 0)
      throw new RuntimeException("No kinect found!");

    Device device = kinect.openDevice(0);
    stream.start(device, resolution, this);
  }
 
開發者ID:MyRobotLab,項目名稱:myrobotlab,代碼行數:20,代碼來源:KinectRGBDepth.java

示例3: process

import boofcv.openkinect.UtilOpenKinect; //導入方法依賴的package包/類
public void process() throws IOException {

		// make sure there is a "log" directory
		new File("log").mkdir();

		int w = UtilOpenKinect.getWidth(resolution);
		int h = UtilOpenKinect.getHeight(resolution);

		buffRgb = new BufferedImage(w,h,BufferedImage.TYPE_INT_RGB);

		savedRgb = new MultiSpectral<ImageUInt8>(ImageUInt8.class,w,h,3);
		savedDepth = new ImageUInt16(w,h);

		gui = ShowImages.showWindow(buffRgb, "Kinect RGB");
		gui.addKeyListener(this);
		gui.requestFocus();

		StreamOpenKinectRgbDepth stream = new StreamOpenKinectRgbDepth();
		Context kinect = Freenect.createContext();

		if( kinect.numDevices() < 0 )
			throw new RuntimeException("No kinect found!");

		Device device = kinect.openDevice(0);

		stream.start(device,resolution,this);

		long targetTime = System.currentTimeMillis() + period;
		updateDisplay = true;
		while( true ) {
			BoofMiscOps.pause(100);

			if( targetTime < System.currentTimeMillis() ) {
				userChoice = -1;
				savedImages = false;
				updateDisplay = false;
				while( true ) {
					if( savedImages && userChoice != -1 ) {
						if( userChoice == 1 ) {
							UtilImageIO.savePPM(savedRgb, String.format(directory + "rgb%07d.ppm", frameNumber), buffer);
							UtilOpenKinect.saveDepth(savedDepth, String.format(directory + "depth%07d.depth", frameNumber), buffer);
							frameNumber++;
							text = "Image Saved!";
						} else {
							text = "Image Discarded!";
						}
						timeText = System.currentTimeMillis()+500;
						updateDisplay = true;
						targetTime = System.currentTimeMillis()+period;
						break;
					}
					BoofMiscOps.pause(50);
				}
			}
		}
	}
 
開發者ID:intrack,項目名稱:BoofCV-master,代碼行數:57,代碼來源:CaptureCalibrationImagesApp.java

示例4: process

import boofcv.openkinect.UtilOpenKinect; //導入方法依賴的package包/類
public void process() {

		int w = UtilOpenKinect.getWidth(resolution);
		int h = UtilOpenKinect.getHeight(resolution);

		buffRgb = new BufferedImage(w,h,BufferedImage.TYPE_INT_RGB);
		buffDepth = new BufferedImage(w,h,BufferedImage.TYPE_INT_RGB);

		gui = ShowImages.showWindow(buffRgb,"Kinect Overlay");

		StreamOpenKinectRgbDepth stream = new StreamOpenKinectRgbDepth();
		Context kinect = Freenect.createContext();

		if( kinect.numDevices() < 0 )
			throw new RuntimeException("No kinect found!");

		Device device = kinect.openDevice(0);
		stream.start(device,resolution,this);
	}
 
開發者ID:intrack,項目名稱:BoofCV-master,代碼行數:20,代碼來源:OverlayRgbDepthStreamsApp.java


注:本文中的boofcv.openkinect.UtilOpenKinect.getWidth方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。