Git Product home page Git Product logo

bm3d-gpu's People

Contributors

dawyd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bm3d-gpu's Issues

16-bit tiff file

This project is not working with 16-bit tiff images. It is still doing something and the output is a 8-bit tiff pretty close to a random image.

Sigma argument not used for gray value images?

Hi! Thanks for this great implementation!
However, I noticed that changing sigma did not change the output when denoising gray scale images. From looking into the code, I think the reason is that the parameter sigma is only actually used if channels == 3, while it is initialized to 625 otherwise. I changed it in my local copy of the repository, and it seems to have fixed it, although based on the results I am still not 100% sure I really replaced it with the correct values (from my understanding, sigma2 should simply be sigma squared, i.e. the variance).

It concerns lines 49-64 in main_nodisplay.cpp (I indicate my "fix" as a comment in line 53 (line 5 of the snippet))

	//Allocate images
	CImg<unsigned char> image(argv[1]);
	CImg<unsigned char> image2(image.width(), image.height(), 1, channels, 0);
	std::vector<unsigned int> sigma2(channels);
	sigma2[0] = 25 * 25;   // <---    sigma2[0] = sigma * sigma;     
	
	//Convert color image to YCbCr color space
	if (channels == 3)
	{
		image = image.get_channels(0, 2).RGBtoYCbCr();
		//Convert the sigma^2 variance to the YCbCr color space
		long s = sigma * sigma;
		sigma2[0] = ((66l*66l*s + 129l*129l*s + 25l*25l*s) / (256l*256l));
		sigma2[1] = ((38l*38l*s + 74l*74l*s + 112l*112l*s) / (256l*256l)),
		sigma2[2] = ((112l*112l*s + 94l*94l*s + 18l*18l*s) / (256l*256l));
	}

It would be great if you could verify the issue and that the fix is correct.

undefined reference to `jpeg_std_error'

hello,

this error appears with make command:

[100%] Linking CXX executable bm3d
/usr/bin/ld: CMakeFiles/bm3d.dir/src/main_nodisplay.cpp.o: in function `cimg_library::CImg<unsigned char>::_save_jpeg(_IO_FILE*, char const*, unsigned int) const':
main_nodisplay.cpp:(.text._ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj]+0x26b): undefined reference to `jpeg_std_error'
/usr/bin/ld: main_nodisplay.cpp:(.text._ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj]+0x28b): undefined reference to `jpeg_CreateCompress'
/usr/bin/ld: main_nodisplay.cpp:(.text._ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj]+0x2d4): undefined reference to `jpeg_stdio_dest'
/usr/bin/ld: main_nodisplay.cpp:(.text._ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj]+0x31a): undefined reference to `jpeg_set_defaults'
/usr/bin/ld: main_nodisplay.cpp:(.text._ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj]+0x345): undefined reference to `jpeg_set_quality'
/usr/bin/ld: main_nodisplay.cpp:(.text._ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj]+0x359): undefined reference to `jpeg_start_compress'
/usr/bin/ld: main_nodisplay.cpp:(.text._ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj]+0x808): undefined reference to `jpeg_write_scanlines'
/usr/bin/ld: main_nodisplay.cpp:(.text._ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj]+0x81c): undefined reference to `jpeg_finish_compress'
/usr/bin/ld: main_nodisplay.cpp:(.text._ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj]+0x844): undefined reference to `jpeg_destroy_compress'
/usr/bin/ld: CMakeFiles/bm3d.dir/src/main_nodisplay.cpp.o: in function `cimg_library::CImg<unsigned char>::_load_jpeg(_IO_FILE*, char const*)':
main_nodisplay.cpp:(.text._ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc[_ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc]+0x100): undefined reference to `jpeg_std_error'
/usr/bin/ld: main_nodisplay.cpp:(.text._ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc[_ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc]+0x233): undefined reference to `jpeg_CreateDecompress'
/usr/bin/ld: main_nodisplay.cpp:(.text._ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc[_ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc]+0x24c): undefined reference to `jpeg_stdio_src'
/usr/bin/ld: main_nodisplay.cpp:(.text._ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc[_ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc]+0x260): undefined reference to `jpeg_read_header'
/usr/bin/ld: main_nodisplay.cpp:(.text._ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc[_ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc]+0x26f): undefined reference to `jpeg_start_decompress'
/usr/bin/ld: main_nodisplay.cpp:(.text._ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc[_ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc]+0x4da): undefined reference to `jpeg_read_scanlines'
/usr/bin/ld: main_nodisplay.cpp:(.text._ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc[_ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc]+0x799): undefined reference to `jpeg_finish_decompress'
/usr/bin/ld: main_nodisplay.cpp:(.text._ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc[_ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc]+0x7a8): undefined reference to `jpeg_destroy_decompress'
/usr/bin/ld: CMakeFiles/bm3d.dir/src/main_nodisplay.cpp.o: in function `cimg_library::CImg<unsigned char>::_cimg_jpeg_error_exit(jpeg_common_struct*)':
main_nodisplay.cpp:(.text._ZN12cimg_library4CImgIhE21_cimg_jpeg_error_exitEP18jpeg_common_struct[_ZN12cimg_library4CImgIhE21_cimg_jpeg_error_exitEP18jpeg_common_struct]+0x45): undefined reference to `jpeg_destroy'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/bm3d.dir/build.make:129: bm3d] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/bm3d.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

Illegal memory access on some images

I get the following error:

Sigma = 10
Number of Steps: 2
Color denoising: yes
Noise variance for individual channels (YCrCb if color): 32 29 33 
width: 4231 height: 3051
Shared memory : 46KB/48KB
Number of warps: 20
Processing 0%terminate called after throwing an instance of 'thrust::system::system_error'
  what():  bm3d.hpp(788):: an illegal memory access was encountered
test_bm3d.sh: line 6:  5767 Aborted                 (core dumped) bm3d ${NOISYTESTDIR}/${TESTSET}/${TESTIMG} results/test2/bm3d-${SIGMA}/${TESTIMG} ${SIGMA} color twostep

when trying to denoise any of the images in that set https://commons.wikimedia.org/wiki/File:NIND_MuseeL-skull-C500D_ISO200.jpg

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.