本文整理汇总了C++中Signal::savepng方法的典型用法代码示例。如果您正苦于以下问题:C++ Signal::savepng方法的具体用法?C++ Signal::savepng怎么用?C++ Signal::savepng使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Signal
的用法示例。
在下文中一共展示了Signal::savepng方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(void)
{
////////////////////////////////////////////////
/// DEBUG
////////////////////////////////////////////////
// Signal signal(8);
// for(int i = 0; i<signal.getSize(); ++i)
// signal[i] = i;
// Signal filtre(5);
// filtre[2] = 1;
// Signal cpy = signal;
// tools::filtrage(cpy, filtre);
// cpy.save("test.dat");
std::cout << "//////////////////////////////////////////////" << std::endl;
std::cout << "/// RAMPE" << std::endl;
std::cout << "//////////////////////////////////////////////" << std::endl;
Signal rampe(256);
for(int i = 0; i<rampe.getSize(); ++i)
rampe[i] = i;
rampe.savepng("./data/rampe/origine.png");
haar::analyse(rampe);
rampe.savepng("./data/rampe/haaranalyse.png");
haar::synthese(rampe);
rampe.savepng("./data/rampe/haarsynthese.png");
biortho97::analyse(rampe);
rampe.savepng("./data/rampe/biortho97analyse.png");
biortho97::synthese(rampe);
rampe.savepng("./data/rampe/biortho97synthese.png");
std::cout << std::endl << "//////////////////////////////////////////////" << std::endl;
std::cout << "/// LELECUM" << std::endl;
std::cout << "//////////////////////////////////////////////" << std::endl;
Signal signal;
signal.load("./data/leleccum.txt");
signal.savepng("./data/leleccum/origine.png");
Signal signalHaar = signal;
Signal signalLift = signal;
Signal signalBiortho = signal;
Signal signalAMR = signal;
lifting::analyse(signalLift);
signalLift.savepng("./data/leleccum/liftinganalyse.png");
lifting::synthese(signalLift);
signalLift.savepng("./data/leleccum/lifting.png");
haar::analyse(signalHaar);
signalHaar.savepng("./data/leleccum/haaranalyse.png");
haar::synthese(signalHaar);
signalHaar.savepng("./data/leleccum/haar.png");
biortho97::analyse(signalBiortho);
signalBiortho.savepng("./data/leleccum/biortho97analyse.png");
biortho97::synthese(signalBiortho);
signalBiortho.savepng("./data/leleccum/biortho97.png");
amr::analyse(signalAMR, 1);
signalAMR.savepng("./data/leleccum/amranalyse.png");
amr::synthese(signalAMR, 1);
signalAMR.savepng("./data/leleccum/amr.png");
std::cout << "Error Test (signal avec lui même): " << tools::significantError(signal, signal) << std::endl;
std::cout << "Error Lift: " << tools::significantError(signal, signalLift) << std::endl;
std::cout << "Error Haar: " << tools::significantError(signal, signalHaar) << std::endl;
std::cout << "Error Biortho: " << tools::significantError(signal, signalBiortho) << std::endl;
std::cout << "Error AMR: " << tools::significantError(signal, signalAMR) << std::endl;
std::cout << std::endl << "//////////////////////////////////////////////" << std::endl;
std::cout << "/// LENA SIGNAL 1D" << std::endl;
std::cout << "//////////////////////////////////////////////" << std::endl;
Signal lena1D;
lena1D.load("./data/lena.txt");
signalHaar = lena1D;
signalBiortho = lena1D;
signalLift = lena1D;
Signal signalAMR2 = lena1D;
Signal signalAMR4 = lena1D;
Signal signalAMRMax = lena1D;
haar::analyse(signalHaar);
signalHaar.savepng("./data/lena1D/haaranalyse.png");
haar::synthese(signalHaar);
signalHaar.savepng("./data/lena1D/haar.png");
biortho97::analyse(signalBiortho);
signalBiortho.savepng("./data/lena1D/biortho97analyse.png");
biortho97::synthese(signalBiortho);
signalBiortho.savepng("./data/lena1D/biortho97.png");
lifting::analyse(signalLift);
signalLift.savepng("./data/lena1D/liftinganalyse.png");
lifting::synthese(signalLift);
signalLift.savepng("./data/lena1D/lifting.png");
//.........这里部分代码省略.........