using namespace arma;
{
int R = 120, C = 160;
mat x( R, C );
cx_mat X( R, C );
mat mag( R, C );
gp0.
window(
"Image", 10, 10, 2 * C + 80, 2 * R + 50 );
gp1.
window(
"FFT Blue channel", 640, 10, 2 * C + 80 + 50, 2 * R + 50 );
cube x3( R, C, 3, fill::randu );
x3 *= 100;
x3.slice( 0 ).submat( span( 20, 51 ), span( 20, 51 ) ) = 250 * ones( 32, 32 );
x3.slice( 1 ).submat( span( 80, 111 ), span( 70, 101 ) ) = 250 * ones( 32, 32 );
x3.slice( 2 ).submat( span( 20, 51 ), span( 110, 141 ) ) = 250 * ones( 32, 32 );
ppm.
write(
"test.ppm", ppm.
PPM_B, x3,
"Test picture" );
x = x3.slice( 2 );
return 0;
}
void fft2(arma::mat &x, arma::cx_mat &Pxx)
FFT of real 2D input.
Portable anymap format class.
bool write(std::string fname, const imtype _type, const arma::cube &img, const std::string info="")
Write the .pnm file.
void send2gp(const char *cmdstr)
Send command to Gnuplot pipe.
void image(const arma::Mat< T > &x)
Plot mat as image.
void set_term(const char *ttype)
Set output terminal.
void window(const int fig, const char *name, const int x, const int y, const int width, const int height)
Configure the figure used Windows environment.
arma::Col< T > fftshift(const arma::Col< T > &Pxx)
1D FFT shift.