Skip to content

Mash707/OpenCV-Image-Filtering

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenCV-Image-Filtering

Prerequisites

  1. Platform - Windows
  2. Microsoft Visual Studio 2022
  3. OpenCV 4.0 or above

Quick setup

  1. Clone this repository to your local system.
  2. Open the OpenCV-Image-Filtering.sln in visual studio.
  3. Now setup path directories for opencv in the project properties.
    • Under Configuration Properties, go to VC++ Directories and set the path for include directories and library directories to path\to\opencv-folder\opencv\build\include and path\to\opencv-folder\opencv\build\x64\vc16\lib respectively.
    • Under Linker Properties, go to Input and add opencv_world480d.lib under Additional Dependencies.

What does the Program do?

The Program includes a total of 5 image filters from opencv library.

  • Gaussian Blur
  • Dilate
  • Erode
  • Median Blur
  • Filter2D

The program requires 2 header files imgproc.hpp for using the filters and highgui.hpp for displaying images.

1. Gaussian blur

The function convolves the source image with the specified Gaussian kernel.

For more information regarding the parameters please visit here

void cv::GaussianBlur  ( InputArray  src,
OutputArray 	dst,
Size 	ksize,
double 	sigmaX,
double 	sigmaY = 0,
int 	borderType = BORDER_DEFAULT 
)
Original Output
test Gaussian Blur

2. Dilate

Dilates an image by using a specific structuring element. The function dilates the source image using the specified structuring element that determines the shape of a pixel neighborhood over which the maximum is taken:

image

For more information regarding the parameters please visit here

void cv::dilate	(	InputArray 	src,
OutputArray 	dst,
InputArray 	kernel,
Point 	anchor = Point(-1,-1),
int 	iterations = 1,
int 	borderType = BORDER_CONSTANT,
const Scalar & 	borderValue = morphologyDefaultBorderValue() 
)
Original Output
test Dilate

3. Erode

Erodes an image by using a specific structuring element. The function erodes the source image using the specified structuring element that determines the shape of a pixel neighborhood over which the minimum is taken:

image

For more information regarding the parameters please visit here

void cv::erode	(	InputArray 	src,
OutputArray 	dst,
InputArray 	kernel,
Point 	anchor = Point(-1,-1),
int 	iterations = 1,
int 	borderType = BORDER_CONSTANT,
const Scalar & 	borderValue = morphologyDefaultBorderValue() 
)
Original Output
test Dilate

4. Median Blur

Blurs an image using the median filter. The function smoothes an image using the median filter with the ksize × ksize aperture. Each channel of a multi-channel image is processed independently.

For more information regarding the parameters please visit here


void cv::medianBlur	(	InputArray 	src,
OutputArray 	dst,
int 	ksize 
)
Original Output
test Dilate

5. Filter2D

Convolves an image with the kernel.
The function applies an arbitrary linear filter to an image. In-place operation is supported. When the aperture is partially outside the image, the function interpolates outlier pixel values according to the specified border mode.
The function does actually compute correlation, not the convolution:

image

For more information regarding the parameters please visit here


void cv::filter2D	(	InputArray 	src,
OutputArray 	dst,
int 	ddepth,
InputArray 	kernel,
Point 	anchor = Point(-1,-1),
double 	delta = 0,
int 	borderType = BORDER_DEFAULT 
)
Original Output
test Dilate

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages