Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Adding crosshairs to camera image (http://www.chiefdelphi.com/forums/showthread.php?t=94620)

ratdude747 16-04-2011 20:07

Adding crosshairs to camera image
 
slight noob here with another question

My team's programmer is overtaxed with arm issues so I was assigned the task of making camera code.

I already tacked the task of making it so a driver's button flips the camera servo backwards and flips the image 180 degrees (minibot backup camera mode).

the next task is adding crosshairs to the image to assist with camera aiming. the programmer mentioned something about a bitmap overlay but beyond that I am lost.

I am trying do do it all in the robot code and not the dashboard to make the code more modular.

any ideas on where to start?

Alan Anderson 16-04-2011 20:38

Re: Adding crosshairs to camera image
 
The dashboard image comes from a specific camera data stream that is just passed through the cRIO with no modification. It would be very difficult to add crosshairs using robot code.

On the other hand, it is extremely easy to do it in the Dashboard program using IMAQ Image Overlay functions.

ratdude747 16-04-2011 21:08

Re: Adding crosshairs to camera image
 
i think the programmer also mentioned that it was going though the access point to bypass the crio... not sure if that matters... do i need to put the image flip in the dashboard too then?

Vikesrock 16-04-2011 21:13

Re: Adding crosshairs to camera image
 
Quote:

Originally Posted by ratdude747 (Post 1053621)
i think the programmer also mentioned that it was going though the access point to bypass the crio... not sure if that matters... do i need to put the image flip in the dashboard too then?

Yes, if the camera is wired directly to the DLink bridge both the image flip and overlays would have to be done on the dashboard.

The default dashboard camera display also has to be modified to read directly from the camera if your programmer has not already done so. This thread has details on how to do that as well as some general information on custom dashboards.

Mark McLeod 16-04-2011 22:15

Re: Adding crosshairs to camera image
 
1 Attachment(s)
Flip the image on the camera or in the Dashboard.
For a crosshair you might find a multi-line or oval overlay easier than a bitmap.
Vision Motion->Vision Utilities->Overlay
I've also done a crosshair just by drawing it on the Dashboard front panel itself and dragging it on top of the camera output.
No computational work required that way.

Attached is a Dashboard overlay example from last year's default framework.

sanddrag 16-04-2011 22:46

Re: Adding crosshairs to camera image
 
As a mechanical way to do what you want, I saw one team had placed a pointer stick on their robot, between the camera and the pole. As you're watching the image, line up the stick with the pole and you're golden. I thought it was rather clever.

charrisTTI 17-04-2011 08:30

Re: Adding crosshairs to camera image
 
Camera looked through a piece of polycarbonate with strips of electrical tape indicating left and right limits of the compliance of the minibot deployment mechanism. If robot was touching the base and pole was between the markers, deployment was successful every time.

Greg McKaskle 17-04-2011 08:33

Re: Adding crosshairs to camera image
 
1 Attachment(s)
I was going to mention. As a last ditch MacGyver, a rubber band around the monitor makes a decent horizontal crosshair.

But being a SW guy, this also isn't hard to do the right way. The game code for last year included some overlay code that drew a light blue line vertically on the center of the screen and some ovals on the target. You can use it as an example.

The code in the loop marked the various ellipses, and the single icon on the right drew the line. The icon on the far left returns the image sizes, or you can use constants if the image size is well known. Add this to the dashboard code as was done in 2010.

Greg McKaskle

ratdude747 17-04-2011 19:51

Re: Adding crosshairs to camera image
 
got it.

what i did is I added the servo postion to the dashboard typedef and then made a custom dashboard (I have done this a few times before). I then discived all of the NI vision (as opposed to FIRST vision) stuff... and I have it so:

it overlays 2 rectangles on the image for each line of the crosshair (1 px seemed too thin...) and has a case structure that flips the image 180 degrees when the servo angle reaches a certain point (i put in 110 degrees).

sound good?

Greg McKaskle 18-04-2011 07:38

Re: Adding crosshairs to camera image
 
If it looks good, it sounds good.

Greg McKaskle

ratdude747 18-04-2011 15:26

Re: Adding crosshairs to camera image
 
i modded it so the crosshairs change when flipped over... the code will be tested and dialed in tonight.

ratdude747 20-04-2011 03:00

Re: Adding crosshairs to camera image
 
some minor tweaks and it works great now. life is good.


All times are GMT -5. The time now is 09:27.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi