00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include <math.h>
00027 #include <limits.h>
00028 #include "image.h"
00029 #include "proto2D.h"
00030 #include "radar.h"
00031
00032
00051 int main(int argc, char *argv[]){
00052
00053
00054 select_ima_t *pt_sel;
00055 save_ima_t *pt_sav;
00056 idctexp_t idc;
00057
00058
00059 param par0, *ptp;
00060 int n, N, n0, j, lectOK;
00061
00062
00063 imafl *pt_imdct;
00064 imau2 *pt_imres;
00065
00066
00067
00068 param_debut(argc, argv, &par0);
00069 ptp = &par0;
00070
00071 ptp = idctexp_lect(&idc, ptp, "Retour en temporel (DCT-1) et multiplicatif (exp) : ");
00072 N = idc.N;
00073
00074
00075 if( (pt_sel = (select_ima_t *)malloc(N*sizeof(select_ima_t))) == NULL ){
00076 printf("\n>>midctexp_u2: ERREUR allocation tableau descripteurs impossible\n");
00077 exit(1);
00078 }
00079 if( (pt_sav = (save_ima_t *)malloc(N*sizeof(save_ima_t))) == NULL ){
00080 printf("\n>>midctexp_u2: ERREUR allocation tableau descripteurs impossible\n");
00081 exit(1);
00082 }
00083
00084 ptp = select_ima_lect(pt_sel, ptp, "premiere image coeff 0 de DCT (fl) :");
00085 ptp = save_ima_lect(pt_sav, ptp, "premiere image resultat (u2) :");
00086
00087 param_fin(argc, argv, &par0);
00088
00089 for(n=1; n<N; n++){
00090 pt_sel[n] = pt_sel[0];
00091 nom_image_suivante( pt_sel[n-1].nom, pt_sel[n].nom);
00092 pt_sav[n] = pt_sav[0];
00093 nom_image_suivante( pt_sav[n-1].nom, pt_sav[n].nom);
00094 }
00095
00096
00097
00098
00099 if( (pt_imres = (imau2 *)malloc(N*sizeof(imau2))) == NULL ){
00100 printf ("\n>>midctexp_u2: ERREUR allocation tableau image impossible\n");
00101 exit(1);
00102 }
00103 if( (pt_imdct = (imafl *)malloc(N*sizeof(imafl))) == NULL ){
00104 printf ("\n>>midctexp_u2: ERREUR allocation tableau image impossible\n");
00105 exit(1);
00106 }
00107
00108
00109 for(n=0; n<N; n++){
00110 select_imafl_init(pt_sel+n , pt_imdct+n);
00111 save_ima_init(pt_sav+n);
00112 pt_imres[n].p = NULL;
00113 }
00114 idctexp_u2_init(&idc, pt_imdct, pt_imres);
00115
00116
00117
00118 lectOK = 1;
00119 while( (select_imafl_calc(pt_sel, pt_imdct)==0) && (lectOK==1)){
00120 for(n=1; n<N; n++)
00121 if(select_imafl_calc(pt_sel+n, pt_imdct+n)){
00122 lectOK = 0;
00123 break;
00124 }
00125 if( lectOK == 0 ){
00126 printf("\n Pb lecture image %s : fin prematuree\n", pt_sel[n].nom);
00127 break;
00128 }
00129 idctexp_u2_calc(&idc, pt_imdct, pt_imres);
00130 for(n=0; n<N; n++)
00131 save_imau2_calc(pt_sav+n, pt_imres[n]);
00132 }
00133
00134
00135
00136
00137 for(n=0; n<N; n++)
00138 save_ima_ferm(pt_sel[N-1], pt_sav[n]);
00139
00140 }
00141
00142
00143