Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Servos controlling camera and purple screen (http://www.chiefdelphi.com/forums/showthread.php?t=41811)

ryan_f 13-01-2006 23:27

Servos controlling camera and purple screen
 
We are having two problems with our camera. We aren't exactly sure how to get the servo motors to move so the camera can track a target. Our camera is able to track targets fine with labview but there's just no movement in the servos. We connected them to pwm01 and pwm02 and used the default 2006 camera code.


Our other problem is when we load the settings for the camera to track the green lights. when we click "grab frame", the image comes out completely purple. If we load the default settings for the camera then the picture comes out fine.

Any ideas?

X-Istence 13-01-2006 23:34

Re: Servos controlling camera and purple screen
 
Quote:

Originally Posted by ryan_f
We are having two problems with our camera. We aren't exactly sure how to get the servo motors to move so the camera can track a target. Our camera is able to track targets fine with labview but there's just no movement in the servos. We connected them to pwm01 and pwm02 and used the default 2006 camera code.


If you want LabView to be able to track the green light, you will need to use the servo outputs on the camera instead of sticking them into pwm01, and pwm02. There is however the question if this is legal with the rules, as currently that is unknown.

buss 14-01-2006 18:21

Re: Servos controlling camera and purple screen
 
I found that the screen will be purple unless you calibrate in RGB mode, and then calibrate in YCrCb mode. That worked for us, anyway.

Alan Anderson 16-01-2006 20:43

Re: Servos controlling camera and purple screen
 
Using the supplied calibration and YCrCb mode, the camera view does seem completely purple, but bright fluorescent lights can be seen as a somewhat reddish purple, and the green target will actually appear as a faint bit of bluish purple.

That bluish purple is easily tracked by the camera against the less bluish purple background.

Damian Manda 16-01-2006 22:51

Re: Servos controlling camera and purple screen
 
Quote:

Originally Posted by Alan Anderson
That bluish purple is easily tracked by the camera against the less bluish purple background.

We were trying to figure out what to do with the purple screen in LabVIEW today, until I clicked on a random part of a frame grab taken when pointing at the green target. The selection area showed up on the outside with an un-highlighted section where the green light box was. Clicking in this area reversed the selection highlighting. I could not even see the difference on the laptop screeen (with highlighting turned off), so you may not be able to notice a difference either. However, the camera can certainly detect the difference and now tracks perfectly.

Also, we still hade problems with slight detections of other lights. The noise filter was not working well enough, so I corrected this by modifying
Code:

if(T_Packet_Data.my != 0)
to
if(T_Packet_Data.my != 0 && T_Packet_Data.pixels > 10)
in tracking.c

Just wanted to let others know how to easily correct this problem in the default code.

Joe Hershberger 17-01-2006 01:34

Re: Servos controlling camera and purple screen
 
Quote:

Originally Posted by Damian Manda
We were trying to figure out what to do with the purple screen in LabVIEW today, until I clicked on a random part of a frame grab taken when pointing at the green target. The selection area showed up on the outside with an un-highlighted section where the green light box was. Clicking in this area reversed the selection highlighting. I could not even see the difference on the laptop screeen (with highlighting turned off), so you may not be able to notice a difference either. However, the camera can certainly detect the difference and now tracks perfectly.

Also, we still hade problems with slight detections of other lights. The noise filter was not working well enough, so I corrected this by modifying
Code:

if(T_Packet_Data.my != 0)
to
if(T_Packet_Data.my != 0 && T_Packet_Data.pixels > 10)
in tracking.c

Just wanted to let others know how to easily correct this problem in the default code.

The purple screen is due to a bug in the LabVIEW code for the camera which has the picture that is displayed interpret the YCrCb data as RGB data. The conversion ends up being "all purple" -> "all black". Fixed it up last weekend and will post it tomorrow when I get to work. It should be easier to see dark gray on black than purple on slightly darker purple. ;) Besides, it's just ugly to look at.

Sorry for the delay on getting it posted. We are trying to get a site approved to host the VIs that everyone can get to. Some people have restrictions getting to FTP sites.

For you kids out there who are interested in what that problem is and how you can fix it, Google for "YUV RGB conversion" or "YCrCb RGB conversion". You'll find plenty of information about it. You can then try fixing it in the version you have by implementing the 3 equations. You can also download the fix tomorrow and see how I chose to implement it. Consider it a challenge. Play around with LabVIEW and you'll see just how powerful and easy to use it really is.

Best of luck!
-Joe

Joe Hershberger 17-01-2006 23:21

Re: Servos controlling camera and purple screen
 
OK... the new version is posted here. It supports a few new features and the purple bug fix. Read about it and enjoy.

Cheers!
-Joe

BTW, did anyone look at the problem to see if they could solve it?


All times are GMT -5. The time now is 07:30.

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