Permalink
Browse files

update the rotate function

  • Loading branch information...
1 parent 6187a73 commit d42fd7ccbf79b72c42ff64b33fe23270e7389023 dezyal committed Oct 17, 2012
Showing with 4 additions and 3 deletions.
  1. +3 −2 OCR/Rotation.ml
  2. +1 −1 OCR/main.ml
View
@@ -1,9 +1,10 @@
(*
[Fonction Rotate]
Effectue la rotation d'une image à partir
- d'un angle en radian
+ d'un angle en degré
*)
-let rotate mtx w h a =
+let rotate mtx w h angle =
+ let a = Tools.deg2rad angle in
let new_w = int_of_float(
(float)w*.cos(a) +. (float)h*.sin(a))
and new_h = int_of_float(
View
@@ -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 (2.) in
OSdl.display (Pretreatment.mtx2su mtx3 w h pfi) w h;
OSdl.wait ();
exit 0

0 comments on commit d42fd7c

Please sign in to comment.