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


Java RGBColour.RED属性代码示例

本文整理汇总了Java中org.openimaj.image.colour.RGBColour.RED属性的典型用法代码示例。如果您正苦于以下问题:Java RGBColour.RED属性的具体用法?Java RGBColour.RED怎么用?Java RGBColour.RED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.openimaj.image.colour.RGBColour的用法示例。


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

示例1: drawContours

/**
 * Draw the given contour.
 * 
 * @param root
 *            the contour.
 */
public void drawContours(Contour root) {
	final List<Contour> toDraw = new ArrayList<Contour>();
	toDraw.add(root);
	while (!toDraw.isEmpty()) {
		final Contour next = toDraw.remove(toDraw.size() - 1);
		Float[] c = null;
		switch (next.type) {
		case HOLE:
			c = RGBColour.BLUE;
			break;
		case OUTER:
			c = RGBColour.RED;
			break;
		}
		this.drawShape(next, 3, c);

		toDraw.addAll(next.children);
	}
}
 
开发者ID:openimaj,项目名称:openimaj,代码行数:25,代码来源:ContourRenderer.java

示例2: drawBoxes

/**
 * 	Draws the boxes to show movements.
 *	@param img The image to draw to
 */
protected void drawBoxes( final MBFImage img, final double[][] sim )
{
	final int gw = img.getWidth()  / this.nGridElements;
	final int gh = img.getHeight() / this.nGridElements;
	for( int y = 0; y < this.nGridElements; y++ )
	{
		for( int x = 0; x < this.nGridElements; x++ )
		{
			Float[] c = new Float[]{0f,0f,0f,0f};
			if( sim[y][x] == this.boostFactor )
					c = RGBColour.RED;
			else
			if( sim[y][x] == this.limitingFactor )
					c = RGBColour.BLUE;
			else	c = RGBColour.BLACK;
			img.drawShape( new Rectangle(x*gw,y*gh,gw,gh), c );
		}
	}
}
 
开发者ID:openimaj,项目名称:openimaj,代码行数:23,代码来源:LocalHistogramVideoShotDetector.java

示例3: addPoint

/**
 * 	Adds a default coloured dot with the given size (in red).
 *	@param x The x location
 *	@param y The y location
 *	@param d The size
 */
public void addPoint( final double x, final double y, final double d )
{
	Float[] c = RGBColour.RED;
	if( this.colourMap != null )
		c = this.colourMap.apply( (float)((d-this.colourMapMin)/(this.colourMapMax-this.colourMapMin)) );
	super.addPoint( x, y, new ColouredDot( d, c ) );
}
 
开发者ID:openimaj,项目名称:openimaj,代码行数:13,代码来源:DotPlotVisualisation.java

示例4: addPoint

/**
 *
 * @param x
 * @param y
 * @param z
 * @param size
 */
public void addPoint( final double x, final double y, final double z, final double size )
{
	Float[] c = RGBColour.RED;
	if( this.colourMap != null )
		c = this.colourMap.apply( (float)((size-this.colourMapMin)/(this.colourMapMax-this.colourMapMin)) );
	this.data.add( new LocatedObject3D<ColouredDot>( x, y, z, new ColouredDot( size, c ) ) );
}
 
开发者ID:openimaj,项目名称:openimaj,代码行数:14,代码来源:DotPlotVisualisation3D.java

示例5: colourForBin

@Override
public Float[] colourForBin(final int bin) {
	return RGBColour.RED;
}
 
开发者ID:openimaj,项目名称:openimaj,代码行数:4,代码来源:VideoFeatureExtraction.java

示例6: beforeUpdate

@Override
public void beforeUpdate(MBFImage frame) {
	if (this.tldMain.selector.drawRect(frame)) {
		return;
	}
	final long tic = System.currentTimeMillis();
	currentFrame++;
	FImage grey = null;
	if (!reuseFrameOnce) {
		grey = frame.flatten();
	}

	if (!skipProcessingOnce) {
		tldMain.tld.processImage(grey);
	} else {
		skipProcessingOnce = false;
	}

	if (tldMain.printResults != null) {
		if (tldMain.tld.currBB != null) {
			tldMain.resultsFile.printf("%d %.2f %.2f %.2f %.2f %f\n", currentFrame - 1, tldMain.tld.currBB.x,
					tldMain.tld.currBB.y, tldMain.tld.currBB.width, tldMain.tld.currBB.height, tldMain.tld.currConf);
		} else {
			tldMain.resultsFile.printf("%d NaN NaN NaN NaN NaN\n", currentFrame - 1);
		}
	}

	final float fps = 1 / ((System.currentTimeMillis() - tic) / 1000f);

	final boolean confident = (tldMain.tld.currConf >= tldMain.threshold) ? true : false;

	if (tldMain.showOutput || tldMain.saveDir != null) {
		String learningString = "";
		if (tldMain.tld.isLearning()) {
			learningString = "learning";
		}

		final String string = String.format("#%d,Posterior %.2f; fps: %.2f, #numwindows:%d, %s", currentFrame - 1,
				tldMain.tld.currConf, fps, tldMain.tld.detectorCascade.getNumWindows(), learningString);
		final Float[] yellow = RGBColour.YELLOW;
		final Float[] blue = RGBColour.BLUE;
		final Float[] red = RGBColour.RED;

		if (tldMain.tld.currBB != null) {
			final Float[] rectangleColor = confident ? blue : yellow;
			// cvRectangle(img, tld.currBB.tl(), tld.currBB.br(),
			// rectangleColor, 8, 8, 0);
			frame.drawShape(tldMain.tld.currBB, rectangleColor);
			if (tldMain.markerMode && this.tldMain.tld.medianFlowTracker.featuresTrackedToBfromA != null) {
				// Draw the tracked points
				final Feature[] from = this.tldMain.tld.medianFlowTracker.featuresTrackedToBfromA.features;
				final Feature[] to = this.tldMain.tld.medianFlowTracker.featuresTrackedToAviaB.features;
				for (int i = 0; i < from.length; i++) {
					frame.drawLine(from[i], to[i], 3, red);
				}
			}
		}

		drawPositivePatches();

		final HersheyFont font = HersheyFont.ROMAN_SIMPLEX;
		frame.drawText(string, 25, 25, font, 12);

	}

	if (reuseFrameOnce) {
		reuseFrameOnce = false;
	}

}
 
开发者ID:openimaj,项目名称:openimaj,代码行数:70,代码来源:TLDVideoListener.java

示例7: LabelledDot

/**
 * 	Create a labelled dot.
 *	@param l The label
 *	@param s The size
 */
public LabelledDot( final String l, final double s )
{
	super( s, RGBColour.RED );
	this.label = l;
}
 
开发者ID:openimaj,项目名称:openimaj,代码行数:10,代码来源:LabelledPointVisualisation.java


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