Skip to content

Commit

Permalink
라이브러리 업데이트
Browse files Browse the repository at this point in the history
  • Loading branch information
gellston committed Jan 19, 2022
1 parent 25fd4cc commit 11609a1
Show file tree
Hide file tree
Showing 11 changed files with 131 additions and 2 deletions.
13 changes: 11 additions & 2 deletions FastROI/ConsoleExample/ConsoleExample1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include <iostream>
#include <opencv2/opencv.hpp>
#include <ctime>
#include <chrono>

#include "fastRect.h"

Expand All @@ -13,12 +15,18 @@ int main()

double angle = 0;
cv::Mat result(cv::Size(4000, 4000), CV_8UC3);
std::chrono::high_resolution_clock::time_point _start;

_start = std::chrono::high_resolution_clock::now();
int count = 0;
while (true) {


result = cv::Scalar(0, 0, 0);

std::vector<std::vector<fast::calPoint>> vertical_lines = fast::rectROI(2000, 2000, angle, 1000, 1000, false, 40);


std::vector<std::vector<fast::calPoint>> vertical_lines = fast::rectROI(2000, 2000, angle, 1000, 1000, false, 50);

for (auto vertical_line : vertical_lines) {
for (auto calPoint : vertical_line) {
if (calPoint.x < 0 || calPoint.x >= 4000 || calPoint.y < 0 || calPoint.y >= 4000)
Expand All @@ -28,6 +36,7 @@ int main()
}
}


cv::imshow("result", result);
if (cv::waitKey(1) == 27)break;
if (angle++ > 360) angle = 0;
Expand Down
21 changes: 21 additions & 0 deletions FastROI/lib/Debug/calPoint.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#pragma once

#ifndef HV_CAL_POINT
#define HV_CAL_POINT

#include <type_traits>

#pragma pack(push, 1)

namespace fast {
struct calPoint {
double x;
double y;
};
}

static_assert(std::is_standard_layout_v<fast::calPoint>);
#pragma pack(pop)


#endif
Binary file added FastROI/lib/Debug/fastROI.dll
Binary file not shown.
Binary file added FastROI/lib/Debug/fastROI.lib
Binary file not shown.
19 changes: 19 additions & 0 deletions FastROI/lib/Debug/fastRect.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once

#ifndef FAST_RECT
#define FAST_RECT

#include <vector>
#include <memory>

#include "macro.h"
#include "calPoint.h"

namespace fast {
FAST_API_EXPORT std::vector<std::vector<fast::calPoint>> rectROI(int centerx, int centery, double angle, int range, int distance, bool direction, int skip_pixels);
}




#endif
20 changes: 20 additions & 0 deletions FastROI/lib/Debug/macro.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#pragma once


#include <stdexcept>

#ifndef FAST_MACRO
#define FAST_MACRO


#if FAST_API
#define FAST_API_EXPORT __declspec(dllexport)
#else
#define FAST_API_EXPORT __declspec(dllimport)
#endif


#define HVERROR(name, message) \
std::string name;name += "error:";name += __func__;name += ":";name += std::to_string(__LINE__);name += ":";name += message;throw std::runtime_error(name);\

#endif
21 changes: 21 additions & 0 deletions FastROI/lib/Release/calPoint.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#pragma once

#ifndef HV_CAL_POINT
#define HV_CAL_POINT

#include <type_traits>

#pragma pack(push, 1)

namespace fast {
struct calPoint {
double x;
double y;
};
}

static_assert(std::is_standard_layout_v<fast::calPoint>);
#pragma pack(pop)


#endif
Binary file added FastROI/lib/Release/fastROI.dll
Binary file not shown.
Binary file added FastROI/lib/Release/fastROI.lib
Binary file not shown.
19 changes: 19 additions & 0 deletions FastROI/lib/Release/fastRect.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once

#ifndef FAST_RECT
#define FAST_RECT

#include <vector>
#include <memory>

#include "macro.h"
#include "calPoint.h"

namespace fast {
FAST_API_EXPORT std::vector<std::vector<fast::calPoint>> rectROI(int centerx, int centery, double angle, int range, int distance, bool direction, int skip_pixels);
}




#endif
20 changes: 20 additions & 0 deletions FastROI/lib/Release/macro.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#pragma once


#include <stdexcept>

#ifndef FAST_MACRO
#define FAST_MACRO


#if FAST_API
#define FAST_API_EXPORT __declspec(dllexport)
#else
#define FAST_API_EXPORT __declspec(dllimport)
#endif


#define HVERROR(name, message) \
std::string name;name += "error:";name += __func__;name += ":";name += std::to_string(__LINE__);name += ":";name += message;throw std::runtime_error(name);\

#endif

0 comments on commit 11609a1

Please sign in to comment.