Go to Post I've never liked the pressure pads. This just confirms my suspicions: Pressure pads hate robots. It must be some inferiority complex or something. - Andy A. [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rating: Thread Rating: 39 votes, 5.00 average. Display Modes
  #31   Spotlight this post!  
Unread 03-02-2015, 11:18
brk brk is offline
Registered User
FRC #0180
 
Join Date: Feb 2013
Location: Florida
Posts: 11
brk is an unknown quantity at this point
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   Spotlight this post!  
Unread 03-02-2015, 11:40
brk brk is offline
Registered User
FRC #0180
 
Join Date: Feb 2013
Location: Florida
Posts: 11
brk is an unknown quantity at this point
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   Spotlight this post!  
Unread 04-02-2015, 18:03
Sparkyshires Sparkyshires is offline
Registered User
AKA: Michael Shires
FRC #0384 (Sparky)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2006
Location: Virginia
Posts: 226
Sparkyshires is an unknown quantity at this point
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!
__________________
"Measure with a micrometer, mark with chalk, cut with an axe."
  #34   Spotlight this post!  
Unread 04-02-2015, 18:39
mikhail's Avatar
mikhail mikhail is offline
Registered User
AKA: Mentor of The Software ERRORs
FRC #3130 (ERRORS)
Team Role: Mentor
 
Join Date: Dec 2014
Rookie Year: 2013
Location: Minnesota
Posts: 17
mikhail is an unknown quantity at this point
Re: OpenCV for RoboRio - Release

Quote:
Originally Posted by Sparkyshires View Post
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
  #35   Spotlight this post!  
Unread 04-02-2015, 19:31
jreneew2's Avatar
jreneew2 jreneew2 is offline
Alumni of Team 2053 Tigertronics
AKA: Drew Williams
FRC #2053 (TigerTronics)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Vestal, NY
Posts: 212
jreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura about
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
  #36   Spotlight this post!  
Unread 04-02-2015, 19:37
Ben Wolsieffer Ben Wolsieffer is offline
Dartmouth 2020
AKA: lopsided98
FRC #2084 (Robots by the C)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Manchester, MA (Hanover, NH)
Posts: 520
Ben Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud of
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.
Attached Files
File Type: cpp VideoServer.cpp (4.2 KB, 22 views)
File Type: h VideoServer.h (1.2 KB, 8 views)
__________________



2016 North Shore District - Semifinalists and Excellence in Engineering Award
2015 Northeastern University District - Semifinalists and Creativity Award
2014 Granite State District - Semifinalists and Innovation in Control Award
2012 Boston Regional - Finalists
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:55.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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