File tree Expand file tree Collapse file tree 1 file changed +56
-0
lines changed
Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Original file line number Diff line number Diff line change 1+ # ** SystemC Image Data Generation Tool for Project Testbench**
2+
3+ This tool will help to generate the required data for the testbench. It
4+ generates grayscale, Sobel x, Sobel y, and combined Sobel x-y images.
5+
6+
7+ ## ** Installation**
8+
9+ Before running, make sure you have installed Python OpenCV. You can run:
10+ ``` shell
11+ cd tools/datagen/
12+ chmod +x install_pyopencv.sh
13+ ./install_pyopencv.sh
14+ ```
15+
16+ It will display the OpenCV version at the end of the installation.
17+
18+
19+ ## ** Usage**
20+
21+ There are two versions of the script, a JupyterNotebook and a normal Python
22+ script. For both of them, in the main function, the variables ` img_name ` and
23+ ` img_ext ` must be updated. The ` img_name ` is only the name of the image that
24+ is saved in ` tools/datagen/src/imgs ` and the ` img_ext ` is the extension of the
25+ image. For instance:
26+
27+ ``` python
28+ img_name: str = ' car'
29+ img_ext: str = ' jpg
30+ ```
31+
32+ will load ` tools/datagen/src/imgs/car.jpg ` image and generate:
33+
34+ * tools/datagen/src/imgs/car\_ grayscale\_ image.jpg
35+ * tools/datagen/src/imgs/car\_ sobel\_ combined\_ result.jpg
36+ * tools/datagen/src/imgs/car\_ sobel\_ x\_ result.jpg
37+ * tools/datagen/src/imgs/car\_ sobel\_ y\_ result.jpg
38+
39+ These generated images are ignored and must not be committed to the repository.
40+
41+
42+ ### ** Python Script**
43+
44+ To run the Python script:
45+
46+ ``` shell
47+ cd tools/datagen/
48+ python3 datagen.py
49+ ```
50+
51+
52+ ### ** JupyterNotebook**
53+
54+ You can open the file from the JupyterNotebook app or upload it to
55+ [ Google Colab] ( https://colab.research.google.com/ ) .
56+
You can’t perform that action at this time.
0 commit comments