当前位置: 首页>>代码示例>>Java>>正文


Java ShowImages类代码示例

本文整理汇总了Java中boofcv.gui.image.ShowImages的典型用法代码示例。如果您正苦于以下问题:Java ShowImages类的具体用法?Java ShowImages怎么用?Java ShowImages使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ShowImages类属于boofcv.gui.image包,在下文中一共展示了ShowImages类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: run

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
@Override
public void run() {
    if (!streaming) {
        addMouseListener(panel);
    }
    JFrame window = ShowImages.showWindow(panel, PlaySet.class.getSimpleName(),true);
    window.addKeyListener(new KeyAdapter() {
        @Override
        public void keyTyped(KeyEvent e) {
            if (e.getKeyChar() == 'x' && previousSet != null) {
                System.out.println("'Not a Set!'");
                ImageSuppliers.WebcamSaverImageSupplier.save(image);
            }
        }
    });

    if (streaming) {
        while (true) {
            image = imageSupplier.get();
            newImage(image);
        }
    }
}
 
开发者ID:tomwhite,项目名称:set-game,代码行数:24,代码来源:PlaySet.java

示例2: view

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
public static void view(File directory) {
    ListDisplayPanel panel = new ListDisplayPanel();
    int numCols = 20;

    int numImagesPerLabel = -1;
    char prevNumLabel = ' ';
    for (File d : directory.listFiles((dir, name) -> !name.matches("\\..*"))) {
        String label = d.getName();
        BufferedImage[] bufferedImages = Arrays.stream(d.listFiles((dir, name) -> name.matches(".*\\.jpg")))
                .map(f -> UtilImageIO.loadImage(f.getAbsolutePath()))
                .map(bi -> resize(bi, bi.getWidth() / 3, bi.getHeight() / 3))
                .collect(Collectors.toList())
                .toArray(new BufferedImage[0]);
        panel.addItem(new ImageGridPanel((bufferedImages.length / numCols) + 1, numCols, bufferedImages), label);
        System.out.println(label + "\t" + bufferedImages.length);
        if (prevNumLabel != label.charAt(0)) {
            numImagesPerLabel = bufferedImages.length;
            prevNumLabel = label.charAt(0);
        } else if (numImagesPerLabel != bufferedImages.length) {
            throw new IllegalStateException("Expected " + numImagesPerLabel + " images, but only found " + bufferedImages.length + " for " + label);
        }
    }

    ShowImages.showWindow(panel, ViewLabelledImagesV2.class.getSimpleName(), true);
}
 
开发者ID:tomwhite,项目名称:set-game,代码行数:26,代码来源:ViewLabelledImagesV2.java

示例3: processRgb

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
protected void processRgb(FrameMode mode, ByteBuffer frame, int timestamp) {
	if (mode.getVideoFormat() != VideoFormat.RGB) {
		System.out.println("Bad rgb format!");
	}

	if (outRgb == null) {
		rgb.reshape(mode.getWidth(), mode.getHeight());
		outRgb = new BufferedImage(rgb.width, rgb.height, BufferedImage.TYPE_INT_RGB);
		guiRgb = ShowImages.showWindow(outRgb, "RGB Image");
	}

	App.bufferRgbToMsU8(frame, rgb);
	ConvertBufferedImage.convertTo_U8(rgb, outRgb, true);

	drawButton(buttonMove, outRgb);
	drawButton(buttonStop, outRgb);
	drawButton(buttonLeft, outRgb);
	drawButton(buttonRight, outRgb);

	processButtonStatePhaseTwo(buttonMove, outRgb);
	processButtonStatePhaseTwo(buttonStop, outRgb);
	processButtonStatePhaseTwo(buttonLeft, outRgb);
	processButtonStatePhaseTwo(buttonRight, outRgb);

	guiRgb.repaint();
}
 
开发者ID:IBM-Cloud,项目名称:controller-kinect-bluemix,代码行数:27,代码来源:App.java

示例4: processRgb

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
protected void processRgb(FrameMode mode, ByteBuffer frame, int timestamp) {
  if (mode.getVideoFormat() != VideoFormat.RGB) {
    System.out.println("Bad rgb format!");
  }

  System.out.println("Got rgb!   " + timestamp);

  if (outRgb == null) {
    rgb.reshape(mode.getWidth(), mode.getHeight());
    outRgb = new BufferedImage(rgb.width, rgb.height, BufferedImage.TYPE_INT_RGB);
    guiRgb = ShowImages.showWindow(outRgb, "RGB Image");
  }

  UtilOpenKinect.bufferRgbToMsU8(frame, rgb);
  ConvertBufferedImage.convertTo_U8(rgb, outRgb, true);

  guiRgb.repaint();
}
 
开发者ID:MyRobotLab,项目名称:myrobotlab,代码行数:19,代码来源:KinectStreamer.java

示例5: processRgb

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
protected void processRgb( FrameMode mode, ByteBuffer frame, int timestamp ) {
	if( mode.getVideoFormat() != VideoFormat.RGB ) {
		System.out.println("Bad rgb format!");
	}

	System.out.println("Got rgb! "+timestamp);

	if( outRgb == null ) {
		rgb.reshape(mode.getWidth(),mode.getHeight());
		outRgb = new BufferedImage(rgb.width,rgb.height,BufferedImage.TYPE_INT_RGB);
		guiRgb = ShowImages.showWindow(outRgb,"RGB Image");
	}

	UtilOpenKinect.bufferRgbToMsU8(frame, rgb);
	ConvertBufferedImage.convertTo_U8(rgb,outRgb);

	guiRgb.repaint();
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:19,代码来源:OpenKinectStreamingTest.java

示例6: process

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
public void process() throws IOException {
	parseFrame(0);

	outRgb = new BufferedImage(rgb.getWidth(),rgb.getHeight(),BufferedImage.TYPE_INT_RGB);
	outDepth = new BufferedImage(depth.getWidth(),depth.getHeight(),BufferedImage.TYPE_INT_RGB);

	gui = new ImageGridPanel(1,2,outRgb,outDepth);
	ShowImages.showWindow(gui,"Kinect Data");

	int frame = 1;
	while( true ) {
		parseFrame(frame++);
		ConvertBufferedImage.convertTo_U8(rgb,outRgb);
		VisualizeImageData.disparity(depth, outDepth, 0, UtilOpenKinect.FREENECT_DEPTH_MM_MAX_VALUE, 0);
		gui.repaint();
		BoofMiscOps.pause(30);
	}
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:19,代码来源:PlaybackKinectLogApp.java

示例7: main

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
public static void main( String args[] ) {

		// load images with lens distortion removed
		String dir = "../data/applet/stereo/";
		BufferedImage imageA = UtilImageIO.loadImage(dir + "mono_wall_01.jpg");
		BufferedImage imageB = UtilImageIO.loadImage(dir + "mono_wall_03.jpg");

		// Find a set of point feature matches
		List<AssociatedPair> matches = ExampleFundamentalMatrix.computeMatches(imageA,imageB);

		// Prune matches using the epipolar constraint
		List<AssociatedPair> inliers = new ArrayList<AssociatedPair>();
		DenseMatrix64F F = ExampleFundamentalMatrix.robustFundamental(matches, inliers);

		// display the inlier matches found using the robust estimator
		AssociationPanel panel = new AssociationPanel(20);
		panel.setAssociation(inliers);
		panel.setImages(imageA,imageB);

		ShowImages.showWindow(panel, "Inlier Pairs");

		rectify(F,inliers,imageA,imageB);
	}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:24,代码来源:ExampleRectifyUncalibratedStereo.java

示例8: main

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
public static void main(String args[]) {

		ShowImageDerivative<ImageFloat32,ImageFloat32> app
				= new ShowImageDerivative<ImageFloat32,ImageFloat32>(ImageFloat32.class,ImageFloat32.class);
//		ShowImageDerivative<ImageUInt8, ImageSInt16> app
//				= new ShowImageDerivative<ImageUInt8,ImageSInt16>(ImageUInt8.class,ImageSInt16.class);

		List<PathLabel> inputs = new ArrayList<PathLabel>();
		inputs.add(new PathLabel("shapes","../data/evaluation/shapes01.png"));
		inputs.add(new PathLabel("sunflowers","../data/evaluation/sunflowers.png"));
		inputs.add(new PathLabel("beach","../data/evaluation/scale/beach02.jpg"));
		inputs.add(new PathLabel("xray","../data/applet/xray01.jpg"));

		app.setInputList(inputs);

		// wait for it to process one image so that the size isn't all screwed up
		while( !app.getHasProcessedImage() ) {
			Thread.yield();
		}

		ShowImages.showWindow(app, "Image Derivative");
	}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:23,代码来源:ShowImageDerivative.java

示例9: printClickedColor

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
/**
 * Shows a color image and allows the user to select a pixel, convert it to HSV, print
 * the HSV values, and calls the function below to display similar pixels.
 */
public static void printClickedColor( final BufferedImage image ) {
	ImagePanel gui = new ImagePanel(image);
	gui.addMouseListener(new MouseAdapter() {
		@Override
		public void mouseClicked(MouseEvent e) {
			float[] color = new float[3];
			int rgb = image.getRGB(e.getX(),e.getY());
			ColorHsv.rgbToHsv((rgb >> 16) & 0xFF,(rgb >> 8) & 0xFF , rgb&0xFF,color);
			System.out.println("h = " + color[0]);
			System.out.println("s = "+color[1]);
			System.out.println("v = "+color[2]);

			showSelectedColor("Selected",image,(float)color[0],(float)color[1]);
		}
	});

	ShowImages.showWindow(gui,"Color Selector");
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:23,代码来源:ExampleSegmentColor.java

示例10: detectLineSegments

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
/**
 * Detects segments inside the image
 *
 * @param image Input image.
 * @param imageType Type of image processed by line detector.
 * @param derivType Type of image derivative.
 */
public static<T extends ImageSingleBand, D extends ImageSingleBand>
void detectLineSegments( BufferedImage image ,
						 Class<T> imageType ,
						 Class<D> derivType )
{
	// convert the line into a single band image
	T input = ConvertBufferedImage.convertFromSingle(image, null, imageType );

	// Comment/uncomment to try a different type of line detector
	DetectLineSegmentsGridRansac<T,D> detector = FactoryDetectLineAlgs.lineRansac(40, 30, 2.36, true, imageType, derivType);

	List<LineSegment2D_F32> found = detector.detect(input);

	// display the results
	ImageLinePanel gui = new ImageLinePanel();
	gui.setBackground(image);
	gui.setLineSegments(found);
	gui.setPreferredSize(new Dimension(image.getWidth(),image.getHeight()));

	ShowImages.showWindow(gui,"Found Line Segments");
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:29,代码来源:ExampleLineDetection.java

示例11: independent

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
/**
 * Many operations designed to only work on {@link boofcv.struct.image.ImageSingleBand} can be applied
 * to a MultiSpectral image by feeding in each band one at a time.
 */
public static void independent( BufferedImage input ) {
	// convert the BufferedImage into a MultiSpectral
	MultiSpectral<ImageUInt8> image = ConvertBufferedImage.convertFromMulti(input,null,ImageUInt8.class);

	// declare the output blurred image
	MultiSpectral<ImageUInt8> blurred =
			new MultiSpectral<ImageUInt8>(ImageUInt8.class,image.width,image.height,image.getNumBands());
	
	// Apply Gaussian blur to each band in the image
	for( int i = 0; i < image.getNumBands(); i++ ) {
		// note that the generalized version of BlurImageOps is not being used, but the type
		// specific version.
		BlurImageOps.gaussian(image.getBand(i),blurred.getBand(i),-1,5,null);
	}
	
	// Declare the BufferedImage manually to ensure that the color bands have the same ordering on input
	// and output
	BufferedImage output = new BufferedImage(image.width,image.height,input.getType());
	ConvertBufferedImage.convertTo(blurred, output);
	ShowImages.showWindow(input,"Input");
	ShowImages.showWindow(output,"Ouput");
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:27,代码来源:ExampleMultiSpectralImages.java

示例12: convertToGray

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
/**
 * There is no real perfect way that everyone agrees on for converting color images into gray scale
 * images.  Two examples of how to convert a MultiSpectral image into a gray scale image are shown 
 * in this example.
 */
public static void convertToGray( BufferedImage input ) {
	// convert the BufferedImage into a MultiSpectral
	MultiSpectral<ImageUInt8> image = ConvertBufferedImage.convertFromMulti(input,null,ImageUInt8.class);
	
	ImageUInt8 gray = new ImageUInt8( image.width,image.height);
	
	// creates a gray scale image by averaging intensity value across pixels
	GPixelMath.averageBand(image, gray);
	BufferedImage outputAve = ConvertBufferedImage.convertTo(gray,null);

	// create an output image just from the first band
	BufferedImage outputBand0 = ConvertBufferedImage.convertTo(image.getBand(0),null);

	ShowImages.showWindow(outputAve,"Average");
	ShowImages.showWindow(outputBand0,"Band 0");
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:22,代码来源:ExampleMultiSpectralImages.java

示例13: process

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
/**
 * Processes the sequence of images and displays the tracked features in a window
 */
public void process(SimpleImageSequence<T> sequence) {

	// Figure out how large the GUI window should be
	T frame = sequence.next();
	gui.setPreferredSize(new Dimension(frame.getWidth(),frame.getHeight()));
	ShowImages.showWindow(gui,"KTL Tracker");

	// process each frame in the image sequence
	while( sequence.hasNext() ) {
		frame = sequence.next();

		// tell the tracker to process the frame
		tracker.process(frame);

		// if there are too few tracks spawn more
		if( tracker.getActiveTracks(null).size() < 100 )
			tracker.spawnTracks();

		// visualize tracking results
		updateGUI(sequence);

		// wait for a fraction of a second so it doesn't process to fast
		BoofMiscOps.pause(100);
	}
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:29,代码来源:ExamplePointFeatureTracker.java

示例14: showMatchIntensity

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
/**
 * Computes the template match intensity image and displays the results. Brighter intensity indicates
 * a better match to the template.
 */
public static void showMatchIntensity(ImageFloat32 image, ImageFloat32 template) {

	// create algorithm for computing intensity image
	TemplateMatchingIntensity<ImageFloat32> matchIntensity =
			FactoryTemplateMatching.createIntensity(TemplateScoreType.SUM_DIFF_SQ, ImageFloat32.class);

	// apply the template to the image
	matchIntensity.process(image, template);

	// get the results
	ImageFloat32 intensity = matchIntensity.getIntensity();

	// adjust the intensity image so that white indicates a good match and black a poor match
	// the scale is kept linear to highlight how ambiguous the solution is
	float min = ImageStatistics.min(intensity);
	float max = ImageStatistics.max(intensity);
	float range = max - min;
	PixelMath.plus(intensity, -min, intensity);
	PixelMath.divide(intensity, range, intensity);
	PixelMath.multiply(intensity, 255.0f, intensity);

	BufferedImage output = new BufferedImage(image.width, image.height, BufferedImage.TYPE_INT_BGR);
	VisualizeImageData.grayMagnitude(intensity, output, -1);
	ShowImages.showWindow(output, "Match Intensity");
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:30,代码来源:ExampleTemplateMatching.java

示例15: process

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
/**
 * Updates and displays the pyramid.
 */
public void process( BufferedImage image ) {
	T input = ConvertBufferedImage.convertFromSingle(image, null, imageType);
	pyramid.process(input);

	ImagePyramidPanel<T> gui = new ImagePyramidPanel<T>();
	gui.set(pyramid, true);
	gui.render();

	ShowImages.showWindow(gui,"Image Pyramid Float");

	// To get an image at any of the scales simply call this get function
	T imageAtScale = pyramid.getLayer(1);

	ShowImages.showWindow(ConvertBufferedImage.convertTo(imageAtScale,null),"Image at layer 1");
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:19,代码来源:ExamplePyramidFloat.java


注:本文中的boofcv.gui.image.ShowImages类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。