Professional Documents
Culture Documents
Color Fundamentals:
Color fundamentals involve understanding the basic principles of how colors are perceived,
represented, and manipulated. Here are key concepts related to color fundamentals:
In the additive color model, colors are created by combining different intensities of red,
green, and blue light. The combination of full intensities in all three channels results in white
light.
Example: In a computer monitor, colors are displayed using the RGB model.
In the subtractive color model, colors are created by subtracting light wavelengths. This
model is commonly used in color printing and involves cyan, magenta, yellow, and black
(CMYK).
Example: In color printing, the CMYK model is used to produce a wide range of colors by
combining these ink colors.
Color Models:
1. RGB Model:
In the RGB model, a pixel is represented as a combination of red, green, and blue intensities.
A pixel with full intensity in all three channels (255, 255, 255) results in white color.
2. CMYK Model:
Used in color printing and represents colors using cyan, magenta, yellow, and black.
In CMYK used for printing, a pixel with no ink in any channel (0, 0, 0, 0) results in white,
while full ink in all channels (100, 100, 100, 100) produces black.
3. HSV Model:
In the HSV model, a color can be represented as (120, 100, 100), where 120 is the hue
(green), 100 is the saturation, and 100 is the value (brightness).
Color Transformation:
1. RGB to Grayscale:
2. RGB to HSV:
Represents colors using Hue, Saturation, and Value, which can be more intuitive for certain
applications.
3. RGB to CMYK:
Useful for color printing. Each channel in CMYK represents the amount of cyan, magenta,
yellow, and black ink required.
import cv2
import numpy as np
image_rgb = cv2.imread("example_image.jpg")
cv2.waitKey(0)
cv2.destroyAllWindows()
1. Smoothing Techniques:
Reducing noise and details using filters like Gaussian or mean filter.
2. Sharpening Techniques:
Enhancing edges and fine details using filters like Laplacian or unsharp mask.
Color Segmentation:
1. Thresholding:
2. Region Growing:
Image Pyramids:
1. Gaussian Pyramid:
2. Laplacian Pyramid:
Multi-Resolution Expansion:
1. Image Scaling:
2. Aliasing:
Wavelet Transform:
1. Wavelet Basics:
2. Wavelet Decomposition:
Applications:
1. Image Compression:
2. Feature Extraction:
First, you need to install the PyWavelets library if you haven't already:
Now, let's create a basic example for a 1D signal using wavelet transform and multi-
resolution analysis:
import numpy as np
import pywt
signal_length = 512
# Wavelet Transform
wavelet = 'db1'
level = 4
# Multi-Resolution Analysis
axs[0].set_title('Original Signal')
axs[i].set_title('Approximation Coefficients')
else:
plt.tight_layout()
plt.show()