arcjetCV 0.0.7.dev6__tar.gz → 1.1.0.dev2__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-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/PKG-INFO +57 -39
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/README.md +48 -22
- arcjetcv-1.1.0.dev2/arcjetCV/calibration/calibrate_video.py +55 -0
- arcjetcv-1.1.0.dev2/arcjetCV/calibration/chessboard_pattern.png +0 -0
- arcjetcv-1.1.0.dev2/arcjetCV/calibration/detetct_example.py +48 -0
- arcjetcv-1.1.0.dev2/arcjetCV/calibration/rotated_pattern.png +0 -0
- arcjetcv-1.1.0.dev2/arcjetCV/chessboard_pattern.png +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV.egg-info/PKG-INFO +57 -39
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV.egg-info/SOURCES.txt +5 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/setup.py +39 -13
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/LICENSE +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/__init__.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/calibration/__init__.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/calibration/calibration_controller.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/calibration/calibration_main.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/calibration/calibration_model.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/calibration/calibration_view.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/gui/__init__.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/gui/_arcjetCV_gui.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/gui/arcjetCV_gui.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/gui/custom_classes.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/gui/logo/arcjetCV_logo.icns +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/gui/logo/arcjetCV_logo.ico +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/gui/logo/arcjetCV_logo_.png +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/gui/logo/arcjetCV_logo_white.png +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/gui/main.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/gui/main_window.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/segmentation/__init__.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/segmentation/contour/__init__.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/segmentation/contour/cnn.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/segmentation/contour/contour.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/segmentation/time/__init__.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/segmentation/time/time_segmentation.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/utils/__init__.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/utils/logger.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/utils/output.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/utils/processor.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/utils/utils.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV/utils/video.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV.egg-info/dependency_links.txt +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV.egg-info/entry_points.txt +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV.egg-info/requires.txt +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/arcjetCV.egg-info/top_level.txt +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/setup.cfg +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/tests/README.md +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/tests/__init__.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/tests/test_calibration_functions.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/tests/test_calibration_gui.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/tests/test_functions.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/tests/test_gui.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/tests/test_obj_models.py +0 -0
- {arcjetcv-0.0.7.dev6 → arcjetcv-1.1.0.dev2}/tests/test_segmentation.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
2
|
Name: arcjetCV
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1.1.0.dev2
|
|
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,15 +26,6 @@ Requires-Dist: scikit-learn
|
|
|
26
26
|
Requires-Dist: segmentation-models-pytorch
|
|
27
27
|
Requires-Dist: torch
|
|
28
28
|
Requires-Dist: torchvision
|
|
29
|
-
Dynamic: author
|
|
30
|
-
Dynamic: classifier
|
|
31
|
-
Dynamic: description
|
|
32
|
-
Dynamic: description-content-type
|
|
33
|
-
Dynamic: home-page
|
|
34
|
-
Dynamic: platform
|
|
35
|
-
Dynamic: project-url
|
|
36
|
-
Dynamic: requires-dist
|
|
37
|
-
Dynamic: summary
|
|
38
29
|
|
|
39
30
|
[](https://arcjetcv.readthedocs.io/en/latest/?badge=latest)
|
|
40
31
|
[](https://anaconda.org/conda-forge/arcjetcv)
|
|
@@ -43,86 +34,113 @@ Dynamic: summary
|
|
|
43
34
|
-----
|
|
44
35
|
|
|
45
36
|
<div align="center">
|
|
46
|
-
<img src="https://
|
|
37
|
+
<img src="https://raw.githubusercontent.com/magnus-haw/arcjetCV/main/arcjetCV/gui/logo/arcjetCV_logo_.png" alt="arcjetCV Logo" width="30%">
|
|
38
|
+
|
|
47
39
|
</div>
|
|
48
40
|
|
|
49
41
|
# arcjetCV
|
|
50
42
|
|
|
51
43
|
Package to process arcjet videos and segment the edge of the shock and of the sample.
|
|
52
44
|
|
|
53
|
-

|
|
54
46
|
|
|
55
47
|
## Installation
|
|
56
48
|
|
|
57
|
-
###
|
|
49
|
+
### PyPi Installation (Universal)
|
|
58
50
|
|
|
59
|
-
|
|
51
|
+
#### Prerequisites:
|
|
52
|
+
- Ensure you have **Python 3.8** or higher installed.
|
|
60
53
|
|
|
54
|
+
To install **arcjetCV** via **pip** from **PyPi**, run:
|
|
61
55
|
|
|
62
|
-
|
|
63
|
-
|
|
56
|
+
```bash
|
|
57
|
+
pip install arcjetCV
|
|
58
|
+
```
|
|
64
59
|
|
|
65
|
-
|
|
60
|
+
This will install **arcjetCV** along with its dependencies.
|
|
66
61
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### Unix Users (Linux and macOS)
|
|
62
|
+
#### Note for macOS Users:
|
|
63
|
+
You might need to install Xcode Command Line Tools:
|
|
72
64
|
|
|
73
|
-
|
|
65
|
+
```bash
|
|
66
|
+
xcode-select --install
|
|
67
|
+
```
|
|
74
68
|
|
|
69
|
+
#### Note for Linux Users:
|
|
70
|
+
|
|
71
|
+
You may need to install **libxcb-cursor**. Use your package manager to install it:
|
|
72
|
+
|
|
73
|
+
For **Ubuntu/Debian**-based distributions:
|
|
75
74
|
```bash
|
|
76
|
-
|
|
75
|
+
sudo apt-get install libxcb-cursor0
|
|
77
76
|
```
|
|
78
77
|
|
|
79
|
-
|
|
78
|
+
For **Fedora**:
|
|
79
|
+
```bash
|
|
80
|
+
sudo dnf install libxcb-cursor
|
|
81
|
+
```
|
|
80
82
|
|
|
81
|
-
For
|
|
83
|
+
For **Arch Linux**:
|
|
84
|
+
```bash
|
|
85
|
+
sudo pacman -S libxcb
|
|
86
|
+
```
|
|
82
87
|
|
|
83
|
-
|
|
88
|
+
### Developer Installation
|
|
89
|
+
|
|
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 puropse, 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):
|
|
@@ -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
|
+
```
|
|
29
|
+
|
|
30
|
+
This will install **arcjetCV** along with its dependencies.
|
|
31
|
+
|
|
32
|
+
#### Note for macOS Users:
|
|
33
|
+
You might need to install Xcode Command Line Tools:
|
|
26
34
|
|
|
27
|
-
|
|
35
|
+
```bash
|
|
36
|
+
xcode-select --install
|
|
37
|
+
```
|
|
28
38
|
|
|
29
|
-
|
|
30
|
-
xcode-select --install
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### Unix Users (Linux and macOS)
|
|
39
|
+
#### Note for Linux Users:
|
|
34
40
|
|
|
35
|
-
|
|
41
|
+
You may need to install **libxcb-cursor**. Use your package manager to install it:
|
|
42
|
+
|
|
43
|
+
For **Ubuntu/Debian**-based distributions:
|
|
44
|
+
```bash
|
|
45
|
+
sudo apt-get install libxcb-cursor0
|
|
46
|
+
```
|
|
36
47
|
|
|
48
|
+
For **Fedora**:
|
|
37
49
|
```bash
|
|
38
|
-
|
|
50
|
+
sudo dnf install libxcb-cursor
|
|
39
51
|
```
|
|
40
52
|
|
|
41
|
-
|
|
53
|
+
For **Arch Linux**:
|
|
54
|
+
```bash
|
|
55
|
+
sudo pacman -S libxcb
|
|
56
|
+
```
|
|
42
57
|
|
|
43
|
-
|
|
58
|
+
### Developer Installation
|
|
44
59
|
|
|
45
|
-
|
|
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)
|
|
46
65
|
|
|
47
|
-
|
|
66
|
+
To install **arcjetCV** for development puropse, follow these steps:
|
|
48
67
|
|
|
49
|
-
|
|
68
|
+
1. Install `git-lfs`:
|
|
50
69
|
|
|
51
|
-
|
|
70
|
+
Download and install it from [here](https://git-lfs.github.com/).
|
|
52
71
|
|
|
53
|
-
|
|
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,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
|
|
Binary file
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import cv2
|
|
2
|
+
import numpy as np
|
|
3
|
+
import matplotlib.pyplot as plt
|
|
4
|
+
|
|
5
|
+
# Load the image
|
|
6
|
+
image_path = "/Users/alexandrequintart/Downloads/IMG_3837.jpeg"
|
|
7
|
+
image = cv2.imread(image_path)
|
|
8
|
+
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
|
|
9
|
+
|
|
10
|
+
# Define pattern size based on the image details (4x9)
|
|
11
|
+
pattern_size = (4, 9)
|
|
12
|
+
|
|
13
|
+
# Try to detect the pattern
|
|
14
|
+
found_chessboard, corners_chessboard = cv2.findChessboardCorners(gray, pattern_size)
|
|
15
|
+
|
|
16
|
+
found_circles_grid, centers_circles_grid = cv2.findCirclesGrid(
|
|
17
|
+
gray, pattern_size, flags=cv2.CALIB_CB_SYMMETRIC_GRID
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
found_asymmetric_grid, centers_asymmetric_grid = cv2.findCirclesGrid(
|
|
21
|
+
gray, pattern_size, flags=cv2.CALIB_CB_ASYMMETRIC_GRID
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
# Visualize the result
|
|
25
|
+
if found_chessboard:
|
|
26
|
+
cv2.drawChessboardCorners(image, pattern_size, corners_chessboard, found_chessboard)
|
|
27
|
+
detected_pattern = "Chessboard"
|
|
28
|
+
|
|
29
|
+
elif found_circles_grid:
|
|
30
|
+
cv2.drawChessboardCorners(image, pattern_size, centers_circles_grid, found_circles_grid)
|
|
31
|
+
detected_pattern = "Symmetric Circles Grid"
|
|
32
|
+
|
|
33
|
+
elif found_asymmetric_grid:
|
|
34
|
+
cv2.drawChessboardCorners(image, pattern_size, centers_asymmetric_grid, found_asymmetric_grid)
|
|
35
|
+
detected_pattern = "Asymmetric Circles Grid"
|
|
36
|
+
|
|
37
|
+
else:
|
|
38
|
+
detected_pattern = "No pattern detected"
|
|
39
|
+
|
|
40
|
+
# Show the detected pattern
|
|
41
|
+
plt.figure(figsize=(10, 6))
|
|
42
|
+
plt.imshow(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))
|
|
43
|
+
plt.title(f"Detected Pattern: {detected_pattern}")
|
|
44
|
+
plt.axis("off")
|
|
45
|
+
plt.show()
|
|
46
|
+
|
|
47
|
+
# Return detection results
|
|
48
|
+
detected_pattern
|
|
Binary file
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
2
|
Name: arcjetCV
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1.1.0.dev2
|
|
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,15 +26,6 @@ Requires-Dist: scikit-learn
|
|
|
26
26
|
Requires-Dist: segmentation-models-pytorch
|
|
27
27
|
Requires-Dist: torch
|
|
28
28
|
Requires-Dist: torchvision
|
|
29
|
-
Dynamic: author
|
|
30
|
-
Dynamic: classifier
|
|
31
|
-
Dynamic: description
|
|
32
|
-
Dynamic: description-content-type
|
|
33
|
-
Dynamic: home-page
|
|
34
|
-
Dynamic: platform
|
|
35
|
-
Dynamic: project-url
|
|
36
|
-
Dynamic: requires-dist
|
|
37
|
-
Dynamic: summary
|
|
38
29
|
|
|
39
30
|
[](https://arcjetcv.readthedocs.io/en/latest/?badge=latest)
|
|
40
31
|
[](https://anaconda.org/conda-forge/arcjetcv)
|
|
@@ -43,86 +34,113 @@ Dynamic: summary
|
|
|
43
34
|
-----
|
|
44
35
|
|
|
45
36
|
<div align="center">
|
|
46
|
-
<img src="https://
|
|
37
|
+
<img src="https://raw.githubusercontent.com/magnus-haw/arcjetCV/main/arcjetCV/gui/logo/arcjetCV_logo_.png" alt="arcjetCV Logo" width="30%">
|
|
38
|
+
|
|
47
39
|
</div>
|
|
48
40
|
|
|
49
41
|
# arcjetCV
|
|
50
42
|
|
|
51
43
|
Package to process arcjet videos and segment the edge of the shock and of the sample.
|
|
52
44
|
|
|
53
|
-

|
|
54
46
|
|
|
55
47
|
## Installation
|
|
56
48
|
|
|
57
|
-
###
|
|
49
|
+
### PyPi Installation (Universal)
|
|
58
50
|
|
|
59
|
-
|
|
51
|
+
#### Prerequisites:
|
|
52
|
+
- Ensure you have **Python 3.8** or higher installed.
|
|
60
53
|
|
|
54
|
+
To install **arcjetCV** via **pip** from **PyPi**, run:
|
|
61
55
|
|
|
62
|
-
|
|
63
|
-
|
|
56
|
+
```bash
|
|
57
|
+
pip install arcjetCV
|
|
58
|
+
```
|
|
64
59
|
|
|
65
|
-
|
|
60
|
+
This will install **arcjetCV** along with its dependencies.
|
|
66
61
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### Unix Users (Linux and macOS)
|
|
62
|
+
#### Note for macOS Users:
|
|
63
|
+
You might need to install Xcode Command Line Tools:
|
|
72
64
|
|
|
73
|
-
|
|
65
|
+
```bash
|
|
66
|
+
xcode-select --install
|
|
67
|
+
```
|
|
74
68
|
|
|
69
|
+
#### Note for Linux Users:
|
|
70
|
+
|
|
71
|
+
You may need to install **libxcb-cursor**. Use your package manager to install it:
|
|
72
|
+
|
|
73
|
+
For **Ubuntu/Debian**-based distributions:
|
|
75
74
|
```bash
|
|
76
|
-
|
|
75
|
+
sudo apt-get install libxcb-cursor0
|
|
77
76
|
```
|
|
78
77
|
|
|
79
|
-
|
|
78
|
+
For **Fedora**:
|
|
79
|
+
```bash
|
|
80
|
+
sudo dnf install libxcb-cursor
|
|
81
|
+
```
|
|
80
82
|
|
|
81
|
-
For
|
|
83
|
+
For **Arch Linux**:
|
|
84
|
+
```bash
|
|
85
|
+
sudo pacman -S libxcb
|
|
86
|
+
```
|
|
82
87
|
|
|
83
|
-
|
|
88
|
+
### Developer Installation
|
|
89
|
+
|
|
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 puropse, 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):
|
|
@@ -2,6 +2,7 @@ LICENSE
|
|
|
2
2
|
README.md
|
|
3
3
|
setup.py
|
|
4
4
|
arcjetCV/__init__.py
|
|
5
|
+
arcjetCV/chessboard_pattern.png
|
|
5
6
|
arcjetCV.egg-info/PKG-INFO
|
|
6
7
|
arcjetCV.egg-info/SOURCES.txt
|
|
7
8
|
arcjetCV.egg-info/dependency_links.txt
|
|
@@ -9,10 +10,14 @@ arcjetCV.egg-info/entry_points.txt
|
|
|
9
10
|
arcjetCV.egg-info/requires.txt
|
|
10
11
|
arcjetCV.egg-info/top_level.txt
|
|
11
12
|
arcjetCV/calibration/__init__.py
|
|
13
|
+
arcjetCV/calibration/calibrate_video.py
|
|
12
14
|
arcjetCV/calibration/calibration_controller.py
|
|
13
15
|
arcjetCV/calibration/calibration_main.py
|
|
14
16
|
arcjetCV/calibration/calibration_model.py
|
|
15
17
|
arcjetCV/calibration/calibration_view.py
|
|
18
|
+
arcjetCV/calibration/chessboard_pattern.png
|
|
19
|
+
arcjetCV/calibration/detetct_example.py
|
|
20
|
+
arcjetCV/calibration/rotated_pattern.png
|
|
16
21
|
arcjetCV/gui/__init__.py
|
|
17
22
|
arcjetCV/gui/_arcjetCV_gui.py
|
|
18
23
|
arcjetCV/gui/arcjetCV_gui.py
|
|
@@ -3,7 +3,7 @@ import sys
|
|
|
3
3
|
import os
|
|
4
4
|
|
|
5
5
|
# Read the README file for long description
|
|
6
|
-
with open("
|
|
6
|
+
with open("README_pypi.md", "r", encoding="utf-8") as fh:
|
|
7
7
|
long_description = fh.read()
|
|
8
8
|
|
|
9
9
|
|
|
@@ -13,10 +13,20 @@ def check_linux_dependencies():
|
|
|
13
13
|
|
|
14
14
|
# List of required packages
|
|
15
15
|
required_packages = [
|
|
16
|
-
"libxcb-xinerama0",
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"libxcb-
|
|
16
|
+
"libxcb-xinerama0",
|
|
17
|
+
"libxcb1",
|
|
18
|
+
"libx11-xcb1",
|
|
19
|
+
"libxcb-cursor0",
|
|
20
|
+
"libxcb-icccm4",
|
|
21
|
+
"libxcb-keysyms1",
|
|
22
|
+
"libxcb-render-util0",
|
|
23
|
+
"libxcb-shape0",
|
|
24
|
+
"libxcb-xfixes0",
|
|
25
|
+
"libxcb-randr0",
|
|
26
|
+
"libxcb-util1",
|
|
27
|
+
"libxcb-image0",
|
|
28
|
+
"libxcb-sync1",
|
|
29
|
+
"libxcb-xinput0",
|
|
20
30
|
]
|
|
21
31
|
|
|
22
32
|
try:
|
|
@@ -24,27 +34,39 @@ def check_linux_dependencies():
|
|
|
24
34
|
with open("/etc/os-release") as f:
|
|
25
35
|
os_info = f.read().lower()
|
|
26
36
|
if "ubuntu" in os_info or "debian" in os_info:
|
|
27
|
-
print(
|
|
37
|
+
print(
|
|
38
|
+
"\n[INFO] Ubuntu/Debian detected. Installing dependencies via APT..."
|
|
39
|
+
)
|
|
28
40
|
subprocess.run(["sudo", "apt", "update"], check=True)
|
|
29
|
-
subprocess.run(
|
|
41
|
+
subprocess.run(
|
|
42
|
+
["sudo", "apt", "install", "-y"] + required_packages, check=True
|
|
43
|
+
)
|
|
30
44
|
print("\n[INFO] System dependencies installed successfully.")
|
|
31
45
|
else:
|
|
32
|
-
print(
|
|
33
|
-
|
|
34
|
-
|
|
46
|
+
print(
|
|
47
|
+
"\n[WARNING] Non-Debian system detected. Please install the dependencies manually."
|
|
48
|
+
)
|
|
49
|
+
print(
|
|
50
|
+
"\n[INFO] Run one of the following commands based on your distribution:"
|
|
51
|
+
)
|
|
52
|
+
print(
|
|
53
|
+
"\n[Ubuntu/Debian] sudo apt-get install "
|
|
54
|
+
+ " ".join(required_packages)
|
|
55
|
+
)
|
|
35
56
|
print("[Fedora] sudo dnf install libxcb libX11-xcb libxcb-cursor")
|
|
36
57
|
print("[Arch] sudo pacman -S libxcb xcb-util xcb-util-cursor\n")
|
|
37
|
-
|
|
58
|
+
|
|
38
59
|
except Exception as e:
|
|
39
60
|
print(f"\n[ERROR] Could not determine Linux distribution: {e}")
|
|
40
61
|
|
|
62
|
+
|
|
41
63
|
# Run the platform check before proceeding
|
|
42
64
|
check_linux_dependencies()
|
|
43
65
|
|
|
44
66
|
# Define the setup configuration
|
|
45
67
|
setup(
|
|
46
68
|
name="arcjetCV",
|
|
47
|
-
version="
|
|
69
|
+
version="1.1.0.dev2", # Set the version directly here
|
|
48
70
|
author="arcjetCV team",
|
|
49
71
|
description="Package to process arcjet videos and segment the edge of the shock and of the sample",
|
|
50
72
|
long_description=long_description,
|
|
@@ -54,7 +76,11 @@ setup(
|
|
|
54
76
|
include_package_data=True, # Include package data based on the rules below
|
|
55
77
|
package_data={
|
|
56
78
|
"": ["*.txt", "*.md", "*.png", "*.gif"], # Include these file types
|
|
57
|
-
"arcjetCV": [
|
|
79
|
+
"arcjetCV": [
|
|
80
|
+
"gui/logo/*.png",
|
|
81
|
+
"gui/logo/*.ico",
|
|
82
|
+
"gui/logo/*.icns",
|
|
83
|
+
], # Include specific logo images
|
|
58
84
|
},
|
|
59
85
|
exclude_package_data={
|
|
60
86
|
"arcjetCV": [
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|