#include #include #include #include using namespace std; using namespace cv; int main() { Mat cow_binary = imread("cow_binary.bmp", IMREAD_GRAYSCALE); Mat castle_grayScale = imread("castle_original.jpg", IMREAD_GRAYSCALE); Mat book_grayScale = imread("book_original.jpg", IMREAD_GRAYSCALE); Mat eroded, dilated, opened, closed; Mat gradient, black_top_hat; Mat structuringElement_5x5 = Mat(5, 5, CV..
#include #include #include #include using namespace std; using namespace cv; Mat adaptiveThresholding(Mat &image, int inputThreshold = 10) { Mat result = image.clone(); // compute integral image Mat integralImage; integral(image, integralImage, CV_32S); int blockSize = 21; // size of the neighborhood int threshold = 10;// pixel will be compared to (mean - threshold) // for each row int halfSize ..
#include #include #include #include using namespace std; using namespace cv; // To create histograms of gray-level images class Histogram1D { private: int histSize[1];// number of bins in histogram float hranges[2];// range of values const float* ranges[1];// pointer to the value ranges int channels[1];// channel number to be examined public: Histogram1D() { // Prepare default arguments for 1D h..

이번 시간에는 Median filter에 대해서 알아보도록 한다. 효과 및 비교를 위해 03. Accessing pixel values 에서 다루었던 salt and pepper noise와 07. mean / gaussian filter 에서 다루었던 mean filter를 사용한다. 먼저 이전에 배웠던 Mean filter에 대해 간단하게 다시 다루면, center pixel을 중심으로 kernel에서 같은 weight를 적용하여 값을 변경한다. 이 경우 white pixel(혹은 black pixel)은 mean filter를 적용하는 과정에서 큰 영향을 끼칠 수 있다. (bad pixel과 같이 눈에 띄는 상황이라면 dot artifact가 생겨날 수 있다.) Median filter는 mean ..

이번 주제에서는 DownSampling과 그 과정에서 사용되는 filter 이야기를 해보고자 한다. 이미지의 사이즈를 줄이는 것을 Downsampling이라고 하는데(반대는 Upsampling), 사이즈를 줄이는 것은 생각보다 간단하지 않다. 결과를 먼저 보자. 위는 low pass filter를 사용하지 않고 downSampling을 한 것이며, 아래는 사용 후 진행한 것이다. 위의 영상에서는 image의 quality가 좋지 않다. (자연스럽지 않고, pixel간 차이가 너무 커서 경계가 있어 보인다. 아래는 blur해보이지만, 둘 중 한 가지를 선택한다면 아래를 선택하는 것이 원본의 신호를 그나마 더 잘 표현하였다.) Low pass filter를 사용하지 않고 downsampling을 진행하면 왜..
- Total
- Today
- Yesterday
- direction detection
- Low pass filter
- segmentation
- pyrUp
- pyrDown
- canny operator
- Line Detection
- 캐니 엣지
- top hat
- bilateral filter
- OpenCV
- morphological operation
- Filter
- morphology
- equalizing
- median filter
- erosion
- dilation
- difference of gaussian
- Sobel
- mean filter
- hough transform
- black top hat
- 영상처리
- upsampling
- laplacian of gaussian
- adaptive thresholding
- canny
- gradient
- high pass filter
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |