digital-image-processing-cpp
cpp implementation for algorithms in the book “数字图像处理与机器视觉-Visual C++与Matlab实现”
To compile CH3_pixel_operation.cpp:
./compile.sh -DCH3 CH3_pixel_operation.cpp utility.cpp
In which -DCH3 activates the main function in the source file, otherwise main function is ignored. And this source file includes utility.h, so we need to compile CH3_pixel_operation.cpp with utility.h’s implementation, which is utility.cpp.
Similar method for CH 4,5,6,7,8 to compile.
To compile CH9_image_segmentation.cpp:
./compile.sh -DCH9 CH9_image_segmentation.cpp CH3_pixel_operation.cpp CH5_spatial_domain_image_enhancement.cpp CH8_morphology_image_processing.cpp utility.cpp
Because it includes the corresponding headers.
CH3 pixel operation
Threshold
Set threshold as 100:
Set dFa as 2.0, set dFb as -55:
Set gamma as 1.8, set comp as 0:
Set dC as 10:
Set x1, x2, y1, y2 as 20, 50, 100, 200:
Histogram equalization
Histogram matching to dark
Histogram matching to light
Move
Move 20 right and 50 down:
Horizontal mirror
Vertical mirror
Scale
Rotate
Rotate 30 degrees counterclockwise:
Image projection restore
CH5 spatial domain image enhancement
Smooth average
Kernel size 3:
Kernel size 5:
Kernel size 7:
Smooth gaussian
Log edge detection
Roberts cross gradient operator
Positive 45 degrees v.s. Negative 45 degrees v.s. Positive+Negative 45 degrees:
Sobel gradient operator
Vertical v.s. Horizontal v.s. Vertical+Horizontal:
Laplacian operator
90 degrees rotation isotropy v.s. 45 degrees rotation isotropy v.s. Weighted
Enhancement
Roberts positive 45 degrees:
Sobel vertical:
Laplacian weighted:
CH6 frequency domain image enhancement
Ideal low pass filter
Gauss low pass filter
Gauss high pass filter
Laplace filter
Gauss band rejection filter
Image and noised image in frequency domain:

Filter and filterd image in frequency domain:

Before and after applying Gauss band rejection filter:

CH7 color image processing
CMY
HSI
HSV
YUV
YIQ
Color compensating
Color balancing
CH8 morphology image processing
Erode using 3 x 3 square kernel and using cross kernel
Dilate using 3 x 3 square kernel and using cross kernel
Erode operation and open operation
Dilate operation and close operation
Trace boundary
Fill region
Label connected component
Thining
Pixelate
Convex hull unconstrained and constrained(using bounding rectangle)
Gray dilate
Gray erode
Gray open
Gray close
CH9 image segmentation
Edge detection using Prewitt operator
Edge detection using Sobel operator
Edge detection using LoG operator
Canny edge detector
Automatically choose threshold for binarization
Region growing for image segmentation
Region splitting(decomposing) for image segmentation
评论