Correct Color | opencv color correction
CorrectColorCorrectsthecolorprofileofasourceRGBimagetothecolorprofileofatargetRGBimage.Thisfunctionoutputstarget_matrix,source_matrix,andtransformation_matrixandsavesthemtotheoutputdirectoryas.npzfiles.Italsooutputs,corrected_img,butstorage(printorplot)isdeterminedbydebugmode.plantcv.transform.correct_color(target_img,target_mask,source_img,source_mask,output_directory)returnstarget_matrix,source_matrix,transformation_matrix,corrected_imgImportantNote:Eachimagemustcontainareferencefromwhichc...
Correct ColorCorrects the color profile of a source RGB image to the color profile of a target RGB image. This function outputs target_matrix, source_matrix, and transformation_matrix and saves them to the output directory as .npz files. It also outputs, corrected_img, but storage (print or plot) is determined by debug mode.
plantcv.transform.correct_color(target_img, target_mask, source_img, source_mask, output_directory)
returns target_matrix, source_matrix, transformation_matrix, corrected_img
Important Note: Each image must contain a reference from which color values are sampled. The following example uses a 24-color Colorchecker passport.
Parameters:target_img = an RGB image with color chips visualized target_mask = a grayscale image with color chips and background each represented with unique values source_img = an RGB image with color chips visualized source_mask = a grayscale image with color c...