| 20 | #include "IPLWarpPerspective.h" |
| 21 | |
| 22 | void IPLWarpPerspective::init() |
| 23 | { |
| 24 | // init |
| 25 | _result = NULL; |
| 26 | _inputA = NULL; |
| 27 | _inputB = NULL; |
| 28 | _previewA = NULL; |
| 29 | _previewB = NULL; |
| 30 | |
| 31 | // basic settings |
| 32 | setClassName("IPLWarpPerspective"); |
| 33 | setTitle("Warp Perspective"); |
| 34 | setDescription("Applies a perspective transformation to an image."); |
| 35 | setCategory(IPLProcess::CATEGORY_GEOMETRY); |
| 36 | setOpenCVSupport(IPLProcess::OPENCV_ONLY); |
| 37 | setKeywords("warp, transformation"); |
| 38 | |
| 39 | // inputs and outputs |
| 40 | addInput("Image", IPL_IMAGE_COLOR); |
| 41 | addInput("Image 2", IPL_IMAGE_COLOR); |
| 42 | addOutput("Result", IPL_IMAGE_COLOR); |
| 43 | addOutput("Preview A", IPL_IMAGE_COLOR); |
| 44 | addOutput("Preview B", IPL_IMAGE_COLOR); |
| 45 | |
| 46 | // properties |
| 47 | std::vector<double> value = {1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0}; |
| 48 | addProcessPropertyInt("method", "Mode:Matrix|Points", "matrix|points", 0 ,IPL_WIDGET_GROUP); |
| 49 | addProcessPropertyVectorDouble("matrix_M", "M:3|3", "Transformation Matrix", value, IPL_WIDGET_MATRIX); |
| 50 | addProcessPropertyString("label0", "label", "Points in Image A", "", IPL_WIDGET_LABEL); |
| 51 | addProcessPropertyPoint("points_a0", "Point 1", "", IPLPoint(0,0)); |
| 52 | addProcessPropertyPoint("points_a1", "Point 2", "", IPLPoint(0,0)); |
| 53 | addProcessPropertyPoint("points_a2", "Point 3", "", IPLPoint(0,0)); |
| 54 | addProcessPropertyPoint("points_a3", "Point 4", "", IPLPoint(0,0)); |
| 55 | addProcessPropertyString("label1", "label", "Points in Image B", "", IPL_WIDGET_LABEL); |
| 56 | addProcessPropertyPoint("points_b0", "Point 1", "", IPLPoint(0,0)); |
| 57 | addProcessPropertyPoint("points_b1", "Point 2", "", IPLPoint(0,0)); |
| 58 | addProcessPropertyPoint("points_b2", "Point 3", "", IPLPoint(0,0)); |
| 59 | addProcessPropertyPoint("points_b3", "Point 4", "", IPLPoint(0,0)); |
| 60 | addProcessPropertyInt("interpolation", "Interpolation:Nearest|Linear|Area|Cubic|Lanczos4", "", 0, IPL_WIDGET_COMBOBOX, 0, 4); |
| 61 | addProcessPropertyInt("border", "Border:Black|Replicate|Reflect|Wrap", "", 0, IPL_WIDGET_COMBOBOX, 0, 3); |
| 62 | } |
| 63 | |
| 64 | void IPLWarpPerspective::destroy() |
| 65 | { |
nothing calls this directly
no test coverage detected