Skip to content

Commit

Permalink
Merge pull request #93 from shelllet/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
shelllet authored Oct 15, 2023
2 parents 345169b + 42b287e commit 622a551
Show file tree
Hide file tree
Showing 71 changed files with 515 additions and 252 deletions.
Binary file added algorithm/ColorPercentage.simple
Binary file not shown.
Binary file added algorithm/ImageDifference.simple
Binary file not shown.
Binary file added assets/circle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/license_plate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/road.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/shape.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/shape2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/star.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/star2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added detection/BlobDetect.simple
Binary file not shown.
Binary file added detection/EllipseDetection.simple
Binary file not shown.
Binary file not shown.
Binary file added detection/FindContours.simple
Binary file not shown.
Binary file added detection/LineDetection.simple
Binary file not shown.
Binary file added detection/MatchShapes.simple
Binary file not shown.
Binary file added detection/MatchTemplate.simple
Binary file not shown.
Binary file added detection/ShapeDetection.simple
Binary file not shown.
Binary file removed detection/模板匹配.simple
Binary file not shown.
17 changes: 16 additions & 1 deletion docx/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
# [0.28](https://github.com/shelllet/winui/compare/main...dev) (2023-09-23)
# [0.29.1](https://github.com/shelllet/winui/compare/main...dev) (2023-10-15)
### Changed:

1. *鼠标监听* 支持监听鼠标按下。
2. 图像查找(特征匹配)返回匹配的多个图像。
3. 增加 *颜色填充* 动作。
4. 增加 *形状查找* 动作,可以查找 *长方形**正方形**三角形*
5. 修复打包错误


### 备注

1. 下载:https://winui.net/_media/simple/0.29.1/setup.exe

## [0.28](https://github.com/shelllet/winui/compare/main...dev) (2023-09-23)
### Changed:
1. 优化图像处理相关动作。
2. 更新相应的注册机制。

### 备注
1. 原购买注册版本的用户,需要更新至当前版本,重新注册。
2. 下载:https://winui.net/_media/simple/0.28/setup.exe

## [0.27](https://github.com/shelllet/winui/compare/main...dev) (2023-09-02)
### Changed:
Expand Down
22 changes: 13 additions & 9 deletions docx/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
- [异步启动](./actions/async/WorkBegin.md)
- [状态切换](./actions/async/WorkReset.md)
- [等待事件](./actions/async/WhenEvent.md)
- [异步等待](./actions/async/WorkWait.md)
- 文件
- [读取文件](./actions/filesystem/FileRead.md)
- [文件写入](./actions/filesystem/FileWrite.md)
Expand Down Expand Up @@ -86,20 +87,19 @@
- [平滑/模糊](./actions/image/ImageBlur.md)
- [标记区域](./actions/image/ImageMarkROI.md)
- [标记相对区域](./actions/image/ImageMarkRelativeROI.md)
- [连通域分析](./actions/image/ConnectedComponents.md)
- 图像检测
- [线段检测](./actions/detection/EdgeLineDetection.md)
- [快速直线检查找](./actions/detection/FastLineDetection.md)
- [直线检测](./actions/detection/LineDetection.md)
- [椭圆检测](./actions/detection/EllipseDetection.md)
- [斑点检测](./actions/detection/BlobDetect.md)
- [形状查找](./actions/detection/ShapeDetection.md)
- [形状匹配](./actions/detection/MatchShapes.md)
- [图像查找](./actions/detection/FeatureDetect.md)
- [Blob 查找](./actions/detection/BlobDetect.md)
- [查找轮廓](./actions/detection/FindContours.md)
- [近似轮廓](./actions/detection/ApproxPolyDP.md)
- [连通域分析](./actions/detection/ConnectedComponents.md)
- [颜色统计](./actions/detection/ColorPercentage.md)
- [特征匹配](./actions/detection/FeatureDetect.md)
- [模板匹配](./actions/detection/MatchTemplate.md)
- [查找轮廓](./actions/detection/FindContours.md)
- 绘图
- [绘制检测结果](./actions/drawing/DrawDetectionResult.md)
- [绘制矩形](./actions/draw/DrawRect.md)
- [填充颜色](./actions/draw/FillColor.md)
- 深度学习
- [目标分类](./actions/dnn/ONNXClassification.md)
- [目标检测](./actions/dnn/ONNXDetection.md)
Expand Down Expand Up @@ -215,6 +215,8 @@
- [窗口筛选](./actions/algorithm/FilterWindows.md)
- [随机数](./actions/algorithm/RandomNumber.md)
- [随机坐标](./actions/algorithm/RandomPoint.md)
- [图像差值](./actions/algorithm/ImageDifference.md)
- [颜色统计](./actions/algorithm/ColorPercentage.md)
- 类型
- [字符串](./actions/type/TypeString.md)
- [Json](./actions/type/TypeJson.md)
Expand Down Expand Up @@ -274,4 +276,6 @@
- [RelativePosition](./enums/RelativePosition.md)
- [MouseMessage](./enums/MouseMessage.md)
- [MorphologicalOperations](./enums/MorphologicalOperations.md)
- [ContourApproximationModes](./enums/ContourApproximationModes.md)
- [FeatureAlgorithm](./enums/FeatureAlgorithm.md)
- [Changelog](./CHANGELOG.md)
35 changes: 35 additions & 0 deletions docx/actions/algorithm/ColorPercentage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 颜色统计
该动作可以统计某一颜色在图像当中所占的比例。

![ColorPercentage](./images/04.png ':size=90%')


## 子流程

> 不支持

## 运行参数

* 图像
> 要进行颜色统计的图像,通常可以选择一个区域进行统计。
* 颜色
> 所要统计的颜色。 由于 *HSV* 颜色空间更符合人的主观视觉感知, 通常使用 *HSV* 颜色空间。
* 误差
> 包含近似颜色的差值。
## 输出

> 所要统计的颜色所占的百分比,参考:[Number](../types/Number.md)

## 脚本调用

```python
import simple;

```

## 资源

例子:https://github.com/shelllet/WinUi/blob/main/algorithm/ColorPercentage.simple
18 changes: 13 additions & 5 deletions docx/actions/algorithm/FilterEllipse.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,17 @@
## 运行参数


* Value: 必须为椭圆列表: [`Ellipses`](./types/Ellipse.md)
*
> 椭圆数组: [`Ellipses`](./types/Ellipse.md)
* Minor 椭圆短轴范围
* Major 椭圆长轴范围
* Angle: 椭圆角度范围
* 短轴
> 短轴的范围,只有该范围内的椭圆才会保留。
* 长轴
> 长轴的范围,只有该范围内的椭圆才会保留。
* 角度

> 椭圆角度范围, 圆的角度始终为: *0*
## 输出
> 椭圆数组:`Ellipses`
Expand All @@ -28,7 +34,9 @@ import simple

```

## 示例
## 资源

[https://github.com/shelllet/WinUi/blob/main/algorithm/filter_ellipse.simple](https://github.com/shelllet/WinUi/blob/main/algorithm/filter_ellipse.simple)


!> 如果短轴的最小值和长轴的最小值相同, 短轴的最大值和长轴的最大值相同,则可以筛选该半径范围内的的圆。
34 changes: 34 additions & 0 deletions docx/actions/algorithm/ImageDifference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 图像差值
这个动作可以比较两个图像,并返回一个显示相似性的度量。结果越低,匹配越好。即使图像旋转、缩放也不会对该比较产生太大影响。

* 为了获得更高的准确性,请使用二值图像
* 要找到的对象应该是白色的,背景应该是黑色的。

![ImageDifference](./images/03.png ':size=90%')

## 子流程
> 不支持

## 运行参数

* 源图像
> 源图像,二值化后的单通道图像,如果为非单通道图像,则会转换成灰度图像。
* 目标
> 目标图像,二值化后的单通道图像,如果为非单通道图像,则会转换成灰度图像。
## 输出

> 相似性的指标(小数)。越低,表示匹配越好。*0*:表示完全匹配,参考: [Number](../types/Number.md)

## 脚本调用

```python
import simple;

```

## 资源

例子:https://github.com/shelllet/WinUi/blob/main/algorithm/ImageDifference.simple
Binary file added docx/actions/algorithm/images/03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docx/actions/algorithm/images/04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 0 additions & 26 deletions docx/actions/detection/ApproxPolyDP.md

This file was deleted.

34 changes: 23 additions & 11 deletions docx/actions/detection/BlobDetect.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,37 @@
# Blob 查找
*Blob* 是图像中与周围区域在属性(例如亮度、颜色)上不同的区域。
# 斑点检测
*斑点* 是图像中与周围区域在属性(例如亮度、颜色)上不同的区域, 也可以称为 *Blob* ,该动作对图像中的 *斑点* ,按照指定的条件进行筛选过滤。

* 查找圆或者椭圆就是从黑色背景中查找白色圆或者椭圆边缘。所以请记住,要找到的圆或者椭圆应该是白色的,背景应该是黑色的。


![BlobDetect](./images/03.png ':size=90%')

## 子流程
> 不支持

## 运行参数

* Image:源图像
* Threshold:阈值范围。通过使用从最小阈值开始对源图像进行阈值处理,将源图像转换为多个二值图像。这些阈值按 *Step*递增, 直到最大阈值。
* Step:相邻阈值之间的距离。
* Color:一个介于 0 和 255 之间的数字,表示 *Blob* 的颜色。*0* 将选择暗斑点,*255* 将选择亮斑点(默认值:*0*)。
* Area:按面积过滤 *Blob*
* Circularity: 衡量 *Blob* 与圆的接近程度。比如:*圆形* 的圆度为 *1**正方形* 的圆度为 *0.785*
* Convexity:按凸性比进行过滤。凸性定义为(*Blob* 的面积/它的*凸包*面积,形状的凸包是完全包围该形状的最紧密的凸形。
* Inertia:按惯量比(拉长比)进行过滤。对于**,惯量比为 *1*,对于*椭圆*,惯量比为 *0**1*,对于*直线*,惯量比值为 *0*
* 图像
> 源图像。
* 阈值
> 通过使用从最小阈值开始对源图像进行阈值处理,将源图像转换为多个二值图像。这些阈值按 *步长* 递增, 直到最大阈值。
* 步长
> 相邻阈值之间的距离。
* 面积
> 范围,提取 *斑点* 的面积,按该设置的范围进行 *斑点*过滤。该参数默认不启用。
* 圆形度
> 范围,衡量 *斑点* 与圆的接近程度。比如:*圆形* 的圆度为 *1**正方形* 的圆度为 *0.785*。该参数默认不启用。
* 凸性比
> 范围,按凸性比进行过滤。凸性定义为(*斑点* 的面积/它的*凸包*面积,形状的凸包是完全包围该形状的最紧密的凸形。该参数默认不启用。
* 惯量比
> 范围,按惯量比(拉长比)进行过滤。对于**,惯量比为 *1*,对于*椭圆*,惯量比为 *0**1*,对于*直线*,惯量比值为 *0*。该参数默认不启用。

## 输出

> *Blob* 区域 [Images](./types/Image.md)
> 检测到 *斑点* 的矩形框,参考: [RotatedRects](./types/RotatedRect.md)

## 脚本调用
Expand Down
31 changes: 0 additions & 31 deletions docx/actions/detection/ColorPercentage.md

This file was deleted.

28 changes: 0 additions & 28 deletions docx/actions/detection/ConnectedComponents.md

This file was deleted.

26 changes: 0 additions & 26 deletions docx/actions/detection/EdgeLineDetection.md

This file was deleted.

20 changes: 13 additions & 7 deletions docx/actions/detection/EllipseDetection.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
# 椭圆检测
检测图像中的圆或者椭圆
检测图像中的圆或者椭圆,线宽通常是 *1*像素。

* 为了获得更高的准确性,请使用二值图像。因此,在查找圆或者椭圆之前,请应用阈值或边缘检测进行预处理。
* 查找圆或者椭圆就是从黑色背景中查找白色圆或者椭圆边缘。所以请记住,要找到的圆或者椭圆应该是白色的,背景应该是黑色的。


![EllipseDetection](./images/02.png ':size=90%')

## 子流程
> 不支持


## 运行参数


* Image: 待检测的图片。
* Area: 面积过滤
* 图像
> 二值化后的单通道图像,如果为非单通道图像,则会转换成灰度图像。

## 输出

> [`Ellipses`](./types/Ellipse.md)
> 检测到的所有圆或者椭圆,参考: [`Ellipses`](./types/Ellipse.md)

### 脚本调用
Expand All @@ -25,7 +31,7 @@ import simple;

```

## 示例
## 资源

[https://github.com/shelllet/WinUi/blob/main/detection/ellipse_detection.simple](https://github.com/shelllet/WinUi/blob/main/detection/ellipse_detection.simple)
例子:https://github.com/shelllet/WinUi/blob/main/detection/EllipseDetection.simple

Loading

0 comments on commit 622a551

Please sign in to comment.