Rm GUI / Add cmd line intf
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1 @@ | ||||
| .vscode | ||||
| @@ -1,24 +0,0 @@ | ||||
| from PIL import Image | ||||
| from PIL import ImageFont | ||||
| from PIL import ImageDraw | ||||
| import os | ||||
|  | ||||
| L = ['ACaslonPro-Regular.otf','AdobeArabic-Regular.otf','AdobeDevanagari-Regular.otf', 'AdobeFangsongStd-Regular.otf','AdobeHebrew-Regular.otf', 'AdobeHeitiStd-Regular.otf', 'AdobeKaitiStd-Regular.otf', 'AdobeMyungjoStd-Medium.otf', 'AdobeNaskh-Medium.otf','AGaramondPro-Regular.otf', 'arial.ttf', 'arialbd.ttf', 'bahnschrift.ttf', 'calibri.ttf', 'calibrib.ttf', 'cambria.ttc', 'cambriab.ttf', 'Candara.ttf', 'Candarab.ttf', 'ChaparralPro-Bold.otf', 'ChaparralPro-Regular.otf', 'consola.ttf', 'consolab.ttf', 'CooperBlackStd.otf', 'corbel.ttf', 'corbelb.ttf', 'ebrima.ttf', 'ebrimabd.ttf', 'framdit.ttf', 'Gabriola.ttf', 'georgia.ttf', 'georgiab.ttf', | ||||
| 'himalaya.ttf', 'HoboStd.otf',   | ||||
| 'Nirmala.ttf', 'NirmalaB.ttf','ntailu.ttf', 'ntailub.ttf', 'NuevaStd-Bold.otf', | ||||
| 'pala.ttf', 'palab.ttf', 'phagspa.ttf', 'phagspab.ttf', | ||||
| 'tahoma.ttf', 'tahomabd.ttf', 'taile.ttf', 'taileb.ttf', 'times.ttf', 'timesbd.ttf', 'trebuc.ttf', 'trebucbd.ttf', 'verdana.ttf', 'verdanab.ttf'] | ||||
|  | ||||
| letter = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,'" | ||||
| os.chdir (os.path.dirname(os.path.dirname(__file__)) + '/src/Dataset') | ||||
|  | ||||
| lon_font = len(L) | ||||
| lon_char = len(letter) | ||||
|  | ||||
| for j in range(lon_char): | ||||
|     for i in range(lon_font): | ||||
|         font = ImageFont.truetype(L[i], 24) | ||||
|         img = Image.new('RGB', (32, 32), color = 'white') | ||||
|         draw = ImageDraw.Draw(img) | ||||
|         draw.text((0, 0),letter[j],(0,0,0),font=font) | ||||
|         img.save('image-' + str(j) + "-" + str(i + 1) + '.bmp', 'bmp') | ||||
							
								
								
									
										67
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						| @@ -1,59 +1,34 @@ | ||||
| CC=gcc | ||||
| CPPFLAGS= -MMD `pkg-config --cflags gtk+-3.0` | ||||
| CFLAGS= -Wall -Wextra -std=c99 -g -D_XOPEN_SOURCE=600 | ||||
| LDLIBS= `pkg-config --libs gtk+-3.0` -lSDL2 -lm -rdynamic | ||||
| LDLIBS= `pkg-config --libs gtk+-3.0` -lSDL2 -lm -rdynamic -Isrc | ||||
| EXEC= OCR | ||||
|  | ||||
| SRC= src/ocr.c \ | ||||
| 	 src/image_treatment/segmentation/segmentation.c \ | ||||
| 	 src/image_treatment/filter/cleanerimage.c \ | ||||
| 	 src/image_treatment/tools/tools.c \ | ||||
| 	 src/image_treatment/display.c \ | ||||
| 	 src/image_treatment/extraction/extraction.c \ | ||||
| 	 src/image_treatment/extraction/extractchar.c \ | ||||
| 	 src/neural_network/structure.c \ | ||||
| 	 src/neural_network/training.c \ | ||||
| 	 src/neural_network/toolsnetworks.c \ | ||||
| 	 src/neural_network/traitement.c \ | ||||
| 	 src/neural_network/load.c \ | ||||
| 	 src/tools/arg_parse.c \ | ||||
|  | ||||
|  | ||||
| all: $(EXEC) | ||||
|  | ||||
| test_train: | ||||
| 	./OCR --train --save-weight=test_train.txt | ||||
|  | ||||
| OCR: main.o segmentation.o cleanerimage.o tools.o display.o extraction.o extractchar.o structure.o training.o toolsnetworks.o traitement.o Load.o | ||||
| 	$(CC) -o OCR main.o segmentation.o cleanerimage.o tools.o display.o extraction.o extractchar.o structure.o training.o toolsnetworks.o Load.o traitement.o $(LDLIBS) | ||||
| 	rm -rf *.o *.d | ||||
|  | ||||
|  | ||||
| main.o: main.c | ||||
| 	$(CC) -o main.o -c main.c $(CFLAGS) $(CPPFLAGS) | ||||
|  | ||||
| segmentation.o: ImageTreatment/Segmentation/segmentation.c | ||||
| 	$(CC) -o segmentation.o -c ImageTreatment/Segmentation/segmentation.c $(CFLAGS) $(CPPFLAGS) | ||||
|  | ||||
| cleanerimage.o: ImageTreatment/Filter/cleanerimage.c | ||||
| 	$(CC) -o cleanerimage.o -c ImageTreatment/Filter/cleanerimage.c $(CFLAGS) $(CPPFLAGS) | ||||
|  | ||||
| tools.o: ImageTreatment/Tools/tools.c | ||||
| 	$(CC) -o tools.o -c ImageTreatment/Tools/tools.c $(CFLAGS) $(CPPFLAGS) -lm | ||||
|  | ||||
| display.o: ImageTreatment/display.c | ||||
| 	$(CC) -o display.o -c ImageTreatment/display.c $(CFLAGS) $(CPPFLAGS) | ||||
|  | ||||
| extraction.o: ImageTreatment/extraction/extraction.c | ||||
| 	$(CC) -o extraction.o -c ImageTreatment/extraction/extraction.c $(CFLAGS) $(CPPFLAGS) | ||||
|  | ||||
| extractchar.o: ImageTreatment/extraction/extractchar.c | ||||
| 	$(CC) -o extractchar.o -c ImageTreatment/extraction/extractchar.c $(CFLAGS) $(CPPFLAGS) | ||||
|  | ||||
| structure.o: NeuralNetwork/structure.c | ||||
| 	$(CC) -o structure.o -c NeuralNetwork/structure.c $(CFLAGS) $(CPPFLAGS) | ||||
|  | ||||
| training.o: NeuralNetwork/training.c | ||||
| 	$(CC) -o training.o -c NeuralNetwork/training.c $(CFLAGS) $(CPPFLAGS) | ||||
|  | ||||
| toolsnetworks.o: NeuralNetwork/toolsnetworks.c | ||||
| 	$(CC) -o toolsnetworks.o -c NeuralNetwork/toolsnetworks.c $(CFLAGS) $(CPPFLAGS) | ||||
|  | ||||
| traitement.o: NeuralNetwork/traitement.c | ||||
| 	$(CC) -o traitement.o -c NeuralNetwork/traitement.c $(CFLAGS) $(CPPFLAGS) | ||||
|  | ||||
| Load.o: NeuralNetwork/Load.c | ||||
| 	$(CC) -o Load.o -c NeuralNetwork/Load.c $(CFLAGS) $(CPPFLAGS) | ||||
|  | ||||
|  | ||||
|  | ||||
| Test: main.c | ||||
| 	$(CC) -o main.o -c main.c $(CFLAGS) $(CPPFLAGS) | ||||
| test_rec: OCR | ||||
| 	./OCR --input-file misc/test_images/test_image.bmp --load-weight misc/nnweight/nnweight.txt | ||||
|  | ||||
| OCR: $(SRC) | ||||
| 	$(CC) $(SRC) -o OCR $(CFLAGS) $(CPPFLAGS) $(LDLIBS)	 | ||||
|  | ||||
| clean: | ||||
| 	rm -rf *.o *.d OCR | ||||
|   | ||||
							
								
								
									
										23
									
								
								README.md
									
									
									
									
									
								
							
							
						
						| @@ -1,20 +1,29 @@ | ||||
| # OCR | ||||
|  | ||||
| This project implement an OCR in C. The OCR use a one layer neural network to reconise charactere. | ||||
| This project implement an OCR in C. The OCR is made of a one hidden layer neural network and is aimed to reconise alpha numeric charactere. | ||||
|  | ||||
| ## Compile | ||||
|  | ||||
| You can use this program with this command | ||||
|  | ||||
| You compile the project using: | ||||
| ``` | ||||
| make | ||||
| ./OCR | ||||
| ``` | ||||
|  | ||||
| When the program run you should first load an image in BitMap format | ||||
| You can test the binary with: | ||||
| ``` | ||||
| ./OCR -i misc/test_images/test_image.bmp -l misc/nnweight/nnweight.txt | ||||
| ``` | ||||
|  | ||||
| Then you can upgrade the quality of your image with our different options. When you are ready simply press ```play``` | ||||
| For additional information, please use: | ||||
| ``` | ||||
| ./OCR --help | ||||
| ``` | ||||
|  | ||||
| Note: The OCR only read bitmap image. | ||||
|  | ||||
| ## Clean | ||||
|  | ||||
| Use ```make clean``` to delete all trash files | ||||
| To clean the environment use: | ||||
| ``` | ||||
| make clean | ||||
| ```  | ||||
							
								
								
									
										10
									
								
								all.h
									
									
									
									
									
								
							
							
						
						| @@ -1,10 +0,0 @@ | ||||
| #include "ImageTreatment/Filter/cleanerimage.h" | ||||
| #include "ImageTreatment/Segmentation/segmentation.h" | ||||
| #include "ImageTreatment/Tools/tools.h" | ||||
| #include "ImageTreatment/display.h" | ||||
| #include "ImageTreatment/extraction/extractchar.h" | ||||
| #include "ImageTreatment/extraction/extraction.h" | ||||
| #include "NeuralNetwork/structure.h" | ||||
| #include "NeuralNetwork/toolsnetworks.h" | ||||
| #include "NeuralNetwork/training.h" | ||||
| #include "NeuralNetwork/traitement.h" | ||||
							
								
								
									
										230
									
								
								main.c
									
									
									
									
									
								
							
							
						
						| @@ -1,230 +0,0 @@ | ||||
| #include <SDL2/SDL.h> | ||||
| #include <err.h> | ||||
| #include <gtk/gtk.h> | ||||
| #include <stdio.h> | ||||
| #include <stdlib.h> | ||||
|  | ||||
| #include "all.h" | ||||
|  | ||||
| GtkWidget *window; | ||||
| GtkWidget *wimage; | ||||
| GtkWidget *image; | ||||
| GtkWidget *textBox; | ||||
| GtkWidget *final; | ||||
| GtkWidget *ninety; | ||||
| GtkWidget *oneeighty; | ||||
| GtkWidget *segm; | ||||
| GtkWidget *grays; | ||||
| GtkWidget *contra; | ||||
| GtkWidget *biner; | ||||
| GtkWidget *play; | ||||
| GtkWidget *noise; | ||||
| GtkWidget *rotation; | ||||
| GtkWidget *nette; | ||||
| SDL_Surface *surf; | ||||
|  | ||||
| int main(int argc, char *argv[]) | ||||
| { | ||||
|     SDL_Init(SDL_INIT_VIDEO); | ||||
|     GtkBuilder *builder; | ||||
|     gtk_init(&argc, &argv); | ||||
|     builder = gtk_builder_new(); | ||||
|     gtk_builder_add_from_file(builder, "main.glade", NULL); | ||||
|     window = GTK_WIDGET(gtk_builder_get_object(builder, "window")); | ||||
|     gtk_builder_connect_signals(builder, NULL); | ||||
|     final = GTK_WIDGET(gtk_builder_get_object(builder, "final")); | ||||
|     textBox = GTK_WIDGET(gtk_builder_get_object(builder, "textBox")); | ||||
|     ninety = GTK_WIDGET(gtk_builder_get_object(builder, "ninety")); | ||||
|     oneeighty = GTK_WIDGET(gtk_builder_get_object(builder, "oneeighty")); | ||||
|     segm = GTK_WIDGET(gtk_builder_get_object(builder, "segmentation")); | ||||
|     grays = GTK_WIDGET(gtk_builder_get_object(builder, "grayscale")); | ||||
|     contra = GTK_WIDGET(gtk_builder_get_object(builder, "contrastes")); | ||||
|     biner = GTK_WIDGET(gtk_builder_get_object(builder, "binarisation")); | ||||
|     play = GTK_WIDGET(gtk_builder_get_object(builder, "lanceTout")); | ||||
|     noise = GTK_WIDGET(gtk_builder_get_object(builder, "noise")); | ||||
|     rotation = GTK_WIDGET(gtk_builder_get_object(builder, "rotation")); | ||||
|     nette = GTK_WIDGET(gtk_builder_get_object(builder, "nettete")); | ||||
|     g_object_unref(builder); | ||||
|     gtk_widget_show(window); | ||||
|     g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL); | ||||
|     gtk_main(); | ||||
|  | ||||
|     return 0; | ||||
| } | ||||
|  | ||||
| SDL_Surface *load_image(char *path) | ||||
| { | ||||
|     SDL_Surface *img; | ||||
|     img = SDL_LoadBMP(path); | ||||
|     if (!img) | ||||
|         errx(3, "Can't load %s: %s", path, SDL_GetError()); | ||||
|     return img; | ||||
| } | ||||
|  | ||||
| void choose_image(char *file) | ||||
| { | ||||
|     gtk_widget_set_sensitive(ninety, TRUE); | ||||
|     gtk_widget_set_sensitive(segm, TRUE); | ||||
|     gtk_widget_set_sensitive(play, TRUE); | ||||
|     gtk_widget_set_sensitive(grays, TRUE); | ||||
|     gtk_widget_set_sensitive(contra, TRUE); | ||||
|     gtk_widget_set_sensitive(biner, TRUE); | ||||
|     gtk_widget_set_sensitive(noise, TRUE); | ||||
|     gtk_widget_set_sensitive(rotation, TRUE); | ||||
|     gtk_widget_set_sensitive(oneeighty, TRUE); | ||||
|     gtk_widget_set_sensitive(nette, TRUE); | ||||
|     surf = load_image(file); | ||||
|     SDL_SaveBMP(surf, "images/temp.bmp"); | ||||
|     SDL_FreeSurface(surf); | ||||
| } | ||||
|  | ||||
| void file_selected(GtkWidget *filechooserbutton) | ||||
| { | ||||
|     char *filename = | ||||
|         gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(filechooserbutton)); | ||||
|     printf("%s\n", filename); | ||||
|     choose_image(filename); | ||||
| } | ||||
|  | ||||
| // Il faut juste que tu mettes tes fonctions à la place des commentaires. Si | ||||
| // jamais tu as pas certaines fonctions par exemple pour recup le resultat du | ||||
| // reseau de neurones dis le moi et je les demanderai à Axelle ou Brice. | ||||
|  | ||||
| // Pour les fonctions, l'image à modifier est sauvegardée dans le fichier | ||||
| // images/temp.bmp | ||||
|  | ||||
| void play_button() | ||||
| { | ||||
|     GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textBox)); | ||||
|     GtkTextIter iter; | ||||
|     gtk_text_buffer_get_iter_at_offset(buffer, &iter, 0); | ||||
|     char *result = calloc(sizeof(char), 10000); | ||||
|  | ||||
|     // result sera le texte final | ||||
|     // traitement de l'image (dans le fichier images/temp.bmp) | ||||
|     // segmentation de l'image | ||||
|     // envoi au reseau de neurones | ||||
|     // stockage du resultat du reseau de neurones dans la variable result | ||||
|     SDL_Surface *loadedImage = SDL_LoadBMP("images/temp.bmp"); | ||||
|     binerize(loadedImage); | ||||
|     Neural_Network *network = (Neural_Network *)malloc(sizeof(Neural_Network)); | ||||
|     Initialisation(network); | ||||
|     Load_Network(network, "SaveNetwork.txt"); | ||||
|     __extractpar(loadedImage, network, result); | ||||
|     Free_Network(network); | ||||
|     SDL_FreeSurface(loadedImage); | ||||
|     gtk_text_buffer_insert(buffer, &iter, result, -1); | ||||
|     free(result); | ||||
|     gtk_widget_show(final); | ||||
|     gtk_widget_hide(window); | ||||
| } | ||||
|  | ||||
| void nettete() | ||||
| { | ||||
|     static float SharpenMatrix[3][3] = { { 0.0, -1.0, 0.0 }, | ||||
|                                          { -1.0, 5.0, -1.0 }, | ||||
|                                          { 0.0, -1.0, 0.0 } }; | ||||
|     SDL_Surface *loadedImage = SDL_LoadBMP("images/temp.bmp"); | ||||
|     SDL_Window *window = display_img(loadedImage); | ||||
|     wait_for_keypressed(); | ||||
|     SDL_DestroyWindow(window); | ||||
|     loadedImage = Convolute(loadedImage, SharpenMatrix); | ||||
|     window = display_img(loadedImage); | ||||
|     SDL_SaveBMP(loadedImage, "images/temp.bmp"); | ||||
|     wait_for_keypressed(); | ||||
|     SDL_DestroyWindow(window); | ||||
|     SDL_FreeSurface(loadedImage); | ||||
| } | ||||
|  | ||||
| void plus_oneeighty() | ||||
| { | ||||
|     SDL_Surface *loadedImage = SDL_LoadBMP("images/temp.bmp"); | ||||
|     SDL_Window *window = display_img(loadedImage); | ||||
|     wait_for_keypressed(); | ||||
|     SDL_DestroyWindow(window); | ||||
|     grayscale(loadedImage); | ||||
|     binerize(loadedImage); | ||||
|     loadedImage = rotate(180, loadedImage); | ||||
|     window = display_img(loadedImage); | ||||
|     SDL_SaveBMP(loadedImage, "images/temp.bmp"); | ||||
|     wait_for_keypressed(); | ||||
|     SDL_DestroyWindow(window); | ||||
|     SDL_FreeSurface(loadedImage); | ||||
| } | ||||
|  | ||||
| void plus_ninety() | ||||
| { | ||||
|     SDL_Surface *loadedImage = SDL_LoadBMP("images/temp.bmp"); | ||||
|     SDL_Window *window = display_img(loadedImage); | ||||
|     wait_for_keypressed(); | ||||
|     SDL_DestroyWindow(window); | ||||
|     grayscale(loadedImage); | ||||
|     binerize(loadedImage); | ||||
|     loadedImage = rotate(90, loadedImage); | ||||
|     window = display_img(loadedImage); | ||||
|     SDL_SaveBMP(loadedImage, "images/temp.bmp"); | ||||
|     wait_for_keypressed(); | ||||
|     SDL_DestroyWindow(window); | ||||
|     SDL_FreeSurface(loadedImage); | ||||
| } | ||||
|  | ||||
| void gray() | ||||
| { | ||||
|     // grayscale | ||||
| } | ||||
|  | ||||
| void bine() | ||||
| { | ||||
|     // binarisation | ||||
| } | ||||
|  | ||||
| void seg() | ||||
| {} | ||||
|  | ||||
| void cont() | ||||
| { | ||||
|     SDL_Surface *loadedImage = SDL_LoadBMP("images/temp.bmp"); | ||||
|     SDL_Window *window = display_img(loadedImage); | ||||
|     wait_for_keypressed(); | ||||
|     SDL_DestroyWindow(window); | ||||
|     ConstrastRenforcement(loadedImage, 100); | ||||
|     window = display_img(loadedImage); | ||||
|     wait_for_keypressed(); | ||||
|     SDL_DestroyWindow(window); | ||||
|     SDL_FreeSurface(loadedImage); | ||||
| } | ||||
|  | ||||
| void rot() | ||||
| { | ||||
|     SDL_Surface *loadedImage = SDL_LoadBMP("images/temp.bmp"); | ||||
|     SDL_Window *window = display_img(loadedImage); | ||||
|     wait_for_keypressed(); | ||||
|     SDL_DestroyWindow(window); | ||||
|     binerize(loadedImage); | ||||
|     grayscale(loadedImage); | ||||
|     double teta = houghtrasformy(loadedImage); | ||||
|     teta -= 90; | ||||
|     loadedImage = rotate(teta, loadedImage); | ||||
|     window = display_img(loadedImage); | ||||
|     SDL_SaveBMP(loadedImage, "images/temp.bmp"); | ||||
|     wait_for_keypressed(); | ||||
|     SDL_DestroyWindow(window); | ||||
|     SDL_FreeSurface(loadedImage); | ||||
| } | ||||
|  | ||||
| void noise_reduction() | ||||
| { | ||||
|     SDL_Surface *loadedImage = SDL_LoadBMP("images/temp.bmp"); | ||||
|     SDL_Window *window = display_img(loadedImage); | ||||
|     wait_for_keypressed(); | ||||
|     SDL_DestroyWindow(window); | ||||
|     noiseReduction(loadedImage); | ||||
|     window = display_img(loadedImage); | ||||
|     wait_for_keypressed(); | ||||
|     SDL_DestroyWindow(window); | ||||
| } | ||||
|  | ||||
| void on_quit_clicked() | ||||
| { | ||||
|     gtk_main_quit(); | ||||
| } | ||||
							
								
								
									
										320
									
								
								main.glade
									
									
									
									
									
								
							
							
						
						| @@ -1,320 +0,0 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!-- Generated with glade 3.38.1 --> | ||||
| <interface> | ||||
|   <requires lib="gtk+" version="3.24"/> | ||||
|   <object class="GtkFileFilter" id="filefilter1"> | ||||
|     <patterns> | ||||
|       <pattern>*.bmp</pattern> | ||||
|     </patterns> | ||||
|   </object> | ||||
|   <object class="GtkWindow" id="window"> | ||||
|     <property name="name">window</property> | ||||
|     <property name="can-focus">False</property> | ||||
|     <property name="opacity">0.9</property> | ||||
|     <property name="title" translatable="yes">window</property> | ||||
|     <property name="window-position">center</property> | ||||
|     <property name="type-hint">utility</property> | ||||
|     <property name="has-resize-grip">True</property> | ||||
|     <signal name="destroy" handler="destroy" swapped="no"/> | ||||
|     <child> | ||||
|       <object class="GtkFixed" id="fixed1"> | ||||
|         <property name="visible">True</property> | ||||
|         <property name="can-focus">False</property> | ||||
|         <child> | ||||
|           <object class="GtkButton" id="lanceTout"> | ||||
|             <property name="label">Play</property> | ||||
|             <property name="name">play</property> | ||||
|             <property name="width-request">100</property> | ||||
|             <property name="height-request">80</property> | ||||
|             <property name="visible">True</property> | ||||
|             <property name="sensitive">False</property> | ||||
|             <property name="can-focus">True</property> | ||||
|             <property name="receives-default">True</property> | ||||
|             <property name="resize-mode">immediate</property> | ||||
|             <signal name="clicked" handler="play_button" swapped="no"/> | ||||
|           </object> | ||||
|           <packing> | ||||
|             <property name="x">400</property> | ||||
|             <property name="y">55</property> | ||||
|           </packing> | ||||
|         </child> | ||||
|         <child> | ||||
|           <object class="GtkLabel" id="label2"> | ||||
|             <property name="width-request">100</property> | ||||
|             <property name="height-request">30</property> | ||||
|             <property name="visible">True</property> | ||||
|             <property name="can-focus">False</property> | ||||
|             <property name="label" translatable="yes">Choose a file</property> | ||||
|             <property name="angle">0.06</property> | ||||
|           </object> | ||||
|           <packing> | ||||
|             <property name="x">50</property> | ||||
|             <property name="y">20</property> | ||||
|           </packing> | ||||
|         </child> | ||||
|         <child> | ||||
|           <object class="GtkButton" id="ninety"> | ||||
|             <property name="label" translatable="yes">+90°</property> | ||||
|             <property name="name">ninety</property> | ||||
|             <property name="width-request">100</property> | ||||
|             <property name="height-request">80</property> | ||||
|             <property name="visible">True</property> | ||||
|             <property name="sensitive">False</property> | ||||
|             <property name="can-focus">True</property> | ||||
|             <property name="receives-default">True</property> | ||||
|             <property name="resize-mode">immediate</property> | ||||
|             <signal name="clicked" handler="plus_ninety" swapped="no"/> | ||||
|           </object> | ||||
|           <packing> | ||||
|             <property name="x">410</property> | ||||
|             <property name="y">250</property> | ||||
|           </packing> | ||||
|         </child> | ||||
|         <child> | ||||
|           <object class="GtkLabel" id="label3"> | ||||
|             <property name="width-request">150</property> | ||||
|             <property name="height-request">80</property> | ||||
|             <property name="visible">True</property> | ||||
|             <property name="can-focus">False</property> | ||||
|             <property name="label" translatable="yes">OCRigolo</property> | ||||
|             <property name="justify">center</property> | ||||
|             <property name="ellipsize">middle</property> | ||||
|             <attributes> | ||||
|               <attribute name="style" value="normal"/> | ||||
|               <attribute name="weight" value="heavy"/> | ||||
|               <attribute name="variant" value="small-caps"/> | ||||
|               <attribute name="scale" value="1"/> | ||||
|               <attribute name="strikethrough-color" value="#ffffffffffff"/> | ||||
|             </attributes> | ||||
|           </object> | ||||
|           <packing> | ||||
|             <property name="x">200</property> | ||||
|             <property name="y">40</property> | ||||
|           </packing> | ||||
|         </child> | ||||
|         <child> | ||||
|           <object class="GtkButton" id="quit"> | ||||
|             <property name="label">gtk-quit</property> | ||||
|             <property name="width-request">500</property> | ||||
|             <property name="height-request">28</property> | ||||
|             <property name="visible">True</property> | ||||
|             <property name="can-focus">True</property> | ||||
|             <property name="receives-default">True</property> | ||||
|             <property name="halign">start</property> | ||||
|             <property name="margin-left">5</property> | ||||
|             <property name="margin-right">5</property> | ||||
|             <property name="margin-top">5</property> | ||||
|             <property name="margin-bottom">5</property> | ||||
|             <property name="border-width">5</property> | ||||
|             <property name="use-stock">True</property> | ||||
|             <property name="xalign">0.44999998807907104</property> | ||||
|             <property name="always-show-image">True</property> | ||||
|             <signal name="clicked" handler="on_quit_clicked" swapped="no"/> | ||||
|           </object> | ||||
|           <packing> | ||||
|             <property name="x">25</property> | ||||
|             <property name="y">330</property> | ||||
|           </packing> | ||||
|         </child> | ||||
|         <child> | ||||
|           <object class="GtkFileChooserButton" id="filechooserbutton1"> | ||||
|             <property name="name">chooser</property> | ||||
|             <property name="width-request">100</property> | ||||
|             <property name="height-request">80</property> | ||||
|             <property name="visible">True</property> | ||||
|             <property name="can-focus">False</property> | ||||
|             <property name="filter">filefilter1</property> | ||||
|             <signal name="file-set" handler="file_selected" swapped="no"/> | ||||
|           </object> | ||||
|           <packing> | ||||
|             <property name="x">50</property> | ||||
|             <property name="y">55</property> | ||||
|           </packing> | ||||
|         </child> | ||||
|         <child> | ||||
|           <object class="GtkButton" id="grayscale"> | ||||
|             <property name="label" translatable="yes">grayscale</property> | ||||
|             <property name="name">grays</property> | ||||
|             <property name="width-request">100</property> | ||||
|             <property name="height-request">80</property> | ||||
|             <property name="visible">True</property> | ||||
|             <property name="sensitive">False</property> | ||||
|             <property name="can-focus">True</property> | ||||
|             <property name="receives-default">True</property> | ||||
|             <property name="resize-mode">immediate</property> | ||||
|             <signal name="clicked" handler="gray" swapped="no"/> | ||||
|           </object> | ||||
|           <packing> | ||||
|             <property name="x">40</property> | ||||
|             <property name="y">150</property> | ||||
|           </packing> | ||||
|         </child> | ||||
|         <child> | ||||
|           <object class="GtkButton" id="binarisation"> | ||||
|             <property name="label" translatable="yes">binerize</property> | ||||
|             <property name="name">biner</property> | ||||
|             <property name="width-request">100</property> | ||||
|             <property name="height-request">80</property> | ||||
|             <property name="visible">True</property> | ||||
|             <property name="sensitive">False</property> | ||||
|             <property name="can-focus">True</property> | ||||
|             <property name="receives-default">True</property> | ||||
|             <property name="resize-mode">immediate</property> | ||||
|             <signal name="clicked" handler="bine" swapped="no"/> | ||||
|           </object> | ||||
|           <packing> | ||||
|             <property name="x">165</property> | ||||
|             <property name="y">250</property> | ||||
|           </packing> | ||||
|         </child> | ||||
|         <child> | ||||
|           <object class="GtkButton" id="contrastes"> | ||||
|             <property name="label" translatable="yes">contrasts</property> | ||||
|             <property name="name">contra</property> | ||||
|             <property name="width-request">100</property> | ||||
|             <property name="height-request">80</property> | ||||
|             <property name="visible">True</property> | ||||
|             <property name="sensitive">False</property> | ||||
|             <property name="can-focus">True</property> | ||||
|             <property name="receives-default">True</property> | ||||
|             <property name="resize-mode">immediate</property> | ||||
|             <signal name="clicked" handler="cont" swapped="no"/> | ||||
|           </object> | ||||
|           <packing> | ||||
|             <property name="x">410</property> | ||||
|             <property name="y">150</property> | ||||
|           </packing> | ||||
|         </child> | ||||
|         <child> | ||||
|           <object class="GtkButton" id="noise"> | ||||
|             <property name="label" translatable="yes">noise</property> | ||||
|             <property name="name">noise</property> | ||||
|             <property name="width-request">100</property> | ||||
|             <property name="height-request">80</property> | ||||
|             <property name="visible">True</property> | ||||
|             <property name="sensitive">False</property> | ||||
|             <property name="can-focus">True</property> | ||||
|             <property name="receives-default">True</property> | ||||
|             <property name="resize-mode">immediate</property> | ||||
|             <signal name="clicked" handler="noise_reduction" swapped="no"/> | ||||
|           </object> | ||||
|           <packing> | ||||
|             <property name="x">285</property> | ||||
|             <property name="y">150</property> | ||||
|           </packing> | ||||
|         </child> | ||||
|         <child> | ||||
|           <object class="GtkButton" id="rotation"> | ||||
|             <property name="label" translatable="yes">rotation</property> | ||||
|             <property name="name">rotation</property> | ||||
|             <property name="width-request">100</property> | ||||
|             <property name="height-request">80</property> | ||||
|             <property name="visible">True</property> | ||||
|             <property name="sensitive">False</property> | ||||
|             <property name="can-focus">True</property> | ||||
|             <property name="receives-default">True</property> | ||||
|             <property name="resize-mode">immediate</property> | ||||
|             <signal name="clicked" handler="rot" swapped="no"/> | ||||
|           </object> | ||||
|           <packing> | ||||
|             <property name="x">40</property> | ||||
|             <property name="y">250</property> | ||||
|           </packing> | ||||
|         </child> | ||||
|         <child> | ||||
|           <object class="GtkButton" id="nettete"> | ||||
|             <property name="label" translatable="yes">sharpness</property> | ||||
|             <property name="name">nette</property> | ||||
|             <property name="width-request">100</property> | ||||
|             <property name="height-request">80</property> | ||||
|             <property name="visible">True</property> | ||||
|             <property name="sensitive">False</property> | ||||
|             <property name="can-focus">True</property> | ||||
|             <property name="receives-default">True</property> | ||||
|             <property name="resize-mode">immediate</property> | ||||
|             <signal name="clicked" handler="nettete" swapped="no"/> | ||||
|           </object> | ||||
|           <packing> | ||||
|             <property name="x">165</property> | ||||
|             <property name="y">150</property> | ||||
|           </packing> | ||||
|         </child> | ||||
|         <child> | ||||
|           <object class="GtkButton" id="oneeighty"> | ||||
|             <property name="label" translatable="yes">+180°</property> | ||||
|             <property name="name">oneeighty</property> | ||||
|             <property name="width-request">100</property> | ||||
|             <property name="height-request">80</property> | ||||
|             <property name="visible">True</property> | ||||
|             <property name="sensitive">False</property> | ||||
|             <property name="can-focus">True</property> | ||||
|             <property name="receives-default">True</property> | ||||
|             <property name="resize-mode">immediate</property> | ||||
|             <signal name="clicked" handler="plus_oneeighty" swapped="no"/> | ||||
|           </object> | ||||
|           <packing> | ||||
|             <property name="x">285</property> | ||||
|             <property name="y">250</property> | ||||
|           </packing> | ||||
|         </child> | ||||
|       </object> | ||||
|     </child> | ||||
|   </object> | ||||
|   <object class="GtkWindow" id="final"> | ||||
|     <property name="width-request">640</property> | ||||
|     <property name="can-focus">False</property> | ||||
|     <property name="margin-bottom">1</property> | ||||
|     <child> | ||||
|       <object class="GtkFixed" id="fixed2"> | ||||
|         <property name="width-request">640</property> | ||||
|         <property name="visible">True</property> | ||||
|         <property name="can-focus">False</property> | ||||
|         <child> | ||||
|           <object class="GtkTextView" id="textBox"> | ||||
|             <property name="name">textBox</property> | ||||
|             <property name="width-request">640</property> | ||||
|             <property name="height-request">460</property> | ||||
|             <property name="visible">True</property> | ||||
|             <property name="can-focus">True</property> | ||||
|           </object> | ||||
|           <packing> | ||||
|             <property name="y">67</property> | ||||
|           </packing> | ||||
|         </child> | ||||
|         <child> | ||||
|           <object class="GtkLabel" id="label4"> | ||||
|             <property name="width-request">100</property> | ||||
|             <property name="height-request">80</property> | ||||
|             <property name="visible">True</property> | ||||
|             <property name="can-focus">False</property> | ||||
|             <property name="label" translatable="yes">Result :</property> | ||||
|           </object> | ||||
|           <packing> | ||||
|             <property name="x">265</property> | ||||
|           </packing> | ||||
|         </child> | ||||
|         <child> | ||||
|           <object class="GtkButton" id="quit1"> | ||||
|             <property name="label">gtk-quit</property> | ||||
|             <property name="width-request">465</property> | ||||
|             <property name="height-request">28</property> | ||||
|             <property name="visible">True</property> | ||||
|             <property name="can-focus">True</property> | ||||
|             <property name="receives-default">True</property> | ||||
|             <property name="halign">start</property> | ||||
|             <property name="margin-top">5</property> | ||||
|             <property name="margin-bottom">5</property> | ||||
|             <property name="border-width">5</property> | ||||
|             <property name="use-stock">True</property> | ||||
|             <property name="always-show-image">True</property> | ||||
|             <signal name="clicked" handler="on_quit_clicked" swapped="no"/> | ||||
|           </object> | ||||
|           <packing> | ||||
|             <property name="x">33</property> | ||||
|             <property name="y">529</property> | ||||
|           </packing> | ||||
|         </child> | ||||
|       </object> | ||||
|     </child> | ||||
|   </object> | ||||
| </interface> | ||||
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB | 
| Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |