Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

udpate Rotation.ml

  • Loading branch information...
commit 3d3357abc7205cd9d2d69e574949e565acb74b2a 1 parent 45c9b74
dezyal authored
Showing with 15 additions and 2 deletions.
  1. +11 −0 OCR/Rotation.ml
  2. +4 −2 OCR/main.ml
View
11 OCR/Rotation.ml
@@ -50,6 +50,17 @@ let hough_skew_detection mtx w h =
let (a,b) = rhotheta2ab rho theta w h in
atan(a)
+(* Debug Hough *)
+let trace_line mtx w h a =
+ let new_mtx = Array.copy mtx in
+ for x = 0 to w-1 do
+ let y = int_of_float(a*.(float)x +. (float)h/.3.) in
+ if (y > -1 && y < h-1) then
+ new_mtx.(x).(y) <- 100
+ done;
+ new_mtx
+
+
(*
[Fonction Rotate]
Effectue la rotation d'une image à partir
View
6 OCR/main.ml
@@ -14,10 +14,12 @@ 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 angle = Rotation.hough_skew_detection mtx3 w h in
- print_string " degree:";print_float (Tools.rad2deg angle);*)
+ let (angle) = Rotation.hough_skew_detection mtx3 w h in
+ let mtx_debug = Rotation.trace_line mtx3 w h angle in
+ print_string " degree:";print_float (Tools.rad2deg angle);
OSdl.display (Pretreatment.mtx2su mtx3 w h pfi) w h;
OSdl.wait ();
+ OSdl.display (Pretreatment.mtx2su mtx_debug w h pfi) w h;
exit 0
let _ = main ();
Please sign in to comment.
Something went wrong with that request. Please try again.