Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Poor Images from CCD camera

Subject: Poor Images from CCD camera

From: Tim Maguire

Date: 22 Apr, 2010 21:43:20

Message: 1 of 13

We are currently capturing images from a CCD camera and there are lines that go down the image.

Are there parameters we can change so that we get a clean, and continuous image?

Subject: Poor Images from CCD camera

From: Rune Allnor

Date: 22 Apr, 2010 22:01:54

Message: 2 of 13

On 22 apr, 23:43, "Tim Maguire" <tim.maguir...@gmail.com> wrote:
> We are currently capturing images from a CCD camera and there are lines that go down the image.
>
> Are there parameters we can change so that we get a clean, and continuous image?

What kind of camera is this? Stills? Video?

The one setting to watch out for, is compression.
The harder the images are compressed, the more
likely you will have artifacts in the image.

Rune

Subject: Poor Images from CCD camera

From: Thomas Clark

Date: 22 Apr, 2010 22:42:05

Message: 3 of 13

Depends on your CCD I deal with high speed CCD and CMOS cameras quite often. They're less predictable than conceptual artwork.

First step is to reset the hardware and let it cool down.

Next step is to let it warm up to a steady state operating temperature, then reset/restart, then retry capturing.

Then start trying postprocessing options:

For the ones I use (APX photrons and Redlake/Midas motionPros), you can take 'dark images' (lens caps on) then subtract that dark image from all your captured images. That might work straight off.

Then, you can take 'white images'. Lens cap off, put a white uniformly illuminated surface in front of the camera, and take an image. Make sure the image is not saturated in any of the pixels! Remove the dark image from your white image.

Now, each pixel on a CCD varies in sensitivity. So, by taking a white image you obtain different intensity values in each pixel, which should be uniform. Thus you have a measure of the sensitivity of each pixel. Determine the gain required to adjust each pixel of your white image to a uniform intensity by dividing by the white image itself.

Then multiply your output image by that gain array to correct for individual pixel sensitivity.

After that, contact your hardware vendor for more suggestions!

Hope this helps

Tom

Subject: Poor Images from CCD camera

From: Walter Roberson

Date: 22 Apr, 2010 22:47:15

Message: 4 of 13

Tim Maguire wrote:
> We are currently capturing images from a CCD camera and there are lines
> that go down the image.
>
> Are there parameters we can change so that we get a clean, and
> continuous image?

Lines that were not present when you previewed the image? How are you
capturing the data?


These days, nearly all the electronic cameras that are not designed as
"scientific instruments" use some variation of CCD -- but there are a couple
of important differences between models.

The first level thing to look at is what image format you have selected to
save the file in, and what kind of image you are trying to record. Consumer
and prosumer cameras usually default to JPEG, often with a three-position
quality control setting hidden under a name such as "regular", "fine", and
"very fine". The two lower level settings are prone to horizontal astigmatism
or sometimes ringing when imaging sharp vertical lines (such as text); even
the highest level setting does not totally eliminate the problem. If the
vertical lines you are seeing are "ghosts" of horizontal or vertical lines
that you are taking an image of, then you are likely hitting limitations in
the JPEG compression. As a general truth, if pixel by pixel fidelity to the
original scene is important, you should use TIFF file format instead of JPEG
if your camera supports it. Also, more expensive cameras support raw image
file formats that directly record the readings from the detectors without any
processing (e.g., no gamma adjustments made in support of low light levels);
in some cases, it can be worth while to work with those files instead, but the
file formats tend to be proprietary; Canon is the only company I can think of
at the moment which has officially released specifications (or was it Nikon?
Only one of the major companies anyhow.)


A more subtle problem started coming onto the prosumer marker about 7 years
ago, and has likely now become common in the consumer market. Before that
time, pretty much everyone used a three-layer CCD detector, with R, G, and B
detectors at slight offsets from each other and gaps in the detectors to
expose the lower-level detectors. No physical assembly of different layers was
required, as the gaps could be etches into differently-doped wafer layers.
With a given wafer manufacturing process, pixel densities were constrained
because 3 sensors were required per pixel.

A company then came up with a different detector mechanism that used
alternating lines of sensors and somehow managed to share one of the sensors
between two adjacent pixels, with the contribution for each of the pixels
somehow post-processed into existence from the readings. I seem to also recall
that the process did not require any etching and could instead be handled
through doping on a single layer; if that memory is correct, then eliminating
the extra layer or two of wafer could be a substantial savings (keeping in
mind that error rates multiply as you add layers, so single-layer processes
tend to also get better yields.) And with the sensor shared between adjacent
pixels, the pixel density could be higher. This was back in the day when 6
megapixels or so was "state of the art", and with these new kinds of sensors,
the "raw" densities sometimes quoted were on the order of 11 megapixels, with
the necessary post-processing reducing the effective density down to about
8.5. The review organizations were, of course, quite concerned about whether
it worked at all, and about the image quality that could possibly result when
one sensor was shared between two pixels, but the hard-line reviewers that do
real tests were giving the new scheme quite good marks for most categories.

But... if the lines you are seeing affect every second or every third pixel in
one direction, then you *might* be seeing the effect of using the newer kind
of array rather than the older kind.


If you are capturing more directly, with the CCD "remote" and the signals
being carried by wire to a capture device local, then especially if you are
using BCD cables, a cable fault of some nature is a possibility -- though such
faults would not tend to affect regular lines on the captured image. Not, that
is, unless perhaps you are capturing at a relatively high frequency and the
cable is chopping some of the frequencies (wrong impedance, worn cable, cable
too long, echo cancellation of a frequency being echoed off of a bad
connection): in such a case of "live" analog data, it is not impossible for
the drop out in frequency (or harmonics thereof) to show up in the presented
image.


If you are transferring the data digitally, cross-check just in case your
camera is transferring with packing two 12-bit values into three 8-bit
bytes... though that particular kind of problem is more likely to happen with
serial transfers and when the camera is transferring more data than you
expect; and you would normally see obvious image distortions if that happened
to be the problem.


It would help us if you could give more details about the capture process,
camera model, and especially if you could post one of the captured images
somewhere that we could look at.

Subject: Poor Images from CCD camera

From: ImageAnalyst

Date: 22 Apr, 2010 22:49:30

Message: 5 of 13

Like the others said, it's most likely due to your camera or the
camera settings. I know in one camera that I use, if I have the
settings not set right then I can get lines and grids all over the
image. If I change some of the settings such as gain, or exposure
time, then I can get a very nice image. Sometimes you can achieve the
same image brightness with several sets of settings but one set will
look good and one will look bad. Chances are the bad one has some of
the setttings torqued real high or real low - near their limits.
Maybe that's happening because you don't have enough light. Try
opening up the aperture or increasing up the illumination.

If you still can't get it right, contact the manufacturer, or ask in
sci.optics or sci.image.processing.
-ImageAnalyst

Subject: Poor Images from CCD camera

From: Tim Maguire

Date: 24 Apr, 2010 00:05:04

Message: 6 of 13

The image is coming from a Sony CCD camera, one that is used for night vision purposes. When we used BNC to USB converter card the images looked crystal clear.

However we are now running through a National Instruments image capture setup and the images come out with the lines running through them.

I cannot tell if it is the NI capture setup or the program. I am guessing it is a setting either in Matlab, or in Labview.

I wish there was a way to post the image so that you can see it.

Thanks.

-Tim

Subject: Poor Images from CCD camera

From: Walter Roberson

Date: 24 Apr, 2010 01:42:08

Message: 7 of 13

Tim Maguire wrote:
> The image is coming from a Sony CCD camera, one that is used for night
> vision purposes. When we used BNC to USB converter card the images
> looked crystal clear.
>
> However we are now running through a National Instruments image capture
> setup and the images come out with the lines running through them.

I think I must have an 8th or 9th sense, to know that BNC connectors are
involved. Telecongition or something like that :-) BNC connectors are fine
when they work, but debugging a problem caused by a faulty connector is like
taking on a Dalek some days.

> I cannot tell if it is the NI capture setup or the program. I am
> guessing it is a setting either in Matlab, or in Labview.

> I wish there was a way to post the image so that you can see it.

If the images are not classified, use getframe() and upload one of the images
to a drop-box site such as io.com or the google groups repository associated
with comp.soft-sys.matlab .

Subject: Poor Images from CCD camera

From: ImageAnalyst

Date: 24 Apr, 2010 03:07:57

Message: 8 of 13

On Apr 23, 8:05 pm, "Tim Maguire" <tim.maguir...@gmail.com> wrote:
[snip]
> I wish there was a way to post the image so that you can see it.
> -Tim
--------------------------------------
My favorite, and I think the easiest by far, is http://drop.io
No account to create, no login required. Just pick your URL (if you
want a custom one) and browse to upload your photo. Then tell us the
URL. It's as simple as that. We can see your image immediately in
one click - no login or multiple screens required. We can download
the original image. Very simple, both for you and for us.

Subject: Poor Images from CCD camera

From: Tim Maguire

Date: 26 Apr, 2010 17:04:04

Message: 9 of 13

The BNC connections are from National Instruments so I hope there isnt a problem with those.

The image can be found at:

http://picasaweb.google.com/Tim.Maguire25/Science#5464492768848083970

Subject: Poor Images from CCD camera

From: ImageAnalyst

Date: 26 Apr, 2010 23:17:34

Message: 10 of 13

On Apr 26, 1:04 pm, "Tim Maguire" <tim.maguir...@gmail.com> wrote:
> The BNC connections are from National Instruments so I hope there isnt a problem with those.
>
> The image can be found at:
>
> http://picasaweb.google.com/Tim.Maguire25/Science#5464492768848083970

--------------------------------------------------------------------------
Tim:
Is this the way the live images look, or is this recalling a stored
image from a disk file? Because if you're reading it from a file, it
kind of looks like the way images look if you're not reading them into
the right data type, like you're reading 16 bit data into 8 bit
variables or vice versa, or reading floating point data into integer
variables, or vice versa.

Another option could be a defective shift register on the CCD. If you
swap cameras with another one does the second camera also look similar?

Subject: Poor Images from CCD camera

From: Tim Maguire

Date: 26 Apr, 2010 23:39:20

Message: 11 of 13


Yes - the files are stored to disk and then read in. When we have a live feed we do not see the same type of phenomena.

Let me try changing the file data type and see if that works.

Thanks!!

 --------------------------------------------------------------------------
Tim:
Is this the way the live images look, or is this recalling a stored image from a disk file? Because if you're reading it from a file, it kind of looks like the way images look if you're not reading them into the right data type, like you're reading 16 bit data into 8 bit variables or vice versa, or reading floating point data into integer variables, or vice versa.

Another option could be a defective shift register on the CCD. If you swap cameras with another one does the second camera also look similar?

Subject: Poor Images from CCD camera

From: Alvin

Date: 15 Jun, 2010 08:08:03

Message: 12 of 13

The image is coming from a Sony CCD camera, one that is used for night vision purposes. When we used BNC to USB converter card the images looked crystal clear. However we are now running through a National Instruments image capture setup and the images come out with the lines running through them.

The live images from MATLAB Image Acquisition show the lines running down, so it does not seem to be a data type problem (i.e. 16-bit into 8-bit) or a file type problem (JPEG).

We have two cameras connected to the NI image capture setup, and both show the same vertical lines, thus it is not the camera's problem.

Possibly a connection issue between the camera and the NI system?

> Tim:
> Is this the way the live images look, or is this recalling a stored
> image from a disk file? Because if you're reading it from a file, it
> kind of looks like the way images look if you're not reading them into
> the right data type, like you're reading 16 bit data into 8 bit
> variables or vice versa, or reading floating point data into integer
> variables, or vice versa.
>
> Another option could be a defective shift register on the CCD. If you
> swap cameras with another one does the second camera also look similar?

Subject: Poor Images from CCD camera

From: Alvin

Date: 15 Jun, 2010 08:09:04

Message: 13 of 13

The image is coming from a Sony CCD camera, one that is used for night vision purposes. When we used BNC to USB converter card the images looked crystal clear. However we are now running through a National Instruments image capture setup and the images come out with the lines running through them.

The live images from MATLAB Image Acquisition show the lines running down, so it does not seem to be a data type problem (i.e. 16-bit into 8-bit) or a file type problem (JPEG).

We have two cameras connected to the NI image capture setup, and both show the same vertical lines, thus it is not the camera's problem.

Possibly a connection issue between the camera and the NI system?

> Tim:
> Is this the way the live images look, or is this recalling a stored
> image from a disk file? Because if you're reading it from a file, it
> kind of looks like the way images look if you're not reading them into
> the right data type, like you're reading 16 bit data into 8 bit
> variables or vice versa, or reading floating point data into integer
> variables, or vice versa.
>
> Another option could be a defective shift register on the CCD. If you
> swap cameras with another one does the second camera also look similar?

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us