Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: yihsien/instant_sudoku
base: 1ff2477e65
...
head fork: yihsien/instant_sudoku
compare: 59974c6953
  • 2 commits
  • 28 files changed
  • 0 commit comments
  • 1 contributor
Commits on Jan 14, 2014
Jennifer Guo adding runme() 83c7d0a
Jennifer Guo including output files 59974c6
Showing with 63 additions and 2 deletions.
  1. +2 −2 .gitignore
  2. +58 −0 code/extract_digits/runme.m
  3. BIN  code/extract_digits/test.jpg
  4. +3 −0  output/extracted_digits/README.txt
  5. BIN  output/extracted_squares/square_1.jpg
  6. BIN  output/extracted_squares/square_10.jpg
  7. BIN  output/extracted_squares/square_11.jpg
  8. BIN  output/extracted_squares/square_12.jpg
  9. BIN  output/extracted_squares/square_13.jpg
  10. BIN  output/extracted_squares/square_14.jpg
  11. BIN  output/extracted_squares/square_15.jpg
  12. BIN  output/extracted_squares/square_2.jpg
  13. BIN  output/extracted_squares/square_3.jpg
  14. BIN  output/extracted_squares/square_4.jpg
  15. BIN  output/extracted_squares/square_5.jpg
  16. BIN  output/extracted_squares/square_6.jpg
  17. BIN  output/extracted_squares/square_7.jpg
  18. BIN  output/extracted_squares/square_8.jpg
  19. BIN  output/extracted_squares/square_9.jpg
  20. BIN  output/extracted_squares/square_sudoku.jpg
  21. BIN  output/extracted_squares/square_sudoku1.png
  22. BIN  output/extracted_squares/square_sudoku2.png
  23. BIN  output/extracted_squares/square_sudoku3.png
  24. BIN  output/extracted_squares/square_sudoku4.png
  25. BIN  output/extracted_squares/square_sudoku5.png
  26. BIN  output/extracted_squares/square_sudoku6.png
  27. BIN  output/extracted_squares/square_sudoku7.png
  28. BIN  output/extracted_squares/square_sudoku8.png
4 .gitignore
View
@@ -1,8 +1,8 @@
# ignore output files
output/*.jpg
output/*.png
-output/*/*.jpg
-output/*/*.png
+output/extracted_digits/*.jpg
+output/extracted_digits/*.png
# OS generated files
.DS_Store
58 code/extract_digits/runme.m
View
@@ -0,0 +1,58 @@
+function [] = runme (force_overwrite)
+ % By default we do not overwrite results
+ if (nargin < 1)
+ force_overwrite = false;
+ end
+
+ close all
+
+ % Get list of all filenames image directory
+ filenames = dir('../../output/extracted_squares');
+
+ % Keep record of the evaluation results for each input image
+ %scores = [];
+
+ % Process all filenames in input directory
+ for i = 1:size(filenames)
+ filename = filenames(i).name;
+
+ % Check if filename is an image
+ if (~isempty(strfind(filename, '.jpg')) || ~isempty(strfind(filename, '.png')))
+ disp(['[+] Processing ' filename]);
+ if (~isempty(strfind(filename, '.jpg')))
+ % Determine filenames
+ basename = strrep(filename, '.jpg', '');
+ input_filename = strcat('../../output/extracted_squares/', basename, '.jpg');
+ output_filename = strcat('../../output/extracted_digits/square_', basename, '.jpg');
+ elseif(~isempty(strfind(filename, '.png')))
+ basename = strrep(filename, '.png', '');
+ input_filename = strcat('../../output/extracted_squares/', basename, '.png');
+ output_filename = strcat('../../output/extracted_digits/square_', basename, '.png');
+ end
+
+
+ % Create output image, if it does not already exist
+ if (force_overwrite || ~exist(output_filename, 'file'))
+
+ % Read the input image
+ input_image = imread(input_filename); % should be a gray image
+
+ % Begin timer
+ tic
+
+ % adaptive thresholding to convert to bw image
+ img = im2bw(input_image);
+ output_struct = extractdigits(img, basename);
+
+ % writing to output folder happens inside extractdigits()
+
+ % End timer
+ toc
+
+
+ end
+
+
+ end
+ end
+end
BIN  code/extract_digits/test.jpg
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3  output/extracted_digits/README.txt
View
@@ -0,0 +1,3 @@
+Contains output from step 2: extract digits.
+Can be used for debugging and final project write up.
+Not uploaded on github, content should be generated yourself.
BIN  output/extracted_squares/square_1.jpg
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  output/extracted_squares/square_10.jpg
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  output/extracted_squares/square_11.jpg
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  output/extracted_squares/square_12.jpg
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  output/extracted_squares/square_13.jpg
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  output/extracted_squares/square_14.jpg
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  output/extracted_squares/square_15.jpg
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  output/extracted_squares/square_2.jpg
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  output/extracted_squares/square_3.jpg
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  output/extracted_squares/square_4.jpg
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  output/extracted_squares/square_5.jpg
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  output/extracted_squares/square_6.jpg
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  output/extracted_squares/square_7.jpg
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  output/extracted_squares/square_8.jpg
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  output/extracted_squares/square_9.jpg
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  output/extracted_squares/square_sudoku.jpg
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  output/extracted_squares/square_sudoku1.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  output/extracted_squares/square_sudoku2.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  output/extracted_squares/square_sudoku3.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  output/extracted_squares/square_sudoku4.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  output/extracted_squares/square_sudoku5.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  output/extracted_squares/square_sudoku6.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  output/extracted_squares/square_sudoku7.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  output/extracted_squares/square_sudoku8.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

No commit comments for this range

Something went wrong with that request. Please try again.