Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

I have taken some images of points of light (stars) which are out of focus...how do I fix the images?

I have some images which are out of focus.  I know how much out of focus they are and can take a picture of a point source of light with the same defocused amount.  Do you just use the deconvolution vision function with the defocused images in as X*Y and the image of the defocused point as Y????  Surely it can't be that simple...

 

Thanks for comments...

 

 

0 Kudos
Message 1 of 7
(3,895 Views)

My suggestion is to look through the Vision Concepts Manual in chapter 5 under Convolution Kernels and Spatial Filtering which is pages 5-10 to 5-35 (PDF pages 78-103). It may be as simple as that once you find the right kernel. The best bet however is to get a better lens at the proper focal length. Although, you probably have already calculated this to the best of you ability for an application of viewing into space. For information on this, see KnowledgeBase 2EFEP6K3: Calculating Camera Sensor Resolution and Lens Focal Length.

Vince M
Applications Engineer
0 Kudos
Message 2 of 7
(3,856 Views)

Thanks, Vince.

 

The lens we used was defocused ... partly on purpose, ... partly in error.  The error was "how much".  So we have the images...and need to fix them.  We have the lens and camera so can shoot an exact spot to use as a point spread function...or simply use one of the points in the images...since they are all "points"...

 

The only problem I have with the vision concepts manual is that it is not tied very well to the function blocks that are available in the vision package.  Someone needs to spend some time on this...It would multiply the value of the manual by a large number.

 

Thanks...

 

Humming and reading.

0 Kudos
Message 3 of 7
(3,851 Views)

Theoretically, deconvolution should do the job.  You would have to be very careful creating your deconvolution template.  Make sure the background level goes to a constant value fairly quickly.  You may need to subtract a constant background level.  You also have to center your template and make it the same size as the original image.  For your original image, make sure there are no points touching the edges.  You should have a nice even black background all the way around your image.  It may help to resize the image up to a factor of two to improve FFT times.

 

I've never actually done deconvolution, so I can't tell you how good of results you will get in the end.  If you post a few images, people may be able to help more.  I might even try deconvolution myself, since I have always wondered how good of a job it would do.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 7
(3,840 Views)

Thanks...I'm confused a little...about making the template (Y) the same size as the original image...seems like you would want Y to be small so you could move it around over the input image more effeciently...Do I need to add a border to the (X*Y) input image to prevent problems with stuff at the edge of the input image?

 

Now we're getting somewhere.

 

If this works, I'll send you and image if I can get that cleared...shouldn't be a problem.

0 Kudos
Message 5 of 7
(3,834 Views)

To do the deconvolution, you will have to convert both images to FFT, divide them, then convert back to a regular image.  I think the division is pixel by pixel, so the images have to be the same size.  FFT convolution/deconvolution is a little different than standard convolution.  If you wanted to convolve the template using the standard method, you would want the template pretty small.

 

All you really need to do is create a small template then surround it by empty space, using the same background level as the template.

 

That is why I suggested posting an image or two.  I could probably figure out the details for you fairly easily instead of trying to explain my best guess of how to do it.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 6 of 7
(3,832 Views)

Looks like this may be a bit challenging.

One reference says that this kind of thing requires high signal to noise ratios...(I don't have that)

It also describes this as an iterative process...I'll have to work on that.  If I make it work, I'll post it.

 

Thanks for the help...this may take a while.

 

The Hummer.

0 Kudos
Message 7 of 7
(3,829 Views)