Summary of the invention
The problem of present invention is to be solved
The present invention be in view of above background and complete, and it is an object of the present invention to provide one kind can use simple processing high-precision
Binary conversion treatment program and binary processing method in the image inspection of ground binaryzation.
The solution to the problem
Binary conversion treatment program in the image inspection of 1st form of the invention, which is characterized in that for making check device
Control unit in the shooting image of the power supply box of at least one element equipped with fuse, fuse wire and relay, constitute institute
It states and sets inspection area in the pixel region of element, execute and the inspection area is converted into the number formed on the element
The binaryzation of word, character or mark and this two-value of background makes the control unit conduct: calculating the inspection in described program
Look into the average calculation section of the average value (A) of the RGB aggregate value of each pixel in region;With based on being calculated according to the average calculation section
RGB aggregate value average value (A) and the inspection area each pixel the value that finds out of both RGB aggregate values (T) and threshold
It is worth the comparison of (B), carries out the binaryzation portion of the binaryzation and function.
Alternatively, it is also possible to be the binaryzation portion be based on (RGB aggregate value (T)-RGB aggregate value of each pixel
Average value (A)/each pixel RGB aggregate value (T) compared with the threshold value (B), carry out the binaryzation.
Alternatively, it is also possible to be shooting image that the shooting figure seems the power supply box equipped with multiple elements, to every
Inspection area described in a components set, the average calculation section calculate the RGB aggregate value to each inspection area
Average value (A).
The binaryzation portion can also carry out the binaryzation using common threshold value (B) for multiple elements.
In addition, the binary processing method in the image inspection of the 2nd form of the invention, which is characterized in that equipped with
In the shooting image of the power supply box of at least one element of fuse, fuse wire and relay, in the pixel region for constituting the element
Interior setting inspection area carries out the inspection area being converted to the number formed on the element, character or mark and back
The binaryzation of this two-value of scape, the binary processing method of described image inspection include: each pixel for calculating the inspection area
The average calculating process of the average value (A) of RGB aggregate value;And based on according to the RGB conjunction for averagely calculating and being calculated in process
The value that both RGB aggregate values (T) of each pixel of the average value (A) and the inspection area of evaluation are found out and threshold value (B)
Compare, carries out the binaryzation process of the binaryzation.
Invention effect
Form of the invention from the description above, due to according to the average value (A) of RGB aggregate value and each pixel
The value that both RGB aggregate values (T) is found out is compared with threshold value (B), therefore, there is no need to each shooting image or each
Element adjusts threshold value (B), can be accurately proceed binaryzation with simple processing.
Specific embodiment
In the following, illustrating an embodiment of the invention based on Fig. 1 and Fig. 2.As shown in the drawing, check device 1 includes:
Inspection desk 11, for carrying power supply box 2;Lighting device 12 illuminates power supply box 2;Camera 13 shoots power supply box 2;And make
For the image analysis apparatus 14 of control unit, image analysis is carried out to the shooting image from camera 13 and is checked.
Power supply box 2 is the device for being mounted in vehicle and distributing the power supply from battery.In power supply box 2, by fuse, fuse wire
Or multiple element 21, the substrate (not shown) equipped with these elements 21 etc. that at least one of relay is constituted are contained in shell
In body 22.
Multiple element 21 configures side by side on substrate (not shown).Multiple element 21 is as shown in Fig. 2, have resinite portion
21A;From resinite portion 21A terminal outstanding (not shown), terminal connects on substrate.Resinite portion 21A is according to element 21
Type, amperage, and the differences such as shape, color.In addition, as shown in Fig. 2, resinite portion 21A terminal institute following table outstanding
The upper surface of face opposite side is formed with the number for indicating amperage using printing.In addition, a part of terminal is in the two sides of number
Expose.In addition, the present invention can also be suitable for the element with terminal not outstanding.
Lighting device 12 includes: flat diffuser plate 12A;And a pair of of LED strip 12B, 12B, it is shone towards diffuser plate 12A
Light is penetrated, power supply box 2 is illuminated using the light reflected by diffuser plate 12A.
A pair of of LED strip 12B, 12B is respectively formed as strip, and multiple LED 12C are arranged side by side along its longitudinal direction.It is a pair of
LED strip 12B, 12B configures side by side in short side direction, and the axis of longitudinal direction and diffuser plate 12A configured in parallel.Utilize the photograph
Bright device 12, power supply box 2 is whole to be uniformly lighted.
Camera 13 configures between diffuser plate 12A and inspection desk 11.
In addition, the switch SW of the camera 13 is arranged in inspection desk 11.Once inspector Operation switch SW, then camera
The multiple element 21 of 13 shooting power supply boxs 2.Shooting image is sent to image analysis apparatus 14.Image analysis apparatus 14 is by individual
Computer (PC) is constituted, and is equipped with image processing software.Image analysis apparatus 14 according to the program of image processing software analyze come
From the shooting image of camera 13, check whether element 21 is not carried defectively.
Above-mentioned power supply box 2, lighting device 12, the configuration of camera 13 are in the space (not shown) surrounded by barn door.By
This, can prevent the influence due to exterior light, and generate in the illumination of power supply box 2 uneven.
Next, illustrating the movement of the check device 1 of above-mentioned composition referring to Fig. 3 and Fig. 4.The flow chart of Fig. 3 is by image
Analytical equipment 14 executes.In addition, image analysis apparatus 14 using the flow chart as program, becomes and executes binary processing method
Binary conversion treatment program.Firstly, inspector configures power supply box 2 in the pre-determined position of inspection desk 11, before being dispatched from the factory
It checks.Once then shooting the element 21 of power supply box 2, the shooting image using camera 13 next, inspector presses lower switch SW
It is sent to image analysis apparatus 14.
After image analysis apparatus 14 receives shooting image, start image analysis processing.In image analysis processing, image point
Analysis apparatus 14 is in received shooting image setting inspection area A1 (step S1).In step S1, image analysis apparatus 14 such as Fig. 2
It is shown, the pre-determined pixel region for shooting image is set as inspection area A1.Inspection area A1 sets each element 21
It is fixed, it is set in the pixel region A2 for constituting element 21.In the present embodiment, inspection area A1 is set as than constituting element 21
Pixel region A2 it is smaller, and include the whole rectangular areas for the number being formed on element 21.
In addition, the determining method as inspection area A1, is not limited to that the pre-determined image-region in image will be shot
Method as inspection area A1.For example, 14 pairs of shooting images of image analysis apparatus carry out image analyses, identify element 21 with
Background other than element 21.Then, image analysis apparatus 14 can will be determined as the region of element 21 as pixel region A2,
Inspection area A1 is set in pixel region A2.
Next, image analysis apparatus 14 calculates RGB aggregate value to each inspection area A1 as average calculation section work
Average value (A) (step S2).It is described in detail, shown in 14 formula described as follows (1) of image analysis apparatus, finds out and constitute inspection area
R value, G value, the summation of the aggregate value of B value (hereinafter referred to as RGB aggregate value) (T) of each pixel of A1, with composition inspection area
The pixel number of A1 is calculated the average value (A) for RGB aggregate value divided by the summation found out.
The average value (A) of RGB aggregate value=(summation for constituting the RGB aggregate value (T) of each pixel of inspection area A1)/
(pixel number for constituting inspection area) ... (1)
As shown in figure 4, if inspection area A1 is made of m × n (m, n are integers) pixels, (m × n is measured
The summation of RGB aggregate value (T))/(m × n) found out average value (A) for RGB aggregate value.
Next, shown in 14 formula described as follows (2) of image analysis apparatus, find out the RGB aggregate value (T) of each pixel with
Ratio (step S3) of the difference of the average value (A) of RGB aggregate value relative to RGB aggregate value (T).Image analysis apparatus 14 for
All inspection area A1 of step S1 setting, find out the ratio of the difference of each pixel.
The ratio of the difference=(average value (A) of RGB aggregate value (T)-RGB aggregate value/RGB aggregate value (T) ... (2)
Next, image analysis apparatus 14 is acted as binaryzation portion, shown in the formula (2) found out to each pixel
The ratio of difference is compared with pre-determined threshold value (B), and two-value turns to character and background, carries out character recognition (step
S4).Specifically, in the case where wrongly written or mispronounced character symbol, if image analysis apparatus 14 is greater than threshold in the ratio {=(T-A)/T } of difference
Value (B) is so identified as constituting the pixel of number, is so identified as constituting the pixel of background if it is less than threshold value (B).?
In the case that surplus accords with, image analysis apparatus 14 will first shoot picture inversion, carry out the same processing with wrongly written or mispronounced character symbol later.
Image forming apparatus 14 carries out character recognition based on the binary image that will shoot image binaryzation.
In addition, image analysis apparatus 14 carries out binaryzation for all inspection area A1 set in step S1.As institute
Threshold value (B) is stated, does not change in each shooting image, each inspection area A1 (that is, each element 21), is wanted using common
Element.
In addition, 14 pairs of shooting images of image analysis apparatus carry out character recognition, color identification, shape recognition (step S5).
Later, image analysis apparatus 14 based on character recognition, color identification, shape recognition as a result, decision element 21 whether without lack
It falls into ground to be carried, it in display (not shown) etc. and is informed (step S6) as the result is shown, is ended processing.
According to above-mentioned embodiment, image analysis apparatus 14 is based on the ratio and threshold value (B) of difference shown in formula (2)
Compare, carries out the binaryzation of inspection area A1.Do not need adjustment threshold value (B) as a result, can with simple processing accurately into
Row binaryzation.
Next, illustrating the effect of above-mentioned present embodiment referring to Fig. 5~Fig. 8.Fig. 5 is to show number shown in Fig. 2
According to the chart of the RGB aggregate value (T) on line D1.Fig. 6 is the figure for showing the RGB aggregate value (T) on data line D2 shown in Fig. 2
Table.Fig. 7 is the chart for showing the ratio of the difference on data line D1 shown in Fig. 2.Fig. 8 is to show data line D2 shown in Fig. 2
On difference ratio chart.
The element (being the fuse of 15A in present embodiment) in identical type is set separately in data line D1, D2 shown in Fig. 2
Same position on element 21.P1, P2 in Fig. 5~Fig. 8 are comparable to the part of the terminal on data line D1, D2, and P3 is structure
At the part of " 1 " of the number on data line D1, D2, P4 is the part for constituting " 5 " of number of data line D1, D2.
As shown in Figure 5 and Figure 6, even if the element 21 for being set with data line D1, D2 is identical due to distinguishing type, due to machine
Difference, installation site become the difference of Illumination Distribution, shadow of other installation elements etc., and color is different, therefore, RGB aggregate value
(T) slightly different.For example, be set with the RGB aggregate values (T) of the background parts of the element 21 of data line D1 less than 400, phase therewith
It is right, the RGB aggregate value (T) of the background parts of the element 21 of data line D2 is set with less than 500.
Therefore, threshold value (B) is used as 400 by image analysis apparatus 14, is compared simultaneously to RGB aggregate value (T) and threshold value (B)
When carrying out binaryzation, become as shown below.That is, image analysis apparatus 14 will be by the solid line encirclement in Fig. 5 on data line D1
Part is identified as background, but the part surrounded by the solid line in Fig. 6 is identified as number on data line D2.By in Fig. 5 and Fig. 6
The part that surrounds of solid line be constitute the part P3 of digital " 1 " and constitute digital " 5 " part P4 between, it should be identified as
Background.
On the other hand, as shown in Figure 7 and Figure 8, data line D1, D2 of the background parts of the ratio of difference shown in formula (2)
Neither to 10.Therefore, threshold value (B) is used as 10 by image analysis apparatus 14, to the ratio and threshold value of difference shown in formula (2)
(B) when being compared and carrying out binaryzation, become as shown below.Both image analysis apparatus 14 can in data line D1, D2
The part surrounded by the solid line in Fig. 7 and Fig. 8 is identified as background.It is to constitute number by the part that the solid line in Fig. 7 and Fig. 8 surrounds
Between the part P3 of " 1 " of word and the part P4 of " 5 " for constituting number, it should be identified as background.
From Fig. 5~Fig. 8 it is found that knowing image analysis apparatus 14 according to the present embodiment, even if not adjusting threshold value (B)
Binaryzation can be accurately proceed.
In addition, setting inspection area A1 according to above-mentioned embodiment in each element 21, calculating the flat of RGB aggregate value
Mean value (A).Thereby, it is possible to further be accurately proceed binaryzation.
In addition, carrying out binaryzation using common threshold value (B) for multiple element 21 according to above-mentioned embodiment.
It does not need to calculate threshold value (B) to each element 21 as a result,.
In addition, according to above-mentioned embodiment, the ratio based on difference shown in formula (2) compared with threshold value (B) base into
Row binaryzation, but not limited to this.It is total according to the average value (A) and RGB of RGB aggregate value as the value compared with threshold value (B)
The value that value (T) is found out, such as can be the average value (A) of RGB aggregate value and the difference of RGB aggregate value (T).
In addition, being checked according to above-mentioned embodiment in the smaller region setting of pixel region A2 than constituting element 21
Region A1, but not limited to this.It is also contemplated that pixel region A2 is set in inspection area A1.
In addition, having carried out character recognition to the number on element 21, but can also know with character according to above-mentioned embodiment
Character, mark on other element 21.
Additionally, this invention is not limited to above embodiment.That is, being able to carry out in the range of not departing from main points of the present invention
Various modifications are implemented.