Coder Social home page Coder Social logo

Comments (3)

KelSolaar avatar KelSolaar commented on June 5, 2024

Hi,

It might be hard to debug without more information, do you have the file to test?

from colour-demosaicing.

m0ose avatar m0ose commented on June 5, 2024

I think it was my fault.
I found a workaround. It turns out the input data was in uint8 and stringIO was expecting values between 0 and 255. The demosaicing algorithm produced several values that were bigger than 255, which I think got converted into zeros somewhere(probably in stringIO).

    # This is a way to output a good demosaiced uint8, from uint8 input
    m = m.astype('float32')
    m = colour_demosaicing.demosaicing_CFA_Bayer_Menon2007(m)
    print 'negative count:', (m < 0).sum(), ', bigger than 255: ' , (m > 255).sum()
    m = m.clip(0,255)
    m = m.astype('uint8')

Here is a test image, if you are still interested.
shot_bayer

and the messed up version:
shot_problem

and a version that used the floats workaround:
shot_good

from colour-demosaicing.

KelSolaar avatar KelSolaar commented on June 5, 2024

Hi,

I was suspecting something along those lines!

Please be aware that the algorithms were tested with floating point images in [0, 1] domain, not integer [0, 255], integer [0, 65535] or any integer representation. You might want to divide your input to the functions by bit_depth - 1.

from colour-demosaicing.

Related Issues (17)

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.