Replies: 1 comment 2 replies
-
Hello, How are you displaying the saved image? Cheers, Thomas |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I`m looking to understant why the image saved is different from the plotted one. Below are the details:
i`d like to save the plotted image!
Reading the png image:
`RGB = colour.read_image('/Users/moon/Documents/phd/kit_teste4/_BBOX_base_bbox.v2i.yolov7pytorch/png/5-APC_0140.png')
COLOUR_CHECKER_IMAGE_PATHS = glob.glob(
os.path.join("/Users/moon/Documents/phd/kit_teste4/_BBOX_base_bbox.v2i.yolov7pytorch/png/", "5-APC_0140.png"))
COLOUR_CHECKER_IMAGES = [
colour.cctf_decoding(RGB)
]
for image in COLOUR_CHECKER_IMAGES:
colour.plotting.plot_image(colour.cctf_encoding(image));
`
Identifying the swatches
`SWATCHES = []
for image in COLOUR_CHECKER_IMAGES:
for colour_checker_swatches_data in detect_colour_checkers_segmentation(
image, additional_data=True):
print (colour_checker_swatches_data)
swatch_colours, colour_checker_image, swatch_masks = (
colour_checker_swatches_data.values)
SWATCHES.append(swatch_colours)
print (SWATCHES)
D65 = colour.CCS_ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D65']
REFERENCE_COLOUR_CHECKER = colour.CCS_COLOURCHECKERS[
'ColorChecker24 - Before November 2014']
REFERENCE_SWATCHES = colour.XYZ_to_RGB(
colour.xyY_to_XYZ(list(REFERENCE_COLOUR_CHECKER.data.values())),
REFERENCE_COLOUR_CHECKER.illuminant, D65,
colour.RGB_COLOURSPACES['sRGB'].matrix_XYZ_to_RGB)`
now, making the correction and plotting and saving the image:
`for i, swatches in enumerate(SWATCHES):
swatches_xyY = colour.XYZ_to_xyY(colour.RGB_to_XYZ(
swatches, D65, D65, colour.RGB_COLOURSPACES['sRGB'].matrix_RGB_to_XYZ))
`
DIff:
Corrected:
Plotted image:
Saved Image:
3 imagens pieces, side by side: [ original, plotted and saved]
Beta Was this translation helpful? Give feedback.
All reactions