├── .gitattributes ├── images ├── lena.jpg └── Project Presentation.gif ├── source ├── ActiveList.h ├── GraphNode.h ├── drawing.cpp ├── ActiveList.cpp ├── GraphSearch.cpp ├── GraphSearch.h ├── imageProcess.h ├── imageProcess.cpp ├── util.cpp ├── main.cpp ├── util.h └── drawing.h ├── .gitignore └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /images/lena.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PupYuan/Intelligent-Scissors/HEAD/images/lena.jpg -------------------------------------------------------------------------------- /source/ActiveList.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PupYuan/Intelligent-Scissors/HEAD/source/ActiveList.h -------------------------------------------------------------------------------- /source/GraphNode.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PupYuan/Intelligent-Scissors/HEAD/source/GraphNode.h -------------------------------------------------------------------------------- /source/drawing.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PupYuan/Intelligent-Scissors/HEAD/source/drawing.cpp -------------------------------------------------------------------------------- /source/ActiveList.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PupYuan/Intelligent-Scissors/HEAD/source/ActiveList.cpp -------------------------------------------------------------------------------- /source/GraphSearch.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PupYuan/Intelligent-Scissors/HEAD/source/GraphSearch.cpp -------------------------------------------------------------------------------- /source/GraphSearch.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PupYuan/Intelligent-Scissors/HEAD/source/GraphSearch.h -------------------------------------------------------------------------------- /source/imageProcess.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PupYuan/Intelligent-Scissors/HEAD/source/imageProcess.h -------------------------------------------------------------------------------- /source/imageProcess.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PupYuan/Intelligent-Scissors/HEAD/source/imageProcess.cpp -------------------------------------------------------------------------------- /images/Project Presentation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PupYuan/Intelligent-Scissors/HEAD/images/Project Presentation.gif -------------------------------------------------------------------------------- /source/util.cpp: -------------------------------------------------------------------------------- 1 | #include "util.h" 2 | 3 | void normalize(cv::Vec2d &dst) { 4 | double sum = sqrt(pow(dst[0], 2) + pow(dst[1], 2)); 5 | dst[0] = dst[0] / sum; 6 | dst[1] = dst[1] / sum; 7 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.suo 2 | *.mdb 3 | *.ldb 4 | *.sln 5 | *.config 6 | *.props 7 | 8 | Debug/ 9 | Release/ 10 | obj/ 11 | .vs/ 12 | lib/ 13 | include/ 14 | bin/ 15 | *.vcxproj 16 | *.filters 17 | *.user 18 | -------------------------------------------------------------------------------- /source/main.cpp: -------------------------------------------------------------------------------- 1 | #include "opencv2/core.hpp" 2 | #include "opencv2/imgproc.hpp" 3 | #include "opencv2/highgui.hpp" 4 | #include "drawing.h" 5 | #include "GraphSearch.h" 6 | 7 | using namespace cv; 8 | 9 | int main(int argc, char** argv) 10 | { 11 | loadImage( argc, argv); 12 | 13 | waitKey(0); 14 | return 0; 15 | } -------------------------------------------------------------------------------- /source/util.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "opencv2/core.hpp" 4 | #include "opencv2/imgproc.hpp" 5 | #include "opencv2/highgui.hpp" 6 | #include 7 | #include 8 | using namespace std; 9 | using namespace cv; 10 | 11 | #define M_PI 3.14159265358979323846 12 | void normalize(cv::Vec2d &dst); 13 | 14 | -------------------------------------------------------------------------------- /source/drawing.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "opencv2/core.hpp" 4 | #include "opencv2/imgproc.hpp" 5 | #include "opencv2/highgui.hpp" 6 | 7 | #include "GraphSearch.h" 8 | #include 9 | #include 10 | using namespace std; 11 | 12 | using namespace cv; 13 | 14 | 15 | void loadImage(int argc, char** argv); 16 | void on_mouse(int event, int x, int y, int flags, void* ustc); 17 | void setSegPoint(int x, int y); 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Intelligent-Scissors 2 | 3 | ## Chinese Blog (中文博客) 4 | 5 | CSDN Blog : https://blog.csdn.net/ddogyuan/article/details/80371070 6 | 7 | 8 | 9 | ## Introduction 10 | 11 | SCUT Computer Vision Experiment 2 12 | 13 | use opencv3.4.1 14 | 15 | 16 | 17 | ## Project Presentatin 18 | ![image](https://github.com/PupYuan/Intelligent-Scissors/blob/master/images/Project%20Presentation.gif) 19 | 20 | 21 | 22 | 23 | ## SetUp(配置方法) 24 | 25 | platform:Windows 26 | 27 | 1. DownLoad OpenCV3.4.1 :https://opencv.org/opencv-3-4-1.htm , download winPack,which was built already. 28 | 29 | 2. import opencv to Solution 30 | 31 | 3. open .exe using console , for example: 32 | 33 | ``` 34 | ./IntelligentScissors lena.jpg 35 | ``` 36 | 37 | 38 | 39 | --------------------------------------------------------------------------------