Go to Post Coopertition™ can take many forms. - MrForbes [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 Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 02-02-2017, 16:51
elijah1111's Avatar
elijah1111 elijah1111 is offline
Registered User
FRC #4601 (Circuit Birds)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2015
Location: Ohio
Posts: 15
elijah1111 is an unknown quantity at this point
Question Open CV help

Hey anybody got any ideas on Open CV? We were planning on using it for auto gears.
Code:
static void VisionThread(){
//blah blah set up cameras

while(true){
inRange(mat,cv::Scalar(0,100,0),cv::Scalar(100,255,100),mat)//find green light
cv::findContours(mat,contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_TC89_KCOS);//find reflect tape
			cv::drawContours(mat,contours,-1,cv::Scalar(255,255,255),1,8);//draw them
cameraserver.putframe(mat);//put the modifed image matrix
centerpoints.read()//I need to find the centerpoints here how would I do that?
}
}

void RobotInit(){
std::thread camthread(VisionThread);//makes a new thread
camthread.detach();//snaps the thread off to do its own thing
}

void AutonomousPeriodic(){
 camera.read()//Here is where I need help how do I get the two threads to talk
}
Anybody got any suggestions? I was thinking if you could calculate the distance between the two center points and you know the actual distance you can find out how far you are from the peg for the gear.

Thanks,
Elijah
4601

P.S. actual code is here https://github.com/CircuitBirds-FRC4601/CB5
Reply With Quote
 


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 07:05.

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