|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#46
|
|||
|
|||
|
Re: Tower Tracker 1.0
Quote:
(Note: Its been 28 or so years since I had to do more complicated math so go easy on me). It looked like in the code you had a known angle of the camera (I'm assuming vertical angle.) and you are plugging that in. I get how this works more or less for figuring out distance/vertical angle. Where we are struggling a bit is in figuring out when we are "off center" - given what you can get out of a contour I'm not sure we would know that we need to move a bit to the right or left in order for a shot to work. Did you wind up solving that? If the contour had given us the boundaries of the rectangle's length or coordinates then I think we could evaluate relative sizes to know to move left or right but I'm not sure even about that. Any feedback is appreciated! |
|
#47
|
|||
|
|||
|
Re: Tower Tracker 1.0
Would this code work with a Microsoft Lifecam?
|
|
#48
|
||||
|
||||
|
Re: Tower Tracker 1.0
You will have to modify a few lines of code but other than that... Yes.
|
|
#49
|
|||
|
|||
|
Re: Tower Tracker 1.0
Wait, is there a way to offload the usbcamera data onto a program on the computer?! I thought that wasn't possible yet...
|
|
#50
|
||||
|
||||
|
Re: Tower Tracker 1.0
We are only using it to view the USB camera feed in the SmartDashboard
|
|
#51
|
||||
|
||||
|
Re: Tower Tracker 1.0
Has anyone gotten a python version of this code to work?
In python many of the methods that this code requires do not exist and this is a problem for many teams that plan on using Python for their vision processing. We have trying to port this code for use as sample code for days but as you can see many of the functions do not exist which causes problems. Here is our code.. so far http://pastebin.com/ecdDFDQp the rectangle class is the main problem we are being faced with. There seems to be no equivalent for those using Python. If anyone has found a solution to this issue. Then please let us know! Thanks! |
|
#52
|
||||
|
||||
|
Re: Tower Tracker 1.0
I believe that in the OpenCV python bindings rectangles are represented as tuples.
|
|
#53
|
|||
|
|||
|
Re: Tower Tracker 1.0
Quote:
|
|
#54
|
|||
|
|||
|
Re: Tower Tracker 1.0
We got it all compiled into a jar and running, but it never seems to open the connection to the camera. It's at the right IP, if we put the address in the code in our browser the mjpg stream comes up, but it just sits at opening forever in the cmd prompt.
|
|
#55
|
|||
|
|||
|
Re: Tower Tracker 1.0
We had this problem too, we fixed it by installing the ffmpeg codec into the system32 like I mentioned on the front page.
|
|
#56
|
||||
|
||||
|
Re: Tower Tracker 1.0
Quote:
Any idea? |
|
#57
|
|||
|
|||
|
Re: Tower Tracker 1.0
Do you know if you can find the distance with this anyone
|
|
#58
|
|||
|
|||
|
Re: Tower Tracker 1.0
yes, update the constants with the constants on YOUR robot, you will find the distance to be accurate to within +- 6-8 inches.
|
|
#59
|
|||
|
|||
|
Re: Tower Tracker 1.0
Quote:
|
|
#60
|
|||
|
|||
|
Re: Tower Tracker 1.0
Thanks for the code, really helped! If anyone is having trouble with the thresh holds you can take the HSV image to http://html-color-codes.info/colors-from-image/ to pull the hex colors of the target. Once you have 3-5 hex colors simply convert them to bgr and find the range from high to low (add/subtract 10% on either end to make it work better).
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|