本文整理汇总了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);
}
}
示例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 );
}
}
}
示例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 ) );
}
示例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 ) ) );
}
示例5: colourForBin
@Override
public Float[] colourForBin(final int bin) {
return RGBColour.RED;
}
示例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;
}
}
示例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;
}