arcjetCV 0.0.7.dev6__tar.gz → 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- arcjetcv-1.1.0/MANIFEST.in +1 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/PKG-INFO +62 -44
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/README.md +51 -25
- arcjetcv-1.1.0/README_pypi.md +135 -0
- arcjetcv-1.1.0/arcjetCV/calibration/calibrate_video.py +55 -0
- arcjetcv-1.1.0/arcjetCV/calibration/calibration_controller.py +908 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/arcjetCV/calibration/calibration_view.py +68 -66
- arcjetcv-1.1.0/arcjetCV/calibration/chessboard_pattern.png +0 -0
- arcjetcv-1.1.0/arcjetCV/calibration/detetct_example.py +48 -0
- arcjetcv-1.1.0/arcjetCV/calibration/rotated_pattern.png +0 -0
- arcjetcv-1.1.0/arcjetCV/calibration/test.py +70 -0
- arcjetcv-1.1.0/arcjetCV/chessboard_pattern.png +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/arcjetCV/gui/arcjetCV_gui.py +23 -11
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/arcjetCV/gui/main.py +12 -3
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/arcjetCV/gui/main_window.py +125 -70
- arcjetcv-1.1.0/arcjetCV/utils/utils.py +192 -0
- {arcjetcv-0.0.7.dev6/arcjetCV.egg-info → arcjetcv-1.1.0/arcjetcv.egg-info}/PKG-INFO +62 -44
- {arcjetcv-0.0.7.dev6/arcjetCV.egg-info → arcjetcv-1.1.0/arcjetcv.egg-info}/SOURCES.txt +15 -6
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/setup.py +40 -14
- arcjetcv-1.1.0/tests/chessboard_pattern.png +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/tests/test_calibration_functions.py +66 -17
- arcjetcv-1.1.0/tests/test_calibration_gui.py +68 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/tests/test_gui.py +12 -12
- arcjetcv-0.0.7.dev6/arcjetCV/calibration/calibration_controller.py +0 -891
- arcjetcv-0.0.7.dev6/arcjetCV/utils/utils.py +0 -160
- arcjetcv-0.0.7.dev6/tests/test_calibration_gui.py +0 -60
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/LICENSE +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/arcjetCV/__init__.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/arcjetCV/calibration/__init__.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/arcjetCV/calibration/calibration_main.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/arcjetCV/calibration/calibration_model.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/arcjetCV/gui/__init__.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/arcjetCV/gui/_arcjetCV_gui.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/arcjetCV/gui/custom_classes.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/arcjetCV/gui/logo/arcjetCV_logo.icns +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/arcjetCV/gui/logo/arcjetCV_logo.ico +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/arcjetCV/gui/logo/arcjetCV_logo_.png +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/arcjetCV/gui/logo/arcjetCV_logo_white.png +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/arcjetCV/segmentation/__init__.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/arcjetCV/segmentation/contour/__init__.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/arcjetCV/segmentation/contour/cnn.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/arcjetCV/segmentation/contour/contour.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/arcjetCV/segmentation/time/__init__.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/arcjetCV/segmentation/time/time_segmentation.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/arcjetCV/utils/__init__.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/arcjetCV/utils/logger.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/arcjetCV/utils/output.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/arcjetCV/utils/processor.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/arcjetCV/utils/video.py +0 -0
- {arcjetcv-0.0.7.dev6/arcjetCV.egg-info → arcjetcv-1.1.0/arcjetcv.egg-info}/dependency_links.txt +0 -0
- {arcjetcv-0.0.7.dev6/arcjetCV.egg-info → arcjetcv-1.1.0/arcjetcv.egg-info}/entry_points.txt +0 -0
- {arcjetcv-0.0.7.dev6/arcjetCV.egg-info → arcjetcv-1.1.0/arcjetcv.egg-info}/requires.txt +0 -0
- {arcjetcv-0.0.7.dev6/arcjetCV.egg-info → arcjetcv-1.1.0/arcjetcv.egg-info}/top_level.txt +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/setup.cfg +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/tests/README.md +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/tests/__init__.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/tests/test_functions.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/tests/test_obj_models.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0}/tests/test_segmentation.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
include README_pypi.md
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
2
|
-
Name:
|
|
3
|
-
Version:
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: arcjetcv
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: Package to process arcjet videos and segment the edge of the shock and of the sample
|
|
5
5
|
Home-page: https://github.com/magnus-haw/arcjetCV
|
|
6
6
|
Author: arcjetCV team
|
|
@@ -26,103 +26,121 @@ Requires-Dist: scikit-learn
|
|
|
26
26
|
Requires-Dist: segmentation-models-pytorch
|
|
27
27
|
Requires-Dist: torch
|
|
28
28
|
Requires-Dist: torchvision
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
Dynamic: home-page
|
|
34
|
-
Dynamic: platform
|
|
35
|
-
Dynamic: project-url
|
|
36
|
-
Dynamic: requires-dist
|
|
37
|
-
Dynamic: summary
|
|
38
|
-
|
|
39
|
-
[](https://arcjetcv.readthedocs.io/en/latest/?badge=latest)
|
|
40
|
-
[](https://anaconda.org/conda-forge/arcjetcv)
|
|
29
|
+
|
|
30
|
+
[](https://magnus-haw.github.io/arcjetCV/)
|
|
31
|
+
[](https://pypi.org/project/arcjetcv/)
|
|
32
|
+
[](https://pepy.tech/project/arcjetcv)
|
|
41
33
|
[](https://colab.research.google.com/github/magnus-haw/arcjetCV/blob/main/tutorial.ipynb)
|
|
42
34
|
|
|
35
|
+
|
|
43
36
|
-----
|
|
44
37
|
|
|
45
38
|
<div align="center">
|
|
46
|
-
<img src="https://
|
|
39
|
+
<img src="https://raw.githubusercontent.com/magnus-haw/arcjetCV/main/arcjetCV/gui/logo/arcjetCV_logo_.png" alt="arcjetCV Logo" width="30%">
|
|
40
|
+
|
|
47
41
|
</div>
|
|
48
42
|
|
|
49
43
|
# arcjetCV
|
|
50
44
|
|
|
51
45
|
Package to process arcjet videos and segment the edge of the shock and of the sample.
|
|
52
46
|
|
|
53
|
-

|
|
54
|
-
|
|
55
47
|
## Installation
|
|
56
48
|
|
|
57
|
-
###
|
|
49
|
+
### PyPi Installation (Universal)
|
|
50
|
+
|
|
51
|
+
#### Prerequisites:
|
|
52
|
+
- Ensure you have **Python 3.8** or higher installed.
|
|
58
53
|
|
|
59
|
-
|
|
54
|
+
To install **arcjetCV** via **pip** from **PyPi**, run:
|
|
60
55
|
|
|
56
|
+
```bash
|
|
57
|
+
pip install arcjetCV
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
This will install **arcjetCV** along with its dependencies.
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
#### Note for macOS Users:
|
|
63
|
+
You might need to install Xcode Command Line Tools:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
xcode-select --install
|
|
67
|
+
```
|
|
64
68
|
|
|
65
|
-
|
|
69
|
+
#### Note for Linux Users:
|
|
66
70
|
|
|
67
|
-
|
|
68
|
-
xcode-select --install
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### Unix Users (Linux and macOS)
|
|
71
|
+
You may need to install **libxcb-cursor**. Use your package manager to install it:
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
For **Ubuntu/Debian**-based distributions:
|
|
74
|
+
```bash
|
|
75
|
+
sudo apt-get install libxcb-cursor0
|
|
76
|
+
```
|
|
74
77
|
|
|
78
|
+
For **Fedora**:
|
|
75
79
|
```bash
|
|
76
|
-
|
|
80
|
+
sudo dnf install libxcb-cursor
|
|
77
81
|
```
|
|
78
82
|
|
|
79
|
-
|
|
83
|
+
For **Arch Linux**:
|
|
84
|
+
```bash
|
|
85
|
+
sudo pacman -S libxcb
|
|
86
|
+
```
|
|
80
87
|
|
|
81
|
-
|
|
88
|
+
### Developer Installation
|
|
82
89
|
|
|
83
|
-
|
|
90
|
+
#### Prerequisites:
|
|
91
|
+
- A valid **git** installation.
|
|
92
|
+
- **Miniconda** or **Anaconda** for environment and package management:
|
|
93
|
+
- [Miniconda](https://docs.anaconda.com/free/miniconda/miniconda-install/)
|
|
94
|
+
- [Anaconda](https://docs.anaconda.com/free/anaconda/install/index.html)
|
|
95
|
+
- For **macOS** users make sure the Xcode Command Line Tools are installed:
|
|
96
|
+
```bash
|
|
97
|
+
xcode-select --install
|
|
98
|
+
```
|
|
84
99
|
|
|
85
|
-
|
|
100
|
+
To install **arcjetCV** for development purposes, follow these steps:
|
|
86
101
|
|
|
87
|
-
|
|
102
|
+
1. Install `git-lfs`:
|
|
88
103
|
|
|
89
|
-
|
|
104
|
+
Download and install it from [here](https://git-lfs.github.com/).
|
|
90
105
|
|
|
91
|
-
|
|
106
|
+
2. Clone the repository and install the package:
|
|
92
107
|
|
|
93
108
|
```bash
|
|
94
109
|
git clone https://github.com/magnus-haw/arcjetCV.git
|
|
95
110
|
cd arcjetCV
|
|
96
111
|
conda env create -f env/arcjetCV_env_[cpu/gpu].yml
|
|
97
|
-
conda activate
|
|
98
|
-
python -m pip install -e .
|
|
112
|
+
conda activate arcjetcv
|
|
113
|
+
python -m pip install -e .
|
|
99
114
|
```
|
|
100
115
|
|
|
101
|
-
The
|
|
116
|
+
The `-e` flag stands for 'editable' and means that any changes to the local source code will immediately affect the **arcjetCV** package and GUI.
|
|
117
|
+
|
|
102
118
|
|
|
103
119
|
## How to Run
|
|
104
120
|
|
|
105
121
|
You can now launch the GUI by running:
|
|
106
122
|
|
|
107
123
|
```bash
|
|
108
|
-
conda activate
|
|
124
|
+
conda activate arcjetcv # (if using conda)
|
|
109
125
|
arcjetCV
|
|
110
126
|
```
|
|
111
127
|
|
|
112
|
-
|
|
128
|
+
Alternatively, you can use **arcjetCV's Python API** inside a Python script, e.g., `test.py`:
|
|
113
129
|
|
|
114
130
|
```python
|
|
115
131
|
import arcjetCV as arcv
|
|
116
132
|
video = arcv.Video("tests/arcjet_test.mp4")
|
|
117
133
|
```
|
|
118
134
|
|
|
119
|
-
|
|
135
|
+
Run the script with:
|
|
120
136
|
|
|
121
137
|
```bash
|
|
122
|
-
conda activate
|
|
138
|
+
conda activate arcjetcv # (if using conda)
|
|
123
139
|
python test.py
|
|
124
140
|
```
|
|
125
141
|
|
|
142
|
+
|
|
143
|
+
|
|
126
144
|
## Citing
|
|
127
145
|
|
|
128
146
|
If you use arcjetCV in your research, please use the following BibTeX entry to cite [our paper](https://arxiv.org/abs/2404.11492):
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
[](https://magnus-haw.github.io/arcjetCV/)
|
|
2
|
+
[](https://pypi.org/project/arcjetcv/)
|
|
3
3
|
[](https://colab.research.google.com/github/magnus-haw/arcjetCV/blob/main/tutorial.ipynb)
|
|
4
|
-
|
|
4
|
+
[](https://pepy.tech/project/arcjetcv)
|
|
5
5
|
-----
|
|
6
6
|
|
|
7
7
|
<div align="center">
|
|
@@ -16,51 +16,77 @@ Package to process arcjet videos and segment the edge of the shock and of the sa
|
|
|
16
16
|
|
|
17
17
|
## Installation
|
|
18
18
|
|
|
19
|
-
###
|
|
19
|
+
### PyPi Installation (Universal)
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
#### Prerequisites:
|
|
22
|
+
- Ensure you have **Python 3.8** or higher installed.
|
|
22
23
|
|
|
24
|
+
To install **arcjetCV** via **pip** from **PyPi**, run:
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
```bash
|
|
27
|
+
pip install arcjetCV
|
|
28
|
+
```
|
|
26
29
|
|
|
27
|
-
|
|
30
|
+
This will install **arcjetCV** along with its dependencies.
|
|
28
31
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### Unix Users (Linux and macOS)
|
|
32
|
+
#### Note for macOS Users:
|
|
33
|
+
You might need to install Xcode Command Line Tools:
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
```bash
|
|
36
|
+
xcode-select --install
|
|
37
|
+
```
|
|
36
38
|
|
|
39
|
+
#### Note for Linux Users:
|
|
40
|
+
|
|
41
|
+
You may need to install **libxcb-cursor**. Use your package manager to install it:
|
|
42
|
+
|
|
43
|
+
For **Ubuntu/Debian**-based distributions:
|
|
37
44
|
```bash
|
|
38
|
-
|
|
45
|
+
sudo apt-get install libxcb-cursor0
|
|
39
46
|
```
|
|
40
47
|
|
|
41
|
-
|
|
48
|
+
For **Fedora**:
|
|
49
|
+
```bash
|
|
50
|
+
sudo dnf install libxcb-cursor
|
|
51
|
+
```
|
|
42
52
|
|
|
43
|
-
For
|
|
53
|
+
For **Arch Linux**:
|
|
54
|
+
```bash
|
|
55
|
+
sudo pacman -S libxcb
|
|
56
|
+
```
|
|
44
57
|
|
|
45
|
-
|
|
58
|
+
### Developer Installation
|
|
46
59
|
|
|
47
|
-
|
|
60
|
+
#### Prerequisites:
|
|
61
|
+
- A valid **git** installation.
|
|
62
|
+
- **Miniconda** or **Anaconda** for environment and package management:
|
|
63
|
+
- [Miniconda](https://docs.anaconda.com/free/miniconda/miniconda-install/)
|
|
64
|
+
- [Anaconda](https://docs.anaconda.com/free/anaconda/install/index.html)
|
|
48
65
|
|
|
49
|
-
|
|
66
|
+
To install **arcjetCV** for development purposes, follow these steps:
|
|
50
67
|
|
|
51
|
-
|
|
68
|
+
1. Install `git-lfs`:
|
|
52
69
|
|
|
53
|
-
|
|
70
|
+
Download and install it from [here](https://git-lfs.github.com/).
|
|
71
|
+
|
|
72
|
+
2. Clone the repository and install the package:
|
|
54
73
|
|
|
55
74
|
```bash
|
|
56
75
|
git clone https://github.com/magnus-haw/arcjetCV.git
|
|
57
76
|
cd arcjetCV
|
|
58
77
|
conda env create -f env/arcjetCV_env_[cpu/gpu].yml
|
|
59
|
-
conda activate
|
|
60
|
-
python -m pip install -e .
|
|
78
|
+
conda activate arcjetcv
|
|
79
|
+
python -m pip install -e .
|
|
61
80
|
```
|
|
62
81
|
|
|
63
|
-
The
|
|
82
|
+
The `-e` flag stands for 'editable' and means that any changes to the local source code will immediately affect the **arcjetCV** package and GUI.
|
|
83
|
+
|
|
84
|
+
#### Note for macOS Users:
|
|
85
|
+
You might need to install Xcode Command Line Tools:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
xcode-select --install
|
|
89
|
+
```
|
|
64
90
|
|
|
65
91
|
## How to Run
|
|
66
92
|
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
[](https://magnus-haw.github.io/arcjetCV/)
|
|
2
|
+
[](https://pypi.org/project/arcjetcv/)
|
|
3
|
+
[](https://pepy.tech/project/arcjetcv)
|
|
4
|
+
[](https://colab.research.google.com/github/magnus-haw/arcjetCV/blob/main/tutorial.ipynb)
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
-----
|
|
8
|
+
|
|
9
|
+
<div align="center">
|
|
10
|
+
<img src="https://raw.githubusercontent.com/magnus-haw/arcjetCV/main/arcjetCV/gui/logo/arcjetCV_logo_.png" alt="arcjetCV Logo" width="30%">
|
|
11
|
+
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
# arcjetCV
|
|
15
|
+
|
|
16
|
+
Package to process arcjet videos and segment the edge of the shock and of the sample.
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
### PyPi Installation (Universal)
|
|
21
|
+
|
|
22
|
+
#### Prerequisites:
|
|
23
|
+
- Ensure you have **Python 3.8** or higher installed.
|
|
24
|
+
|
|
25
|
+
To install **arcjetCV** via **pip** from **PyPi**, run:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install arcjetCV
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
This will install **arcjetCV** along with its dependencies.
|
|
32
|
+
|
|
33
|
+
#### Note for macOS Users:
|
|
34
|
+
You might need to install Xcode Command Line Tools:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
xcode-select --install
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
#### Note for Linux Users:
|
|
41
|
+
|
|
42
|
+
You may need to install **libxcb-cursor**. Use your package manager to install it:
|
|
43
|
+
|
|
44
|
+
For **Ubuntu/Debian**-based distributions:
|
|
45
|
+
```bash
|
|
46
|
+
sudo apt-get install libxcb-cursor0
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
For **Fedora**:
|
|
50
|
+
```bash
|
|
51
|
+
sudo dnf install libxcb-cursor
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
For **Arch Linux**:
|
|
55
|
+
```bash
|
|
56
|
+
sudo pacman -S libxcb
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Developer Installation
|
|
60
|
+
|
|
61
|
+
#### Prerequisites:
|
|
62
|
+
- A valid **git** installation.
|
|
63
|
+
- **Miniconda** or **Anaconda** for environment and package management:
|
|
64
|
+
- [Miniconda](https://docs.anaconda.com/free/miniconda/miniconda-install/)
|
|
65
|
+
- [Anaconda](https://docs.anaconda.com/free/anaconda/install/index.html)
|
|
66
|
+
- For **macOS** users make sure the Xcode Command Line Tools are installed:
|
|
67
|
+
```bash
|
|
68
|
+
xcode-select --install
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
To install **arcjetCV** for development purposes, follow these steps:
|
|
72
|
+
|
|
73
|
+
1. Install `git-lfs`:
|
|
74
|
+
|
|
75
|
+
Download and install it from [here](https://git-lfs.github.com/).
|
|
76
|
+
|
|
77
|
+
2. Clone the repository and install the package:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
git clone https://github.com/magnus-haw/arcjetCV.git
|
|
81
|
+
cd arcjetCV
|
|
82
|
+
conda env create -f env/arcjetCV_env_[cpu/gpu].yml
|
|
83
|
+
conda activate arcjetcv
|
|
84
|
+
python -m pip install -e .
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The `-e` flag stands for 'editable' and means that any changes to the local source code will immediately affect the **arcjetCV** package and GUI.
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## How to Run
|
|
91
|
+
|
|
92
|
+
You can now launch the GUI by running:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
conda activate arcjetcv # (if using conda)
|
|
96
|
+
arcjetCV
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Alternatively, you can use **arcjetCV's Python API** inside a Python script, e.g., `test.py`:
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
import arcjetCV as arcv
|
|
103
|
+
video = arcv.Video("tests/arcjet_test.mp4")
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Run the script with:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
conda activate arcjetcv # (if using conda)
|
|
110
|
+
python test.py
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
## Citing
|
|
116
|
+
|
|
117
|
+
If you use arcjetCV in your research, please use the following BibTeX entry to cite [our paper](https://arxiv.org/abs/2404.11492):
|
|
118
|
+
|
|
119
|
+
```BibTeX
|
|
120
|
+
@article{arcjetCV,
|
|
121
|
+
title={arcjetCV: an open-source software to analyze material ablation},
|
|
122
|
+
author={Quintart, Alexandre and Haw, Magnus and Semeraro, Federico},
|
|
123
|
+
journal={arXiv preprint arXiv:2404.11492},
|
|
124
|
+
year={2024}
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Legal / License
|
|
129
|
+
Copyright © 2024 United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All Rights Reserved.
|
|
130
|
+
|
|
131
|
+
Disclaimers
|
|
132
|
+
|
|
133
|
+
No Warranty: THE SUBJECT SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY OF ANY KIND, EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR FREEDOM FROM INFRINGEMENT, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL BE ERROR FREE, OR ANY WARRANTY THAT DOCUMENTATION, IF PROVIDED, WILL CONFORM TO THE SUBJECT SOFTWARE. THIS AGREEMENT DOES NOT, IN ANY MANNER, CONSTITUTE AN ENDORSEMENT BY GOVERNMENT AGENCY OR ANY PRIOR RECIPIENT OF ANY RESULTS, RESULTING DESIGNS, HARDWARE, SOFTWARE PRODUCTS OR ANY OTHER APPLICATIONS RESULTING FROM USE OF THE SUBJECT SOFTWARE. FURTHER, GOVERNMENT AGENCY DISCLAIMS ALL WARRANTIES AND LIABILITIES REGARDING THIRD-PARTY SOFTWARE, IF PRESENT IN THE ORIGINAL SOFTWARE, AND DISTRIBUTES IT "AS IS."
|
|
134
|
+
|
|
135
|
+
Waiver and Indemnity: RECIPIENT AGREES TO WAIVE ANY AND ALL CLAIMS AGAINST THE UNITED STATES GOVERNMENT, ITS CONTRACTORS AND SUBCONTRACTORS, AS WELL AS ANY PRIOR RECIPIENT. IF RECIPIENT'S USE OF THE SUBJECT SOFTWARE RESULTS IN ANY LIABILITIES, DEMANDS, DAMAGES, EXPENSES OR LOSSES ARISING FROM SUCH USE, INCLUDING ANY DAMAGES FROM PRODUCTS BASED ON, OR RESULTING FROM, RECIPIENT'S USE OF THE SUBJECT SOFTWARE, RECIPIENT SHALL INDEMNIFY AND HOLD HARMLESS THE UNITED STATES GOVERNMENT, ITS CONTRACTORS AND SUBCONTRACTORS, AS WELL AS ANY PRIOR RECIPIENT, TO THE EXTENT PERMITTED BY LAW. RECIPIENT'S SOLE REMEDY FOR ANY SUCH MATTER SHALL BE THE IMMEDIATE, UNILATERAL TERMINATION OF THIS AGREEMENT.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
def apply_calibration(frame, calibration_data):
|
|
2
|
+
"""
|
|
3
|
+
Apply calibration to a single frame using provided calibration data.
|
|
4
|
+
|
|
5
|
+
Args:
|
|
6
|
+
frame (numpy.ndarray): The input frame (image) to calibrate.
|
|
7
|
+
calibration_data (dict): A dictionary containing calibration data with keys:
|
|
8
|
+
- "camera_matrix": The intrinsic camera matrix.
|
|
9
|
+
- "dist_coeffs": The distortion coefficients.
|
|
10
|
+
- "rvec" (optional): The rotation vector for 3D transformations.
|
|
11
|
+
- "tvec" (optional): The translation vector for 3D transformations.
|
|
12
|
+
|
|
13
|
+
Returns:
|
|
14
|
+
numpy.ndarray: The calibrated frame (image).
|
|
15
|
+
"""
|
|
16
|
+
# Extract calibration data
|
|
17
|
+
camera_matrix = np.array(calibration_data["camera_matrix"])
|
|
18
|
+
dist_coeffs = np.array(calibration_data["dist_coeffs"])
|
|
19
|
+
|
|
20
|
+
# Undistort the frame
|
|
21
|
+
h, w = frame.shape[:2]
|
|
22
|
+
new_camera_matrix, _ = cv2.getOptimalNewCameraMatrix(
|
|
23
|
+
camera_matrix, dist_coeffs, (w, h), 1, (w, h)
|
|
24
|
+
)
|
|
25
|
+
undistorted_frame = cv2.undistort(frame, camera_matrix, dist_coeffs, None, new_camera_matrix)
|
|
26
|
+
|
|
27
|
+
# Apply 3D transformations if rvec and tvec are available
|
|
28
|
+
if "rvec" in calibration_data and "tvec" in calibration_data:
|
|
29
|
+
rvec = np.array(calibration_data["rvec"])
|
|
30
|
+
tvec = np.array(calibration_data["tvec"])
|
|
31
|
+
|
|
32
|
+
# Define points on the image plane
|
|
33
|
+
height, width = undistorted_frame.shape[:2]
|
|
34
|
+
object_points = np.array([
|
|
35
|
+
[0, 0, 0],
|
|
36
|
+
[width, 0, 0],
|
|
37
|
+
[width, height, 0],
|
|
38
|
+
[0, height, 0]
|
|
39
|
+
], dtype=np.float32)
|
|
40
|
+
|
|
41
|
+
# Project 3D points to the image plane
|
|
42
|
+
image_points, _ = cv2.projectPoints(object_points, rvec, tvec, new_camera_matrix, None)
|
|
43
|
+
|
|
44
|
+
# Compute the perspective transform
|
|
45
|
+
src_points = np.float32([[0, 0], [width, 0], [width, height], [0, height]])
|
|
46
|
+
dst_points = np.float32(image_points[:, 0, :])
|
|
47
|
+
perspective_transform = cv2.getPerspectiveTransform(src_points, dst_points)
|
|
48
|
+
|
|
49
|
+
# Apply the perspective transformation
|
|
50
|
+
calibrated_frame = cv2.warpPerspective(undistorted_frame, perspective_transform, (w, h))
|
|
51
|
+
else:
|
|
52
|
+
# If no 3D transformation data, return the undistorted frame
|
|
53
|
+
calibrated_frame = undistorted_frame
|
|
54
|
+
|
|
55
|
+
return calibrated_frame
|