Skip to content

Commit

Permalink
Partial pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
Thibaud EHRET committed Jan 2, 2020
1 parent cf551f8 commit 006e305
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 14 deletions.
4 changes: 0 additions & 4 deletions multiscaler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,3 @@ add_library(multiscaler OBJECT iio.c iio.h multiscaler.cpp multiscaler.hpp Image
add_executable(decompose decompose.cpp $<TARGET_OBJECTS:multiscaler>)
add_executable(recompose recompose.cpp $<TARGET_OBJECTS:multiscaler>)
add_executable(merge_coarse merge_coarse.cpp $<TARGET_OBJECTS:multiscaler>)
# iio shared object for piio.py
set(CMAKE_MACOSX_RPATH 1)
ADD_LIBRARY(iio SHARED iio.c iio.h freemem.c)
set_target_properties(iio PROPERTIES SUFFIX ".so")
22 changes: 22 additions & 0 deletions src/Utilities/iio_README
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
his is a C library for reading small images in any format.

To use this library, copy the "iio.c" and "iio.h" files into your source code.
Edit the macros at the end of "iio.h" to fine-tune your library requirements.


CODE CONTRIBUTORS

Enric Meinhardt-Llopis (initial coding)
Gabriele Facciolo (many patches, python bindings, cmake files)
Carlo de Franchis (patches)
Juan Cardelino (cmake configuration, bug reports)



ACKNOWLEDGEMENTS (testing, corrections and bug reports)

Gabriele Facciolo
Carlo de Franchis
Martin Etchart
Roberto Pablo Pérez Palomares
Nicolas Limare
21 changes: 12 additions & 9 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,10 @@ int main(int argc, char **argv)
using std::string;
const string input_path = clo_option("-i" , "" , "< Input sequence");
const string inbsc_path = clo_option("-b" , "" , "< Input basic sequence (it will replace the basic estimation step)");
const string noisy_path = clo_option("-nisy" , "noisy_%03d.tiff", "> Noisy sequence");
const string noisy_path = clo_option("-nisy" , "" , "> Noisy sequence");
const string final_path = clo_option("-deno" , "deno_%03d.tiff" , "> Denoised sequence");
const string basic_path = clo_option("-bsic" , "basic_%03d.tiff", "> Basic denoised sequence");
const string diff_path = clo_option("-diff" , "diff_%03d.tiff" , "> Difference sequence");
const string basic_path = clo_option("-bsic" , "" , "> Basic denoised sequence");
const string diff_path = clo_option("-diff" , "" , "> Difference sequence");
const string meas_path = clo_option("-meas" , "measure.txt" , "> Text file containing the measures (only reliable when -add is set to true)");
#ifdef OPTICALFLOW
const string fflow_path = clo_option("-fflow", "" , "< Forward optical flow ");
Expand Down Expand Up @@ -423,16 +423,19 @@ int main(int argc, char **argv)
}

//! Compute Difference
cout << endl << "Compute difference...";
VideoUtils::computeDiff(vid, vid_denoised, vid_diff, fSigma);
cout << "done." << endl;
if (diff_path != "")
{
cout << endl << "Compute difference...";
VideoUtils::computeDiff(vid, vid_denoised, vid_diff, fSigma);
cout << "done." << endl;
}

//! save noisy, denoised and differences videos
cout << endl << "Save videos...";
vid_noisy.saveVideo(noisy_path, firstFrame, frameStep);
vid_basic.saveVideo(basic_path, firstFrame, frameStep);
if (noisy_path != "") vid_noisy.saveVideo(noisy_path, firstFrame, frameStep);
if (basic_path != "") vid_basic.saveVideo(basic_path, firstFrame, frameStep);
if ( diff_path != "") vid_diff .saveVideo( diff_path, firstFrame, frameStep);
vid_denoised.saveVideo(final_path, firstFrame, frameStep);
vid_diff.saveVideo(diff_path, firstFrame, frameStep);

cout << "done." << endl;

Expand Down
3 changes: 2 additions & 1 deletion src/utils/addnoise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ int main(int argc, char **argv)
//! Paths to input/output sequences
using std::string;
const string input_path = clo_option("-i", "", "< input sequence");
const string output_path = clo_option("-o", "noisy/noisy_%04d.tiff", "> output sequence");
const int sigma = clo_option("-sigma", 20.f, "< Noise level (std. dev.)");
const unsigned first_frame = clo_option("-f", 0, "< First frame of the video");
const unsigned last_frame = clo_option("-l", 0, "< Last frame of the video");
Expand All @@ -55,6 +56,6 @@ int main(int argc, char **argv)
VideoUtils::addNoise(original, noisy, sigma, false);

//! Save noisy video
noisy.saveVideo("noisy/noisy_%04d.tiff", first_frame, 1u);
noisy.saveVideo(output_path, first_frame, 1u);
return EXIT_SUCCESS;
}

0 comments on commit 006e305

Please sign in to comment.