Go to Post Remember: This is High School Competition. - rich2202 [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

 
 
 
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #5   Spotlight this post!  
Unread 29-01-2015, 20:43
Adam8234's Avatar
Adam8234 Adam8234 is offline
Controls Captain
AKA: Adam Corpstein
FRC #2052 (KnightKrawler)
Team Role: Programmer
 
Join Date: Apr 2014
Rookie Year: 2014
Location: United States
Posts: 28
Adam8234 will become famous soon enough
Re: OpenCV USBCamera convert to Mat

Quote:
Originally Posted by JML View Post
Thanks for the reply, we are currently using OpenCV on the Driver Station, and would prefer to do processing there in order to save RoboRIO CPU for max output and reaction speed. We are using the function from the Smart Dashboard camera viewer in order to get the image from the camera. This works well and gives us a BufferedImage of type TYPE_3BYTE_BGR. We can display the image perfectly fine through a simple gui. The problem is with our bufferedImageToMat(Mat img) function:

Code:
	public static Mat bufferedImageToMat(BufferedImage i){
		byte[] pixels = ((DataBufferByte) i.getRaster().getDataBuffer()).getData();
		Mat img = new Mat(i.getWidth(),i.getHeight(), CvType.CV_8UC3);
		img.put(0, 0, pixels);

		return img;
	}
However this is exactly the same as many of the online examples, if anyone has any ideas that would be appreciated. Also, what does everyone think about using OpenCV on the roboRio
This seems odd. Can you provide some screenshots?
 


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 21:02.

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