Пример #1
0
void rotate_fltr(image_t *img,
		const double alpha,
		const double beta,
		const double gamma,
		const double x, const double y, const double z)
{
	float *newimg;
	float *orig;
	int h,w;
	int bands;
	Tmatrix tm;
	double **remaptable;
	const double deg2rad = M_PI/180.0;

	w=img->w;
	h=img->h;
	bands=img->bands;
	if (img->d!=1) return;

	newimg=(float*)calloc(w*h*bands,sizeof(float));

	orig=img->data;

	/* build the transform matrix */
	makeTmatrix(deg2rad*alpha,deg2rad*beta,deg2rad*gamma,x,y,z,tm);

	/* construct the address remap table */
#ifdef DEBUG
	if (verbose) fprintf(stderr,"Passing getMapping() [w,h]=[%d,%d]\n",w,h);
#endif
	remaptable=getMapping3d(w,h,tm);

	/* do the remapping */
	remapImage(orig,w,h,newimg,w,h,bands,remaptable);
	free(remaptable[0]);
	free(remaptable);
	memcpy(orig,newimg,w*h*bands*sizeof(float));
	free(newimg);
}
Пример #2
0
void DisparityProvider::remapImages() noexcept
{
    _leftImage  = remapImage(_leftImage,  _rectifyMapXLeft,  _rectifyMapYLeft);
    _rightImage = remapImage(_rightImage, _rectifyMapXRight, _rectifyMapYRight);
}