#include #include #include #include using namespace std; using namespace cv; #define PI 3.1415926 int main() { Mat input = imread("road.jpg", IMREAD_GRAYSCALE); Mat contours; vector lines; // applying canny algorithm Canny(input, contours, 125, 350); /************* Probabilistic hough transform *************/ HoughLinesP(contours,// InputArray lines,// OutputArray 1,// rho PI / 180,// theta (ste..
#include #include #include #include using namespace std; using namespace cv; #define PI 3.1415926 int main() { Mat image = imread("road.jpg", IMREAD_GRAYSCALE); // Apply Canny algorithm Mat contours; Canny(image, contours, 125, 350); //*************** Basic hough transform *************** // Mat BasicHoughTransform; image.copyTo(BasicHoughTransform); // Hough transform for line detection vector ..
#include #include #include #include using namespace std; using namespace cv; #define PI 3.1415926 class EdgeDetector { private: // original image Mat img; // 16-bit signed int image Mat sobel; // Aperture size of the Sobel kernel int aperture; // Sobel magnitude Mat sobelMagnitude; // Sobel orientation Mat sobelOrientation; public: EdgeDetector() : aperture(3) {} // Set the aperture size of the ..
#include #include #include #include #include #include using namespace std; using namespace cv; int main() { Mat image = imread("building.jpg", IMREAD_GRAYSCALE); // basic MSER detector Ptr ptrMSER = MSER::create(5,// delta value for local detection 200,// min acceptable area 2000);// max acceptable area // vector of point sets vector points; // vector of rectangles vector rects; // detect MSER f..
#include #include #include #include using namespace std; using namespace cv; class WatershedSegmenter { private: Mat markers; public: void setMarkers(const Mat& markerImage) { // Convert to image of ints markerImage.convertTo(markers, CV_32SC1); } Mat process(const Mat &image) { // Apply watershed watershed(image, markers); return markers; } Mat getSegmentation() { Mat tmp; // all segment with l..
#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..
#include #include #include #include using namespace std; using namespace cv; class myLaplacian { private: // laplacian Mat laplace; // size of the laplacian kernel int kernelSize; public: myLaplacian() : kernelSize(3) {} // Set size of the kernel void setKernelSize(int inputAperture) { kernelSize = inputAperture; } // computer the floating point Laplacian Mat computeLaplacian(const Mat& inputIma..
- Total
- Today
- Yesterday
- segmentation
- erosion
- OpenCV
- laplacian of gaussian
- equalizing
- pyrDown
- dilation
- high pass filter
- black top hat
- Sobel
- gradient
- direction detection
- morphological operation
- canny
- canny operator
- pyrUp
- morphology
- top hat
- upsampling
- 영상처리
- Line Detection
- 캐니 엣지
- bilateral filter
- Filter
- median filter
- hough transform
- adaptive thresholding
- Low pass filter
- mean filter
- difference of gaussian
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |