diff --git a/README.md b/README.md index a0f79de..6bcebea 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ Fast ROI ======================= -The FAST ROI library is useful for quickly extracting the coordinates of a rotating rectangular ROI +The FAST ROI library is useful for quickly extracting the coordinates of a rotating rectangular ROI and donut ROI Development Environment ======================= @@ -15,22 +15,24 @@ vcpkg integrate install ``` Performance ======================= -### Baseline = Searching gap : 1 +### fastRect baseline = searching gap : 1 + |Name|fps| |------|---| |fast::fastRect ***(500x500 roi size)***|2100 fps| |fast::fastRect ***(1000x1000 roi size)***|550 fps| |fast::fastRect ***(2000x2000 roi size)***|35 fps| +### fastDonut baseline = start_ratio : 1.3, end_ratio : 0.7, angle_step=1 + +|Name|fps| +|------|---| +|fast::fastDonut ***(800 radius)***|3560 fps| +|fast::fastDonut ***(1500 radius)***|666 fps| How to use? ======================= -#### fastRect - -

- -

- +### fastRect ```cpp #include @@ -43,7 +45,7 @@ int distance = 1000; // same as height bool search_direction = false //search direction (false : foward direction, true : backward direction) int searching gap = 10; //gap pixels -std::vector> result = fast::rectROI(centerX, centerY, angle, range, distance, false, skip_pixels); +std::vector> result = fast::fastRect(centerX, centerY, angle, range, distance, false, skip_pixels); //iteration of vertical line for (auto vertical_line : vertical_lines) { @@ -63,14 +65,50 @@ for (auto vertical_line : vertical_lines) { ``` #### DEMO +
+ +![fastRectDEMO](https://github.com/gellston/FastROI/blob/main/images/fastRect_rotation.gif?raw=true) + +
+ +### fastDonut + +```cpp +#include + +int centerX = 2000; // rect center y +int centerY = 2000; // rect center y +int radius = 1500; // base radius +double start_ratio = 1.5; // start radius ratio , start radius = start_ratio * base radius +double end_ratio = 0.5; // end radius ratio , end radius = end_ratio * base radius +double step_angle = 1; // step angle (angle will increase per step angle CCW) + +std::vector> result = fast::fastDonut(centerX, centerY, radius, start_ratio, end_ratio, step_angle); + +//iteration of vertical line +for (auto vertical_line : vertical_lines) { -

- - + //iteration of point in vertical line + for (auto calPoint : vertical_line) { + + //Check current position is in image + if (calPoint.x < 0 || calPoint.x >= 4000 || calPoint.y < 0 || calPoint.y >= 4000) + continue; + + //Do whatever you want here + + } +} + + +``` + +#### DEMO +

+ -
+
-[TOP](#fast-roi)