Applying the formula to determine the barcode

3 次查看(过去 30 天)
How to write the code to apply the formula to the image and the result is low-pass filtered. The red region is the highest intensity which corresponds to the barcode.
Formula:
Original Image
Processed Image

采纳的回答

Walter Roberson
Walter Roberson 2012-1-25
Perhaps
[FX, FY] = gradient(YourImage);
abs(FX) - abs(FY)
It appears to me that if the image were rotated 90 degrees then the value for any one pixel would switch sign, so you may wish to search for largest absolute values rather than just largest values.
  2 个评论
Kim
Kim 2012-1-30
How can search for largest absolute values?? Btw I was thinking of finding barcode in an angle?? Do you have any idea how to do that?
Walter Roberson
Walter Roberson 2012-1-30
[maxval, maxloc] = max(abs(TheDiff(:)));
[maxr, maxc] = ind2sub(size(TheDiff), maxloc);

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by