How to create a solution for each implementation:
For every implementation in my assignment above, the video is split into frame by frame. Each frame can be treated as an image, therefore it is can be manipulated in a similar way in manipulating an image.
1. Implementation 1
- 50% Split
- Get all pixels in a frame.
- Determine the value in which the RGB value will be split. (example x)
- If an R value in a pixel is lower than x, then it will be set into a new value (example y), otherwise set it into another value (example z).
- This method is applied to G and B value as well, and for every pixel in a frame.
- User Percentile 1 for RGB
- Get all pixels in a frame.
- Get the user input (for R , G and B value)
- Calculation part : new R value = R (user input) / 255 * R (in that particular pixel)
- This method is applied to G and B value as well, and for every pixel in a frame.
- User Percentile 1 for HSV
- Get all pixels in a frame
- Get the user input (for H, S and V value)
- Get the RGB for each pixel and convert it into HSV
- Calculation part : new H value = H (user input) / 360 * H (conversion value)
- new S value = S (user input) / 100 * S (conversion value)
- new V value = V (user input) / 100 * V ('value' value)
- This new HSV value is converted back into RGB and set it into the pixel.
- User Percentile 2 for RGB
- This is almost the same with 50% Split.
- Get all pixels in a frame.
- Get the user input (for R, G and B value)
- Calculation part: compare the RGB value from the pixel and the RGB from user input.
- If pixel RGB value is less than RGB from user input, the RGB is set to 255, otherwise set to 0.
- User Percentile 2 for HSV
- Get all the pixels in a frame.
- Get the user input (for H, S and V value)
- Get the RGB for each pixel and convert it into HSV
- Calculation part : if pixel H value is lower than H value from user input, then it will set to 360, otherwise set to 0
- if pixel S value lower than S value from user input, then it will set to 100, otherwise set to 0
- if pixel V value lower than V value from user input, then it will set to 100, otherwise set to 0
2. Implementation 2
- Equalization by 1 frame
- Each frame of the video is equalized.
- Calculation part : create an empty histogram (example h).
- Find the cumulative histogram resulted from the frame (example hr).
- Apply hr into the frame.
- Equalization by 5 frames and 20 frames are using the same method with equalization by 1 frame, the difference part is : for equalization by 5 frames, the effect is applied every 5 frames, and equalization by 20 frames, the effect is applied
every 20 frames.
3. Implementation 3
- Edge Detection
- This implementation using matrix as it based calculation.
- Matrix for edge detection is [-1, -1, -1], [-1, 8, -1], [-1, -1, -1]
- Calculation part: This matrix times with pixel + its neighbor color (interpreted in 3x3 matrix as well)
- The result of this multiplication is divided by the sum of the edge detection matrix (in this case -1 + -1 + -1 + -1 + 8 + -1 + -1 + -1 + -1)
- Then this division result is applied as new pixel.
- Smoothing
- This implementation has the same algorithm as edge detection.
- The difference is just the matrix which is used for smoothing
- The matrix for smoothing is [1, 2, 1], [2, 4, 2], [1,2,1].
Subscribe to:
Posts (Atom)