Skip to content

Commit 0873d62

Browse files
authored
Merge pull request #524 from lilianmallardeau/master
Fix indentation inconsistency in python scripts + typos in readme
2 parents def6ae1 + 88428aa commit 0873d62

File tree

6 files changed

+29
-31
lines changed

6 files changed

+29
-31
lines changed

object detection/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ZED SDK - Object Detection
22

3-
- **Birds eye viewer**: Deteted objects are displayed in a **3D** view with the current point cloud.
3+
- **Birds eye viewer**: Detected objects are displayed in a **3D** view with the current point cloud.
44
- **Image viewer**: Detected objects are displayed in a **2D** view with the current image.
55
- **Custom detector**: Sample with external detectors to use the DETECTION_MODEL::CUSTOM_BOX_OBJECTS mode

object detection/birds eye viewer/python/ogl_viewer/viewer.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def __add_quad(self, _quad_pts, _alpha1, _alpha2, _clr):
213213
self.indices.append(len(self.indices))
214214

215215
def add_vertical_faces(self, _pts, _clr):
216-
# For each face, we need to add 4 quads (the first 2 indexes are always the top points of the quad)
216+
# For each face, we need to add 4 quads (the first 2 indexes are always the top points of the quad)
217217
quads = [[0, 3, 7, 4] # Front face
218218
, [3, 2, 6, 7] # Right face
219219
, [2, 1, 5, 6] # Back face
@@ -518,13 +518,13 @@ def updateData(self, pc, _objs):
518518

519519
def create_bbox_rendering(self, _bbox, _bbox_clr):
520520
# First create top and bottom full edges
521-
self.BBox_edges.add_full_edges(_bbox, _bbox_clr)
522-
# Add faded vertical edges
523-
self.BBox_edges.add_vertical_edges(_bbox, _bbox_clr)
524-
# Add faces
525-
self.BBox_faces.add_vertical_faces(_bbox, _bbox_clr)
526-
# Add top face
527-
self.BBox_faces.add_top_face(_bbox, _bbox_clr)
521+
self.BBox_edges.add_full_edges(_bbox, _bbox_clr)
522+
# Add faded vertical edges
523+
self.BBox_edges.add_vertical_edges(_bbox, _bbox_clr)
524+
# Add faces
525+
self.BBox_faces.add_vertical_faces(_bbox, _bbox_clr)
526+
# Add top face
527+
self.BBox_faces.add_top_face(_bbox, _bbox_clr)
528528

529529
def idle(self):
530530
if self.available:

object detection/image viewer/python/ogl_viewer/viewer.py

+14-14
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@
3737
GRID_SIZE = 15.0
3838

3939
CLASS_COLORS = np.array([
40-
[44, 117, 255] # People
41-
, [255, 0, 255] # Vehicle
42-
, [0, 0, 255]
40+
[44, 117, 255] # People
41+
, [255, 0, 255] # Vehicle
42+
, [0, 0, 255]
4343
, [0, 255, 255]
4444
, [0, 255, 0]
4545
, [255, 255, 255]]
4646
, np.float32)
4747

4848
ID_COLORS = np.array([
49-
[0.231, 0.909, 0.69]
49+
[0.231, 0.909, 0.69]
5050
, [0.098, 0.686, 0.816]
5151
, [0.412, 0.4, 0.804]
5252
, [1, 0.725, 0]
@@ -253,7 +253,7 @@ def __add_quad(self, _quad_pts, _alpha1, _alpha2, _clr):
253253
self.indices.append(len(self.indices))
254254

255255
def add_vertical_faces(self, _pts, _clr):
256-
# For each face, we need to add 4 quads (the first 2 indexes are always the top points of the quad)
256+
# For each face, we need to add 4 quads (the first 2 indexes are always the top points of the quad)
257257
quads = [[0, 3, 7, 4] # Front face
258258
, [3, 2, 6, 7] # Right face
259259
, [2, 1, 5, 6] # Back face
@@ -396,8 +396,8 @@ def draw(self):
396396
layout(location = 0) in vec3 vert;
397397
out vec2 UV;
398398
void main() {
399-
UV = (vert.xy+vec2(1,1))/2;
400-
gl_Position = vec4(vert, 1);
399+
UV = (vert.xy+vec2(1,1))/2;
400+
gl_Position = vec4(vert, 1);
401401
}
402402
"""
403403

@@ -618,13 +618,13 @@ def update_view(self, _image, _objs): # _objs of type sl.Objects
618618

619619
def create_bbox_rendering(self, _bbox, _bbox_clr):
620620
# First create top and bottom full edges
621-
self.BBox_edges.add_full_edges(_bbox, _bbox_clr)
622-
# Add faded vertical edges
623-
self.BBox_edges.add_vertical_edges(_bbox, _bbox_clr)
624-
# Add faces
625-
self.BBox_faces.add_vertical_faces(_bbox, _bbox_clr)
626-
# Add top face
627-
self.BBox_faces.add_top_face(_bbox, _bbox_clr)
621+
self.BBox_edges.add_full_edges(_bbox, _bbox_clr)
622+
# Add faded vertical edges
623+
self.BBox_edges.add_vertical_edges(_bbox, _bbox_clr)
624+
# Add faces
625+
self.BBox_faces.add_vertical_faces(_bbox, _bbox_clr)
626+
# Add top face
627+
self.BBox_faces.add_top_face(_bbox, _bbox_clr)
628628

629629
def create_id_rendering(self, _center, _clr, _id):
630630
tmp = ObjectClassName()

tutorials/tutorial 1 - hello ZED/python/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ In the console window, you should now see the serial number of the camera (also
7373

7474
To close the camera properly, use zed.close() and exit the program.
7575

76-
```
76+
```python
7777
# Close the camera
7878
zed.close()
7979
return 0

tutorials/tutorial 2 - image capture/python/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ while (i < 50) :
7979

8080
Now that we have captured 50 images, we can close the camera and exit the program.
8181

82-
```
82+
```python
8383
# Close the camera
8484
zed.close()
8585
return 0

tutorials/tutorial 3 - depth sensing/python/README.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,18 @@ Retrieving the depth map is as simple as retrieving an image:
4040
* We create a Mat to store the depth map.
4141
* We call retrieve_measure() to get the depth map.
4242

43-
```
43+
```python
4444
# Capture 50 images and depth, then stop
4545
i = 0
4646
image = sl.Mat()
4747
depth = sl.Mat()
48-
while (i < 50) :
48+
while i < 50 :
4949
# Grab an image
50-
if (zed.grab() == sl.ERROR_CODE.SUCCESS) :
50+
if zed.grab() == sl.ERROR_CODE.SUCCESS :
5151
# A new image is available if grab() returns SUCCESS
5252
zed.retrieve_image(image, sl.VIEW.LEFT) # Get the left image
5353
zed.retrieve_measure(depth, sl.MEASURE.DEPTH) # Retrieve depth Mat. Depth is aligned on the left image
5454
i = i + 1
55-
}
56-
}
5755
```
5856

5957

@@ -73,7 +71,7 @@ printf("Distance to Camera at (", x, y, "): ", distance, "mm")
7371

7472
Once 50 frames have been grabbed, we close the camera.
7573

76-
```
74+
```python
7775
# Close the camera
7876
zed.close()
7977
```

0 commit comments

Comments
 (0)