|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Simple Crosshair
Hi I am a rookie programmer who barely started using labview. I basically finished all my controls including the kinect so I was wondering if it was possible to add a simple + crosshair to the video camera feed. I have the camera directly to the router not cRio. So is there a way I can do this without to much complication.
|
|
#2
|
||||
|
||||
|
Re: Simple Crosshair
The simple way is to place tape on on the screen. When you open the driver user, the drive station will default to the same place every time.
|
|
#3
|
|||
|
|||
|
Re: Simple Crosshair
Is there a way I can program something..
|
|
#4
|
|||
|
|||
|
Re: Simple Crosshair
The first step is to open the Getting Started Window of LabVIEW. It is up when you first launch and it is available from the View menu. Create a project based on the Dashboard template.
When built, that code will create the same thing as the initial installation. There are a couple ways to add crosshairs. One, go to the panel, right click in open space and choose lines from the decoration palette.Place and size the lines, color them if you need to. You could use rectangles if you wanted thicker lines. The second approach is to add the lines into the image programmatically. Go to the diagram and find the loop near the top that Reads the MJPG and the next step it does is clear the overlays. Instead, you want to right click on the Clear and choose Replace Overlay and choose the Line function. Copy it and hook up another. Hook up the parameter values to describe the line endpoints and color. To test it, stop the other dashboard EXE and run your VI using the run arrow. To build it into an EXE, you go to the bottom of the project window, open the Build Specifications, and right click and Build. The resulting dialog will tell you where the EXE was saved. Copy it to the Program Files/FRC Driver Station folder and you are good to go. The DS will launch yours next time it starts up. Greg McKaskle |
|
#5
|
||||
|
||||
|
Re: Simple Crosshair
Quote:
I did A similar technique last year. what I did was I used the "draw rectangle" overlay block twice, one for each crosshair. I did it this way so I could adjust the thickness... It also was linked to the tilt servo position so it would automatically rotate the image when the camera passed 90 degrees... it also changed the crosshairs to a set of parallel lines that could be used to line up with the minibot pole. |
|
#6
|
||||
|
||||
|
Re: Simple Crosshair
You know the Kinect is only used during the first 15 seconds of the match, correct? I apologize if that seems a silly question.
HTH |
|
#7
|
|||||
|
|||||
|
Re: Simple Crosshair
It does seem very silly. I think you posted in the wrong thread.
|
|
#8
|
||||
|
||||
|
Re: Simple Crosshair
Quote:
|
|
#9
|
||||
|
||||
|
Re: Simple Crosshair
i would like to use the drawrect function, but i am unsure where it is. i found a drawrect int value under constants for squawk, but i am not sure how it helps.
|
|
#10
|
|||
|
|||
|
Re: Simple Crosshair
I'm feeling really stupid, but where do I find the option to draw the rectangles. I have the Dashboard Main.vi Front Panel open, and I right-click in an open area and i get a Controls pop-up, but I don't see any drawing tools there or anywhere else.
I haven't used Labview at all - but we'd really like crosshairs! Thanks for any help you may be able to give me. Dale |
|
#11
|
|||
|
|||
|
Re: Simple Crosshair
If you are on the panel, you will find the rectangle and lines in the decoration palette. If you are running on a pretty fast computer, this will be fine, but a more efficient method is available if programmed on the diagram. Give the decoration a try and post again if this isn't fast enough.
Greg Mckaskle |
|
#12
|
|||
|
|||
|
Re: Simple Crosshair
Hi Greg,
The problem is that I don't see anything called a decoration pallette. The closest thing I found was under Vision, Machine Controls, IMAQ Rectangle. But when I added that it just gave me a box where I could enter a start and end coordinates. I didn't see how I could just draw a box, or show the box that I specified by coordinates. Remember that this is literally the first time I opened Labview. :-) You mentioned a speed issue too. Is the "decoration" applied to each frame of the video feed? We'll be running this on the standard Classmate, so that could be an issue. If I can't get this to work, there is always the rubber bands around the screen option. Thanks for the time you give to all of us! Dale |
|
#13
|
|||
|
|||
|
Re: Simple Crosshair
In the upper right of the palette is a search button. Try searching for decoration or rectangle.
Greg Mckaskle |
|
#14
|
|||
|
|||
|
Re: Simple Crosshair
Quote:
|
|
#15
|
|||
|
|||
|
Re: Simple Crosshair
If I'm correct, you would open a program called the "FRC Driver's Station" once your computer is connected to the robot, Once that's open you would also launch a separate program called "FRC Dashboard," although I think the Driver's Station would open up both.Then launch the cRIO Robot Project, then deploy it (from RobotMain). You need to launch these in order to run the robot, so I hope I helped you in some way.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|