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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/146560/image.png)
Original Image
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/146561/image.png)
Processed Image
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/146562/image.png)
0 件のコメント
採用された回答
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 件のコメント
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!