Coder Social home page Coder Social logo

tsarjak / simulate-correct-colorblindness Goto Github PK

View Code? Open in Web Editor NEW
53.0 4.0 15.0 5.04 MB

This Script simulates images based on how people with colorblindness would perceive it naturally. You can also vary the degree of colorblindness for simulating. This script can also be used to correct images, making differenciation of certain colors in an image easier for people with colorblindness.

License: MIT License

Python 100.00%
vision colour-blind-people converts hsv-shifting-algorithm daltonization-algorithm colours image-processing image computer-vision computervision

simulate-correct-colorblindness's People

Contributors

tsarjak 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

Watchers

 avatar  avatar  avatar  avatar

simulate-correct-colorblindness's Issues

Collapse when correcting images with alpha channel

I am so grateful for your excellent work! However, the program collapses when I tried to correct an image with alpha channel.

Solution:
Alpha channel should be ignored when reading an image.

class Utils:
    """
    Couple of utils for loading the images.
    """
    @staticmethod
    def load_rgb(path):
        img_rgb = np.array(Image.open(path)) / 255
        return img_rgb # Here should be img_rgb[:,:,:3] like in load_lms()

    @staticmethod
    def load_lms(path):
        img_rgb = np.array(Image.open(path)) / 255
        img_lms = np.dot(img_rgb[:,:,:3], Transforms.rgb_to_lms())

        return img_lms

Which is the HSV shifting method used ???

The recoloring process you are using, in order to 'correct' the colors,
uses some 'HSV shifting methos', can you describe which it is using equations/pseudocode or Reference
to a scientific Paper???

picture rotated when applying a transformation ?

Hello,

It appears that pictures are rotated during the transformation:

picojr

picojr-st

I haven't found out what is the cause for it yet ^^

But since it occurs for each transformation:

I guess it involves a function that is called regardless of the transformation.

Take care,

silently fails for windows file paths

great package. I encountered a problem where it silently failed when I used windows style file paths instead of linux. I was running from Pycharm terminal on windows machine.

The first time I ran it appeared to work but did not produce any images.

(Simulate-Correct-ColorBlindness) C:\Users\conwayjp\Documents\code\Simulate-Correct-ColorBlindness>python recolor.py -input "C:\Users\conwayjp\test.png" -output "C:\Users\conwayjp" -run_all
ReColorLib completed running! Check output images in C:\Users\conwayjp

When it was run with linux style path names it worked just fine.

(Simulate-Correct-ColorBlindness) C:\Users\conwayjp\Documents\code\Simulate-Correct-ColorBlindness>python recolor.py -input "C:/Users/conwayjp/test.png" -output "C:/Users/conwayjp" -run_all
ReColorLib completed running! Check output images in C:/Users/conwayjp

also, might be worth noting the name of the opencv package on conda is py-opencv, for newbies.

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.