Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Video Signal Construction Using a Non-Standard Camera

Hello guys,

I have a question. I'm using a monochrome non-standard optical machine which outputs a signal which is then converted to a 0-1 volts video signal for output. It reads line after line - a line camera. I control machine's speed of line scanning rate manually and produce an H-Sync after each line. Then I connect the H-sync and the Video signals (Which are on separate lines) to an IMAQ 1410 imaging card and work in the "External H Lock Mode" in "Measurement and Automation Explorer" (MAX).

The case is this:

The picture that I'm getting when I grab the video to my monitor is blurred up and unfocused. It also "vibrates" and the colors are changing from dark black to white all the time. Very unstable, although the sample in the machine is not moving and no environmental changes occur.

Today I thought about the possibility of "Clamp" problems. I read that a video signal needs to have a "Back Porch" or something that is a reference level to the black level before the real data, in each line. Now, my signal is sending data continuously, so I thought that because in each line the reference is completely arbitrary (there is no back porch or clamp in my signal), it explains what happens.

So my questions are these:

1. Is what I'm saying right ? If I have a complete control over the scanning routine, it's speed, direction, pauses, ect', how do you suggest me to build up my video signal and this "Back Porch" or "Clamping" area ?

Is there a way to have no "Back Porch" at all ?

I also heard about "Front Porch", what is its purpose ? Do I need one ?

2. I did not really understand what "Clamping" is. There are also these options in my camera file, called "Clamp Start" and "Clamp Stop", which can have the values of (0-255) each. How do I set them, given that this time I'm adding this "Clamping Area" ? And what do these numbers say ? (msec, microsec... a fraction ?)

0 Kudos
Message 1 of 6
(4,056 Views)
Hi Mic_Scale,
 
I'll try to explain a little more about clamping.  The video signal is AC coupled, and goes from approximately -40IRE to 100IRE.  In the system, the ground reference might not be at 0 IRE.  The clamping area is a quiescent area of the video signal that the IMAQ board can use to set a zero reference for the signal.  Typically the back porch is used for this.  The board will take multiple samples and average over them to get the zero reference voltage.  The clamping area is specified in terms of the number of pixel clocks from the start of the video line (*not* the active video portion of the line).  Specifying a larger clamping area allows the board to average over more pixels and therefore provide a more stable zero reference.  It is important that the signal be stable during the clamping area.  If it is not, the zero reference will be wrong, and vary from line to line.  If the "brightness" of lines vary in the image, it is a good indicator that the clamping area isn't stable.
 
Because clamping is generally done on the back porch, you should really have one.  If you can't have one, then you can clamp to the sync tip.  This will give you a stable image, but because you've set your zero reference to -40IRE, and the active video is only between 0IRE and 100IRE, you'll lose a good bit of precision.
 
I hope this helps,
 
Jeff Kellam
 
0 Kudos
Message 2 of 6
(4,043 Views)
Are you saying that even though I use an "External H Lock" mode and I have a Video and H-Sync signals completely saparete, I still need a "Clamping Area" set in my Video signal ?
 
 
What does "sync tip" clamping mean ?  does it say to clamp not on the back porch, but before, to the H-Sync itslef ?
 
You said that the clamping area is specified in terms of the number of pixel clocks from the start of the video line. Pixel clocks = Pixels, right ? So If I snap a picture of 1000x1000 and tell him to clamp from 10 to 30, those will be the 20 pixels from 10 to 30 ?  So clamping on "sync tip" would be 0 to 5 ? or (-10) to 0 ? does H-Sync starts at pixel 0 (or before/after ?) ?
 
Since I have a non-standard camera, I use a positive H-Sync, of 5 Volts. Does that mean I can't clamp on the sync tip unless I set it negative ? I mean, if 5 Volts would be reference for black color , that would darken my image since the signal is 0-1 Volts, no ?
 
When does the active video portion of the line begins ? is it right after the "clamping area" ?  let's say if my clamping area is set to 0 to 5, active line start at 6 ?
 
For what length should this clamping area last ?
 
 
I've attached a Scope picture of my H-Sync (the upper signal) against my Video signal (the lower signal) for clarity. As can be seen, currently my video is continuos without clamping, back porch or front porch.
 
Thanx
 
 
 
 
0 Kudos
Message 3 of 6
(4,028 Views)
The locking mode only controls the timing of the video signal.  The clamping configures the zero level for the ADC.  Therefore, no matter what locking mode you are in, you will still need to have a clamping area.  Clamping takes place on the video signal, not on the sync signals.
 
Sync tip clamping means that instead of clamping during the back porch, you clamp during the sync pulse.  This is an option if you don't have a back porch but you do have a quiescent video signal during the sync pulse (I mentioned the disadvantage in the previous post).  The clamping takes place on the video signal, so it doesn't matter what the voltage of the HSYNC is - it only matters that you have a 0 IRE or less signal that doesn't change during the HSYNC.
 
As far as the active video portion, the second image in the document I referenced earlier makes this clear that my description but here goes: each video line has an active and an inactive portion.  The active portion represent the active pixels.  The inactive portion contains the front porch, sync tip, back porch, colorburst (if a color camera), and blanking.  The acquisition window sets the start of the active video signal signal within each line.  The clamping area does not need to be adjacent to the active video. 
 
As an example, look at the camera file for RS-170 on the 1409.  Each line is 780 pixels across, of which 640 are active video.  The clamping area is between pixels 102 and 115.  The first active pixel is at pixel 120.  The acquired image does not contain the first 120 pixels of the line, since those pixels don't contain image data.
 
The clamping area should be as long as possible.  As you can see from the above, the 1409 uses 14 pixels for clamping to an RS-170 signal.  The clamping area is imperative - without a clamping area, you will not get a good image.
 
-Jeff
0 Kudos
Message 4 of 6
(4,022 Views)
Hello, thanx for the explanation.
 
I seem to have another issue with my Video signal and the corresponding image I get. I'm attaching a scope Video singal vs. H-sync and its Image, that I received in the Automation and Measurement Explorer.
 
The issue is connected somehow to the LinePixels and LinePixelsRef I write in the camera file.
 
 As can be seen from the scope, my Video signal contains a symmetric signal between each H-Sync, which should produce a symmetric picture, since the whole information between 2 H-Syncs is supposed to be written, isn't it so ?
 
But, On the Image you can see that it is not written to the end. It doesn't even reaches half of the symmetric signal.
 
I've used almost maximum number of pixels possible, 4000 in Maximum Image Size, LinePixels, LinePixelRef and I've shown in the Acquisition Window  the range (0-4000). Where has the rest of the signal go ?
I've also tried 780 pixels (in all these parameters "Linepixels, Acquisition Windows"... ext') , but it shortened the image even more.
 
I thought that by defining pixels, you only increase/decrease quality, that the IMAQ 1410 divides the line signals between H-Syncs so that the number of pixels you write in would fit.
 
Theoretically, if MAX allowed, I could use something like 12,000 pixels and the whole signal would fit I guess, but I'm limited to about 4,200.
 
I think I got something wrong...
 
 
Can anyone explain to me what happens there ?
 
 
0 Kudos
Message 5 of 6
(3,998 Views)
Hi Mic_Scale,
 
I am sure you are already aware, but I believe the situation you are discussing at:
 
 
also addresses the behavior outlined above. 
 
Good luck,
 
Robert
0 Kudos
Message 6 of 6
(3,972 Views)