Hello Guest it is November 13, 2019, 06:29:44 PM

Author Topic: New 3d Video Probe  (Read 32824 times)

0 Members and 1 Guest are viewing this topic.

Re: New 3d Video Probe
« Reply #10 on: July 30, 2009, 07:44:20 PM »
Hi Tom,

Finally I got together some pictures, calibration files and a few scans, that you wished to see.

The hardware:

In addition to the original WatchportV3  4.9mm lens, I got a set of four 3.6 - 6 - 8 and 12mm on eBay
http://cgi.ebay.com/Any-4-pcs-3-6-6-8-12-16mm-CCTV-board-Lens-set-dome_W0QQitemZ370158397420QQcmdZViewItemQQptZLH_DefaultDomain_0?hash=item562f28e7ec&_trksid=p3286.c0.m14

In my setup I prefer the 8mm to the 12 mm lens because I need to have the FOV cover a Z variation of about 28 mm in one frame.

The adjustable focus 5mV green line laser comes from
http://shop.david-vision-systems.de/index.php/language/en

I made a small current regulator for controlling the brightness of the line. This way one can get a very nice and sharp line specially on a light coloured surface.

The calibration setup:

In the following photos you can see the needle fixed on a black velvet to get rid of all unwanted light or reflections that could disturb the calibration. The needle is about 40mm long and 0.8mm thick, painted matt black and touched on the point with white chalk, that lights up like a small LED when hit by the laser. In Scan3D intensities graph it gives a very clean and lonely peak. In the room there is no light and I even turn off the computer screen for the duration of the process. - And as "scanner" moves to the starting point of the calibration scan, I get out of the workshop myself. Not much fun to stay in the dark for hours... ;)

As you guessed all the values I use are in mm.

The orientation for Watchport is 180 and for QuickCam 0 degrees.

And some questions:

My second question in the last post wasn't very clear. Sorry.
The camera-laser setup is fixed. This system has two planes: the laser plane and one perpendicular to it following the lens axis. If the laser line is parallel to X-axis this second plane is normally following the Y-Z plane. This is only very difficult or impossible to set precisely. Does it matter?  If I understand this needle point process right - any deviation of this would be corrected by the calibration, wouldn't it ?

Could you tell me what are the values of Elevation and Azimuth correspond to?

Attachments:
For some reason, as long as I have the camera connected, I can't get any of my computers to get a complete "Print Screen" from your Scan3D window - I only get the leftmost "camera view" window. To show the intensity graph of my calibration "needle point" I had to take a photo of my screen.

I send you two sets of zip files - one for each camera. They include: scan3d.ini, Scan3dCal.pts and an example Scan3dCloud.xyz - plus three photos: lower part of the Scan3DWindow and two pictures of the example PointCloud showing the distortion mentioned in my previous post.

- Too many attachments... You'll find the zip files in the following post below.

All the best,
Eero
Re: New 3d Video Probe
« Reply #11 on: July 30, 2009, 07:54:34 PM »
And here the zip files for the previous...

The object in the example scans is a flat steelbar of 8mm x 25mm x 100mm covered with thin masking tape to avoid too much reflection.

Ciao,
Eero
Re: New 3d Video Probe
« Reply #12 on: July 31, 2009, 02:39:04 AM »
Hello Eero,

> Finally I got together some pictures, calibration files and a few scans,
> that you wished to see.

Thanx. Lots of good detail. Can you post the full plugin box and not just the numbers. I would like to see what the camera is seeing and how it is being interpreted.
 
> The hardware:

> In addition to the original WatchportV3  4.9mm lens, I got a set of four
> 3.6 - 6 - 8 and 12mm on eBay
>  urrl=http://cgi.ebay.com/Any-4-pcs-3-6-6-8-12-16mm-CCTV-board-Lens-set-dome_W0QQitemZ370158397420QQcmdZViewItemQQptZLH_DefaultDomain_0?hash=item562f28e7ec&_trksid=p3286.c0.m14]http://cgi.ebay.com/Any-4-pcs-3-6-6-8-12-16mm-CCTV-board-Lens-set-dome_W0QQitemZ370158397420QQcmdZViewItemQQptZLH_DefaultDomain_0?hash=item562f28e7ec&_trksid=p3286.c0.m14[/url]

> In my setup I prefer the 8mm to the 12 mm lens because I need to have
> the FOV cover a Z variation of about 28 mm in one frame.

You will get less distortion from the lens if you use a longer focal length. This will provide a smaller angular field of view. Move the camera farther back to increase the linear field of view.

> The calibration setup:

> In the following photos you can see the needle fixed on a black velvet to get
> rid of all unwanted light or reflections that could disturb the calibration. The
> needle is about 40mm long and 0.8mm thick, painted matt black and touched
> on the point with white chalk, that lights up like a small LED when hit by the
> laser. In Scan3D intensities graph it gives a very clean and lonely peak. In the
> room there is no light and I even turn off the computer screen for the duration
> of the process. - And as "scanner" moves to the starting point of the calibration
> scan, I get out of the workshop myself. Not much fun to stay in the dark for
> hours... ;)

I use a Watchport/v2. Your v3 settings should be similar.

Most of that light reduction should not be necessary. You probably are using the default exposure control for the camera. Likely set to "average" so the exposure time self adjusts to the max of 0.25 seconds since you turned out all of the lights.

Set your exposure time (use Source/advanced controls) to off or manual. Then adjust the exposure time to 1ms or maybe 2ms. Most of the camera display, due only to ambient light, will go black or at least very dark. The needle point should still show up as a spike in the fourth display. You want the exposure time to be short enough that the spike does not quite reach the top of the display. That is when it is sensitive enough to get a good signal but not so sensitive that the signal saturates.

> As you guessed all the values I use are in mm.

Untested in mm but it should work ok. On that note, Art did MachCloud for mm but said that it should work for inches. It does not. So I guess I need to test in mm to see if there are surprises.

> The orientation for Watchport is 180 and for QuickCam 0 degrees.

I see that you properly rotated the display for each of these cases.

> And some questions:

> My second question in the last post wasn't very clear. Sorry.
> The camera-laser setup is fixed. This system has two planes: the laser plane
> and one perpendicular to it following the lens axis.

The photos look like the proper arrangement.

> If the laser line is parallel to X-axis this second plane is normally following
> the Y-Z plane. This is only very difficult or impossible to set precisely. Does
> it matter?  If I understand this needle point process right - any deviation
> of this would be corrected by the calibration, wouldn't it ?

That is the plan. However, you need to be sure that after you have calibrated the camera and laser that the setup does not change. You can remove it and put it back without recalibration if you can put it back repeatably enough.

> Could you tell me what are the values of Elevation and Azimuth correspond to?

Elevation on mine is 60 degrees. That is the angle the laser plane makes with the XY table plane. This number is based on the calibration data collected and should be close to your design. That would be 45 degrees for your setup.

Azimuth is the angle that the laser line on the XY plane is rotated about the Z axis. That should be zero degrees for my design and calibrates to about 0.5 degrees. Yours should be close to 90 degrees.

Since your numbers are the defaults I would say that calibration has not been done. Are you using the latest version of Scan3d? I posted two versions.

> Attachments:
> For some reason, as long as I have the camera connected, I can't get
> any of my computers to get a complete "Print Screen" from your Scan3D
> window - I only get the leftmost "camera view" window. To show the
> intensity graph of my calibration "needle point" I had to take a photo of
> my screen.

Collecting camera data is done by using the clipboard. Would not be my choice. Just the only way I could get it to work using VFW (Video For Windows). Saving the screen also uses the clipboard so it interferes with camera data collection. That is primarily why I added a Pause button.

Pause the video, snapshot your screen and post in graphics software like MS Paint, then you can Resume the video. If you want to do this in the middle of a running job you would want to first pause the motion. That might be sufficient or you might still have to pause the video.

> I send you two sets of zip files - one for each camera. They include:
> scan3d.ini, Scan3dCal.pts and an example Scan3dCloud.xyz - plus
> three photos: lower part of the Scan3DWindow and two pictures of the
> example PointCloud showing the distortion mentioned in my previous post.

> Too many attachments... You'll find the zip files in the following post below.

Got them all. The only thing I see that is odd is that you scan the Z axis second and not last. Since your object is pretty flat (or am I incorrect) I would be inclined to scan Z last.

The FOV numbers of 1 and 1 are the default of 1 inch by 1 inch. In your case that is 1mm x 1mm . This tells me that you have no calibration data. Yet I can see that you have the cal data points in the cal file and you have values for the calibration coefficients in the ini file. So something is not right. I'll have to dig into that.

Tom Hubin
thubin@earthlink.net
Re: New 3d Video Probe
« Reply #13 on: August 01, 2009, 07:26:43 AM »
Hello Eero,

Just letting you know that I am working the problem.

I have corrected the FOV, elevation, and azimuth calculations. They are not causing your problems but certainly contributed to confusion. Those numbers are intended to be a reality check on your setup and calibration. They are not used anyplace. Just displayed.

It appears that calibration calculations are ok but the pts file data is not.

Look at the pts file with a text editor like MS Notepad or MS Word or a spreadsheet. The 9 columns of numbers are  x, y, z, h, v, gray, red, green, blue.

The green column has lots of values of 255. That is the max possible value. That means the actual value is between 255 and infinity. You need to reduce the camera exposure time so that you get few, if an, values of 255. You can view this on the fourth display. The green graph should not reach 255 (dotted line).

When it does reach 255 it tends to have several neighboring pixels also at 255. This makes it hard to accurately decide which one is the peak value. This will effect accuracy but is not your major problem.

The big problem is very strange. Often where the z value changes the y value will be nonsense for a line or two. These odd data lines will be included in the calculations. I don't know yet where they are coming from but I will be working it. I will need to setup my axes like yours and do them in the same order to see if it is a motion issue. May get to it Sunday night or early in the week.

Meantime, can you try cal again with z last? That would be y first and x second.

Please send me an email address if you want a test version of the plugin when I think it is ok enough for you to try.

Tom Hubin
thubin@earthlink.net
Re: New 3d Video Probe
« Reply #14 on: August 02, 2009, 06:20:27 PM »
Hello Tom,

With your advise  of using the Pause and Resume buttons, I got some snapshots of the screens. Here is again a zip-file with new calibration files and two pictures using the WatchportV3 (still 8mmF2.0 - I already thought of improving the setup so that it'd be quick to change the distance of camera and laser if needed - didn't have time to change it yet...)
This last calibration was done before I got your last reply - the values of green are still too high - even after reducing the exposure quite much and playing around with some of the other settings. The exposure is now less then 1/2 ms, but I had to increase the line brightness. The previous calibration files I sent were done with about 1/60 s. I don't know all the meanings/effects of the different adjustment possibilities of the Watchport screen...
With a 1/2 ms exposure there is a fluctuation of in the picture brightness that goes from a clean picture of the laserline to almost no line and the whole cycle takes something like 20-30 seconds. Specially close to the edges of the picture this gives trouble when trying to adjust the exposure and/or brightness of line right for a non saturated result on the graph. I don't know what causes this... (with a quite feeble line and longer - 1/60s -  exposure I didn't notice this). Increasing the Gamma (?) from one to 2.2 helped some , but I don't know what it means... Nor do I know if I should use the video compression, less or more colour... and white balance automatic or manual... ? Maybe you could send me a snapshot of your camera settings since you use basically the same camera?

The Watchport viewer shows the laser line quite a clean, straight - better then I remembered - or my settings have some way improved much. Even without any correction this should give quite a good scan - but the "bending" in my example last time was quite big. I'll try again tomorrow if I find a moment.

I'll keep an eye on the saturation levels of the colours, and try the axis order your way. (As my router is a X axis gantry type machine, I've just got to a habit of avoiding too much back and forth movement of the X-axis. That's the reason for the odd order of calibration.)

I'll send my email to your earthlink address.

Eero
Re: New 3d Video Probe
« Reply #15 on: August 02, 2009, 06:26:36 PM »
Sorry - the attachment!

Eero
Re: New 3d Video Probe
« Reply #16 on: August 02, 2009, 09:57:37 PM »
Hello Eero,

Thanx for the files. I will download and examine later.

The laser should be used at maximum brightness. That way it is much brighter than any ambient lighting. The camera exposure is set short enough so that the laser does not saturate the ccd array. This usually leaves everything else black, which is exactly what you want. You only reduce the laser if it still saturates the camera on the shortest exposure time.

With a 5mw laser spread over a line, that is not likely to happen with the Watchport camera. The shortest exposure time is something like 1/30 ms.

You may have to increase the exposure time to see things while you are setting up. But before you run the scan you need to reduce the camera sensitivity so that it only sees the laser.

If some ambient light is still appearing at a low level then set the plugin's threshold a little higher than the ambient light and it will be removed from the data set.
 
Calibration is slow right now because it scans the entire volume looking for the point. Later I will make the calibration scan smarter so that it scans the volume but always near the point.

I set the camera for compression to speed up communications. Should work either way. All the other settings are factory defaults, I think. I will look to be sure.

Does your camera lens wiggle around. All of my lenses are loose fitting. I could not find a suitable commercial M12-0.5 nut to lock the lens down so I made some Delrin nuts. A compression spring between the lens and the camera body might also keep the lens from shifting position if you don't touch the lens.

Tom Hubin
thubin@earthlink.net
 
Re: New 3d Video Probe
« Reply #17 on: August 04, 2009, 03:56:31 AM »
Hello Tom,

Attached the last calibration files and a snapshot of camera settings. The laser is at max brightness and I changed my pin point to a thinner one as well - diameter is now in the range of 1/3-1/4mm. As you can see the exposure is about 0.23 ms. I tuned the colour intensity (on the first page of camera settings) down by half. In the resulting scan the 255 max reading appears only 4 times for green and once for red. The scanning order is Y 1, X 2 and Z 3.
One question: After calibration scan, some calculations are done. Where is this resulting information stored? The properties window of scan3d.ini shows it not being changed since I stored the calibration settings BEFORE the calibration started. Is there some button that I'm missing to complete and store the data?

Eero
Re: New 3d Video Probe
« Reply #18 on: August 04, 2009, 07:40:04 AM »
Hello Eero,

> Attached the last calibration files and a snapshot of camera settings.

Thanx. They look good.

> The laser is at max brightness and I changed my pin point to a thinner one as well
> As you can see the exposure is about 0.23 ms.

Much nicer calibration data in your Scan3dCal.pts file.

>The scanning order is Y 1, X 2 and Z 3.

Thanx. I just needed to be sure that scanning order was not the problem.

> After calibration scan, some calculations are done.
> Where is this resulting information stored?

The coefficients are internal but will be saved in the in the ini file. Click the Save button then look at the file with a text editor. You will see that they have changed.

> The properties window of scan3d.ini shows it not being changed since I
> stored the calibration settings BEFORE the calibration started. Is there
> some button that I'm missing to complete and store the data?

that data would normally change but does not work properly in your version. I have corrected that and am testing in case other things got messed up. I will run your data late today. Then probably send you the latest plugin.

Meantime, try scanning a part to see if the calibration is working correctly now.

Tom Hubin
thubin@earthlink.net

Eero
[/quote]
Re: New 3d Video Probe
« Reply #19 on: October 06, 2009, 11:59:51 AM »
Hello,

I am Steve Stallings, a friend of Tom Hubin's and sometimes collaborator in his video probing and other CNC efforts.

Regretably my visit to this forum is to inform you that Tom passed away this morning. Some of you who may have met him in person realize that his health was a constant challenge. He made it into his 60s despite having cystic fibrosis, quite an accomplishment in itself.

Tom was working with his probing ideas almost until the end. While I lack his skills with optics, math, and programming, I will do what I can to see that his work continues. Fortunately he managed to put most of his ideas and software into this forum and provided GPL licenses for it.

Regards,
Steve Stallings
www.PMDX.com


Steve Stallings
www.PMDX.com
For PMDX product support, please use PMDX forum or direct email for quickest response. We do not use this forum as our primary product support site.