This is an autograder for CAD drawings based on image processing.
- Clone this repo. This project is a Visual Studio Solution:
- If you use Visual Studio, click
CAD_Grader->CAD_Grader.sln
opens the solution - Otherwise, all codes files are in
CAD_Grader->CAD_Grader
. Testing pictures are inresources/pictures
Import them to the editor you are comfortable with.
-
Install the latest version of OpenCV C++. Link it to your project if need to.
-
Change image directories in
main.cpp
.
- Main:
main.cpp
- Header files for constants:
color.h
: lower and upper bound of colors in HSV for color detectionfields.h
: all other constants
- There are four modules, each with a cpp file and its corresponding header file:
- COMPARE: crop, resize, get percentage difference of two images
- HATCHING: detect hatcing lines and hatched areas of an image
- ZHANGSUEN: zhang-suen thinning algorithm from yati-sagade
- FEATURE_EXTRACTION: perform feature extractions if two images are not the same
Since some functions I wrote have the same name as OpenCV built-in functions, it is not recommended to do using namespace
in main.
See Issues
- I just got started on color detection. More colors need to be added to
color.h
.feature_extraction.cpp->detectColor()
is the function that performs color separation.