sub2ind out of range subscript error

1 view (last 30 days)
Swapnil
Swapnil on 6 Apr 2014
Commented: Walter Roberson on 8 Apr 2014
Hi,
I am trying to detect the text in an image using code provided for Automatically Detect and Recognize Text in Natural Images on http://www.mathworks.in/help/vision/examples/automatically-detect-and-recognize-text-in-natural-images.html#zmw57dd0e728.
Getting an error on
ind = sub2ind(size(mserMask), mserRegionsPixels(:,2), mserRegionsPixels(:,1));
Error message is
Attempted to access mserRegionsPixels(:,2); index out of bounds because
size(mserRegionsPixels)=[0,0].
I am using the same image handicapsign.jpg to test this code.
Your prompt response will be highly appreciated.
Thanks

Answers (1)

Image Analyst
Image Analyst on 6 Apr 2014
I don't have that toolbox, but backtrack to find out why mserRegionsPixels does not have any coordinates in it. Chances are you replaced the demo image with your image, or you changed a threshold, or something like that.
  6 Comments
Swapnil
Swapnil on 8 Apr 2014
Walter, I do have Computer Vision System Toolbox Version 5.2(R2013a). But I can't see helperGrowEdges.m and helperStrokeWidth.m at "C:\Program Files\MATLAB\R2013a\toolbox\vision\vision".
Could you please share the code of these two files so that I can create them at that location ?
Walter Roberson
Walter Roberson on 8 Apr 2014
R2013a is not the current version; R2014a is the current version. The demo might not be usable for you as it might rely on facilities found only in versions later than what you have.

Sign in to comment.

Categories

Find more on Computer Vision Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!