public int color(int gray, int alpha) { return intf.app.color(gray, alpha); }
public int color(int v1, int v2, int v3) { return intf.app.color(v1, v2, v3); }
public void updateWithIDColors(DepthAnalysisImpl kinect, ArrayList<TrackedDepthPoint> touchs) { Vec3D[] points = kinect.getDepthPoints(); nbVertices = 0; nbColors = 0; int k = 0; parentApplet.pushStyle(); parentApplet.colorMode(HSB, 8, 100, 100); int id = 0; for (TrackedDepthPoint touch : touchs) { int c = this.parentApplet.color(id % 8, 100, 100); int c2 = javaToNativeARGB(c); id++; for (DepthDataElementProjected dde : touch.getDepthDataElements()) { Vec3D p = dde.depthPoint; verticesJava[k++] = p.x; verticesJava[k++] = p.y; verticesJava[k++] = -p.z; verticesJava[k++] = 1; nbVertices++; colorsJava[nbColors++] = c2; } } parentApplet.popStyle(); verticesNative.rewind(); verticesNative.put(verticesJava, 0, nbVertices * 4); colorsNative.rewind(); colorsNative.put(colorsJava, 0, nbColors); }
public int color(float v1, float v2, float v3, float alpha) { return intf.app.color(v1, v2, v3, alpha); }
float g = ((float) out[1] - y) / mag + 0.5f;// / frameHeight; mapImg.pixels[k++] = parent.color(r, g, parent.random(1f));
public int color(int v1, int v2, int v3, int alpha) { return intf.app.color(v1, v2, v3, alpha); }
public int color(float v1, float v2, float v3) { return intf.app.color(v1, v2, v3); }
public int color(int gray) { return intf.app.color(gray); }
public int color(float fgray) { return intf.app.color(fgray); }
public int color(float fgray, float falpha) { return intf.app.color(fgray, falpha); }
/** * Detect faces using {@link HaarCascadeDetector}, return an {@link ArrayList} of * {@link PShape} instances. Note the {@link PShape} instances have no fill and * a colour: 255,0,0 * @return detected faces */ public ArrayList<PShape> faces(){ ArrayList<PShape> faces = new ArrayList<PShape>(); List<DetectedFace> detected = faceDetector.detectFaces(oiImage.flatten()); for (DetectedFace detectedFace : detected) { Rectangle bounds = detectedFace.getBounds(); PShape detectedPShape = this.parent.createShape(RECT,bounds.x,bounds.y,bounds.width,bounds.height); detectedPShape.setFill(false); detectedPShape.setStroke(this.parent.color(255f, 0, 0)); faces.add(detectedPShape); } return faces; } }
/** * Simple visualization * * @param depth * @param color * @param skip * @return */ public PImage update(IplImage depth, IplImage color, int skip) { updateRawDepth(depth); if (color != null) { updateRawColor(color); } depthData.clear(); depthData.timeStamp = papplet.millis(); validPointsPImage.loadPixels(); // set a default color. Arrays.fill(validPointsPImage.pixels, papplet.color(0, 0, 0)); // TODO: get the color with Kinect2... if (this.colorCamera.getPixelFormat() == Camera.PixelFormat.RGB) { computeDepthAndDo(skip, new SetImageDataRGB()); } if (this.colorCamera.getPixelFormat() == Camera.PixelFormat.BGR) { computeDepthAndDo(skip, new SetImageData()); } validPointsPImage.updatePixels(); return validPointsPImage; }