Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Processing variable gray image

I need to process images, as attached, to get a clear, well delineate, B&W image to:
1] Correct position camera, if image are clipping or partially occluded
2] Compare with a master template using Geometric Matching, and reject it, if there is any shape mismatching, focusing en each of four corners.
3] Get accurate X and Y coordinates displacement and T angle rotation on inspected image, most important objective in process.
Image is a paper form, on a back lighted (and holed) semi transparent, conveyor belt.
I’m applying first Geometric Matching on unprocessed images, using a template for each corner, with poor accomplishment (partial or not recognition, error getting coordinates etc).  I concluded that is better to get first a clear image, and then apply Geometric Matching.
 
I’m trying the following algorithm in Vision Assistant 7.1:
A] Read image (Image 17)
B] Lookup Table -Reverse
C] BRIGHTENESS (Apply Bright, Contrast and Gamma adjustment).
D] THRESHOLD (Apply manual threshold)
E] Remove Small Objects
F] Remove Border objects (In practice can’t be used, because image frequently, is clipping or touching a border)
G] Fill Holes
H] Open Object (to delineate borders)
With fine manual tuning C and D, I get some acceptable results. (Image 17 processed)
However I find certain troubles to get always a clear and sharp image due to similar gray levels values, inside and outside target image, because of (I think)   bright and dark light spots, and / or some gradient in light distribution.

Things go worst, with small light conditions changes between images (i.e. Image 18 and 21).
 
Please I need some LabVIEW 7.1 VIs examples, ideas or algorithms (ideally self tuning, using filters, Histograms, etc) to get best quality image, flexible enough to compensate some variable contrast and gradient illumination conditions. 
0 Kudos
Message 1 of 15
(5,110 Views)
The trick is always to enhance the object edges. A Laplacian filter is often a good solution. See the attached script, that seems to work with all your images.
 
Chilly Charly    (aka CC)
Message 2 of 15
(5,096 Views)

Hello CC, your algorithm work really FINE!! .


I reduce Auto Median matrix to 3x3 to minimize acute angle distortion (in fact, area loss).

Do you think that is possible to   automatically calculate target image AREA in order to set programmatically the maximum Particle Filter remove area setting parameter? Or use another algorithm to clear unwanted particles?


Thank a lot for your help!

0 Kudos
Message 3 of 15
(5,075 Views)

Apparently, the piece is the particle with the largest area. So you could just search for the max area value and filter the particles accordingly. But you could also define a more complex criterium, using the perimeter to area ratio or any other combination of descriptors, just to be sure that you are selecting the right particle.

 

 

Chilly Charly    (aka CC)
0 Kudos
Message 4 of 15
(5,064 Views)

Yes CC, I agree: working with a specific relationship between specific parameters could be a solution to identify target image.

 

I enclose an image (1316 pap mdio borde sup GRAD .jpg), what look alike the other ones, but doesn’t work with your script. I’m trying further setting adjustments, without get any improvement.

 

In my previous post I say: I reduce Auto Median  Matrix to 3x3 ,but actually is 5x5, and in practice,  doesn’t work as well as your setting. But 7x7 produce high smoothing and cause an important lack of details in four acute “V” angles, between flanges.

 

Do you think that is possible to improve it, or almost get a best compromise solution?

 

Thank you again.

0 Kudos
Message 5 of 15
(5,055 Views)
The attached script works with the new image, but is much slower. I think the best approach is to improve your images. First you could try to put a black screen under the conveyor belt, to reduce the white holes. Then, according to the color of the objects and of the belt, you could use a colored filter to improve the contrast. What sort of light source are you using ?

Message Edited by chilly charly on 07-27-2005 07:44 AM

Chilly Charly    (aka CC)
Message 6 of 15
(5,062 Views)
I have read again your first post. Discard the black screen idea, sorry ! I didn't remember that you were use back light. Is that your only option ?
Chilly Charly    (aka CC)
0 Kudos
Message 7 of 15
(5,051 Views)

Hi CC!

 

Yes, mechanical and lighting parts are pre existent and so difficult to change. Target image color and background belt, can it has a similar yellow coloration, then, direct light, cause very low contrast. No way to improve with color or optical filter.

 

Your last SCR work really well, much better than the first one, but yes, it is slow to process, even in a fast Pentium.  Anyway, I processed a lot of different images and I can believe to get this accomplishment. Congratulations!

 

I begin to work with “worst cases”. Not always reality is so bad.

I enclose some images with much better contrast.

Can you see a better way to get processed images, with a contour as identical as possible to original image? In other words: without noticeable “jagged” or better straight lines on rotated images, and minimizing subtle changes in form and dimensions….

As you saw, serious issues may occur, when darks spots are in touch with target image borders.

 

Speed will be a serious constrain because real images could be taken from a 1280 x1024 digital camera. I haven’t yet examples images in such resolution.

 

With these high contrasted images, do you think is better to work with same scripts, changing some parameter setting, or with a new concept of processing to improve quality and speed?

 

Thanks a lot

0 Kudos
Message 8 of 15
(5,033 Views)
I'm afraid that if you use higher resolution images, the speed penalty will be worse. What should be the object recognition rate ?
Can you explain why you can't use refected light ?
Have you considered using light out of the visible range (IR, UV ?)
Have you considered using polarized light ?

A possible approach could be to use a two step processing :
1/ use my algorithm to get a coarse location of the paper sheet corners/(or points of interest)
2/ define ROIs around these locations and redo an image processing on the selected ROIs.
Such a technique will allow the use of better local parameter values.

I'll have a look later on the new images.
Chilly Charly    (aka CC)
0 Kudos
Message 9 of 15
(5,025 Views)

Hi CC.

1] I need locate, move and position every piece of paper, with an error < 0,25mm X an Y axis, and < 0,5º rotation, using 3 servos.

2] Each batch of paper may change in size almost 6:1 (200x120mm to 40x20 mm. Maximum and minimum paper sizes). Of course I can adjust programmatically, any number of parameters before occur every change in size or in transparence degree.

3] Digital camera and lens ensemble, works within a covering area (roughly.) of 360x300mm. A large margin enough, to locate bigger pieces of paper, without mechanical movement.

4] I prefer to leave changes in light system as a last resort, because I’m working with an existing mechanical ensemble, not accessible to modify.

 5] Current background illumination comes from an array of side optical fiber with a variable power light source and an opaline light diffuser.

6] SPEED: I need to capture, process a new image, reject a piece if detect any flaw (i.e. loose of any flange) and calculate new X, Y, T coordinates in less than one second (Ideally…) I'm now refining a process to locate target image using a whole image template with Geometric Pattern Matching ( work fine) and locate flaws on each of four corners, with a separate template for each quarter, using GPM too (Yet I have some troubles).

7] Based on my short experience working on GPM, I think, I can’t use it, with a raw, low or high contrast, image without previous processing, to locate flaws or to get precise coordinates.

8] And YES you are right, I’m afraid too. Now, I enlarged an image to a final size of 680 x 745 pixels within an inspection area of 1250x960 pixels.

Scores Vision Assistant 7.1.1 running on a 3GHz P4 with 1GB Dual Channel Ram:

 Conveyor belt.scr 500ms /image

 Conveyor belt2.scr 1392ms /image

Geometric PM.scr 256 ms /image (searching 5 templates within entire inspection area)

9] Reversing steps as you proposed on you last post, is possible to define a ROI, using GPM Bounding Box output, on a raw image to minimizing processing area. Key points

 a] Build a fast algorithm adequate to process contrasted images (like last ones) running within a ROI delimited area (feasibility?)

b] CCD camera work with 3 pre programmed ROI areas 1280x1024, 1000x1000 and 640 x480 (too low resolution). Play with speed vs. precision, finding best compromise relationship.

I appreciate very much your help and opinions.

 Best regards

Mensaje editado por altelec

0 Kudos
Message 10 of 15
(5,013 Views)