arcjetCV 0.0.7.dev4__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.
Files changed (62) hide show
  1. arcjetcv-1.1.0/MANIFEST.in +1 -0
  2. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/PKG-INFO +63 -44
  3. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/README.md +51 -25
  4. arcjetcv-1.1.0/README_pypi.md +135 -0
  5. arcjetcv-1.1.0/arcjetCV/calibration/calibrate_video.py +55 -0
  6. arcjetcv-1.1.0/arcjetCV/calibration/calibration_controller.py +908 -0
  7. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/arcjetCV/calibration/calibration_view.py +68 -66
  8. arcjetcv-1.1.0/arcjetCV/calibration/chessboard_pattern.png +0 -0
  9. arcjetcv-1.1.0/arcjetCV/calibration/detetct_example.py +48 -0
  10. arcjetcv-1.1.0/arcjetCV/calibration/rotated_pattern.png +0 -0
  11. arcjetcv-1.1.0/arcjetCV/calibration/test.py +70 -0
  12. arcjetcv-1.1.0/arcjetCV/chessboard_pattern.png +0 -0
  13. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/arcjetCV/gui/arcjetCV_gui.py +23 -11
  14. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/arcjetCV/gui/main.py +12 -3
  15. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/arcjetCV/gui/main_window.py +125 -70
  16. arcjetcv-1.1.0/arcjetCV/utils/utils.py +192 -0
  17. {arcjetcv-0.0.7.dev4/arcjetCV.egg-info → arcjetcv-1.1.0/arcjetcv.egg-info}/PKG-INFO +63 -44
  18. {arcjetcv-0.0.7.dev4/arcjetCV.egg-info → arcjetcv-1.1.0/arcjetcv.egg-info}/SOURCES.txt +15 -9
  19. {arcjetcv-0.0.7.dev4/arcjetCV.egg-info → arcjetcv-1.1.0/arcjetcv.egg-info}/requires.txt +1 -0
  20. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/setup.py +41 -14
  21. arcjetcv-1.1.0/tests/chessboard_pattern.png +0 -0
  22. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/tests/test_calibration_functions.py +66 -17
  23. arcjetcv-1.1.0/tests/test_calibration_gui.py +68 -0
  24. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/tests/test_gui.py +12 -12
  25. arcjetcv-0.0.7.dev4/arcjetCV/calibration/calibration_controller.py +0 -891
  26. arcjetcv-0.0.7.dev4/arcjetCV/segmentation/contour/Unet-xception-last-checkpoint.pt +0 -3
  27. arcjetcv-0.0.7.dev4/arcjetCV/segmentation/contour/Unet-xception_25_original.pt +0 -3
  28. arcjetcv-0.0.7.dev4/arcjetCV/segmentation/time/time-checkpoint.pt +0 -3
  29. arcjetcv-0.0.7.dev4/arcjetCV/utils/utils.py +0 -160
  30. arcjetcv-0.0.7.dev4/tests/test_calibration_gui.py +0 -60
  31. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/LICENSE +0 -0
  32. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/arcjetCV/__init__.py +0 -0
  33. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/arcjetCV/calibration/__init__.py +0 -0
  34. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/arcjetCV/calibration/calibration_main.py +0 -0
  35. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/arcjetCV/calibration/calibration_model.py +0 -0
  36. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/arcjetCV/gui/__init__.py +0 -0
  37. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/arcjetCV/gui/_arcjetCV_gui.py +0 -0
  38. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/arcjetCV/gui/custom_classes.py +0 -0
  39. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/arcjetCV/gui/logo/arcjetCV_logo.icns +0 -0
  40. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/arcjetCV/gui/logo/arcjetCV_logo.ico +0 -0
  41. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/arcjetCV/gui/logo/arcjetCV_logo_.png +0 -0
  42. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/arcjetCV/gui/logo/arcjetCV_logo_white.png +0 -0
  43. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/arcjetCV/segmentation/__init__.py +0 -0
  44. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/arcjetCV/segmentation/contour/__init__.py +0 -0
  45. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/arcjetCV/segmentation/contour/cnn.py +0 -0
  46. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/arcjetCV/segmentation/contour/contour.py +0 -0
  47. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/arcjetCV/segmentation/time/__init__.py +0 -0
  48. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/arcjetCV/segmentation/time/time_segmentation.py +0 -0
  49. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/arcjetCV/utils/__init__.py +0 -0
  50. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/arcjetCV/utils/logger.py +0 -0
  51. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/arcjetCV/utils/output.py +0 -0
  52. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/arcjetCV/utils/processor.py +0 -0
  53. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/arcjetCV/utils/video.py +0 -0
  54. {arcjetcv-0.0.7.dev4/arcjetCV.egg-info → arcjetcv-1.1.0/arcjetcv.egg-info}/dependency_links.txt +0 -0
  55. {arcjetcv-0.0.7.dev4/arcjetCV.egg-info → arcjetcv-1.1.0/arcjetcv.egg-info}/entry_points.txt +0 -0
  56. {arcjetcv-0.0.7.dev4/arcjetCV.egg-info → arcjetcv-1.1.0/arcjetcv.egg-info}/top_level.txt +0 -0
  57. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/setup.cfg +0 -0
  58. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/tests/README.md +0 -0
  59. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/tests/__init__.py +0 -0
  60. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/tests/test_functions.py +0 -0
  61. {arcjetcv-0.0.7.dev4 → arcjetcv-1.1.0}/tests/test_obj_models.py +0 -0
  62. {arcjetcv-0.0.7.dev4 → 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
2
- Name: arcjetCV
3
- Version: 0.0.7.dev4
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
@@ -18,6 +18,7 @@ License-File: LICENSE
18
18
  Requires-Dist: pyside6>=6.5.0
19
19
  Requires-Dist: opencv-python
20
20
  Requires-Dist: opencv-contrib-python
21
+ Requires-Dist: numpy
21
22
  Requires-Dist: matplotlib
22
23
  Requires-Dist: pandas
23
24
  Requires-Dist: pyarrow
@@ -25,103 +26,121 @@ Requires-Dist: scikit-learn
25
26
  Requires-Dist: segmentation-models-pytorch
26
27
  Requires-Dist: torch
27
28
  Requires-Dist: torchvision
28
- Dynamic: author
29
- Dynamic: classifier
30
- Dynamic: description
31
- Dynamic: description-content-type
32
- Dynamic: home-page
33
- Dynamic: platform
34
- Dynamic: project-url
35
- Dynamic: requires-dist
36
- Dynamic: summary
37
-
38
- [![Documentation Status](https://readthedocs.org/projects/arcjetcv/badge/?version=latest)](https://arcjetcv.readthedocs.io/en/latest/?badge=latest)
39
- [![Anaconda-Server Badge](https://anaconda.org/conda-forge/arcjetcv/badges/version.svg)](https://anaconda.org/conda-forge/arcjetcv)
29
+
30
+ [![GitHub Docs](https://img.shields.io/badge/docs-GitHub%20Pages-blue)](https://magnus-haw.github.io/arcjetCV/)
31
+ [![PyPI version](https://badge.fury.io/py/arcjetcv.svg)](https://pypi.org/project/arcjetcv/)
32
+ [![Downloads](https://pepy.tech/badge/arcjetcv)](https://pepy.tech/project/arcjetcv)
40
33
  [![tutorial](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/magnus-haw/arcjetCV/blob/main/tutorial.ipynb)
41
34
 
35
+
42
36
  -----
43
37
 
44
38
  <div align="center">
45
- <img src="https://github.com/magnus-haw/arcjetCV/blob/main/arcjetCV/gui/logo/arcjetCV_logo_.png" alt="arcjetCV Logo" width="30%">
39
+ <img src="https://raw.githubusercontent.com/magnus-haw/arcjetCV/main/arcjetCV/gui/logo/arcjetCV_logo_.png" alt="arcjetCV Logo" width="30%">
40
+
46
41
  </div>
47
42
 
48
43
  # arcjetCV
49
44
 
50
45
  Package to process arcjet videos and segment the edge of the shock and of the sample.
51
46
 
52
- ![arcjetCV Functionality](https://github.com/magnus-haw/arcjetCV/blob/main/docs/source/arcjet_video.gif)
53
-
54
47
  ## Installation
55
48
 
56
- ### Prerequisites
49
+ ### PyPi Installation (Universal)
50
+
51
+ #### Prerequisites:
52
+ - Ensure you have **Python 3.8** or higher installed.
57
53
 
58
- Before you start, ensure you have the following tools installed on your system:
54
+ To install **arcjetCV** via **pip** from **PyPi**, run:
59
55
 
56
+ ```bash
57
+ pip install arcjetCV
58
+ ```
59
+
60
+ This will install **arcjetCV** along with its dependencies.
60
61
 
61
- 1. **Miniconda or Anaconda:** Follow the respective installation guide for [Miniconda](https://docs.anaconda.com/free/miniconda/miniconda-install/) or [Anaconda](https://docs.anaconda.com/free/anaconda/install/index.html).
62
- 2. **(macOS only) Install Xcode Command Line Tools:**
62
+ #### Note for macOS Users:
63
+ You might need to install Xcode Command Line Tools:
64
+
65
+ ```bash
66
+ xcode-select --install
67
+ ```
63
68
 
64
- Ensure that you have the Xcode Command Line Tools installed by running:
69
+ #### Note for Linux Users:
65
70
 
66
- ```bash
67
- xcode-select --install
68
- ```
69
-
70
- ### Unix Users (Linux and macOS)
71
+ You may need to install **libxcb-cursor**. Use your package manager to install it:
71
72
 
72
- The software can be installed by running:
73
+ For **Ubuntu/Debian**-based distributions:
74
+ ```bash
75
+ sudo apt-get install libxcb-cursor0
76
+ ```
73
77
 
78
+ For **Fedora**:
74
79
  ```bash
75
- conda create --name arcjetcv conda-forge::arcjetcv
80
+ sudo dnf install libxcb-cursor
76
81
  ```
77
82
 
78
- ### Windows Users and Developers
83
+ For **Arch Linux**:
84
+ ```bash
85
+ sudo pacman -S libxcb
86
+ ```
79
87
 
80
- For local development of arcjetCV and for Windows users, these are the recommended installation steps:
88
+ ### Developer Installation
81
89
 
82
- 1. **Install `git`:**
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
+ ```
83
99
 
84
- You can download and install it from [here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).
100
+ To install **arcjetCV** for development purposes, follow these steps:
85
101
 
86
- 2. **Install `git lfs` (Git Large File Storage):**
102
+ 1. Install `git-lfs`:
87
103
 
88
- You can download and install it from [here](https://git-lfs.github.com/).
104
+ Download and install it from [here](https://git-lfs.github.com/).
89
105
 
90
- 3. **Clone the repository and install the package:**
106
+ 2. Clone the repository and install the package:
91
107
 
92
108
  ```bash
93
109
  git clone https://github.com/magnus-haw/arcjetCV.git
94
110
  cd arcjetCV
95
111
  conda env create -f env/arcjetCV_env_[cpu/gpu].yml
96
- conda activate arcjetCV
97
- python -m pip install -e .
112
+ conda activate arcjetcv
113
+ python -m pip install -e .
98
114
  ```
99
115
 
100
- The -e flag stands for 'editable' and it means that any change to the local source code will have immediate effect on the arcjetCV python package and GUI.
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
+
101
118
 
102
119
  ## How to Run
103
120
 
104
121
  You can now launch the GUI by running:
105
122
 
106
123
  ```bash
107
- conda activate arcjetCV
124
+ conda activate arcjetcv # (if using conda)
108
125
  arcjetCV
109
126
  ```
110
127
 
111
- or you can import arcjetCV's python API inside a python script, e.g. test.py:
128
+ Alternatively, you can use **arcjetCV's Python API** inside a Python script, e.g., `test.py`:
112
129
 
113
130
  ```python
114
131
  import arcjetCV as arcv
115
132
  video = arcv.Video("tests/arcjet_test.mp4")
116
133
  ```
117
134
 
118
- and then run it as:
135
+ Run the script with:
119
136
 
120
137
  ```bash
121
- conda activate arcjetCV
138
+ conda activate arcjetcv # (if using conda)
122
139
  python test.py
123
140
  ```
124
141
 
142
+
143
+
125
144
  ## Citing
126
145
 
127
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
- [![Documentation Status](https://readthedocs.org/projects/arcjetcv/badge/?version=latest)](https://arcjetcv.readthedocs.io/en/latest/?badge=latest)
2
- [![Anaconda-Server Badge](https://anaconda.org/conda-forge/arcjetcv/badges/version.svg)](https://anaconda.org/conda-forge/arcjetcv)
1
+ [![GitHub Docs](https://img.shields.io/badge/docs-GitHub%20Pages-blue)](https://magnus-haw.github.io/arcjetCV/)
2
+ [![PyPI version](https://badge.fury.io/py/arcjetcv.svg)](https://pypi.org/project/arcjetcv/)
3
3
  [![tutorial](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/magnus-haw/arcjetCV/blob/main/tutorial.ipynb)
4
-
4
+ [![Downloads](https://pepy.tech/badge/arcjetcv)](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
- ### Prerequisites
19
+ ### PyPi Installation (Universal)
20
20
 
21
- Before you start, ensure you have the following tools installed on your system:
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
- 1. **Miniconda or Anaconda:** Follow the respective installation guide for [Miniconda](https://docs.anaconda.com/free/miniconda/miniconda-install/) or [Anaconda](https://docs.anaconda.com/free/anaconda/install/index.html).
25
- 2. **(macOS only) Install Xcode Command Line Tools:**
26
+ ```bash
27
+ pip install arcjetCV
28
+ ```
26
29
 
27
- Ensure that you have the Xcode Command Line Tools installed by running:
30
+ This will install **arcjetCV** along with its dependencies.
28
31
 
29
- ```bash
30
- xcode-select --install
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
- The software can be installed by running:
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
- conda create --name arcjetcv conda-forge::arcjetcv
45
+ sudo apt-get install libxcb-cursor0
39
46
  ```
40
47
 
41
- ### Windows Users and Developers
48
+ For **Fedora**:
49
+ ```bash
50
+ sudo dnf install libxcb-cursor
51
+ ```
42
52
 
43
- For local development of arcjetCV and for Windows users, these are the recommended installation steps:
53
+ For **Arch Linux**:
54
+ ```bash
55
+ sudo pacman -S libxcb
56
+ ```
44
57
 
45
- 1. **Install `git`:**
58
+ ### Developer Installation
46
59
 
47
- You can download and install it from [here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).
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
- 2. **Install `git lfs` (Git Large File Storage):**
66
+ To install **arcjetCV** for development purposes, follow these steps:
50
67
 
51
- You can download and install it from [here](https://git-lfs.github.com/).
68
+ 1. Install `git-lfs`:
52
69
 
53
- 3. **Clone the repository and install the package:**
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 arcjetCV
60
- python -m pip install -e .
78
+ conda activate arcjetcv
79
+ python -m pip install -e .
61
80
  ```
62
81
 
63
- The -e flag stands for 'editable' and it means that any change to the local source code will have immediate effect on the arcjetCV python package and GUI.
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
+ [![GitHub Docs](https://img.shields.io/badge/docs-GitHub%20Pages-blue)](https://magnus-haw.github.io/arcjetCV/)
2
+ [![PyPI version](https://badge.fury.io/py/arcjetcv.svg)](https://pypi.org/project/arcjetcv/)
3
+ [![Downloads](https://pepy.tech/badge/arcjetcv)](https://pepy.tech/project/arcjetcv)
4
+ [![tutorial](https://colab.research.google.com/assets/colab-badge.svg)](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