PDA

View Full Version : CCD camera pixel grid colors


rjet
Jun 23, 2005, 02:39 PM
I am working to convert an NTSC camera that has a DSP chipset into a digital camera. The DSP chip already adjusts the light gain and does analog to digital conversion, which makes this easier.

In the attached photo you can see that the CCD signal outputs a 604 pixel wide grid (note: I stretched and chopped the sides off) that alternates different colored pixels (cyan, magenta, yellow?). With pixel averaging the black-and-white luminance looks good, but there is a pixel grid that I would like to write a computer program to decode the color information.

I think I can lock onto the horizontal synchronization and I could write the software to convert the data to RGB data for the computer display, but I would like to figure out what color these pixels are supposed to be. Can anyone tell what the color pattern is (see attached file), or should I just take a guess at it?

AndyKunz
Jun 23, 2005, 10:05 PM
I would find the datasheet from the CCD manufacturer. Or maybe you can find somebody who sells them and get a comparable item to use as a reference.

Andy

Zlatko
Jun 23, 2005, 11:34 PM
Hi rjet,

The camera should output blue, green,red ( like the phosphor on a colour TV screen ). Those cameras normaly have a tri-colour filter in a repeating patern for the light sensors ( CCD ) horizontally.
Try adjusting the colour intensities of those colours based on the information about the light intensity from the DSP repeating every 3 pixels. I think the pixel grid will dissapear if you do this.
I guess the camera came from a mobile phone, have a look at the screen to see the colour patern. I think it should be blue, green, red. If you don't have access to the original screen perhaps make provision in your programm to be able to change the colours.

How big is the sensor/dsp ?
Does it have a serial interface?

Cheers
Zlatko

rjet
Jun 24, 2005, 09:45 AM
Andy,
It is a supercircuits microlens camera, but I cannot find the ccd chip part numbers on the camera (without unsoldering it). I was able to download a different ccd datsheet from another manufacturer and it shows a cyan, yellow, magenta, green pattern that looks from the signal that it may be a similar arrangement.

Zlatko,
It looks like the signal repeats every other pixel if you look closely at the attached image, so I think it may alternate cyan-yellow on every other horizontal line and magenta-green on the others.

It is a tiny ccd surveillance camera about 1-inch cube with only an NTSC output and I was able to get the datasheet on the DSP chip, so I knew that it had an ADC and I soldered 10-bit logic wires from it to a 256kb memory chip and into the parallel port of my computer, but eventually I hope to use a microcontroller to receive the image from a remote vehicle.

I will try writing a program to subtract the voltages from each adjacent pixel and use it for the RGB values to the video display. With a little trial and error it might work.

rjet
Jun 24, 2005, 02:16 PM
Okay, I wrote a program that does the horizontal sync and counts the pixels. Every other pixel is subtracted from the previous pixel and every other line alternates between offseting red or blue from the RGB values of the video display. It appears to work, as you can see a red cup in the middle of the pic and a blue battery, but I suspect the colors may still be somewhat off hue of the ccd filter and different lighting conditions may affect it. Anyone know if cyan and magenta are different than the computer's RGB? I suppose I will have to do some testing. Thanks

cryptic
Jun 25, 2005, 01:32 PM
Nice work rjet :)
Most of the ccd imagers these days are using CMY filters. I think cyan is 50% blue, 50% green, 0% red. magenta 50% blue, 50% red, 0% green. yellow 50% green, 50% red, 0% blue.

From the looks of the photo you are pretty close. Perhaps it is that you are subtracting RGB values instead of adding. Like subtracting red for a high cyan signal.

You will want to fine tune the color gain and bias for the lighting conditions either in hardware or software if you want perfect color accuracy.

e-sailpilot86
Jun 28, 2005, 02:22 AM
where do I find a camera like this? I'd like to get a CCD camera for astrophotography.

AndyKunz
Jun 28, 2005, 07:00 AM
This particular one he got from www.supercircuits.com

They've been around for ages, know their stuff, and love modelers. I bought my first stuff from them about 15 years ago, when a really bad B&W was $200+ airborne.

Andy

rjet
Jun 28, 2005, 09:45 AM
e-sailpilot86,
The camera I use is one of supercircuits cheap ccd color cameras $79. I am also using a PC-182XS which is popular for astrophotography and night flying .0003 lux, unless you want to go for a bigger lens camera like a 164C.

Their cameras are sold without telling who manufactures them, but the quality and price is pretty good. The 182XS for instance is made by KT&C of Korea.

Are you considering hacking a chipset for better astronomy performance or just to connect it to a telescope for tv viewing?

The digital camera project is just about finished. I implemented an automatic white balance feature in software and adjusted the color balance. Also put in a PIC microcontroller to take over the color processing, so the image can be transmitted through a uni-directional wireless link.

e-sailpilot86
Jun 30, 2005, 11:18 PM
What we use is a program to "stack" the frames on top of one another, both to provide more resolution, color, detail, etc. It's accomplished by stacking a still avi image. :) Sometimes, they do things differently, as with an SBIG camera which is about as good as you can get for an amateur CCD. So, I'd be using it as a camera, not a live view video camera. What's real important, is that the chip is relatively large. Otherwise, I need to get a focal reducer... :mad: I'll see what I can do. That lux is plenty low, but I would prefer something in B/W + some color wheels. :D So, how did you figure out how to write a program? What language is it in? :cool:

If I get one, I'd put a peltier chip on the back, maybe a couple on the ground and a water pump and get the CCD chip supercooled (below freezing point). Helps get rid of a lotta darkcurrent. I'd also need a darned good focal reducer...

BTW, I just looked at the one you recommended for astrophotography, and yes, that would do. The only trick is to find one that's cheaper... That's an excellent resolution BTW!

Seems someone has worked with it before, not bad eh? :D
http://www.pbase.com/emagowan/image/14163268
http://www.pbase.com/emagowan/image/25894477

e-sailpilot86
Jun 30, 2005, 11:41 PM
Ooh! Ooh! This guy has the same setup I have! Look at what he's done with what he's got! Check out the Video of jupiters moons orbiting! :D

http://www.outcastsoft.com/AstroImages/AstroIndex.html

rjet
Jul 01, 2005, 10:14 AM
e-sailpilot86,
I am a computing student at UF, so I wrote a C++ Win32 program that receives the signals directly from the CCD through the parallel port. I also put in a graphical control panel with sliders for contrast and color adjustments, so it is fun to play with.

I did a little bit of image stacking by putting two video frames into an memory array and using it like a color filter to reprocess the displayed image, so you could probably add many more frames and remove noise.

There are long exposure cameras of several seconds, which can be homebuilt like the cookbook camera. Even some $50 security cameras have been modified for long exposures and the pictures are amazing.