Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   OpenCV for RoboRio - Release (http://www.chiefdelphi.com/forums/showthread.php?t=131905)

brk 03-02-2015 11:18

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.

brk 03-02-2015 11:40

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?

Sparkyshires 04-02-2015 18:03

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!

mikhail 04-02-2015 18:39

Re: OpenCV for RoboRio - Release
 
Quote:

Originally Posted by Sparkyshires (Post 1438388)
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!

Yes, there is always a solution. Remove or change the line #8 in WPILib.h which defines "REAL" (#define REAL) to something else, e.g. "#define REAL_ROBOT"

Details: http://www.chiefdelphi.com/forums/sh...8&postcount=18

jreneew2 04-02-2015 19:31

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();

SetImage seems to take a Image object. We cannot find any real documentation on how to use this object. Any help would be most appreciated.

Thanks,
Team 2053

Ben Wolsieffer 04-02-2015 19:37

Re: OpenCV for RoboRio - Release
 
2 Attachment(s)
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.


All times are GMT -5. The time now is 01:57.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi