-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
enhancementNew feature or requestNew feature or request
Description
If the image does not contain a sudoku at all, the code:
[solution, outputs] = solver.process(exampleImage);
errors as follows:
Index in position 1 is invalid. Array indices must be positive integers or logical values.
Error in tabular/subsrefBraces (line 35)
b = b(rowIndices,:); % without using reshape, may not have one
Error in tabular/numArgumentsFromSubscript (line 21)
x = t.subsrefBraces(s(1));
Error in sudoku.findPrimaryRegion (line 19)
filledRegion = imerode(regions{end, 3}{1}, ones(3));
Error in sudoku.PuzzleSolver/findPuzzle (line 82)
mask = sudoku.findPrimaryRegion(thresholdedImage);
Error in sudoku.PuzzleSolver/process (line 62)
[mask, findSteps] = obj.findPuzzle(im);
It would be great if we could make it error in a more sensible way. So far, in my own repo I added the following in src/sudoku/+sudoku/findPrimaryRegions
if isempty(regions)
error('A sudoku could not be found on the image')
end
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request