imageproc icon indicating copy to clipboard operation
imageproc copied to clipboard

Random color palette utils for visual debugging/visualization purposes

Open colbyn opened this issue 5 years ago • 3 comments

Alright results are looking interesting I think Dy-b6Y3 Dy-b6Y3 debug

Using this:

pub fn preprocess(image: &DynamicImage) -> DynamicImage {
    // let image = image.resize_exact(700, 700, ::image::FilterType::Lanczos3);
    let image = image.to_luma();
    let image = imageproc::contrast::equalize_histogram(&image);
    let image = imageproc::filter::sharpen_gaussian(&image, 12.0, 38.0);
    let image = imageproc::region_labelling::connected_components(
        &image,
        Connectivity::Eight,
        Luma::black()
    );
    let image = color_palette::filter_luma_u32_regions(&image, 100);
    let image = image.to_pretty_rgb_palette();
    DynamicImage::ImageRgb8(image)
}

colbyn avatar Jan 19 '20 05:01 colbyn

Not sure how useful this would be apart from visualizing the results from connected_components. Overall maybe the colors could perhaps be a bit more diverse...

CK-tgYJ debug eH-vWUx debug

colbyn avatar Jan 19 '20 06:01 colbyn

Thanks for the PR. I don't have time at the moment to look into it, but I'll get to it in the next couple of weeks. Sorry for the delay.

theotherphil avatar Jan 22 '20 09:01 theotherphil

@theotherphil oh okay no rush.

colbyn avatar Jan 23 '20 00:01 colbyn

I think this functionality is not a core image processing operation and so does not belong in the imageproc crate. I think the best place for such functionality would be in a separate crate called something like image_debug_utils, I'm not sure if such a crate already exists though. If the other crate is created then we could definitely link to it in the readme as well.

As such I would suggest closing this PR.

ripytide avatar May 03 '24 17:05 ripytide

Debugging utils are fine for this crate, but I agree that this functionality is a bit too niche.

theotherphil avatar May 04 '24 06:05 theotherphil