|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Sending OpenCV Output back to the Driver Laptop?
Hi,
We have a mini-PC on our testing robot and we are testing some different vision code. One problem is that in our OpenCV Python code, we simply cannot figure how to send the final image back to us. We have looked all other the internet with no avail. We would like to be able to the output for not only testing but eventually, we might make a driver assist computer vision program that points out game pieces and such. Ideally, we would like to be able to send it to an HTTP page, but we are open to other options. Also, being low latency is a big need in the solution. Thanks a bunch in advance! |
|
#2
|
||||
|
||||
|
Re: Sending OpenCV Output back to the Driver Laptop?
|
|
#3
|
||||
|
||||
|
Re: Sending OpenCV Output back to the Driver Laptop?
You could reimplement the WPILib CameraServer protocol (which is pretty easy if you ignore the client to server side). Basically on a TCP connection on port 1735, repeatedly send the following in order:
- the bytes 1, 0, 0, 0 - a network-order 32-bit integer with the length in bytes of the frame data (JPEG format) - the JPEG frame data Then you can view the stream on SmartDashboard with the USB Camera widget. |
|
#4
|
||||
|
||||
|
Re: Sending OpenCV Output back to the Driver Laptop?
Quote:
|
|
#5
|
||||
|
||||
|
Re: Sending OpenCV Output back to the Driver Laptop?
Quote:
And, it supports a python input plugin. https://github.com/robotpy/mjpg-stre...r_py/README.md |
|
#6
|
||||
|
||||
|
Re: Sending OpenCV Output back to the Driver Laptop?
Quote:
|
|
#7
|
||||
|
||||
|
Re: Sending OpenCV Output back to the Driver Laptop?
If you have the right prerequistites installed (python-devel, numpy, and opencv-devel 3.1), then when you build mjpg-streamer using CMake it should just automatically detect the dependencies and build it.
|
|
#8
|
|||
|
|||
|
Re: Sending OpenCV Output back to the Driver Laptop?
While I personally have used mjpg-streamer for some other projects, I've never used it to serve images from opencv. my preferred method has been this copy pasted and cut up to be used as it's own module. Might be interesting to see if there are any performance differences between doing it yourself and going through mjpg-streamer.
|
|
#9
|
||||
|
||||
|
Re: Sending OpenCV Output back to the Driver Laptop?
Quote:
After optimization, I suspect the mjpg-streamer version would still end up winning. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|