#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; class ColorHistogram { private: int histSize[3]; // size of each dimension float hranges[2]; // range of values (same for the 3 dimensions) const float* ranges[3]; // array of ranges for each dimension int channels[3]; // channel to be considered public: ColorHistogram() { // Prepare default arguments for a color histog..
#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..
- Total
- Today
- Yesterday
- morphological operation
- pyrDown
- equalizing
- top hat
- gradient
- difference of gaussian
- bilateral filter
- hough transform
- Low pass filter
- dilation
- canny
- canny operator
- OpenCV
- median filter
- upsampling
- Filter
- 영상처리
- Sobel
- direction detection
- black top hat
- 캐니 엣지
- laplacian of gaussian
- mean filter
- adaptive thresholding
- erosion
- pyrUp
- segmentation
- morphology
- Line Detection
- 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 | 29 | 30 |