Skip to content

Commit aa3c810

Browse files
committed
Updating the datagen README with instructions to generate the noise
1 parent a4650fd commit aa3c810

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tools/datagen/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,25 @@ There are two versions of the script, a JupyterNotebook and a normal Python
2222
script. For both of them, in the main function, the variables `img_name` and
2323
`img_ext` must be updated. The `img_name` is only the name of the image that
2424
is saved in `tools/datagen/src/imgs` and the `img_ext` is the extension of the
25-
image. For instance:
25+
image. The `salt_probability` is used to set the probability of getting a salt
26+
pixel in the image, while `pepper_probability` is used for the pepper pixels.
27+
These two variables can be set to 0.0 to generate an image without noise. For
28+
instance:
2629

2730
```python
31+
salt_probability: float = 0.1
32+
salt_probability: float = 0.1
2833
img_name: str = 'car'
2934
img_ext: str = 'jpg
3035
```
3136

3237
will load `tools/datagen/src/imgs/car.jpg` image and generate:
3338

3439
* tools/datagen/src/imgs/car\_grayscale\_image.jpg
35-
* tools/datagen/src/imgs/car\_sobel\_combined\_result.jpg
40+
* tools/datagen/src/imgs/car\_noisy\_image.jpg
3641
* tools/datagen/src/imgs/car\_sobel\_x\_result.jpg
3742
* tools/datagen/src/imgs/car\_sobel\_y\_result.jpg
43+
* tools/datagen/src/imgs/car\_sobel\_combined\_result.jpg
3844

3945
These generated images are ignored and must not be committed to the repository.
4046

0 commit comments

Comments
 (0)