Claudius-Appel / duflor.gui

GUI frontent for `duflor`-package
https://claudius-appel.github.io/duflor.gui/
MIT License
0 stars 0 forks source link

Ensure red dot evaluation by defining rectangle via x/y pairs #24

Closed Claudius-Appel closed 6 months ago

Claudius-Appel commented 7 months ago

When loading all images, we currently have the issue of rogue pixels being perceived as red.

You could then define an x/y range within which pink pixels are considered, and all pixels outside that range are not counted.

Maybe?

Claudius-Appel commented 7 months ago

Consider

true_identifier_pixels <- ret$identifier$pixel.idx[((ret$identifier$pixel.idx[,"x"]>1800)
                                                    & (ret$identifier$pixel.idx[,"y"]<200)
                                                    & (ret$identifier$pixel.idx[,"y"]>5)),]
pixels <- list(identifier = length(true_identifier_pixels)/2)
# for ranges where we must assume all pixels to be valid, we can just do the shortcut and choose ret$<type>$pixel.count
pixels$complete <- ret$complete$pixel.count
pixels$drought <- ret$drought$pixel.count
pixels$green <- ret$green$pixel.count
#### Evaluate: Convert to Area, display and print counts ####
duflor::convert_pixels_to_area(pixels)
duflor::plot_array_as_image_sRGB(
    duflor::HSVtoRGB(
        duflor::change_pixel_color_HSV(
            pixel.array = pixel.array,
            pixel.idx = true_identifier_pixels,
            target.color = "white",
            mask_extreme = T
        )
    )
)

I think leaving this to the user is probably better. It might be much more annoying however. I need to think about how to incorporate this into the GUI - currently, drawing a rectangle and double-clicking it is already assigned a function. How would you define pinkdot-limits?

Claudius-Appel commented 6 months ago

Functionally the same as crop image:

Decide how to define this so it is limited to use with identifier_dot.

Claudius-Appel commented 6 months ago

closed in https://github.com/Claudius-Appel/duflor.gui/commit/4f58978e3aba0eea5bfe875db443a8adc8c4d742