【发布时间】:2015-06-18 15:49:21
【问题描述】:
我尝试选择边框,然后计算面积。 Вut 我对此有一些困难。这是我的原图。
经过对原图的一些处理,我得到了这张图:
这是我的代码:
clear;
I=imread('C:\Users\Sashka\Desktop\calculator.jpg');
i=rgb2gray(I);
background = imopen(i,strel('disk',20));
im=histeq(background, 64);
uns=fspecial('unsharp') ;
uns1=imfilter(im, uns);
bw = im2bw(uns1,0.3);
bw2=bwmorph(bw, 'close', Inf);
bw3=bwmorph(bw2, 'majority', Inf);
bw4=bwmorph(bw3, 'erode', 18);
c=[30 30 440 440];
r=[480 680 680 480];
bw5=bwselect(bw4,c,r,4);
I2=imcrop(bw5, [30 25 1300 1090]);
你能帮我数一下中号按钮的数量吗?
【问题讨论】:
-
你要数所有的按钮吗?
标签: matlab image-processing object-recognition