【发布时间】:2015-03-16 07:07:12
【问题描述】:
我有一张对比度非常低的图像,我想从中提取一个文本对象。由于它的对比度低,我尝试了几种方法,但没有一种方法能给我带来令人满意的结果。我使用watershed 提取文本对象,但由于对比度差,提取不成功。
watershed 我的程序是:
I_cropped=imread(strcat('C:\Id\',currentfilename));
I_cropped = rgb2gray(I_cropped);
I_eq = histeq(I_cropped);
figure,imshow(I_eq);
bw = im2bw(I_eq, graythresh(I_eq));
bw2 = imfill(bw,'holes');
bw3 = imopen(bw2, ones(5,5));
bw4 = bwareaopen(bw3, 40);
bw = im2bw(I_eq, graythresh(I_eq));
figure,imshow(bw);
mask_em = imextendedmax(I_eq, 30);
mask_em = imclose(mask_em, ones(5,5));
mask_em = imfill(mask_em, 'holes');
mask_em = bwareaopen(mask_em, 40);
figure,imshow(mask_em);
I_eq_c = imcomplement(I_eq);
figure,imshow(I_eq_c);
I_mod = imimposemin(I_eq_c, ~bw4 | mask_em);
figure,imshow(I_mod);
L = watershed(I_mod);
figure,imshow(label2rgb(L));
我应用了laplacian滤镜并增强了边缘,但效果不佳。
我的目标是提取文本对象。对于这种低对比度的图像,我应该尝试什么方法?
图片附上:
【问题讨论】:
-
“提取文本对象”是什么意思?你想得到一个包含所有数字的区域,将数字分开,还是得到一个与图像上的数字相对应的数字?请更具体地说明所需的输出。
标签: matlab image-processing text-extraction