|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Resizing Camera View
I was wondering if it was possible to resize the viewing area of the camera during operation. Would you have to put a physical lens on the camera, or is it possible to have the camera ignore say, the right half of the image that it takes in as input?
If this is possible, it would make it much easier to focus on a single light when you encounter an orientation that presents two lights in your field of view. |
|
#2
|
||||
|
||||
|
Re: Resizing Camera View
i'm pretty sure there is a way to limit the viewing area through software
|
|
#3
|
|||||
|
|||||
|
Re: Resizing Camera View
First off, after looking at our goal for awhile, I don't think you will find a configuration where the CMUcam's field of view covers two lights.
With that out of the way, I think the VW function is what you seek: Quote:
JBot |
|
#4
|
|||||
|
|||||
|
Re: Resizing Camera View
If you turn to page 55 in your CMUcam2 manual you will see the command for adjusting the virtual window size.
If you don't have the manual get it from kevin.org/frc The command is: VW x y x2 y2 those are the corners of the frame, the default(full) size is 1,1,88,143 Edit: curses, JBotAlan beat me to it Last edited by Cuog : 13-01-2007 at 20:42. |
|
#5
|
|||
|
|||
|
Re: Resizing Camera View
I've tried using the VW command while the camera is streaming data (T packets from Track Color), and often it seems to shut the camera down.
What are the rules for sending a command to the camera? Call Camera_Idle first? Wait for an ACK? I tried adding a state to Kevin's code between STATE_TWO and STATE_THREE, and the first call to Write_Camera_Module_Register times out. (no ACK returned). That's all I did - add a no-action state. (I want to put a Poll Mode command there but that didn't work so I took out the command and its wait for ack, thus adding a no-action state). |
|
#6
|
||||
|
||||
|
Re: Resizing Camera View
Quote:
If you want to call Virtual_Window( ) from the initialization function, this is a fragment from some code I'm working on: Code:
case STATE_SIXTEEN: // initialize the Noise Filter value Noise_Filter(Camera_Config_Data.NF); // next state state = STATE_SEVENTEEN; // wait for an ACK before transitioning to the next state wait_for_ack =1; break; case STATE_SEVENTEEN: // set window size Virtual_Window(60, 100, 100, 239); // next state state = STATE_EIGHTEEN; // wait for an ACK before transitioning to the next state wait_for_ack =1; break; case STATE_EIGHTEEN: // send the TC or Track Color command Track_Color(Camera_Config_Data.R_Min, Camera_Config_Data.R_Max, Camera_Config_Data.G_Min, Camera_Config_Data.G_Max, Camera_Config_Data.B_Min, Camera_Config_Data.B_Max); // next state state = STATE_NINETEEN; // wait for an ACK before transitioning to the next state wait_for_ack =1; break; case STATE_NINETEEN: // signal that we're done return_value =1; break; |
|
#7
|
|||
|
|||
|
Re: Resizing Camera View
Kevin, Are you sure about waiting for the ACK after Camera_Idle()? When I put in a wait there, I never got it. I noticed in you initialization code that you don't wait for an ACK after Camera_Idle(). When I took out the wait for the ACK, things worked a lot better. I did have to wait for an ACK after the Poll Mode funciton and Virtual_Window funciton that I called.
|
|
#8
|
||||
|
||||
|
Re: Resizing Camera View
Quote:
). I'll have a look at it tonight after I get home from the day gig.-Kevin |
|
#9
|
|||
|
|||
|
Re: Resizing Camera View
The camera does not send an ACK after going into idle mode (which is kind of the point
). If you send "\r" again (or any other command that does not sleep the camera) it will "wake up" and ACK. |
|
#10
|
||||
|
||||
|
Re: Resizing Camera View
Just FYI, this is what the CMUcam2 manual has to say about the idle command: "This command is used to set the camera board into an idle state. Like all other commands, you should receive the acknowledgment string “ACK” or the not acknowledge string “NCK” on failure. After acknowledging the idle command the camera board waits for further commands, which is shown by the ‘:’ prompt. While in this idle state a \r by itself will return an “ACK” followed by \r and : character prompt. This is how you stop the camera while in streaming mode." -Kevin |
|
#11
|
|||
|
|||
|
Re: Resizing Camera View
Nevermind then, I stand corrected
My apologies for the misinformation! |
|
#12
|
|||
|
|||
|
Re: Resizing Camera View
I found the edubot camera code (http://kevin.org/frc/edu_camera.zip), and it loads and cycles OK. But when I turn on the _DEBUG switch in the camera.h file, the debug output shows that camera initialization is timing out on the first CR command (no ACK or NCK back). I made no changes to the code except to turn on _DEBUG. Does anyone have a notion of what is going on? Here is the sequence of characters going out to the camera: 13, R, M, space, 5, \r, <state 1>, \r, <state 2>, <state 3>, C, R, 2, 41 (COMI), 128.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Camera Help (New to Camera Programming) | Idaman323 | Programming | 6 | 14-01-2006 03:56 |
| Camera View Size | pyrr101 | Programming | 0 | 10-01-2006 22:42 |
| Image resizing tips? | jpsaul7usa | Chit-Chat | 5 | 04-03-2005 00:52 |
| Resizing pictures.. | Brandon Martus | CD Forum Support | 4 | 26-02-2004 15:22 |
| Resizing Assemblies in Inventor | Jeff Waegelin | Inventor | 7 | 25-02-2003 13:43 |