Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
Tags
- C++
- PCA
- Computer Architecture
- llm을 활용 단어장 앱 개발일지
- BAEKJOON
- Widget
- BOF
- Flutter
- 영상처리
- Stream
- fastapi를 사용한 파이썬 웹 개발
- system hacking
- BFS
- study book
- bloc
- 파이토치 트랜스포머를 활용한 자연어 처리와 컴퓨터비전 심층학습
- Image Processing
- Dreamhack
- DART
- rao
- MATLAB
- ML
- 백준
- pytorch
- MDP
- FastAPI
- Kaggle
- ARM
- Got
- Algorithm
Archives
- Today
- Total
Bull
[Image Processing] Banded Notch Filter 본문
https://codcost.tistory.com/137
[Image Processing] Gaussian and Butterworth Notch Filter
과제우선 학교 과제로 한건데, 자료도 없고,,, 지식도 없어서 GPT한테 땡깡 부리면서 만들었다. 정확히 맞는 건지는 모르지만 대략적으로 적용된 거 같아서 포스팅으로 남긴다.요구 사항우선 "무
codcost.tistory.com
이전 글과 연계되는 과제이므로 간략하게 적겠다.
요구사항
우주에서 찍은 토성 고리사진이다.
위성에서 전달받아 우주에 있는 잡음에 의해 사진이 손상되었다.
주파수 영역을 확인하고 에너지가 큰 부분(흰색 영역)을 filter로 가려보자.
banded notch filter 공식은 따로 없고 표기를 위한 공식만 있다.
그냥 식 대입하면서 주파수 영역을 가려주면 된다.
결과
Code
clear;
clc;
im = imread('saturn.jpg');
im = uint8(mean(im, 3));
% parameter
r = size(im, 1);
c = size(im, 2);
center_col = ceil(c / 2);
center_row = ceil(r/2);
[U, V] = meshgrid(1:c, 1:r);
U = U - ceil(c/2);
% % % % % % % % % % % % % % % % % % % % %
% notch reject filter
H1 = ones(r, c);
H1(1:center_row-4, center_col-1:center_col+1) = 0;
H1(center_row+4:end, center_col-1:center_col+1) = 0;
F = fft2(im);
F_shifted = fftshift(F);
mtrans = F_shifted .* H1;
out1 = abs(ifft2(ifftshift(mtrans)));
% notch passed filter
H2 = zeros(r, c);
H2(1:center_row-4, center_col-1:center_col+1) = 1;
H2(center_row+4:end, center_col-1:center_col+1) = 1;
F = fft2(im);
F_shifted = fftshift(F);
mtrans = F_shifted .* H2;
out2 = abs(ifft2(ifftshift(mtrans)));
% % % % % % % % % % % % % % % % % % % % %
%output
subplot(3, 2, 1);
imshow(im, []);
title('Original Image');
subplot(3, 2, 2);
imshow(log(abs(F_shifted) + 1), []);
title('Frequency spectrum');
subplot(3, 2, 3);
imshow(log(1 + abs(H1)), []);
title('Notch Reject Filter function');
subplot(3, 2, 4);
imshow(out1, []);
title('Filtered image');
subplot(3, 2, 5);
imshow(log(1 + abs(H2)), []);
title('Notch pass filter function');
subplot(3, 2, 6);
imshow(out2, []);
title('Output of the notched passed filtered image');
'Computer Science > Image Processing' 카테고리의 다른 글
[Image Processing] Gaussian and Butterworth Notch Filter (0) | 2024.05.08 |
---|---|
[Image Processing] Histogram Equalization (by MATLAB) (1) | 2024.03.23 |
[Image Processing] Bit-Plane Slicing (8bit slicing) (by MATLAB) (0) | 2024.03.21 |
[Image Processing] Piecewise linear transformation(구간별 선형 변환) (by MATLAB) (0) | 2024.03.21 |
[Image Processing] 명도변환 (Power-Law Transformations)하기 (by MATLAB) (0) | 2024.03.19 |