Applying a barcode formula - Matlab

How to write code to apply a formula to an image, and a low-pass filter result. The red area is the highest intensity that matches the barcode.

Formula: Formula

Original Image: Original

Processed Image: Localization of barcode

edited How to build points

edited Building points: Plot the points

-2
source share
1 answer

I tend to agree with nikie that you should work from a book if you are at this basic level, but that is the answer anyway.

I = imread('your_image'); # convert I to grayscale double as appropriate using rgb2gray(), double(), etc. # calculate the gradients and the formula you provided [dIx, dIy] = gradient(I); B = abs(dIx) - abs(dIy); # do your low-pass filtering H = fspecial('gaussian', 20, 10); C = imfilter(B, H); imagesc(C); colorbar; 

Good luck Make sure you understand this code before doing copypasta.

+3
source

Source: https://habr.com/ru/post/1393882/


All Articles