-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
548 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
######################################################################## | ||
# | ||
# Copyright (c) 2017, STEREOLABS. | ||
# | ||
# All rights reserved. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
# | ||
######################################################################## | ||
|
||
""" | ||
Read SVO sample to read the video and the information of the camera. It can pick a frame of the svo and save it as | ||
a JPEG or PNG file. Depth map and Point Cloud can also be saved into files. | ||
""" | ||
import sys | ||
import pyzed.sl as sl | ||
import cv2 | ||
|
||
|
||
def main(): | ||
|
||
init = sl.InitParameters() | ||
init.camera_resolution = sl.RESOLUTION.RESOLUTION_HD720 | ||
init.depth_mode = sl.DEPTH_MODE.DEPTH_MODE_PERFORMANCE | ||
|
||
if (len(sys.argv) > 1) : | ||
ip = sys.argv[1] | ||
init.set_from_stream(ip) | ||
else : | ||
print('Usage : python3 streaming_receiver.py ip') | ||
exit(1) | ||
|
||
cam = sl.Camera() | ||
status = cam.open(init) | ||
if status != sl.ERROR_CODE.SUCCESS: | ||
print(repr(status)) | ||
exit(1) | ||
|
||
runtime = sl.RuntimeParameters() | ||
mat = sl.Mat() | ||
|
||
key = '' | ||
print(" Quit : CTRL+C\n") | ||
while key != 113: | ||
err = cam.grab(runtime) | ||
if (err == sl.ERROR_CODE.SUCCESS) : | ||
cam.retrieve_image(mat, sl.VIEW.VIEW_LEFT) | ||
cv2.imshow("ZED", mat.get_data()) | ||
key = cv2.waitKey(1) | ||
else : | ||
key = cv2.waitKey(1) | ||
|
||
cam.close() | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
######################################################################## | ||
# | ||
# Copyright (c) 2017, STEREOLABS. | ||
# | ||
# All rights reserved. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
# | ||
######################################################################## | ||
|
||
""" | ||
Read SVO sample to read the video and the information of the camera. It can pick a frame of the svo and save it as | ||
a JPEG or PNG file. Depth map and Point Cloud can also be saved into files. | ||
""" | ||
import sys | ||
import pyzed.sl as sl | ||
import cv2 | ||
|
||
|
||
def main(): | ||
|
||
init = sl.InitParameters() | ||
init.camera_resolution = sl.RESOLUTION.RESOLUTION_HD720 | ||
init.depth_mode = sl.DEPTH_MODE.DEPTH_MODE_NONE | ||
cam = sl.Camera() | ||
status = cam.open(init) | ||
if status != sl.ERROR_CODE.SUCCESS: | ||
print(repr(status)) | ||
exit(1) | ||
|
||
runtime = sl.RuntimeParameters() | ||
|
||
stream = sl.StreamingParameters() | ||
stream.codec = sl.STREAMING_CODEC.STREAMING_CODEC_AVCHD | ||
stream.bitrate = 4000 | ||
status = cam.enable_streaming(stream) | ||
if status != sl.ERROR_CODE.SUCCESS: | ||
print(repr(status)) | ||
exit(1) | ||
|
||
print(" Quit : CTRL+C\n") | ||
while True: | ||
err = cam.grab(runtime) | ||
|
||
cam.disable_streaming() | ||
cam.close() | ||
|
||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.