我正在尝试从纸币图像中提取一个对象。 我对原始图像应用了Sobel边缘检测。这是图片:
我的问题是,在下面的裁剪图像中,我只想显示数字100,而不要其他干扰。请问如何做到这一点?
我到目前为止使用的代码是:
(注:本段内容无需翻译,仅为说明用途)
![enter image description here](https://istack.dev59.com/ZkdU1.webp)
![enter image description here](https://istack.dev59.com/6lh7K.webp)
close All;
clear All;
Note1 = imread('0001.jpg');
Note2 = imread('0007.jpg');
figure(1), imshow(Note1);
figure(2), imshow(Note2);
Note1=rgb2gray(Note1);
Note2=rgb2gray(Note2);
Edge1=edge(Note1,'sobel');
Edge2=edge(Note2,'sobel');
figure(5), imshow(Edge1),title('Edge sobel1');
figure(6), imshow(Edge2),title('Edge sobel2');
rect_Note1 = [20 425 150 70];
rect_Note2 = [20 425 150 70];
sub_Note1 = imcrop(Edge1,rect_Note1);
sub_Note2 = imcrop(Edge2,rect_Note2);
figure(7), imshow(sub_Note1);
figure(8), imshow(sub_Note2);
为了完整起见,这是原始图片:
(注:本段内容无需翻译,仅为说明用途)