|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#31
|
|||
|
|||
|
Re: OpenCV for RoboRio - Release
To encode the JPEG, i have:
unsigned int SPAMVision::_encodeJpeg(std::vector<uchar> & dst, cv::Mat src, int quality) { std::vector<int> param = std::vector<int>(2); param[0] = CV_IMWRITE_JPEG_QUALITY; param[1] = quality; cv::imencode(".jpg", src, dst, param); return dst.size(); } And I use this in something very similar to the CameraServer class. |
|
#32
|
|||
|
|||
|
Re: OpenCV for RoboRio - Release
I have a new problem...
I'm trying to do this on a beaglebone black. I thought it should work out of the box, but... when I run an executable built in eclipse, I get: error while loading shared libraries: libstdc++.so.6.0.20: cannot open shared object file: No such file or directory ldd shows libstdc++.so.6 isn't found, as well as some others. In fact, these are the missing ones (from ldd) libffi.so.6 => not found libstdc++.so.6 => not found libstdc++.so.6.0.20 => not found libz.so.1 => not found This will be a problem in that the beaglebone only has libstdc++.so.6.0.17. Does that mean I need to recompile opencv for this to remove that dependency? |
|
#33
|
|||
|
|||
|
Re: OpenCV for RoboRio - Release
hello!
Looks like an awesome resource. I'm having an issue though. When I try and compile it it gives errors on all the includes, even string and anything else from the c std library. Do you have any solutions for this? Thanks again! |
|
#34
|
||||
|
||||
|
Re: OpenCV for RoboRio - Release
Quote:
Details: http://www.chiefdelphi.com/forums/sh...8&postcount=18 |
|
#35
|
||||
|
||||
|
Re: OpenCV for RoboRio - Release
Hello there! We are up to the point where we can grab image data from the camera and process it using OpenCV. However, we can't figure out how to get that jpeg data on the smartdashboard via CameraServer.
Here is what we have: Code:
std::string videoStreamAddress = "http://169.254.149.22/mjpg/video.mjpg";
Mat frame;
VideoCapture vidcap;
vidcap.open(videoStreamAddress);
vidcap >> frame;
vector<int> param = vector<int>(2);
param[0] = CV_IMWRITE_JPEG_QUALITY;
param[1] = 80;
vector<uchar> img_data;
imencode(".jpg", frame, img_data, param);
// This is where we're stuck :)
RobotMap::cam_server->SetImage();
Thanks, Team 2053 |
|
#36
|
|||
|
|||
|
Re: OpenCV for RoboRio - Release
The CameraServer is designed to work with the the NI Vision libraries and I don't know how to make it work with OpenCV. I wrote an OpenCV mjpg server a while ago (not for the roboRIO), that you might be able to make work. It requires Boost, which might be difficult to get on the roboRIO. Maybe it will help you with something though.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|