Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Avoid blurring when doing imrotate; or apply a histogram #17
When I use imrotate, on a 28x28 pixel, greyscale image (actually MNIST data), it ends up more blurred. I.e. when I plot the before and after histogram, the after image has slightly lower peaks at the black and white extremes, and all the much smaller grey peaks in the middle have got a bit higher.
If I do 12 rotations of 30 degrees, I get a blurry blob. The ideal would be no information loss at all and to get back the exact pixels I started with. (I tried all three values for
(BTW, I used
IDEA 1: Be able to apply the histogram of another image, and it will brighten or dim pixels until it matches. I don't know how to write this, but the usage would be:
IDEA 2: Could there be a version of imrotate() that didn't change the image size, and didn't blur? (It feels like the fact that the image grows in size is related to the dilution of image brightness?)
P.S. I'm happy to provide test data, and my test rotation scripts, if there is interest.
Rotation without blurring is hard, I wouldn't be surprised if people
For histogram matching, is that what you need?
Le 15/08/2016 22:46, Darren Cook a écrit :
However when I rotate 12 times, 30 degrees, it corrupts the image in an interesting way!
For comparison, here is the the same loop without the histogram adjustment:
(I'll post code in the next comment.)
The code for the previous comment