フィルターのクリア

issue when quantifying logo symmetry

1 回表示 (過去 30 日間)
Sebano
Sebano 2020 年 5 月 19 日
コメント済み: Tengbo Zhuang 2020 年 7 月 2 日
Hi, I am trying to quantify the symmetry of logo images. So far, I have used the "immse" (mean square error) function and the "fliplr" in MatLab to compare the differences in mean square error (MSE) between the originial logo and the flipped version of the logo to quantify the symmetry. I am experiencing one issue atm with this approach and I need your help... When analysing logos that are 100% symmetric, the MSE can sometimes be super high when it should be extremely close to zero, since theres no differences between the original and flipped version. What may the issue be here? and any ideas on how to solve it?
  4 件のコメント
Sebano
Sebano 2020 年 5 月 23 日
How can I make sure that its divided in the exact middle? What is the code to do this? Thanks.
Sebano
Sebano 2020 年 5 月 23 日
E.g. What I use the following codes to analyze the symmetry of Starbucks logo:
>> Starbucks = imread('132. Starbucks logo.png');
>> imshow(Starbucks);
>> [rows, columns, numberOfColorBrands] = size(Starbucks);
>> if numberOfColorBrands > 1
grayImage = rgb2gray(Starbucks);
else
grayImage = Starbucks;
end
>> imshow(grayImage);
>> immse(grayImage, fliplr(grayImage));
>> imshow(grayImage);
>> imshow(grayImage, fliplr);
The MSR is results in 298... Even when the logo is very symmetric logo! The MSR should be very close to zero... Any recommendations for how to make sure this is done correctly? I have attached the logo file above.

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2020 年 5 月 23 日
regionprops(double(grayimage>0), 'centroid')
and observe that the centroid is 1 pixel to the right of where you would expect.
So construct a new image that is padded on the right with one column of 0. Run the immse and you will see a lower value.
I recommend that you imshow(imsubtract()) the two images to see visually how they are not quite symmetric. As I discussed earlier some of the problem is jpg blurring of edges.

その他の回答 (1 件)

Image Analyst
Image Analyst 2020 年 5 月 23 日
編集済み: Image Analyst 2020 年 5 月 23 日
You have to make sure you're truly flipping about the true vertical axis, which I suspect you're not. You'd have to get rid of the TM in the Starbucks logo that is making the whole logo not symmetric.
Usually symmetry is computed using a symmetry metric like the Sørensen–Dice coefficient.
See attached demo.
  11 件のコメント
Image Analyst
Image Analyst 2020 年 7 月 2 日
It was in the file:
%===============================================================================
% Get the thresholds from which we'll use to create two binary images:
function [lowThreshold, highThreshold] = GetThresholds(pixelCount, grayLevels)
cdf = cumsum(pixelCount);
cdf = cdf / cdf(end);
lowPercentage = 20;
lowThresholdIndex = find(cdf > lowPercentage / 100, 1, 'first');
lowThreshold = grayLevels(lowThresholdIndex);
highPercentage = 40;
highThresholdIndex = find(cdf > highPercentage / 100, 1, 'first');
highThreshold = grayLevels(highThresholdIndex);
Looks like you changed the name when you called it from GetThresholds to GetThersholds.
Tengbo Zhuang
Tengbo Zhuang 2020 年 7 月 2 日
Right! Didn't notice that
I just tested Apple, I think it works now! (0.85) Thanks a lot!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeHistorical Contests についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by