フィルターのクリア

barcode detection....i wanted to draw a red box around a barcode image...showing that the barcode is detected from the image...

3 ビュー (過去 30 日間)
i wanted to draw a red box around a barcode image... showing that the barcode is detected from the image... my image is a barcode image itself... (means barcode is not a portion of my image..the full image is barcode itself...

採用された回答

michael scheinfeild
michael scheinfeild 2012 年 10 月 17 日
hold on use line command you have option of color
  2 件のコメント
Elysi Cochin
Elysi Cochin 2012 年 10 月 17 日
編集済み: Image Analyst 2012 年 10 月 17 日
Irgb = imread('15wmqe9.jpg');
Irgb = imread('av672a.jpg');
Iresize = imresize(Irgb,0.33);
Igray = double(rgb2gray(Iresize));
[dIx dIy] = gradient(Igray);
B = imabsdiff(abs(dIx),abs(dIy));
H = fspecial('gaussian', 20, 10);
C = imfilter(B, H);
Th = max(C(:));
D = C < Th-10;
stat = regionprops(~D,'Area','BoundingBox');
for i = 1 : numel(stat),
Iarea(i) = stat(i).Area;
end
[C I] = max(Iarea);
bb = stat(I).BoundingBox;
imshow(Iresize); hold on
rectangle('position',bb,'edgecolor','r');
Now my error code is:
??? Index exceeds matrix dimensions.
Error in ==> Untitled6 at 20
bb = stat(I).BoundingBox;
Can u rectify the above error for me?
Image Analyst
Image Analyst 2012 年 10 月 17 日
What's the URL where you uploaded 15wmqe9.jpg?????

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by