An Image Processing Project.
The project was completed in 3 weeks and 2 days. Implementation ideas came to me successively.
- Developed simple functions using nearest-neighbor interpolation.
- Used the
round()
function to find the nearest neighbor (also worked withfloor()/ceil()
). - Added 1 to obtain a correct result.
- Implemented
nn_resize
:- Found valid scaling factors.
- Used
round()
again for correct results.
- RGB functions were straightforward, based on the other functions.
- Spent 3-4 days correcting
bilinear_resize
andbilinear_rotate
functions. - The more permissive checker was helpful.
- Faced most obstacles in the optimization part.
- Additional 2-3 days were necessary for debugging.
-
bilinear_2x2:
- Used the relation presented in the PDF document.
- Introduced valid values in corners.
-
bilinear_coef:
- Similar to
bilinear_2x2
. - Swapped x and y (f(y,x)) due to matrix representation.
- Similar to
-
bilinear_resize and bilinear_rotate:
- Experience from Week 1 was helpful.
- Found interpolation coefficients by calculating I values at corresponding points.
- Used the relation from the document to find the final value.
bilinear_rotate
was similar tobilinear_resize
, with an additional check for point existence in the image.
-
RGB functions were quickly implemented, based on other functions.
- Spent 2 more days debugging.
-
precal_d:
- Required much attention due to many conditions.
- Used pen and paper for implementation.
-
Auxiliary functions (fx, fy, fxy):
- Simple, relations were in the document.
-
bicubic_resize:
- Took a long time to write.
- Used parts of
bilinear_resize
for the first part. - Performed Matrix = Matrix' operation for correct element order:
a b T a c --> (To avoid errors) c d b d
- Used
mod
andfloor
to stay within 0-3 range (as per document's sum indices). - Saved interpolated value in matrix R at the end.
-
RGB function was straightforward, dependent on
resize_bicubic
.
This project was complex but interesting. The provided document and skeleton were helpful.