I planned a tracking from ceiling to floor. Attached is a sketch for the projection. Now, where do I place the camera best. I planned on using the Unibrain Fire-i board camer with a 2.1mm lens. Is the camera cone similar to the one of the projector?
Unfortunately, 2.1 mm lens doesn’t mean much when we don’t know the sensor size/focal length. Even so, it’s better to just try it out and see how close you can get to a match. I’ve done a few projects that needed to track people in front of a projected image and what I have found to be the best solution is to use a function that will let you compensate for keystoning by warping the image. This way you don’t have to worry about lining things up perfectly by using optics, plus it compensates for perspective.
void getQuadSubImage( unsigned char * inputData, unsigned char * outputData,
int inW, int inH, int outW, int outH,
int x1, int y1, int x2, int y2,
int x3, int y3, int x4, int y4, int bpp) {
for(int x=0;x<outW;x++) {
for(int y=0;y<outH;y++) {
float xlrp = x/(float)outW;
float ylrp = y/(float)outH;
int xinput = (x1*(1-xlrp)+x2*xlrp)*(1-ylrp) + (x4*(1-xlrp)+x3*xlrp)*ylrp;
int yinput = (y1*(1-ylrp)+y4*ylrp)*(1-xlrp) + (y2*(1-ylrp)+y3*ylrp)*xlrp;
int inIndex = (xinput + yinput*inW)*bpp;
int outIndex = (x+y*outW)*bpp;
memcpy((void*)(outputData+outIndex),(void*)(inputData+inIndex),sizeof(unsigned char)*bpp);
}
}
}
thanks, thats a great hepl. but right now i am just looking for the material first, also because there are some restriction regarding the height of the ceiling and the projector.