Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Affine transformation of a portion of an image-C++

i have 2 frames of a video stream given by a moving camera . My aim is to blacken, in the 2° frame, the portion of the image that represents the same thing represented in the first frame. Obviously the images represent only partially the same thing (some background is removed and other is added) but after a roto-translation (an affine transformation caused by the camera movement). My idea is to calculate the AffineTransformation matrix (through the OpenCV function: GetAffineTransform) using 3 matching features found by SURF algorithm. After that i would transform the coordinates of each pixel of the image (via the matrix just found), not the whole image!! and blacken the "transformed" pixels. I really don't know how implement this last passage: using WarpAffine on the image itself I can only blacken the outlier pixel not the inlier and i don't know how i can maintain invariate the outlier. help me please!

Affine transformation of a portion of an image-C++

i have 2 frames of a video stream given by a moving camera . My aim is to blacken, in the 2° frame, the portion of the image that represents the same thing represented in the first frame. Obviously the images represent only partially the same thing (some background is removed and other is added) but after a roto-translation (an affine transformation caused by the camera movement). My idea is to calculate the AffineTransformation matrix (through the OpenCV function: GetAffineTransform) using 3 matching features found by SURF algorithm. After that i would transform the coordinates of each pixel of the image (via the matrix just found), not the whole image!! and blacken the "transformed" pixels. I really don't know how implement this last passage: using WarpAffine on the image itself I can only blacken the outlier pixel not the inlier and i don't know how i can maintain invariate the outlier. help me please!