GithubHelp home page GithubHelp logo

cnr-isti-vclab / piccante Goto Github PK

View Code? Open in Web Editor NEW
249.0 37.0 60.0 36.45 MB

The hottest High Dynamic Range (HDR) Library

Home Page: http://vcg.isti.cnr.it/piccante/

License: Mozilla Public License 2.0

TeX 0.01% C++ 99.99%
hdr hdr-image hdr-reinhard hdr-compression tone-mapping hdr-generation c-plus-plus computer-vision feature-extraction triangulation

piccante's Introduction

PICCANTE

The hottest hdr imaging library

PICCANTE is a C++11 image processing library aimed to provide structures and functionalities for enabling both High Dynamic Range (HDR) and standard imaging.

DEPENDENCIES:

Piccante uses STB image library for reading and writing PNG and JPEG files. STB can be downloaded here: https://github.com/nothings/stb

By default this library is needed to run all examples, and needs to be localed as follow:

-folder
+___"piccante"
+___"stb"

If you have STB in the system path you can disable the local path include system by adding the following define before including piccante.hpp:

#define PIC_DISABLE_STB

To disable the use of STB, you can add the following define before including piccante.hpp:

#define PIC_DISABLE_STB_LOCAL

HOW TO INSTALL:

  1. Unzip the file .zip in a FOLDER on your machine

  2. Add piccante include directory in your include path

  3. Include "piccante.hpp" in your project

NOTE ON CODE USE:

When you use parts or the full source code of this project in your own project, please remember to cite this project both in your project webpage and in its source code. This SHOULD be done even when you convert this code into another programming language.

Be kind.

NOTE ON PULL REQUESTS:

Please, send your pull requests to the develop branch.

TEAM:

Francesco Banterle

Luca Benedetti

LICENSE:

Piccante is distributed under the MPL 2.0 license: https://www.mozilla.org/MPL/2.0/

REFERENCE:

If you use PICCANTE in your work, please cite it using this reference:

@misc{banterle:pic:2014,

Author = {Francesco Banterle and Luca Benedetti},

Title = {{PICCANTE: An Open and Portable Library for HDR Imaging}},

Year = {2014},

Howpublished = {\url{ http://vcg.isti.cnr.it/piccante }}

}

FREQUENTLY ASKED QUESTIONS (FAQs):

Question: Can I disable OpenGL?

Answer: Yes, you can do it. You need to add this line of code before including piccante.hpp in your project:

#define PIC_DISABLE_OPENGL
#include "piccante.hpp"

Question: Can I use my version of Eigen instead of the one in the bundle?

Answer: Yes, you can do it. You just need to add this line of code before including piccante.hpp in your project:

#define PIC_EIGEN_NOT_BUNDLED
#include "piccante.hpp"

Question: Can I use OpenEXR instead of TinyEXR?

Answer: Yes, you can do it. You just need to add these two lines of code before including piccante.hpp in your project:

#define PIC_DISABLE_TINY_EXR
#define PIC_ENABLE_OPEN_EXR
#include "piccante.hpp"

SCREENSHOTS:

Piccante can be used for generating HDR images starting from a stack of classic 8-bit images.

HDR Generation

Piccante can manage different color spaces, and new ones can be added to its core with ease.

Color Spaces

Piccante provides algorithms for tone mapping HDR images in order to be visualized on traditional displays.

Tone Mapping

Piccante can filter images using a high quality selection of linear and non linear filters.

Filtering

Piccante can extract local features for different tasks such as image alignments, classification, 3D reconstruction, etc.

Local Features

piccante's People

Contributors

banterle avatar kd496 avatar sallo97 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  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

piccante's Issues

building examples is not documented

I don't know what to install and what to run in order to build the examples. I think that such a piece of documentation belongs in the library. Not everyone who does computer vision knows Qt very well.

LischinskiTMO NaN and file permissions

Apologies for the continuous creation of issues. In the photographic operator computation in LischinskiTMO I'm getting a NaN because f and Rz[i] are 0, which causes the tmo to fail and output a black image. The same image works on the Matlab since the initial value for Rz is computed using the MaxQuart function.

Another minor thing is the Lischinski code is that fstop is saved into a file in the parent of the working directory and on linux I might not have permissions to write in that folder. I can make a pull request to write the file on "/tmp/" on linux if that makes sense.

I'm not particularly concerned about this issues as I'm mainly using Reinhard and ExposureFusion.

errors when building the OpenGL example

I'm trying to build the opengl_tone_mapping example. I use Ubuntu 18.04, so I simply installed Qt with apt, opened the .pro file with QtCreator and clicked build.

I'm getting like 9000 warnings, as well as some errors.
The first error:

In file included from ../../include/gl.hpp:38:0,
                 from ../../include/piccante.hpp:226,
                 from ../opengl_tone_mapping/main.cpp:42:
../../include/util/gl/program.hpp: In member function ‘bool pic::ProgramGL::checkShaderStatus()’:
../../include/util/gl/program.hpp:46:9: error: ‘glGetShaderiv’ was not declared in this scope
         glGetShaderiv(object, GL_COMPILE_STATUS, &bCheckStatus);
         ^~~~~~~~~~~~~

I was thinking that maybe OpenGL was not installed correctly, so I ran an OpenGL example from Qt itself (the /usr/lib/x86_64-linux-gnu/qt5/examples/opengl/2dpainting from qtbase5-examples package) and it works fine.

What could be the issue?

hdr_generation_alignment example: HDR output is unexpectedly overexposed

What am I seeing?

When I run the hdr_generation_alignment example, the produced HDR image is exposed with intensity at +7/+9 stops for all pixels. A few environments with reasonable tonemapping implemented (Photoshop/Unity) render the output as pure white on SDR screens.

To produce a more balanced result, adjusting the example's exposure in Photoshop by about -10 is required.

What would I expect to see?

I expected the example to output a more balanced HDR image to serve as a representation of the kinds of "correct" inputs that yield "correct" outputs.

Is this a bug, or is the intended result of this example that the HDR image would be this exposed?

By more balanced, I specifically mean:

  • Standard SDR tonemapping would capture detail of the image, rather than showing all white
  • A reasonable level of bloom applied on the image would yield the kind of result most people would expect, with bloom most prominent in the sky (at the moment every pixel will be lit up, like the image is of a bright light bulb)

More info

  • Compiled on Windows 11 using cl \HEsc main.cpp

can‘t merge hdr image

There was a problem when I used your program to synthesize these three pictures,

image:

window1
window2
window3

code:

#define PIC_DISABLE_OPENGL

#include "piccante.hpp"

int main(int argc, char *argv[])
{
    printf("Adding file names to the merger... ");
    pic::HDRMerger merger;
    // merger.addFile("../data/input/stack_alignment/IMG_4209.jpg");
    // merger.addFile("../data/input/stack_alignment/IMG_4210.jpg");
    // merger.addFile("../data/input/stack_alignment/IMG_4211.jpg");
    merger.addFile("../data/input/Multi-exposure/window1.jpg");
    merger.addFile("../data/input/Multi-exposure/window2.jpg");
    merger.addFile("../data/input/Multi-exposure/window3.jpg");
    printf("Ok\n");

    merger.update(pic::CW_DEB97, pic::HRD_LOG, pic::HA_MTB, NULL);

    printf("Merging LDR images into an HDR image... ");
    pic::Image *imgOut = merger.execute(NULL);
    printf("Ok\n");

    if (imgOut != NULL)
    {
        if (imgOut->isValid())
        {
            imgOut->Write("../data/output/image_aligned.hdr");
            pic::Image *imgTmo = pic::ReinhardTMO::executeGlobal1(imgOut, NULL);
            imgTmo->Write("../data/output/image_aligned_tmo1.png", pic::LT_NOR_GAMMA);
            delete imgTmo;
            delete imgOut;
        }
    }

    return 0;
}

result:
image_aligned_tmo1

Can I get a raw image?

This library seems promising, one question: Can I import a .hdr file to a raw argb ?
That way I can make a WIC imaging component so Windows can read/write HDR files.

Sample simple_matching will not compile

The file feature_matching.hpp does not have #include "features_matching/poisson_descriptor.hpp" . The code compiles once it is added after the "transform_data.hpp" entry.

Memory leak

When reading .exr files only half of the allocated memory gets freed. I tested with tinyexr.

img1

2-Before destruction

img2

3-After destruction

img3

#include <iostream>
#define _CRT_SECURE_NO_DEPRECATE
#define _CRT_NONSTDC_NO_DEPRECATE
#define _CRT_SECURE_NO_WARNINGS
#define PIC_ENABLE_INLINING
#define PIC_DISABLE_OPENGL
#include <piccante.hpp>

void loadHDR(const std::string &filePath)
{
	auto image = pic::Image{ filePath };
	std::cout << "Image loaded" << std::endl;
}

int main()
{
	loadHDR("F:/Graphics/HDR/Manhattan Nights Vol. 1/5TH_AVENUE.exr");

	std::cout << "Press Enter to continue...";
	std::cin.get();
}

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.