Skip to content

Commit

Permalink
Merge pull request #7 from geoyee/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
geoyee authored Mar 14, 2023
2 parents 4575984 + 6bab5d0 commit 88e0b40
Show file tree
Hide file tree
Showing 50 changed files with 1,857 additions and 1,076 deletions.
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,16 @@ FodyWeavers.xsd
# Test
testimgs/

# setup
# Qt build
build-LabCD-*-Debug/
build-LabCD-*-Release/

# Setup
setup/

# depends
# Depends
labcd/depends/

# config
# Config
labcd/configs/setting.ini

46 changes: 14 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,20 @@

简体中文 | [English](./README_EN.md)

https://user-images.githubusercontent.com/71769312/216638896-bd1d5e40-6512-478d-b7b0-927c142aece6.mp4

遥感变化检测标注工具,设计参考[EISeg](https://github.com/PaddlePaddle/PaddleSeg/tree/release/2.6/EISeg),可以分别在左右两张画布中标注两个时段影像的变化信息,将自动同步在另一画布进行显示,[快捷键](https://github.com/geoyee/LabCD/wiki/%E5%BF%AB%E6%8D%B7%E9%94%AE%E5%88%97%E8%A1%A8)更方便。
[![version](https://img.shields.io/github/release/geoyee/LabCD.svg)](https://github.com/geoyee/LabCD/releases) [![license](https://img.shields.io/badge/license-GPLv3-blue.svg)](LICENSE) ![Language](https://img.shields.io/badge/language-C++%2017-blue.svg)

**哔哩哔哩:[https://www.bilibili.com/video/BV11j411T7up?t=23.2](https://www.bilibili.com/video/BV11j411T7up?t=23.2)**
https://user-images.githubusercontent.com/71769312/216638896-bd1d5e40-6512-478d-b7b0-927c142aece6.mp4

**下载:[Windows x64 exe](https://github.com/geoyee/LabCD/releases/download/0.2/LabCD-0.2-x64-setup.exe)**
遥感变化检测标注工具,设计参考[EISeg](https://github.com/PaddlePaddle/PaddleSeg/tree/release/2.6/EISeg),可以分别在左右两张画布中标注两个时段影像的变化信息,将自动同步在另一画布进行显示。

## 更新

1. 添加英语
2. 添加标注进程和定位十字丝
4. 增加对tif的支持,包含大图切块以及带地理参考的标签保存
6. 增加一个CVA参考图方便定位
1. 增加第一次加载多光谱数据计算最佳波段组合,后续加载计算所得的波段
2. 增加切分图像块可以设置大小,并不会舍去不满一个块的部分
4. 增加合并标签图像块
6. 增加过滤空标签和图像和加载推理好的掩膜

## 环境及依赖

- Visual Studio 2019
## 依赖

- Qt 6.4.0

Expand All @@ -29,29 +25,15 @@ https://user-images.githubusercontent.com/71769312/216638896-bd1d5e40-6512-478d-

- GDAL 3.5.3

## 文件组织

```
testimgs
├-- A # 用于存放时段一的图像
| └-- 01.jpg # 时段一图像
├-- B # 用于存放时段二的图像
| └-- 01.jpg # 时段二图像
├-- GT # 自动生成,用于存放标注结果
| ├-- 01_pseudo.jpg # 伪彩色图
| ├-- 01.bmp # 单波段标注图
| └-- 01.json # 自定义格式标注,用于恢复多边形
└-- label.json # 自动生成,用于自动标签导入
```
- Eigen 3.4.0

## 使用帮助
## 教程与文档

1. 需要点击标签后才能在画布进行绘制
2. 绘制以鼠标左键开始,鼠标右键结束(最好每次绘制完一个多边形都在画布上点一下鼠标右键)
3. 切换图像会自动保存
- [下载与使用](./docs/Download_and_usage.md)
- [快捷键](./docs/Keyboard_shortcuts.md)
- [使用教程](./docs/Usage_tutorial.md)

## 参考与辅助资源
## 资源

- 部分图标:[SuperMap GIS产品彩色系功能图标库](https://www.iconfont.cn/collections/detail?spm=a313x.7781069.1998910419.d9df05512&cid=32519)
- 标签预定义颜色:[色板 | AntV](https://antv.vision/zh/docs/specification/language/palette)
- 打包:[Inno Setup](https://jrsoftware.org/)
47 changes: 15 additions & 32 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,20 @@

Englis | [简体中文](./README.md)

https://user-images.githubusercontent.com/71769312/216638896-bd1d5e40-6512-478d-b7b0-927c142aece6.mp4

Remote sensing change detection annotation tool, it was designed with reference to [EISeg](https://github.com/PaddlePaddle/PaddleSeg/tree/release/2.6/EISeg). It can mark the change information of images in two periods in the left and right canvases respectively, and automatically display it in the other canvas synchronously. It makes it easy to use [shortcut keys](https://github.com/geoyee/LabCD/wiki/%E5%BF%AB%E6%8D%B7%E9%94%AE%E5%88%97%E8%A1%A8).
[![version](https://img.shields.io/github/release/geoyee/LabCD.svg)](https://github.com/geoyee/LabCD/releases) [![license](https://img.shields.io/badge/license-GPLv3-blue.svg)](LICENSE) ![Language](https://img.shields.io/badge/language-C++%2017-blue.svg)

**bilibili: [https://www.bilibili.com/video/BV11j411T7up?t=23.2](https://www.bilibili.com/video/BV11j411T7up?t=23.2)**
https://user-images.githubusercontent.com/71769312/216638896-bd1d5e40-6512-478d-b7b0-927c142aece6.mp4

**download: [Windows x64 exe](https://github.com/geoyee/LabCD/releases/download/0.2/LabCD-0.2-x64-setup.exe)**
Remote sensing change detection annotation tool, it was designed with reference to [EISeg](https://github.com/PaddlePaddle/PaddleSeg/tree/release/2.6/EISeg). It can mark the change information of images in two periods in the left and right canvases respectively, and automatically display it in the other canvas synchronously.

## News

1. Add English support
2. Add annotation process and positioning cross
4. Add tif support, about large image split and IO with geolocation
6. Add CVA reference image

## Environment and dependence
1. Add calculation of OIF for the first time loading multi-spectral data, and subsequent loading of calculated bands.
2. Add the ability to set the size of the split image blocks, without discarding any portions that do not fill a complete block.
3. Add merging of labeled image blocks.
4. Add filtering of empty labels and images, and loading of pre-inferred masks.

- Visual Studio 2019
## Dependences

- Qt 6.4.0

Expand All @@ -29,29 +25,16 @@ Remote sensing change detection annotation tool, it was designed with reference

- GDAL 3.5.3

## Data organization
- Eigen 3.4.0

```
testimgs
├-- A # time1 image folder
| └-- 01.jpg # time1 image
├-- B # time2 image folder
| └-- 01.jpg # time2 image
├-- GT # automatically generated for save annotation
| ├-- 01_pseudo.jpg # pseudo-color map
| ├-- 01.bmp # annotation with single band
| └-- 01.json # custom format used to restore polygons
└-- label.json # automatically generated for label import
```
## Tutorials and Documents

## Help
- [Download and usage](./docs/Download_and_usage_en.md)

1. You need to click the label to draw on the canvas
2. The starts with the left mouse button and ends with the right mouse button (It's best to right-click on the canvas every time you finish drawing a polygon)
3. Automatically saved after switching images
- [Keyboard shortcuts](./docs/Keyboard_shortcuts_en.md)
- [Usage tutorial](./docs/Usage_tutorial_en.md)

## Reference and resources
## Resources

- Icon:[SuperMap GIS产品彩色系功能图标库](https://www.iconfont.cn/collections/detail?spm=a313x.7781069.1998910419.d9df05512&cid=32519&lang=en-us)
- Icon:[SuperMap GIS Product color system function icon library](https://www.iconfont.cn/collections/detail?spm=a313x.7781069.1998910419.d9df05512&cid=32519&lang=en-us)
- Color:[Color Palette | AntV](https://antv.vision/en/docs/specification/language/palette)
- Packaging:[Inno Setup](https://jrsoftware.org/)
42 changes: 42 additions & 0 deletions docs/Download_and_usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 下载和使用

## 直接使用

提供x64版本的Windows exe[下载](https://github.com/geoyee/LabCD/releases/download/0.3/LabCD-0.3-x64-setup.exe),下载后按照流程安装后即可。打包过程由[Inno Setup](https://jrsoftware.org/)提供。

## 构建使用

1. 克隆项目到本地:

```shell
git clone https://github.com/geoyee/LabCD
```

2. 根据系统下载[Qt 6.4.0](https://www.qt.io/download-qt-installer?hsCtaTracking=99d9dd4f-5681-48d2-b096-470725510d34%7C074ddad0-fdef-4e53-8aa8-5e8a876d6ab4)版本并安装。Windows用户如需要使用Visual Studio需要下载VS扩展:Qt Visual Studio Tools。

3. 下载所需的依赖包。目前需要的第三方包有`OpenCV 4.5.5``JsonCpp 1.9.5``GDAL 3.5.3``Eigen 3.4.0`

1. `OpenCV 4.5.5`可从官方github仓库进行[下载](https://github.com/opencv/opencv/releases/tag/4.5.5)并使用cmake进行编译。
2. `JsonCpp 1.9.5`可从官方github仓库进行[下载](https://github.com/open-source-parsers/jsoncpp/releases/tag/1.9.5)并使用cmake进行编译。
3. `GDAL 3.5.3`可从官方github仓库进行[下载](https://github.com/OSGeo/gdal/releases/tag/v3.5.3)并使用cmake进行编译。
4. `Eigen 3.4.0`可从官方gitlab仓库直接进行[下载](https://gitlab.com/libeigen/eigen/-/tree/3.4.0)

准备好之后需要在`labcd`的文件夹下新建`depends`文件夹,其中包括`include``lib`文件夹。将Opencv、JsonCpp和GDAL编译完成对应的include和lib文件放入,将Eigen源代码直接放到`depends`下。完成后的`depends`文件夹结构如下:

```
depends
├-- include
| ├-- gdal
| ├-- json
| └-- opencv2
├-- lib
| ├-- gdal_i.lib
| ├-- jsoncpp_static.lib
| ├-- jsoncpp_staticd.lib
| ├-- opencv_world455.lib
| └-- opencv_world455d.lib
└-- Eigen
```

4. 完成后可使用Visual Studio打开对应的`sln`文件构建或其他平台使用Qt Creator打开`pro`文件,建立qmake后构建,即可使用。
5. CMakeLists由[qmake2cmake](https://www.qt.io/blog/introducing-qmake2cmake)生成,如第三方依赖的路径发生变化,无论是Visual Studio还是Qt Creator或是Cmake都需要对依赖的路径进行调整。
43 changes: 43 additions & 0 deletions docs/Download_and_usage_en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Download and Usage

## Direct Use

The x64 version of Windows exe is available for direct use, which can be downloaded [here](https://github.com/geoyee/LabCD/releases/download/0.3/LabCD-0.3-x64-setup.exe). After downloading, follow the process to install. The packaging process is provided by [Inno Setup](https://jrsoftware.org/).

## Building and Use

1. Clone the project to your local machine:

```shell
git clone https://github.com/geoyee/LabCD
```

1. Download and install [Qt 6.4.0](https://www.qt.io/download-qt-installer?hsCtaTracking=99d9dd4f-5681-48d2-b096-470725510d34|074ddad0-fdef-4e53-8aa8-5e8a876d6ab4) version according to your system. Windows users who want to use Visual Studio need to download the VS extension: Qt Visual Studio Tools.

2. Download the required dependencies. Currently, the required third-party packages are `OpenCV 4.5.5`, `JsonCpp 1.9.5`, `GDAL 3.5.3`, and `Eigen 3.4.0`.

1. `OpenCV 4.5.5` can be downloaded from the official GitHub repository [here](https://github.com/opencv/opencv/releases/tag/4.5.5) and compiled using cmake.
2. `JsonCpp 1.9.5` can be downloaded from the official GitHub repository [here](https://github.com/open-source-parsers/jsoncpp/releases/tag/1.9.5) and compiled using cmake.
3. `GDAL 3.5.3` can be downloaded from the official GitHub repository [here](https://github.com/OSGeo/gdal/releases/tag/v3.5.3) and compiled using cmake.
4. `Eigen 3.4.0` can be downloaded directly from the official gitlab repository [here](https://gitlab.com/libeigen/eigen/-/tree/3.4.0).

After preparing, you need to create a `depends` folder under the `labcd` folder, which includes `include` and `lib` folders. Put the completed include and lib files corresponding to Opencv, JsonCpp, and GDAL into the `depends` folder, and put the Eigen source code directly into `depends`. The `depends` folder structure after completion is as follows:

```
luaCopy codedepends
├-- include
| ├-- gdal
| ├-- json
| └-- opencv2
├-- lib
| ├-- gdal_i.lib
| ├-- jsoncpp_static.lib
| ├-- jsoncpp_staticd.lib
| ├-- opencv_world455.lib
| └-- opencv_world455d.lib
└-- Eigen
```

3. After completion, you can use Visual Studio to open the corresponding `sln` file for building or use Qt Creator to open the `pro` file, establish qmake and build, then you can use it.

4. The CMakeLists is generated by [qmake2cmake](https://www.qt.io/blog/introducing-qmake2cmake). If the paths of third-party dependencies change, whether it is Visual Studio, Qt Creator, or CMake, you need to adjust the paths of the dependencies.
18 changes: 18 additions & 0 deletions docs/Keyboard_shortcuts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 快捷键列表

| 操作 | 快捷键 |
| -------------- | ------------------- |
| 画布移动 | 按住鼠标中键移动 |
| 画布缩放 | Ctrl + 鼠标滚轮滚动 |
| 画点 | 鼠标左键 |
| 结束画点 | 鼠标右键 |
| 打开文件夹 | Ctrl + O |
| 切分大图 | Ctrl + B |
| 合并大图 | Ctrl + M |
| 打开快捷键帮助 | Ctrl + H |
| 保存 | Ctrl + S |
| 切换上一张 | S |
| 切换下一张 | F |
| 图像全屏 | Ctrl + F |
| 删除多边形 | Backspace |
| 删除所有多边形 | Delete |
18 changes: 18 additions & 0 deletions docs/Keyboard_shortcuts_en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Keyboard shortcut list

| Operation | Shortcut |
| ------------------------ | --------------------------------- |
| Move canvas | Hold middle mouse button and move |
| Zoom canvas | Ctrl + Scroll mouse wheel |
| Draw point | Left mouse button |
| End point drawing | Right mouse button |
| Open folder | Ctrl + O |
| Split image | Ctrl + B |
| Merge image | Ctrl + M |
| Open shortcut help | Ctrl + H |
| Save | Ctrl + S |
| Switch to previous image | S |
| Switch to next image | F |
| Image fullscreen | Ctrl + F |
| Delete polygon | Backspace |
| Delete all polygons | Delete |
47 changes: 47 additions & 0 deletions docs/Usage_tutorial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 使用教程

在使用前,需要对文件的组织形式进行了解。当未标注时,文件可只有`A``B`两个文件夹,其中保存的两时期影像的文件名相同。文件组织如下:

```
testimgs
├-- A # 用于存放时段一的图像
| └-- 01.jpg # 时段一图像
├-- B # 用于存放时段二的图像
| └-- 01.jpg # 时段二图像
├-- GT # 自动生成,用于存放标注结果
| ├-- 01_pseudo.png # 伪彩色图
| ├-- 01.bmp # 单波段标注图
| └-- 01.json # 自定义格式标注,用于恢复多边形
└-- label.json # 自动生成,用于自动标签导入
```

## 切分/合并大图

在“文件”中使用“切分大图”,需要选择大图路径和切分大小,可将一张大的遥感图像切分为多张小图。其中小图的命名中带有该图在大图像左上角的坐标,因此如果需要使用“合并大图”操作将该文件夹内的小图合并,则不能修改图像的名字。

## 清理空白标签

在“文件”中使用“清理空白标签”,需要选择符合文件组织的文件夹。该操作会遍历`GT`中的标签,将没有内容的标签对应的两时期影像、json文件等一并删除。

## 从标签建立标注

在“文件”中使用“从标签建立标注”,需要选择一个仅存放图像掩模的文件夹,该操作会为文件夹中的掩膜生成对应的json文件,使LabCD打开时绘制多边形以用于进行调整。

## 变化检测标注

核心功能,该功能使用时,在“文件”中使用“打开文件夹”,选择符合文件组织的文件夹,即可进行标注。

1. 标注时需要先在“标签列表”中“添加标签”,设置对应的颜色和文字内容。
2. 可以通过上/下翻页或直接双击“数据列表”中的文件名,切换到需要标注的文件。
3. 点击一个标签,再在图像中进行标注,鼠标左边新建点,右键完成当前多边形标注。
4. 完成后切换图像或点击保存都会保存结果,结果包括一个掩膜文件、一个多边形的json文件和一个伪彩色文件。

*最好每次绘制完一个多边形都在画布上点一下鼠标右键,若突然点击左键无效,可以切换一下标签,重新点击。*

其余功能包括:

- 设置十字丝的颜色。
- 加载一个小图像,该图像为两时期影像计算的变化强度图像。
- 增加第一次加载多光谱数据计算最佳波段组合,后续加载计算所得的波段。
- 删除指定多边形和清空多边形。
- 双击”点“可以删除该点,双击”线“可以在该线处新建一个点。
Loading

0 comments on commit 88e0b40

Please sign in to comment.