Based on HSV space and regioselective Micro-wood Fiber examine of diameter algorithm
Affiliated technical field
The present invention relates to a kind of Micro-wood Fiber examine of diameter algorithm based on micro-image, relate in particular to a kind of based on hsv color space and regioselective improved Micro-wood Fiber examine of diameter algorithm.
Background technology
The fibre diameter detection method has pneumatic tester method, optical microscope sciagraphy, optical microscope autoscan method, laser scanning method, scanning electron microscopy etc. at present, but because of instrument expensive, range of application is limited, can not be generalized in production well, thereby the difficulty that the robotization of xylogen diameter detects is increased.RGB color model commonly used is owing to there being very strong correlativity between R, G, B three-component, and the hsv color space more meets the feature of human eye to Color perception, and its three components are separate, stronger robustness is arranged.The people such as Wang Xiali are in document 1 " a kind of vehicle license extracting method based on the hsv color space " (computer engineering, 2004,30 (17)) in, utilize the hsv color space directly to be processed the coloured image that contains license plate of input, design a kind of car plate method of inspection, realize the car plate location.Mathematical morphology has perfect Fundamentals of Mathematics, obtained good effect in the rim detection field, as Li Jie waits in document 2 " research of the edge detection algorithm based on mathematical morphology " (computer science, 2012,39 (6A)) in by a kind of improved morphological operator, effectively detect edge, and kept edge-smoothing.Fiber areal survey method can be utilized the feature of each segmentation well, Zhang Peng flies to wait the people in document 3 " a kind of method based on the pretreated quick test fibre diameter of image " (Shanghai Textile science and technology, 2011, (39) 12) in, the wool fiber length direction, every about 9 pixels, fiber is carried out to the diameter measurement based on fitting a straight line from fiber one end, this algorithm has shortened the examine of diameter time, improved measurement efficiency, the advantage of performance digital image processing techniques.The application of maximum inscribed circle is more, the people such as Wu Wei are at document 4 " selection and the Position Research of area-of-interest in palm vein identification " (photoelectron laser, 2013, (24) 1) in, the ROI localization method of proposition based on thenar area, near wrist side maximum inscribed circle, to determine two invariant feature points on palm, utilize these two invariant feature points to determine ROI, ROI image to thenar area and centre of the palm district carries out the recognition performance contrast experiment, result shows, this method make multiple recognition performance index all be improved significantly.The above is based on hsv color space and regioselective Micro-wood Fiber examine of diameter algorithm theoretical foundation is provided.
Summary of the invention
The purpose of this invention is to provide a kind of based on HSV space and regioselective improved Micro-wood Fiber examine of diameter algorithm, this algorithm adopts the S component realize target based on the hsv color space to extract, based on the user's request concept, calculate the diameter of each segmentation and obtain mean value by improve traditional areal survey method based on the maximum inscribed circle algorithm, realizing the Micro-wood Fiber examine of diameter.Algorithm is not subject to the noise effect of background, and examine of diameter is effective, and applicability is stronger.
In order to achieve the above object, the present invention adopts following technical scheme:
Based on HSV space and regioselective Micro-wood Fiber examine of diameter algorithm, comprise the following steps:
(1) read in the micro-enlarged drawing of Micro-wood Fiber, the RGB image conversion that obtains, to the hsv color space, is extracted to the S component and carries out Threshold segmentation, carry out the operations such as mathematical morphology and filtering and noise reduction, obtain the binaryzation target of removing background;
(2) if the Micro-wood Fiber form is irregular, first carry out the user area selection, extract the xylogen body region, and carry out morphology single scale rim detection;
(3) the improved segmentation fibre diameter that the image after the edge detection carries out based on the maximum inscribed circle algorithm is measured, and the net result using the mean value of each sectional area diameter as the Micro-wood Fiber diameter, and algorithm finishes.
The accompanying drawing explanation
Fig. 1 is based on HSV space and regioselective Micro-wood Fiber examine of diameter algorithm flow chart;
Fig. 2 is the micro-enlarged image of Micro-wood Fiber of experiment use;
Fig. 3 is xylogen image hsv color space three-component figure, and wherein figure (a) divides spirogram for S divides spirogram, figure (c) for V for H divides spirogram, figure (b);
Fig. 4 is based on the S component xylogen image is carried out to binaryzation extraction result;
Fig. 5 carries out the extraction of xylogen body region to binary image based on user's request;
Fig. 6 carries out the result of rim detection to the image after extracted region;
Fig. 7 carries out the result of one of them areal survey based on maximum inscribed circle to xylogen;
Embodiment:
Fig. 1 is based on HSV space and regioselective Micro-wood Fiber examine of diameter algorithm flow chart; Of the present inventionly based on HSV space and regioselective Micro-wood Fiber examine of diameter algorithm, comprise the following steps:
(1) by the RGB image conversion that collects to the hsv color space;
(2) extract the S component and carry out the extraction of binaryzation target;
(3) carry out the operations such as mathematical morphology and filtering and noise reduction, obtain the binaryzation target of removing background;
(4) extract the Micro-wood Fiber body region based on user's request;
(5) adopt morphology single scale operator to detect the Micro-wood Fiber edge;
(6) image after the edge extraction adopts the improved areal survey method detection fibers diameter based on the maximum inscribed circle algorithm;
(7) to each segmentation diameter calculating mean value, as the net result of Micro-wood Fiber diameter.
Fig. 2 is the micro-enlarged image of Micro-wood Fiber collected;
Fig. 3 is xylogen image hsv color space three-component figure, and wherein figure (a) divides spirogram for S divides spirogram, figure (c) for V for H divides spirogram, figure (b).Because the S component has highlighted complete xylogen particle preferably, therefore adopt the S component to remove the background extracting target;
Fig. 4 is for to carry out based on S spatial extraction target the micro-enlarged image of xylogen by above-mentioned analysis, the figure as a result that the operations such as the line number of going forward side by side morphology and filtering and noise reduction obtain.From this interpretation, the method can successfully be isolated preferably xylogen from background;
Fig. 5 be to gained binary segmentation result image based on the user's request concept, remove the figure as a result of the irregular morphological feature of xylogen (such as bifurcated, burr etc.).Can find out from experimental result, based on user's request, not only obtain the xylogen body region of comparatively complete rule, be convenient to ensuing diameter measurement, and introduce user's participation, make algorithm more there is interactivity;
Fig. 6 is that the image after above-mentioned target is extracted carries out morphology single scale operator edge detection, and the operator of employing is:
Wherein, f (x, y) is pixel, and b (i, j) is structural elements.Algorithm picks disc structure unit, radius is 3;
Fig. 7 carries out the result of one of them areal survey based on maximum inscribed circle to xylogen.