How do I quantify the symmetry of an image?
6 次查看(过去 30 天)
显示 更早的评论
I am interested in quantifying the symmetry in a set of images. In particular, I am interested in symmetry along the vertical and horizontal axes that cut through the middle of the image. (I.e., the two in the example).
Is there a "best" way to do this in MATLAB?
0 个评论
采纳的回答
Walter Roberson
2017-3-22
One way to quantify would be Mean Squared Error between the image and its flipped version. For example,
immse( YourImage, fliplr(YourImage) )
However, this could be very sensitive to small translations along the way, and it is not obvious that there is a single "right" answer for that.
Consider for example alternating stripes of width one pixel, first column 1, second column 0. Suppose there are 200 total columns. Then column 99 would be 1, column 100 would be 0, column 101 would be 1, column 102 would be 0, etc. After flipping, column 101 (1s) would become column 100 (was 0), and would be completely different than the other column 100; column 102 (0s) would become column 99 (was 1s), and completely different than it. So by a strict definition, the two halves are not mirror images -- and yet if the original image had 199 columns instead of 200 then the reflection would be around the "middle" of column 100 and the two sides should be considered mirrors in that case. The image would not really have changed in any fundamental way in one sense, but symmetry or not in a strict sense depends on the detail of even or odd number of columns.
Now suppose you had all black except a symmetric "heart" in each half, and those are the only features. Chances are that you probably do not really care that if the heart in each half are exactly the same distance from the center of the image array due to odd/even considerations. A translation of half a pixel or one pixel probably does not matter for that case. If you were to cross-correlation one half of the image with the flipped version of the other half, the match would be good.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!