Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
gellston committed Jan 21, 2022
1 parent 46087bd commit aebc4e4
Showing 1 changed file with 52 additions and 14 deletions.
66 changes: 52 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
=======================
Expand All @@ -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

<p align="center">
<img src="https://raw.githubusercontent.com/gellston/FastROI/main/images/fastRect.png" style="float:center">
</p>

### fastRect

```cpp
#include <fastRect.h>
Expand All @@ -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<std::vector<fast::calPoint>> result = fast::rectROI(centerX, centerY, angle, range, distance, false, skip_pixels);
std::vector<std::vector<fast::calPoint>> result = fast::fastRect(centerX, centerY, angle, range, distance, false, skip_pixels);

//iteration of vertical line
for (auto vertical_line : vertical_lines) {
Expand All @@ -63,14 +65,50 @@ for (auto vertical_line : vertical_lines) {
```

#### DEMO
<center>

![fastRectDEMO](https://github.com/gellston/FastROI/blob/main/images/fastRect_rotation.gif?raw=true)

</center>

### fastDonut

```cpp
#include <fastDonut.h>

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<std::vector<fast::calPoint>> result = fast::fastDonut(centerX, centerY, radius, start_ratio, end_ratio, step_angle);

//iteration of vertical line
for (auto vertical_line : vertical_lines) {

<p align="center">
<img src="https://github.com/gellston/FastROI/blob/main/images/fastRect_rotation.gif?raw=true" width=700 style="float:center">
</o>
//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
<center>

<img src="https://github.com/gellston/FastROI/blob/main/images/fastDonut_demo.png?raw=true" width=450>

<div style="text-align: right; margin-right:30px;">
</center>

[TOP](#fast-roi)


0 comments on commit aebc4e4

Please sign in to comment.