Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

update rotate function

  • Loading branch information...
commit 439b628bdf4a735e9c1600190b42f600c63e83c3 1 parent 0d9a133
dezyal authored
Showing with 3 additions and 3 deletions.
  1. +2 −2 OCR/Rotation.ml
  2. +1 −1  OCR/main.ml
View
4 OCR/Rotation.ml
@@ -17,8 +17,8 @@ let rotate mtx w h a =
and new_y = int_of_float(
(float)(x)*.sin(a) +. (float)y*.cos(a)) in
print_int new_x;print_string ":";print_int new_y;print_newline();
- if not(out_of_bounds new_mtx new_w new_h new_x new_y) then
- new_mtx.(new_x).(new_y) <- 0
+ if (new_x > -1 && new_x < new_w && new_y > -1 && new_y < new_h) then
+ new_mtx.(new_x).(new_y) <- 0
done
done;
new_mtx
View
2  OCR/main.ml
@@ -14,7 +14,7 @@ let main () =
[|2;5;2;5;20;5;2;5;2|] (1./.48.) in
let mtx3 = Pretreatment.new_binarisation
(Pretreatment.pre_bin mtx2 w h) w h in
- (*let mtx3 = Rotation.rotate mtx3 w h (0.0523598776)*) in
+ let mtx3 = Rotation.rotate mtx3 w h (0.0523598776) in
OSdl.display (Pretreatment.mtx2su mtx3 w h pfi) w h;
OSdl.wait ();
exit 0
Please sign in to comment.
Something went wrong with that request. Please try again.