Views
No views yet
Gamma Correction:
Adjusts the brightness and contrast of the blended image for enhanced clarity and visibility.
Input and Output:
Processes an input image and generates a contour-accentuated version as the output.Python 3.x
Libraries:
numpy
opencv-pythonPrepare Your Image:
Place the input image (e.g., input.jpg) in the same directory as the script or update the input_image_path variable with the full path to your image.
Run the Script:
Execute the script:
python CAT.pyThe processed image will be saved as output_sketch.jpg in the same directory or at the specified output_image_path.Adjust the gamma parameter in the adjust_gamma() function to fine-tune the brightness and contrast:
img_gamma = adjust_gamma(img_blend, gamma=0.5) # Example gamma adjustmentrender(img_rgb):
Applies grayscale conversion, Gaussian blur, and blending for initial contour enhancement.
adjust_gamma(image, gamma=1.0):
Performs gamma correction to optimize contrast and brightness.
Main Script:
Reads the input image, applies the CAT process, and saves the output image.