|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Camera Tracking/Image Processing
Hey everyone,
We are almost ready with our image processing code, but we need help with aligning ourselves based on the right 2-point hoop. What we want to know is when we get the red squares, how do we recognize the right 2-pointer, set the Gyro, and align ourselves to that hoop? Thanks! Last edited by cjlane1138 : 12-02-2012 at 12:34. |
|
#2
|
|||
|
|||
|
Re: Robot Position Tracking, Gyro, Alignment help needed
Anyone? We need some help...
|
|
#3
|
|||||
|
|||||
|
Re: Robot Position Tracking, Gyro, Alignment help needed
The right hoop on the middle row will have the right-most X coordinate. That should be enough for you to recognize the target you want to focus on.
If you have the ability to command the robot to a specific heading, you should be able to figure out what change in heading is required to make the target get from where you see it to where you want it to be. If you have a rotating turret, you can similarly figure out how far it needs to rotate in order to make the detected target location and desired location match. |
|
#4
|
||||
|
||||
|
Re: Robot Position Tracking, Gyro, Alignment help needed
After you acquired an image from the camera and processed the image to find some targets, the target will give you center_mass_x and center_mass_y. By comparing center_mass_x to the screen_center_x (160 if your resolution is 320x240), then you can calculate the angle you need to turn the robot to bring center_mass_x to be aligned with screen_center_x. Once you did that, your target is dead ahead.
|
|
#5
|
|||
|
|||
|
Re: Robot Position Tracking, Gyro, Alignment help needed
Okay we have done all of this, but we have an issue. You know how the tracking gives us a number per square detected right? So its 0-3 for the squares? How do I tell the robot that I want to move to x square that was recognized? Basically, how does the processing software assign its values?
|
|
#6
|
||||
|
||||
|
Re: Robot Position Tracking, Gyro, Alignment help needed
Quote:
When enumerating the targets in the array, not only that you validate and discard false positive targets, you also go through an algorithm to "select target". In teleop mode, the target selection is driven by the drivers. After we got the array of possible targets filtered down, we (would like to) display the rectangle overlays on the video stream of the driver station. A pair of buttons on the joystick are used by the driver to "cycle" through the possible targets. Then we use the data of the selected target to compute the shooter motor speed according to the target distance and height. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|