Have outside work need to do… So don’t have much time on the project this week… SOrry
https://editor.p5js.org/LunaChen/sketches/_zdpY9AMs
let index = (x + y * depth.width)*3;
let depthValue = depth.data[index];
// Set to pixel
let pixelIndex = index * 4;
depthImg.pixels[pixelIndex] = depthValue;
depthImg.pixels[pixelIndex + 1] = random(255);
depthImg.pixels[pixelIndex + 2] = x+y;
depthImg.pixels[pixelIndex + 3] = 220;
Still figuring out a way to play with it, if it is already slow, whatelse can we add on top of it…..
And by the way love to work on handpose more than the image segmentation:
https://editor.p5js.org/LunaChen/sketches/zv9AD9F2q
WebGL 使用GPU来避免任何插件,实现2D或3D的交互
WebGPU
Based in COCO image Ai training
rgb value in pixel need * 4, but if only data value, don’t need to *4
Gradient pixel:
let tileWidth = width /columNum; //Global Var columNum = 10;
let tileHeight = height /rowNum; //used for image how may colums of pixels you want for this image
background(255);
loadPixels();
for(var c=0;c<columNum;c++){
for(var r=0;r<rowNum;r++){
var index = (c+r*width)*4;
pixels[index]=c;
pixels[index+1]=0;
pixels[index+2]=random(255);
pixels[index+3]=255; //transparency
}
}
updatePixels();
}