How do I rotate each block of image to be perpendicular to x-axis?

For each block of a fingerprint image, the local orientation is measured. I tried to rotate gradients by their mean orientation but it looks same as gradients and not perpendicular to x-axis.

 Accepted Answer

You could use imrotate() on the block, or use various combinations of transpose (the ' operator), flipud(), and fliplr().

8 Comments

What if I don't have image processing toolbox?
transpose and flip functions are in Base MATLAB so you have them.
Thanks. How to get ensure that after rotation, it's angle to the x-axis is 90 degree?
What's angle? The block will always have sides at 0 and 90 since it's rectangular. And some arbitrary fingerprint ridges inside the block will have gradient vectors at a bunch of arbitrary angles.
Because its asked to Rotate the block such that the dominant ridge flow is perpendicular to the x-axis. Is there any formula to rotate each block in this way?
You didn't say that before. First you need to determine the dominant ridge flow angle somehow (think up some method or follow a paper that describes it), then use imrotate with that angle.
Thanks. Reminding that I don't have Image Processing Toolbox, then is is possible to rotate it based on Rotation matrix?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!