The dataset is available here.
- Histogram Equalization
- Losspass/Highpass Filter: Mean and Median
- Edge detection: Sobel, Prewitt and Robert
- User-Defined Thresholding
macOS 10.13.6
g++ 4.2.1
opencv 3.4.2
Histogram Equalizaion is a useful image processing method for contrast adjustment.
g++ $(pkg-config --cflags --libs opencv) histogram.cpp -o histogram
./histogram input_img output_img
- For example
./histogram test.tif output.tif
Taking a image, Chapter3, Fig0320(4)(bottom_left).tif, as example.
Losspass/Highpass Filtering is a useful way for reducing noises of image.
g++ $(pkg-config --cflags --libs opencv) filter.cpp -o filter
./filter input_img
- For example
./filter test.tif
Taking a image, Chapter3, Fig0335(a)(ckt_board_saltpep_prob_pt05).tif, as example. Note that the size of mean_filter and median_filter is 3x3 for demonstration.
Here, we mplement three edge detection method -- Sobel, Prewitt and Robert.
g++ $(pkg-config --cflags --libs opencv) edge_detection.cpp -o edge_detection
./edge_detection input_img mode
- For example
./edge_detection median_test.tif sobel
Taking a median result above as example.
Thresholding is the simplest method of image segmentation.
g++ $(pkg-config --cflags --libs opencv) threshold.cpp -o threshold
./threshold input_file threshold_value
- For example
./threshold test.tif 55
Note that the proper value should be 0≤threshold_value≤255
Taking a image, Chapter3,Fig0316(3)(third_from_top).tif, as example.