Browse files

interface finale et makefile

  • Loading branch information...
1 parent 5d8a241 commit 52cb8615945b999a1b437f6aa824a76c65a77602 Chuck committed Dec 7, 2012
Showing with 36 additions and 10 deletions.
  1. +1 −1 OCR/Main.ml
  2. +2 −2 OCR/Makefile
  3. +1 −1 OCR/Pretreatment.ml
  4. +32 −6 OCR/ocr_gui.ml
View
2 OCR/Main.ml
@@ -23,4 +23,4 @@ let mtx3 = Pretreatment.new_binarisation
OSdl.wait ();
(*OSdl.display (Pretreatment.mtx2su mtx_debug w h pfi) w h;*)
exit 0
-
+
View
4 OCR/Makefile
@@ -3,8 +3,8 @@ DPDC = sdl.cmxa sdlloader.cmxa bigarray.cmxa lablgtk.cmxa
MOD = Tools.ml Pretreatment.ml OSdl.ml Rotation.ml Binarisation.ml Main.ml
EXE:
- $(LIB) $(DPDC) -o Interface $(MOD) ocr_gui.ml
+ $(LIB) $(DPDC) -o Colibri $(MOD) ocr_gui.ml
Clean :
- rm *.cm* *.o Interface
+ rm *.cm* *.o Colibri
View
2 OCR/Pretreatment.ml
@@ -128,4 +128,4 @@ let conv_filter_3x3 mtx w h kernel factor =
done
done;
print_string " done\n";
- new_mtx
+ new_mtx
View
38 OCR/ocr_gui.ml
@@ -8,7 +8,7 @@ let window = GWindow.window
~width:800 ()
let box = GPack.vbox
- ~spacing:10
+ ~spacing:2
~border_width:10
~packing:window#add ()
@@ -30,17 +30,25 @@ let get_contents = function (* str_op -> str *)
let data = [`T "Extraire le texte"; `S; `B `SAVE; `S; `B `CUT; `B `COPY; `B `PASTE; `S;]
+let btn1 = GButton.tool_button
+ ~label:"Extraire le texte"
+ ~packing:toolbar#insert ()
+
let _ =
let packing = toolbar#insert in
List.iter (function
| `S -> ignore (GButton.separator_tool_item ~packing ())
| `B stock -> ignore (GButton.tool_button ~stock ~packing ())
- | `T label -> let btn1 = GButton.tool_button ~label ~packing ()
- in ignore btn1;btn1#connect#clicked (let img = btn#title
- in Main.main img)
| _ -> ()
) data
-
+
+let _ =
+ begin
+ ignore btn1;
+ btn1#connect#clicked
+(function _ -> Main.main (get_contents (btn#filename)))
+ end
+
let item = GButton.tool_item
~packing:toolbar#insert ()
@@ -54,7 +62,7 @@ Dos Santos Johan (<dossan_j@epita.fr>)
Froger Antoine (<froger_a@epita.fr>)
Gibert Charles (<gibert_c@epita.fr>)"]
~copyright:"Copyright © 2012-2013 Colibri"
- ~version:" colibri 1.0"
+ ~version:" version 1.0"
~website:"site elie ici"
~position:`CENTER_ON_PARENT
~parent:window
@@ -64,6 +72,17 @@ Gibert Charles (<gibert_c@epita.fr>)"]
btn#connect#clicked (fun () -> ignore (dlg#run ()); dlg#misc#hide ());
btn
+(* Boutons presentation *)
+let bbox = GPack.button_box `HORIZONTAL
+ ~layout:`EDGE
+ ~packing:box#pack ()
+
+let binarisation = GButton.button ~label:"binarisation" ~packing:bbox#add ()
+let rotation = GButton.button ~label:"rotation" ~packing:bbox#add ()
+let rlsa = GButton.button ~label:"rlsa" ~packing:bbox#add ()
+let extraction = GButton.button ~label:"extraction" ~packing:bbox#add ()
+
+
(* Textbox *)
let txt_frame = GBin.aspect_frame
~label:"Texte"
@@ -82,6 +101,13 @@ let image = GMisc.image
~packing:img_frame#add ()
(* Events *)
+
+let _ =
+ binarisation#connect#clicked (fun _ -> image#set_file "bin.bmp");
+ rotation#connect#clicked (fun _ -> image#set_file "rot.bmp");
+ rlsa#connect#clicked (fun _ -> image#set_file "rlsa.bmp");
+ extraction#connect#clicked (fun _ -> image#set_file "extraction.bmp")
+
let _ =
btn#connect#selection_changed ~callback:(
fun _ -> image#set_file(get_contents btn#filename);

0 comments on commit 52cb861

Please sign in to comment.