본문 바로가기

College Computer Science60

[그래픽스] 나만의 드로잉 2022. 2. 9.
[그래픽스] 나만의 필터 만들기 레트로 감성, 노이즈 필터를 만들어보았습니다. 먼저, 필터의 컨셉입니다. 최근 레트로, 복고 등의 열풍이 불면서 인기를 얻은 추억의 물건 중 하나는 바로 필름카메라인데요. 필름카메라의 색감과 빛을 담는 방식이 인기를 얻자, 사람들은 스마트폰과 컴퓨터를 이용해 '마치 필카로 찍은듯한' 보정을 하기 시작했습니다. 각종 필터 어플에서도 레트로 테마가 유행입니다. 레트로 테마 필터의 특징 중 가장 두드러지고, 또 제가 개인적으로 좋아하는 부분은 바로 노이즈, 잡음입니다. 지금 보여드리는 두 사진은 팬들이 레트로 감성으로 보정한 연예인들의 사진입니다. 사진을 자세히 보시면 먼지와 같은 필터가 껴있음을 알 수 있습니다. 이 노이즈는 옛날 카메라의 화질저하 현상을 인위적으로 구현했다고 생각하시면 됩니다. 이번 수업을.. 2022. 2. 8.
[그래픽스] line.cpp 만들기 vec.h #pragma once #include #include #define M_PI 3.14159265358979323846 #define radians(x) x*M_PI/180.0 #define degrees(x) x*180.0/M_PI ////////////////////////////////////////////////////////////////////////////// // // 2D vector // ///////////////////////////////////////////////////////////////////////////// class vector2D { float x; float y; public: // // --- Constructors and Destructors ---.. 2022. 1. 28.
[알고리즘] Assignment 5 - LCS 알고리즘, BFS 알고리즘, Kruskal 알고리즘, Dijkstra 알고리즘, Prim 알고리즘 1. LCS (Longest Common Subsequence, 최장 공통 부분 문자열) #include #define MAX(a,b) ((a)>(b)? (a):(b)) int LCS_table[10][10] = { 0, }; void LCS_length(int str1_len, int str2_len, char* str1, char* str2) { for (int i = 1; i < str1_len; i++) { for (int j = 1; j < str2_len; j++) { if (str1[i] == str2[j]) { LCS_table[i][j] = LCS_table[i - 1][j - 1] + 1; } else { LCS_table[i][j] = MAX(LCS_table[i - 1][j], LC.. 2022. 1. 28.
[알고리즘] Assignment 4 Implement the following algorithms in the C programming language and put the described input to the algorithm in order to check the answer. Submit 1) a report containing outputs of the following problems and 2) the codes you have written (screenshots okay). 1. Implement an algorithm of Fibonacci numbers using dynamic programming and get the answers when feeding 𝑛=5 and 𝑛=10 into the algorithm as.. 2022. 1. 28.
[알고리즘] Assignment 3 - 정렬 알고리즘 (bubble sort, insertion sort, merge sort, quick sort, radix sort, bucket sort) 1. Code #include #include #define SIZE 1000 #define DIGIT 4 int origin[SIZE], result[SIZE], result_2[SIZE]; void bubble_sort() { int i, j, temp; for (i = SIZE - 1; i > 0; i--) { for (j = 0; j origin[j + 1]) { temp = origin[j]; origin[j] = origin[j + 1]; origin[j + 1] = temp; } } } } void insertion_sort() { int i, j, temp; for (i = 1; i < SIZE; i++) { temp = origin[i];.. 2022. 1. 28.
[알고리즘] Assignment 2 Submit a word, hwp or pdf file to the e-class that contains (1) your answers for the following exercises, and (2) your codes written in the C programming language and their results for programming exercises (screenshots okay). 1. (programming) Write a program that takes a number n and displays the largest k satisfying the following equations: 2^k 2022. 1. 28.
[알고리즘] Assignment 1 2022. 1. 28.
[자료구조 프로그래밍 연습문제] 이진탐색트리 (binary search tree), 힙 (heap), min cost spanning tree, 전위표기식 (postfix), 연결 리스트 (linked list) 1. binary search tree와 heap binary search tree는 노드에 key 값만 저장하는 것이 아니라 key값과 관련된 정보(associated item)를 같이 저장한다. 후자를 단순히 value라고 하자. 이 (key, value) 쌍을 보통 dictionary pair라고 부른다 (교재 ADT 5.3 Dictionary 참조). 은 binary search tree의 예로 각 노드에 키 값만 나타낸 것이다. 는 각 노드에 (key, value) 쌍을 나타낸 것이다. (앞의 한자리 수는 key, 뒤의 두자리 수가 value) complete binary tree로 표현되는 heap도 노드에 (key, value) 쌍을 저장할 수 있다. (교재 5.6.3절에는 heap의 노드에.. 2022. 1. 28.