/*************************************************************************************************************************************/ /* */ /* S E U I L L A G E N O I R / B L A N C D ' U N E I M A G E : */ /* */ /* */ /* Definition : */ /* */ /* Cette commande permet de */ /* binarise (NOIR,BLANC) une */ /* image Argument. */ /* */ /* */ /* Author of '$xci/seuil$K' : */ /* */ /* Jean-Francois COLONNA (LACTAMME, 1989??????????). */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* I N T E R F A C E ' listG ' : */ /* */ /* */ /* :Debut_listG: */ /* :Fin_listG: */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* D I R E C T I V E S S P E C I F I Q U E S D E C O M P I L A T I O N : */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* F I C H I E R S D ' I N C L U D E S : */ /* */ /*************************************************************************************************************************************/ #include INCLUDES_BASE #include image_image_IMAGESF_EXT /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* P A R A M E T R E S : */ /* */ /*************************************************************************************************************************************/ #define SEUIL_NOIR_BLANC \ NOIR \ /* Seuil de discrimination entre le 'NOIR' et le 'BLANC'... */ #define NIVEAU_INFERIEUR \ NOIR #define NIVEAU_SUPERIEUR \ BLANC /* Niveaux jouant le role du 'NOIR' et du 'BLANC'... */ #define F_SEUIL_NOIR_BLANC \ FZERO \ /* Seuil de discrimination flottant (introduit le 20040908165025)... */ #define F_NIVEAU_INFERIEUR \ FZERO #define F_NIVEAU_SUPERIEUR \ FU /* Niveaux flottants jouant le role du 'NOIR' et du 'BLANC' (introduits le 20040908165025). */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* M A C R O S U T I L E S : */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* S E U I L L A G E N O I R / B L A N C D ' U N E I M A G E : */ /* */ /*************************************************************************************************************************************/ BCommande(nombre_d_arguments,arguments) /*-----------------------------------------------------------------------------------------------------------------------------------*/ Bblock DEFV(CHAR,INIC(POINTERc(nom_imageR),NOM_PIPE)); DEFV(CHAR,INIC(POINTERc(nom_imageA),NOM_PIPE)); DEFV(genere_p,INIT(seuil,SEUIL_NOIR_BLANC)); /* Seuil de discrimination entre le 'NOIR' et le 'BLANC'... */ DEFV(genere_p,INIT(niveau_inferieur,NIVEAU_INFERIEUR)); DEFV(genere_p,INIT(niveau_superieur,NIVEAU_SUPERIEUR)); /* Niveaux jouant le role du 'NOIR' et du 'BLANC'... */ DEFV(genere_Float,INIT(Fseuil,F_SEUIL_NOIR_BLANC)); /* Seuil de discrimination flottant (introduit le 20040908165025)... */ DEFV(genere_Float,INIT(Fniveau_inferieur,F_NIVEAU_INFERIEUR)); DEFV(genere_Float,INIT(Fniveau_superieur,F_NIVEAU_SUPERIEUR)); /* Niveaux flottants jouant le role du 'NOIR' et du 'BLANC' (introduits le 20040908165025). */ /*..............................................................................................................................*/ GET_ARGUMENTSi(nombre_d_arguments ,BLOC(GET_ARGUMENT_C("imageA=""A=",nom_imageA); GET_ARGUMENT_C("imageR=""R=",nom_imageR); GET_ARGUMENT_L("standard=",les_images_sont_standards); GET_ARGUMENT_P("seuil=""s=",seuil); GET_ARGUMENT_P("inferieur=""inf=",niveau_inferieur); GET_ARGUMENT_P("superieur=""sup=",niveau_superieur); GET_ARGUMENT_F("Fseuil=""Fs=",Fseuil); GET_ARGUMENT_F("Finferieur=""Finf=",Fniveau_inferieur); GET_ARGUMENT_F("Fsuperieur=""Fsup=",Fniveau_superieur); ) ); CALi(gInettoyage(les_images_sont_standards,ImageR,IFmageR)); /* Initialisation de l'image Resultat. */ Test(PAS_D_ERREUR(CODE_ERROR(gIload_image(les_images_sont_standards,ImageA,IFmageA,nom_imageA)))) Bblock Test(EST_VRAI(les_images_sont_standards)) Bblock /* Cas d'une image 'image' : */ CALS(Ibinarisation_generale(ImageR,ImageA,seuil,niveau_inferieur,niveau_superieur)); Eblock ATes Bblock /* Cas d'une image 'imageF' : */ CALS(IFbinarisation_generale(IFmageR,IFmageA,Fseuil,Fniveau_inferieur,Fniveau_superieur)); Eblock ETes CALi(gIupdate_image(les_images_sont_standards,nom_imageR,ImageR,IFmageR)); Eblock ATes Bblock Test__CODE_ERREUR__ERREUR07; Eblock ETes RETU_Commande; Eblock ECommande