Code Monkey home page Code Monkey logo

mclahe's People

Contributors

vincentstimper 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

Watchers

 avatar  avatar  avatar

mclahe's Issues

kernel_size parameter

Hi, thanks for the code.
I have one dubt. I don't understand the bolded part of the following sentence.

kernel_size: Tuple, list, or numpy array specifying the kernel size along the data dimensions. If kernel_size=None, the kernel size is set to 1/8 of the data size along each dimension. This is a typical choice for photographs. For more complex dataset, the kernel size should be roughly of the size of the features which shall be enhanced by MCLAHE

Compatibility with TF2

Hi,

Is there any update on when / whether this will be made compatible with TF2?
I'd be really interested in using your clahe with TF2.

Greetings,
Lydia

Color image

Hi Vincent, great library, thank you very much!!! Question, how I can apply mc.mclahe to a color image?

Why is the images quality slower?

I used the mclahe to enhance my images which size were[128, 128, 80], the super parameter are (n_bins=32, clip_limit=0.01, adaptive_hist_range=Fasle, use_gpu=True). But I found the qualities of images were degraded. Are the super parameters set wrong?

Need to clear tf session if looping through images

Thanks for the code. Just a few notes in case anyone else runs into the same problems. I needed to add a statement to clear the session when I was using mclahe to loop through thousands of 3D images on a CPU. Otherwise, memory usage expands and code slows to a crawl. Also, the default kernel size is 1/8 of data dimensions. For a 3D image with one dimension less than 8, I got an error. I needed to change kernel size to ceiling of 1/8 image dims. These fixes are shown below.

for i, full_path in enumerate(full_paths):
    os.makedirs(paths_new[i], exist_ok = True)
    print(i)
    img_arr, meta_data = load(full_path)
    dims = np.shape(img_arr)
    img_arr_eq = mc.mclahe(img_arr, kernel_size = [int(np.ceil(dims[0]/8)), int(np.ceil(dims[1]/8)), int(np.ceil(dims[2]/8))])
    save(img_arr_eq, full_paths_new[i], meta_data)
    tf.keras.backend.clear_session()

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.