- Obtain the size of the original image.
Transform image or a set of point from the direction of eigenvector
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi,
I'm using the function:
[outIm,whatScale,Direction] = FrangiFilter2D(I, options) in
where Direction is a matrix from computing the direction of the minor eigenvector:
% Calculate (abs sorted) eigenvalues and vectors
[Lambda2,Lambda1,Ix,Iy]=eig2image(Dxx,Dxy,Dyy);
% Compute the direction of the minor eigenvector
angles = atan2(Ix,Iy)
I'd like to use Direction to transform the original image (or a set of original points) in order to correct the warping.
How could I do this without using imtransform or imwarp ?
Thank you,
Best
0 comentarios
Respuestas (1)
Hari
el 4 de Sept. de 2023
Hi Maia,
As per my understanding, you want to use the Direction matrix to transform the original image without using the built-in “imtransform” or “imwarp” functions in MATLAB.
You can do so by manually applying the transformation using interpolation techniques. You can follow the below steps:
[height, width] = size(I);
2. Create a grid of coordinates representing the pixel locations in the original image.
[X, Y] = meshgrid(1:width, 1:height);
3. Calculate the displacement vectors using the Direction matrix.
displacementX = Direction(:,:,1);
displacementY = Direction(:,:,2);
4. Apply the displacement vectors to the grid of coordinates.
newX = X + displacementX;
newY = Y + displacementY;
5. Perform interpolation to obtain the transformed image or transformed set of points.
transformedIm = interp2(X, Y, I, newX, newY, 'linear', 0);
% For transforming a set of points represented by pointsX and pointsY:
transformedPointsX = interp2(X, Y, pointsX, newX, newY, 'linear', 0);
transformedPointsY = interp2(X, Y, pointsY, newX, newY, 'linear', 0);
Refer the below documentation to learn more about “interp2” function in MATLAB.
0 comentarios
Ver también
Categorías
Más información sobre Geometric Transformation and Image Registration en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!