【发布时间】:2016-02-18 01:38:06
【问题描述】:
我正在尝试按照本教程http://www.mathworks.com/help/vision/examples/automatically-detect-and-recognize-text-in-natural-images.html 使用 Matlab 检测图像中的文本。
作为第一步,本教程使用detectMSERFeatures 检测图像中的文本区域。但是,当我在图像上使用此步骤时,未检测到文本区域。
这是我正在使用的 sn-p:
colorImage = imread('demo.png');
I = rgb2gray(colorImage);
% Detect MSER regions.
[mserRegions] = detectMSERFeatures(I, ...
'RegionAreaRange',[200 8000],'ThresholdDelta',4);
figure
imshow(I)
hold on
plot(mserRegions, 'showPixelList', true,'showEllipses',false)
title('MSER regions')
hold off
这是原图
这是第一步之后的图像
[![在此处输入图片描述][2]][2]
更新
我玩过参数,但似乎没有一个可以完美地检测到文本区域。有没有比调整数字更好的方法来实现这一点?调整参数不适用于我可能拥有的大量图像。
我尝试过的一些参数及其结果:
[mserRegions] = detectMSERFeatures(I, ...
'RegionAreaRange',[30 100],'ThresholdDelta',12);
[mserRegions] = detectMSERFeatures(I, ...
'RegionAreaRange',[30 600],'ThresholdDelta',12);
【问题讨论】:
-
尝试减少“MaxAreaVariation”,因为您的文本和背景几乎没有变化(减少误报),减少“RegionAreaRange”的最小值,因为小字符可能小于 200 像素(增加 true阳性),并增加“ThresholdDelta”,因为您知道文本和背景之间存在鲜明对比(减少误报)。
-
@kmac,你应该把这个作为答案。
-
我根本没有测试它......我想如果它真的有效的话我可以。 :)
标签: matlab image-processing computer-vision matlab-cvst mser