/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        T R A N S F O R M A T I O N   A F F I N E   D E S   C O O R D O N N E S   D ' U N E   I M A G E  :                         */
/*                                                                                                                                   */
/*                                                                                                                                   */
/*        Author of '$xci/affine.01$K' :                                                                                             */
/*                                                                                                                                   */
/*                    Jean-Francois COLONNA (LACTAMME, 1993??????????).                                                              */
/*                                                                                                                                   */
/*************************************************************************************************************************************/

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        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

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        P A R A M E T R E S  :                                                                                                     */
/*                                                                                                                                   */
/*************************************************************************************************************************************/
#define   MATRICE_CX_CX                                                                                                                 \
                    FU
#define   MATRICE_CX_CY                                                                                                                 \
                    FZERO
#define   MATRICE_CY_CX                                                                                                                 \
                    FZERO
#define   MATRICE_CY_CY                                                                                                                 \
                    FU
                                        /* Definition de la matrice precisant la rotation et les deformations des coordonnees.       */

#define   TRANSLATION_A_DX                                                                                                              \
                    FDU
#define   TRANSLATION_A_DY                                                                                                              \
                    FDU
                                        /* Definition du vecteur de translation des coordonnees de l'image Argument.                 */
#define   TRANSLATION_R_DX                                                                                                              \
                    FDU
#define   TRANSLATION_R_DY                                                                                                              \
                    FDU
                                        /* Definition du vecteur de translation des coordonnees de l'image Rrgument.                 */

#define   FAIRE_LA_TRANSFORMATION_INVERSE                                                                                               \
                    FAUX                                                                                                                \
                                        /* Indicateur precisant s'il faut faire la transformation "directe" ('FAUX') ou bien la      */ \
                                        /* transformation "inverse" ('VRAI').                                                        */
#define   INTERPOLER                                                                                                                    \
                    VRAI                                                                                                                \
                                        /* Indicateur precisant s'il faut interpoler ('VRAI') ou pas ('FAUX'), mais uniquement       */ \
                                        /* lorsque la transformation inverse est demandee...                                         */

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        M A C R O S   U T I L E S  :                                                                                               */
/*                                                                                                                                   */
/*************************************************************************************************************************************/

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        T R A N S F O R M A T I O N   A F F I N E   D E S   C O O R D O N N E S   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(matrixF_2D,matrice_de_rotation_scaling_skew);
                                        /* Definition de la matrice precisant la rotation et les deformations des coordonnees.       */
     DEFV(deltaF_2D,vecteur_de_translation_de_imageA);
                                        /* Definition du vecteur de translation des coordonnees de l'image Argument.                 */
     DEFV(deltaF_2D,vecteur_de_translation_de_imageR);
                                        /* Definition du vecteur de translation des coordonnees de l'image Resultat.                 */
     DEFV(Logical,INIT(faire_la_transformation_inverse,FAIRE_LA_TRANSFORMATION_INVERSE));
                                        /* Indicateur precisant s'il faut faire la transformation "directe" ('FAUX') ou bien la      */
                                        /* transformation "inverse" ('VRAI').                                                        */
     DEFV(Logical,INIT(interpoler,INTERPOLER));
                                        /* Indicateur precisant s'il faut interpoler ('VRAI') ou pas ('FAUX'), mais uniquement       */
                                        /* lorsque la transformation inverse est demandee...                                         */
     /*..............................................................................................................................*/
     INITIALISATION_MATRICE_2D(matrice_de_rotation_scaling_skew
                              ,MATRICE_CX_CX,MATRICE_CX_CY
                              ,MATRICE_CY_CX,MATRICE_CY_CY
                               );
                                        /* Initialisation de la matrice precisant la rotation et les deformations des coordonnees.   */
     INITIALISATION_ACCROISSEMENT_2D(vecteur_de_translation_de_imageA
                                    ,TRANSLATION_A_DX
                                    ,TRANSLATION_A_DY
                                     );
                                        /* Initialisation du vecteur de translation des coordonnees de l'image Argument.             */
     INITIALISATION_ACCROISSEMENT_2D(vecteur_de_translation_de_imageR
                                    ,TRANSLATION_R_DX
                                    ,TRANSLATION_R_DY
                                     );
                                        /* Initialisation du vecteur de translation des coordonnees de l'image Resultat.             */

     GET_ARGUMENTSi(nombre_d_arguments
                   ,BLOC(GET_ARGUMENT_C("imageA=""A=",nom_imageA);
                         GET_ARGUMENT_C("imageR=""R=",nom_imageR);

                         GET_ARGUMENT_F("mxx=""Mxx=",ASD2(matrice_de_rotation_scaling_skew,cx,cx));
                         GET_ARGUMENT_F("mxy=""Mxy=",ASD2(matrice_de_rotation_scaling_skew,cx,cy));
                         GET_ARGUMENT_F("myx=""Myx=",ASD2(matrice_de_rotation_scaling_skew,cy,cx));
                         GET_ARGUMENT_F("myy=""Myy=",ASD2(matrice_de_rotation_scaling_skew,cy,cy));
                         GET_ARGUMENT_F("TxA=",ASD1(vecteur_de_translation_de_imageA,dx));
                         GET_ARGUMENT_F("TyA=",ASD1(vecteur_de_translation_de_imageA,dy));
                         GET_ARGUMENT_F("TxR=",ASD1(vecteur_de_translation_de_imageR,dx));
                         GET_ARGUMENT_F("TyR=",ASD1(vecteur_de_translation_de_imageR,dy));
                         GET_ARGUMENT_L("inverse=",faire_la_transformation_inverse);
                         GET_ARGUMENT_L("interpoler=",interpoler);
                         GET_ARGUMENT_L("interpolation_cubique=""cubique="
                                       ,Itransformation_affine_des_coordonnees_____interpolation_cubique
                                        );
                         GET_ARGUMENT_N("interpolation_lineaire=""lineaire="
                                       ,Itransformation_affine_des_coordonnees_____interpolation_cubique
                                        );
                                        /* Arguments introduits le 20131230130118...                                                 */
                         )
                    );

     CALi(Inoir(ImageR));
                                        /* Initialisation de l'image Resultat.                                                       */

     Test(PAS_D_ERREUR(CODE_ERROR(Iload_image(ImageA,nom_imageA))))
          Bblock
          CALS(Itransformation_affine_des_coordonnees(ImageR
                                                     ,ADRESSE(matrice_de_rotation_scaling_skew)
                                                     ,ADRESSE(vecteur_de_translation_de_imageR)
                                                     ,ImageA
                                                     ,ADRESSE(vecteur_de_translation_de_imageA)
                                                     ,faire_la_transformation_inverse
                                                     ,interpoler
                                                      )
               );
                                        /* Transformation affine des coordonnees de l'image Argument...                              */
          CALi(Iupdate_image(nom_imageR,ImageR));
          Eblock
     ATes
          Bblock
          Test__CODE_ERREUR__ERREUR07;
          Eblock
     ETes

     RETU_Commande;
     Eblock
ECommande



Copyright © Jean-François COLONNA, 2019-2024.
Copyright © CMAP (Centre de Mathématiques APpliquées) UMR CNRS 7641 / École polytechnique, Institut Polytechnique de Paris, 2019-2024.