thehapyone / nanocamera Goto Github PK
View Code? Open in Web Editor NEWA simple to use camera interface for the Jetson Nano for working with USB and CSI cameras in Python.
License: MIT License
A simple to use camera interface for the Jetson Nano for working with USB and CSI cameras in Python.
License: MIT License
Describe the bug
CSI Camera never ready. Tested with the python example and always shows CSI Camera Ready? - False
To Reproduce
import cv2
#from nanocamera.NanoCam import Camera
import nanocamera as nano
if __name__ == '__main__':
# Create the Camera instance
camera = nano.Camera(flip=0, width=1280, height=800, fps=30)
print('CSI Camera ready? - ', camera.isReady())
while camera.isReady():
try:
# read the camera image
frame = camera.read()
# display the frame
cv2.imshow("Video Frame", frame)
if cv2.waitKey(25) & 0xFF == ord('q'):
break
except KeyboardInterrupt:
break
# close the camera instance
camera.release()
# remove camera object
del camera
Desktop (please complete the following information):
Standard Jetson Nano SDK - Jetpack 4.4
Additional context
CSI Camera works fine using the nvgstcapture-1.0 command
I am getting the below warnings while trying to use the library. I am using it on JetsonNX.
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (1757) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module rtspsrc4 reported: Could not open resource for reading and writing.
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (886) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
Any idea on resolving them
Hello,
I m able to initialize the camera when using python 3.6 but it's not working with python 3.7
The error code I get from camera.hasError(), is :
1 = Error: Could not initialize camera.
>>> import nanocamera as nano
>>> camera=nano.Camera(debug=True)
Traceback (most recent call last):
File "/home/seller/.local/lib/python3.7/site-packages/nanocamera/NanoCam.py", line 163, in __open_csi
raise RuntimeError()
RuntimeError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/seller/.local/lib/python3.7/site-packages/nanocamera/NanoCam.py", line 47, in __init__
self.open()
File "/home/seller/.local/lib/python3.7/site-packages/nanocamera/NanoCam.py", line 122, in open
self.__open_csi()
File "/home/seller/.local/lib/python3.7/site-packages/nanocamera/NanoCam.py", line 168, in __open_csi
raise RuntimeError('Error: Could not initialize CSI camera.')
RuntimeError: Error: Could not initialize CSI camera.
I'd like to stream my Jetson Nano's CSI camera over my network. The nanocamera program works and has very high quality feedback, but I'm having trouble with the RTSP example.
If I execute the RTSP example where I've changed my rtsp_location to the ip of my Jetson Nano, I get the following error:
<....>line 25, in <module> cv2.imshow("Video Frame", frame) cv2.error: OpenCV(4.1.1) /home/nvidia/host/build_opencv/nv_opencv/modules/highgui/src/window.cpp:352: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'imshow'
I'm not really sure what's happening with the opencv error. Very general.
Any pointers? I'm also completely new to RTSP streaming. Is there anything outside of the RTSP example I need to do other than changing
HI .
Thanks for your work.
I have 3 threads that will consume the nanocamera read() method. to grab a frame
Is there known problem? also threadsafe is handled in library?
please advise.
For the same USB camera, the following code is helpful to adjust the resolution. But the nanocamera
can't.
capture = cv2.VideoCapture(3)
if capture.isOpened():
capture.set(cv2.CAP_PROP_FRAME_WIDTH, 640)
capture.set(cv2.CAP_PROP_FRAME_HEIGHT, 480)
Bug Description
I have been using your nanocamera repository for interfacing my USB camera(Arducam IMX219) with Jetson nano. I checked if my OpenCV is correctly installed. It is correctly installed.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Desktop (please complete the following information):
Hello,
I have a project which is the following:
On a jeston Nano, I have a CSI camera. I want to take one picture every 5s from this cam , and then evaluate this picture in a tensorflow model.
The tensorflow part is working without problem if I use pictures on the disk.
The problem is to get one picture every 5 seconds.
I just create this simple piece of code:
cam=nano.Camera(flip=0, width=640, height=480, fps=30)
while True:
image = cam.read()
cv2.imshow("image",image)
cv2.waitKey(5000)
if cv2.waitKey(1) & 0xFF == ord(' '):
break
cap.release()
cv2.destroyAllWindows()
The problem is that, the delay between 2 pictures is really longer than 5s, it seems that the system is laging.
And when I'm sending the picture to the model, it seems that the evaluation is done correctly. Only the display in cv2.imshow seems to have a problem.
Any idea on this issue?
Thanks
After successfully installing your application on my Jetson Nano 2GB whenever I attempt to import the application I get this result: Illegal instruction (core dumped)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.