CN103234472A - Detecting method and detecting system for fiber fineness and density of Rex-rabbit clothing hair - Google Patents
Detecting method and detecting system for fiber fineness and density of Rex-rabbit clothing hair Download PDFInfo
- Publication number
- CN103234472A CN103234472A CN2013100728438A CN201310072843A CN103234472A CN 103234472 A CN103234472 A CN 103234472A CN 2013100728438 A CN2013100728438 A CN 2013100728438A CN 201310072843 A CN201310072843 A CN 201310072843A CN 103234472 A CN103234472 A CN 103234472A
- Authority
- CN
- China
- Prior art keywords
- data
- hair
- coat
- image data
- detection
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 31
- 239000000835 fiber Substances 0.000 title claims abstract description 15
- 210000004209 hair Anatomy 0.000 title claims description 57
- 241000283973 Oryctolagus cuniculus Species 0.000 claims abstract description 46
- 238000001514 detection method Methods 0.000 claims abstract description 35
- 238000004458 analytical method Methods 0.000 claims abstract description 28
- 238000013500 data storage Methods 0.000 claims abstract description 8
- 210000002268 wool Anatomy 0.000 claims description 7
- 241001233242 Lontra Species 0.000 claims description 4
- 230000005540 biological transmission Effects 0.000 claims 1
- 238000012545 processing Methods 0.000 abstract description 24
- 238000003860 storage Methods 0.000 abstract description 3
- 238000013461 design Methods 0.000 description 18
- 230000006870 function Effects 0.000 description 15
- 238000004422 calculation algorithm Methods 0.000 description 10
- 238000010586 diagram Methods 0.000 description 9
- 210000003491 skin Anatomy 0.000 description 9
- 238000004364 calculation method Methods 0.000 description 8
- 230000003695 hair diameter Effects 0.000 description 8
- 238000013499 data model Methods 0.000 description 7
- 230000008569 process Effects 0.000 description 7
- 230000037308 hair color Effects 0.000 description 6
- 238000013178 mathematical model Methods 0.000 description 6
- 241001465754 Metazoa Species 0.000 description 5
- 238000001914 filtration Methods 0.000 description 5
- 238000003491 array Methods 0.000 description 4
- 230000008859 change Effects 0.000 description 3
- 230000007613 environmental effect Effects 0.000 description 3
- 238000007639 printing Methods 0.000 description 3
- 230000005855 radiation Effects 0.000 description 3
- 230000011218 segmentation Effects 0.000 description 3
- 230000009466 transformation Effects 0.000 description 3
- 230000003044 adaptive effect Effects 0.000 description 2
- 230000002776 aggregation Effects 0.000 description 2
- 238000004220 aggregation Methods 0.000 description 2
- 210000004556 brain Anatomy 0.000 description 2
- 239000003086 colorant Substances 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 238000012937 correction Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000005286 illumination Methods 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 239000011159 matrix material Substances 0.000 description 2
- 238000005259 measurement Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 238000005070 sampling Methods 0.000 description 2
- 238000001228 spectrum Methods 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 239000004753 textile Substances 0.000 description 2
- 238000012935 Averaging Methods 0.000 description 1
- 101100115215 Caenorhabditis elegans cul-2 gene Proteins 0.000 description 1
- 241000772415 Neovison vison Species 0.000 description 1
- 240000007594 Oryza sativa Species 0.000 description 1
- 235000007164 Oryza sativa Nutrition 0.000 description 1
- 238000010521 absorption reaction Methods 0.000 description 1
- 230000003796 beauty Effects 0.000 description 1
- 230000007797 corrosion Effects 0.000 description 1
- 238000005260 corrosion Methods 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000004043 dyeing Methods 0.000 description 1
- 230000005670 electromagnetic radiation Effects 0.000 description 1
- 230000008030 elimination Effects 0.000 description 1
- 238000003379 elimination reaction Methods 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 230000007717 exclusion Effects 0.000 description 1
- 231100000640 hair analysis Toxicity 0.000 description 1
- 210000003780 hair follicle Anatomy 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 230000008676 import Effects 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 239000002932 luster Substances 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000012067 mathematical method Methods 0.000 description 1
- 210000000050 mohair Anatomy 0.000 description 1
- 230000008447 perception Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 235000009566 rice Nutrition 0.000 description 1
- 230000000630 rising effect Effects 0.000 description 1
- 238000010008 shearing Methods 0.000 description 1
- 238000003307 slaughter Methods 0.000 description 1
- 238000007619 statistical method Methods 0.000 description 1
Images
Landscapes
- Image Analysis (AREA)
Abstract
本发明提供一种獭兔被毛纤维细度、密度检测方法及检测系统,方法包括如下步骤:a、采集被毛图像数据;b、将被毛图像数据传输到计算机中存储;c、通过计算机处理软件完成检测分析。系统包括被毛图像数据采集装置、被毛图像数据存储及检测分析装置。本发明可以在活体獭兔取被毛直接检测分析獭兔毛皮质量,被毛密度、密度结果,操作方便、效率高;检测系统结构简单、方便携带,检测速度快、精度高。
The invention provides a method and system for detecting the fiber fineness and density of a rex rabbit coat. The method includes the following steps: a. collecting coat image data; b. transmitting the coat image data to a computer for storage; c. processing by a computer The software completes the detection analysis. The system includes a coat image data acquisition device, a coat image data storage and detection analysis device. The invention can directly detect and analyze the fur quality, coat density and density results of the live rex rabbit by taking the coat of the live rex rabbit, and has convenient operation and high efficiency; the detection system is simple in structure, convenient to carry, fast in detection speed and high in precision.
Description
技术领域 technical field
本发明属于精密计量仪器技术领域,特别涉及一直包括兔毛、羊毛、貂绒、马海毛等毛皮动物毛皮质量和其他圆形截面的纺织纤维的细度测量方法及设备,广泛应用于毛皮产品、纺织品进出口和生产行业的质量管理。 The invention belongs to the technical field of precision measuring instruments, and particularly relates to a method and equipment for measuring the fineness of the fur quality of fur animals such as rabbit hair, wool, mink, mohair and other circular cross-section textile fibers, and is widely used in fur products and textiles Quality management in import, export and production industries. the
背景技术 Background technique
獭兔又名力克斯兔(Rex rabbit),原意为“兔中之王”。又因力克斯兔被毛平整直立,富有绚丽光泽,手感柔软、舒适,毛细密,很似珍贵毛皮兽水獭。所以,多以“獭兔”称之。獭兔是典型皮用兔。獭兔毛皮品质标准要求,概括为“短、细、密、平、美、牢”。所谓“短”,就是毛纤维短,毛纤维长度在1.3厘米~2.2厘米之间。“细”就是毛纤维直径在16微米~18微米,粗毛少。“密”就是绒毛丰厚,被毛密度在10000根~25000根/cm2。“平”就是绒毛长短一致,平整。“美”就是色调美观,有光泽。“牢”就是被毛着生牢固,不易脱落。獭兔皮毛在国际市场上销售一直被看好。 Rex rabbit, also known as Rex rabbit, originally means "king of rabbits". And because the fur of the Lex rabbit is flat and upright, full of gorgeous luster, soft and comfortable to the touch, with fine and dense hair, just like the precious fur beast otter. Therefore, it is mostly called "rex rabbit". Rex rabbit is a typical fur rabbit. Rex rabbit fur quality standard requirements are summarized as "short, thin, dense, flat, beautiful, and firm". The so-called "short" means that the wool fiber is short, and the length of the wool fiber is between 1.3 cm and 2.2 cm. "Fine" means that the diameter of the wool fiber is 16 microns to 18 microns, and there are few coarse hairs. "Dense" means thick hair, with a coat density of 10,000 to 25,000 hairs/cm 2 . "Ping" means that the fluff is uniform in length and smooth. "Beauty" means that the tone is beautiful and shiny. "Long" means that the coat is firmly grown and not easy to fall off. The sale of Rex Rabbit fur in the international market has always been favored.
2007.04.11公告号为CN1946335的专利申请涉及一种被毛质量检测设备(100),其具有电磁辐射源(80) 和成像传感器(74),并具有辐射选择装置(83,48)。在该设备的使用过程中,该选择装置提高发射的接入到皮肤(8)、在皮肤中经由多次散射而均匀化且没有吸收,并到达该传感器(74)且提供皮肤图像的那部分辐射,与经由其它方式例如在皮肤表面反射到达传感器的那部分辐射之间比率。借助于该选择,图像的对比度可得以提高,并可以更少的依赖于皮肤颜色和皮肤伪像,从而能使检测例如浅色皮肤上的白色被毛更容易。该被毛检测设备主要用于活体毛皮动物毛皮质量的检测设备,现有獭兔被毛细度、密度检测方法,主要有人工剪毛计数法,显微镜投影法和取皮切片染色检测毛囊纤维计数法,一方面需要活体取皮、剪毛,损伤毛皮或屠宰獭兔;另一方面该检测仪器结构复杂,检测只能在实验室内操作,工作量大周期长,不便于数据处理,耗费人力物力,检测成本高,已不便于生产行业的质量管理。 The 2007.04.11 announcement number is that the patent application of CN1946335 relates to a coat quality detection device (100), which has an electromagnetic radiation source (80) and an imaging sensor (74), and has a radiation selection device (83,48). During use of the device, the selection means increases the access of the emission to the part of the skin (8), homogenized in the skin via multiple scattering and without absorption, and reaches the sensor (74) and provides an image of the skin The ratio of radiation to that portion of radiation that reaches the sensor by other means, such as reflection off the skin surface. By means of this option, the contrast of the image can be improved and can be less dependent on skin color and skin artifacts, thus making it easier to detect eg a white coat on light skin. The hair coat detection equipment is mainly used for the detection equipment of the fur quality of living fur animals. The existing methods for detecting the fineness and density of the coat of rex rabbits mainly include artificial shearing counting method, microscope projection method and hair follicle fiber counting method for skin section dyeing detection. On the one hand, it is necessary to take the skin, shear the fur, damage the fur or slaughter the rex rabbit; on the other hand, the detection instrument has a complex structure, and the detection can only be performed in the laboratory. The workload is large and the cycle is long, it is not convenient for data processing, it consumes manpower and material resources, and the detection cost is high. , It is not convenient for the quality management of the production industry.
发明内容 Contents of the invention
在发明内容部分中引入了一系列简化形式的概念,这将在具体实施方式部分中进一步详细说明。本发明的发明内容部分并不意味着要试图限定出所要求保护的技术方案的关键特征和必要技术特征,更不意味着试图确定所要求保护的技术方案的保护范围。 A series of concepts in simplified form are introduced in the Summary of the Invention, which will be further detailed in the Detailed Description. The summary of the invention in the present invention does not mean to limit the key features and essential technical features of the claimed technical solution, nor does it mean to try to determine the protection scope of the claimed technical solution. the
本发明目的之一是提供一种獭兔被毛纤维细度、密度检测方法,可以在活体獭兔取毛样直接检测分析,操作方便、效率高。 One of the purposes of the present invention is to provide a method for detecting the fiber fineness and density of rex rabbit coat, which can be directly detected and analyzed by taking wool samples from living rex rabbits, and is easy to operate and high in efficiency.
本发明同时提供一种獭兔被毛纤维细度、密度检测系统,其结构简单、方便携带,检测速度快、精度高。 The invention also provides a detection system for the fiber fineness and density of the rex rabbit coat, which is simple in structure, convenient to carry, fast in detection speed and high in precision.
本发明是通过如下技术方案实现的, The present invention is achieved through the following technical solutions,
一种獭兔被毛细度、密度纤维检测方法,其特征在于包括如下步骤: A kind of rex rabbit is capillary, density fiber detection method, it is characterized in that comprising the steps:
a、采集被毛图像数据; a. Collect coat image data;
b、将被毛图像数据传输到计算机中存储; b. Transmit the coat image data to the computer for storage;
c、通过计算机处理软件完成检测分析。 c. Complete the detection and analysis through computer processing software.
根据本发明的方法,采用检测仪直接从活体獭兔身上采集被毛图像数据。 According to the method of the present invention, a detector is used to directly collect coat image data from a live rex rabbit.
根据本发明的方法,在步骤c中采用便携式数据处理设备完成数据检测分析。 According to the method of the present invention, in step c, a portable data processing device is used to complete data detection and analysis.
根据本发明的检测仪具体为DinoLite手持式USB数码显微镜。 The detector according to the present invention is specifically a DinoLite handheld USB digital microscope.
獭兔被毛纤维细度、密度检测系统,其特征在于包括被毛图像数据采集装置、被毛图像数据存储及检测分析装置。 The fiber fineness and density detection system of the rex rabbit is characterized in that it includes a coat image data acquisition device, a coat image data storage and detection analysis device.
根据本发明的系统,所述图像数据采集装置为DinoLite手持式USB数码显微镜。 According to the system of the present invention, the image data acquisition device is a DinoLite handheld USB digital microscope.
根据本发明的系统,所述被毛图像数据存储及检测分析装置为便携式数据处理设备。 According to the system of the present invention, the coat image data storage, detection and analysis device is a portable data processing device.
根据本发明的系统,所述显微镜主要由CCD、凸透镜、以及照明单元构成。 According to the system of the present invention, the microscope is mainly composed of a CCD, a convex lens, and an illumination unit.
根据本发明的系统,为使用更方便,所述便携式数据处理设备设置有为输入/输出接口和充电口。 According to the system of the present invention, for more convenient use, the portable data processing device is provided with an input/output interface and a charging port.
本发明可以在活体獭兔取毛样直接检测分析,而且结构简单、方便携带,检测速度快、精度高,使用操作方便。具体而言,具有如下4个显著的特点: The invention can directly detect and analyze hair samples taken from live rex rabbits, has simple structure, is convenient to carry, has fast detection speed, high precision, and is convenient to use and operate. Specifically, it has the following four notable features:
1、快速:即测即得,图像数据分析,统计,迅速获取该只獭兔的检测数据结果,储取方便,还可事后分析,输出。 1. Fast: Instantly measure and obtain, image data analysis, statistics, quickly obtain the detection data results of the Rex Rabbit, easy to store and retrieve, and can also be analyzed and output afterwards.
2、便携式:仪器设计为手持式,操作简便,无需交流电,适合野外,现场检测。 2. Portable: The instrument is designed to be hand-held, easy to operate, does not require AC power, and is suitable for field and on-site testing.
3、无损:直接在动物活体上进行检测,对被检测毛皮动物皮毛无损害,可多次重复测量。 3. Non-destructive: The test is carried out directly on the live animal, without damage to the fur of the tested fur animal, and the measurement can be repeated many times.
4、更换不同的采样头,可对多种动物皮毛进行检测。 4. Different sampling heads can be replaced to detect the fur of various animals.
附图说明 Description of drawings
图1为本发明中检测系统的结构示意图。 Fig. 1 is a schematic structural diagram of the detection system in the present invention. the
图2为640X480的BMP格式图像。 Figure 2 is a 640X480 BMP format image.
图3为未经处理的图片。 Figure 3 is the unprocessed picture.
图4为经灰度处理后的图片。 Figure 4 is the image after grayscale processing.
图5为对图4所作的色阶谱图。 Fig. 5 is the chromatic order spectrogram that Fig. 4 is made.
图6为色阶谱图示例图。 Figure 6 is an example diagram of the color spectrum.
图7为图像相应位置的像素信息示意图。 FIG. 7 is a schematic diagram of pixel information of a corresponding position in an image.
图8a和图8b分别为二维适应性去噪过滤处理示例图。 Fig. 8a and Fig. 8b are illustrations of two-dimensional adaptive denoising filtering processing respectively.
图9a和图9b分别为创建预定义过滤器示例图。 Figure 9a and Figure 9b are examples of creating predefined filters.
图10a和10b分别为识别强度图像中的边界示例图。 Figures 10a and 10b are examples of boundaries in the recognition intensity image, respectively.
图11为獭兔被毛在显微镜下呈现的无交叉示意图。 Fig. 11 is a schematic diagram of the cross-free appearance of the coat of a rex rabbit under a microscope.
图12为獭兔被毛在显微镜下呈现的交叉或重叠示意图。 Fig. 12 is a cross or overlapping schematic diagram of the coat of a rex rabbit under a microscope.
图13为从左至右的对图像进行切片操作所得示意图。 FIG. 13 is a schematic diagram obtained by slicing an image from left to right.
图14为数据-灰度值变化示意图。 Fig. 14 is a schematic diagram of data-gray value change.
图15为统计结果示意图。 Figure 15 is a schematic diagram of statistical results.
图16为去噪算法图。 Figure 16 is a diagram of the denoising algorithm.
其中1为被毛图像数据采集装置、2为被毛图像数据存储及检测分析装置、3为CCD、4为凸透镜、5为照明单元、6为输入/输出接口、7为充电口。 Among them, 1 is a coat image data acquisition device, 2 is a coat image data storage and detection analysis device, 3 is a CCD, 4 is a convex lens, 5 is a lighting unit, 6 is an input/output interface, and 7 is a charging port.
具体实施方式 Detailed ways
在下文的描述中,给出了大量具体的细节以便提供对本发明更为彻底的理解。然而,对于本领域技术人员来说显而易见的是,本发明可以无需一个或多个这些细节而得以实施。在其他的例子中,为了避免与本发明发生混淆,对于本领域公知的一些技术特征未进行描述。 In the following description, numerous specific details are given in order to provide a more thorough understanding of the present invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced without one or more of these details. In other examples, some technical features known in the art are not described in order to avoid confusion with the present invention. the
为了彻底了解本发明,将在下列的描述中提出详细的细节,以便说明本发明是如何解决现有的通信感知评估系统的无法对网络问题区域进行收集分类等问题。显然,本发明的施行不限定于通信领域的技术人员所熟习的特殊细节。本发明的较佳实施例详细描述如下,然而除了这些详细描述外,本发明还可以具有其他实施方式。 In order to thoroughly understand the present invention, detailed details will be provided in the following description, so as to illustrate how the present invention solves the problems that the existing communication perception evaluation system cannot collect and classify network problem areas. Obviously, the practice of the invention is not limited to specific details familiar to those skilled in the communications arts. Preferred embodiments of the present invention are described in detail below, however, the present invention may have other embodiments besides these detailed descriptions.
一种獭兔被毛纤维细度、密度检测方法,其特征在于包括如下步骤: A method for detecting the fiber fineness and density of a rex rabbit coat is characterized in that it comprises the following steps:
a、采集被毛图像数据; a. Collect coat image data;
b、将被毛图像数据传输到计算机中存储; b. Transmit the coat image data to the computer for storage;
c、通过计算机处理软件完成检测分析。 c. Complete the detection and analysis through computer processing software.
本发明中采用DinoLite手持式USB数码显微镜直接从活体獭兔身上采集被毛图像数据。在步骤c中采用便携式数据处理设备完成数据检测分析。 In the present invention, a DinoLite handheld USB digital microscope is used to directly collect coat image data from a live rex rabbit. In step c, use portable data processing equipment to complete data detection and analysis.
本发明同时还提供一种獭兔被毛纤维细度、密度检测系统,其特征在于包括被毛图像数据采集装置1、被毛图像数据存储及检测分析装置2。 The present invention also provides a rex rabbit coat fiber fineness and density detection system, which is characterized in that it includes a coat image data acquisition device 1 , and a coat image data storage and detection analysis device 2 .
进一步的,本发明所述图像数据采集装置为DinoLite手持式USB数码显微镜。 Further, the image data acquisition device of the present invention is a DinoLite handheld USB digital microscope.
进一步的,本发明所述被毛图像数据存储及检测分析装置2为便携式数据处理设备。 Further, the coat image data storage and detection analysis device 2 of the present invention is a portable data processing device.
所述DinoLite手持式USB数码显微镜主要由CCD3、凸透镜4、以及照明单元5构成。 The DinoLite handheld USB digital microscope is mainly composed of a CCD3, a convex lens 4, and an illumination unit 5.
为了使用更方便,所述便携式数据处理设备设置有为输入/输出接口6和充电口7。 For more convenient use, the portable data processing device is provided with an input/output interface 6 and a charging port 7 .
獭兔被毛检测仪的软件功能大体如下: a)通过视频头采集存储獭兔被毛图像。 b)将獭兔被毛图像形成可分析计算的格式。 c)通过獭兔被毛检测要求指标设计数学模型。 d)根据獭兔被毛检测报告要求设计结果统计界面。 The software functions of the Rex Rabbit Coat Detector are generally as follows: a) Collect and store the image of the Rex Rabbit coat through the video head. b) Form the image of the coat of Rex Rabbit into a format that can be analyzed and calculated. c) Design a mathematical model based on the requirements for the detection of rex rabbit coat. d) Design the result statistics interface according to the requirements of the Rex Rabbit Coat Inspection Report.
獭兔被毛检测仪的图像采集是通过USB2.0独立手持式显微放大视频头采集。采用Directshow技术编程对USB设备(显微放大视频头)编写该软件的图像采集部分。 The image collection of the Rex Rabbit Coat Detector is collected through a USB2.0 independent handheld micro-magnification video head. The image acquisition part of the software is programmed for the USB device (microscopic magnification video head) by using Directshow technology programming.
图像数据分为2类:动态视频图像(avi文件),静态图像文件(bmp或jpg格式)。捕捉之后得到的这2类数据,取静态图像文件(bmp或jpg格式)作为分析数据。采用BMP格式作为最终分析数据。 Image data is divided into 2 categories: dynamic video images (avi files), static image files (bmp or jpg format). For these two types of data obtained after capture, static image files (bmp or jpg format) are used as analysis data. BMP format was adopted as the final analysis data.
采集640X480的BMP格式图像,将BMP图片从左下角开始,右上角结束,一共640X480个点。声名一个PBits[640][480]的一个RGB类的数组,每个矩阵点得到的数据都是一个RGB值,RGB类是一个由R,G,B个数据组成,分别代表该点的红R,绿G,蓝B三元色的数值。 如图2所示,可以看到能够得到的只是这640X480个点数据RGB值。由于需要处理的数据是白色或者棕色,黑色的毛发,所以需要对数据进行灰度处理。处理过程如下: Collect 640X480 BMP format images, start from the lower left corner of the BMP image and end at the upper right corner, a total of 640X480 points. Declare an array of RGB types of PBits[640][480]. The data obtained by each matrix point is an RGB value. The RGB type is composed of R, G, and B data, which represent the red R of the point respectively. , Green G, blue B ternary color values. As shown in Figure 2, it can be seen that only the RGB values of the 640X480 point data can be obtained. Since the data to be processed is white or brown or black hair, it is necessary to perform grayscale processing on the data. The process is as follows:
每个点的RGB灰度值经过灰度经典运算公式得到一个(0-255)的数据值,这样就得到了一个整形二维数组P[640][480]。这个数据每一个点就反映了图片每个位置的明暗程度。这个阵列数组就是后面数学建模的一个基础。下面看一下灰度处理的结果。 图3为没有经过处理的图片,图4是一个灰度处理过的图片,可以看到毛发的位置的灰度值和底色的差异。 The RGB gray value of each point obtains a (0-255) data value through the classic calculation formula of the gray value, thus obtaining a two-dimensional array P[640][480]. Each point of this data reflects the lightness and darkness of each position of the picture. This array of arrays is a basis for subsequent mathematical modeling. Let's take a look at the results of grayscale processing. Figure 3 is an unprocessed picture, and Figure 4 is a grayscale-processed picture, where you can see the difference between the grayscale value of the hair position and the background color.
数据模型分析处理过程 Data model analysis process
得到的只是一个P[640][480]的一个数据阵列。 What is obtained is only a data array of P[640][480].
处理的第一步色阶分析: The first step of processing color scale analysis:
例如对上一部图作色阶分析,得到图5所示的色阶谱图。从图5可以看到色阶的一个分部,利用这个色阶可以把底色和有用数据部分分开,进而对毛发部分数据进行分析处理。当然并不是每一个图片都能进行有效处理,以图6为例, 可以看到当色阶定义为109的时候,毛发部分并不能很好的显示出来,还参杂了底色在里面。这个说明底色和毛发颜色过于接近, 或者说毛发颜色和底色交叉很严重。换句话说,例如毛发色阶在(110-130)之间,而环境色,底色(80-150)之间,这就使得有用数据无法剔除出来。因为进行的灰度处理,所以3元色变为了一元色,这个过程是数据进行了丢失,但是灰度处理是图像色阶剔除的一个最简单的方法。所以数学模型不能简单的参照灰度处理来分割,需要从3元色基础进行另外的方法建模。例如对R色,G色,B色3种颜色都进行分割处理细化。但是这里有个一很困难的问题,毛发的颜色大多为白,灰白,黑,棕,这些颜色的RGB值,接近于3等分。所以即便进行3色分割分析,实际和灰度分割效果一样。所以需要数据源能够将毛发和环境色有效的进行区分。这就要求加入底色来区分。设想底色和毛发颜色能够有效区分之后,可以得到毛发的数据坐标位置,这个坐标位置点就是对应了P[640][480]这个二维数据的阵列位置(横,列位置)。有了这些位置,再用一个有效可行的数据建模,可以测量出毛发的直径,数量,单位面积根数等结果。 For example, perform color scale analysis on the previous figure to obtain the color scale spectrum shown in Figure 5. From Figure 5, we can see a subsection of the color scale, which can be used to separate the background color from the useful data, and then analyze and process the data of the hair part. Of course, not every picture can be processed effectively. Taking Figure 6 as an example, it can be seen that when the color scale is defined as 109, the hair part cannot be displayed well, and the background color is mixed in it. This indicates that the base color and the hair color are too close, or that the hair color and the base color are seriously crossed. In other words, for example, the hair color scale is between (110-130), while the environment color and background color are between (80-150), which makes it impossible to remove useful data. Because of the grayscale processing, the 3-primary color becomes a 1-primary color. This process causes data to be lost, but grayscale processing is the simplest method for image level elimination. Therefore, the mathematical model cannot be divided simply by referring to the grayscale processing, and it is necessary to carry out another modeling method based on the 3-primary color basis. For example, the three colors of R color, G color and B color are segmented and refined. But there is a very difficult problem here. Most of the hair colors are white, gray, black, and brown. The RGB values of these colors are close to 3 equal parts. So even if the 3-color segmentation analysis is performed, the actual effect is the same as the gray-scale segmentation. Therefore, the data source needs to be able to effectively distinguish the hair from the environment color. This requires the addition of background color to distinguish. Imagine that after the background color and hair color can be effectively distinguished, the data coordinate position of the hair can be obtained. This coordinate position point corresponds to the array position (horizontal, column position) of the two-dimensional data of P[640][480]. With these positions, and then using an effective and feasible data model, the results such as the diameter, quantity, and number of hairs per unit area can be measured.
毛发根数计算其实这一个过程就是所谓的数据聚集分析。 In fact, the process of calculating the number of hair roots is the so-called data aggregation analysis.
毛发的直径计算是一个数据斜率统计计算再加上几何形态计算建模分析。 The hair diameter calculation is a data slope statistical calculation plus geometric shape calculation modeling analysis.
4)数据模型的建立 4) Establishment of data model
首先,用于处理的数据的数据结构。如图7所示,整形二维数组P[640][480]包含了640*480个点,每个点的(X,Y)对应的值对应了图像相应位置的像素信息。 First, the data structure for the processed data. As shown in Figure 7, the plastic two-dimensional array P[640][480] contains 640*480 points, and the value corresponding to (X, Y) of each point corresponds to the pixel information of the corresponding position of the image.
由于处理的图像每个点的数据已经不再是RGB值,而是灰度值,每个点的信息只有一个值。再而可以将P[640][480]看做一个矩阵阵列数据。设计模型时,有这个数据阵列为基础来设计。这里需要用到还有一个很重要的数学工具Matlab。Matlab可以进行大量的复杂数学计算。由于图像不可能完全符合数学模型处理。为了更好的建立和设计模型,需要对图像数据进行模糊,去噪处理。经过处理后的图片色阶变换更为平稳,这样的数据更有利于进行分析。 Since the data of each point of the processed image is no longer an RGB value, but a gray value, the information of each point has only one value. Furthermore, P[640][480] can be regarded as a matrix array data. When designing the model, design based on this data array. There is also a very important mathematical tool Matlab that needs to be used here. Matlab can perform a large number of complex mathematical calculations. Because the image cannot be completely processed according to the mathematical model. In order to better establish and design the model, it is necessary to blur and denoise the image data. The color scale transformation of the processed image is more stable, and such data is more conducive to analysis.
利用Matlab强大图像数据处理功能先对图像进行去噪处理: wiener2 Use the powerful image data processing function of Matlab to denoise the image first: wiener2
功能: Function:
进行二维适应性去噪过滤处理。 Carry out two-dimensional adaptive denoising and filtering.
语法: grammar:
J = wiener2(I,[m n],noise) J = wiener2(I,[m n],noise)
[J,noise] = wiener2(I,[m n]) [J,noise] = wiener2(I,[m n])
举例 example
I = imread('saturn.GIF'); I = imread('saturn. GIF');
J = imnoise(I,'gaussian',0,0.005); J = imnoise(I,'gaussian',0,0.005);
K = wiener2(J,[5 5]); K = wiener2(J,[5 5]);
imshow(J) imshow(J)
figure, imshow(K) figure, imshow(K)
如图8a和图8b所示,所有的处理操作都要围绕最开始进行的图像数据格式化,数据化之后的二维数组来进行操作。有的时候獭兔被毛图像效果不是太理想,环境噪音太大的时候,还要做滤波处理等操作。 As shown in Fig. 8a and Fig. 8b, all processing operations must be performed around the initial image data format and the two-dimensional array after digitization. Sometimes the image effect of the rex rabbit coat is not ideal, and when the environmental noise is too large, it needs to do filtering and other operations.
freqspace freqspace
功能: Function:
确定二维频率响应的频率空间。 Determine the frequency space for the frequency response in 2D.
语法: grammar:
[f1,f2] = freqspace(n) [f1,f2] = freqspace(n)
[f1,f2] = freqspace([m n]) [f1,f2] = freqspace([m n])
[x1,y1] = freqspace(...,'meshgrid') [x1,y1] = freqspace(...,'meshgrid')
f = freqspace(N) f = freqspace(N)
f = freqspace(N,'whole') f = freqspace(N,'whole')
相关命令: Related commands:
fsamp2, fwind1, fwind2 fsamp2, fwind1, fwind2
freqz2 freqz2
功能: Function:
计算二维频率响应。 Computes the frequency response in 2D.
语法: grammar:
[H,f1,f2] = freqz2(h,n1,n2) [H,f1,f2] = freqz2(h,n1,n2)
[H,f1,f2] = freqz2(h,[n2 n1]) [H,f1,f2] = freqz2(h,[n2 n1])
[H,f1,f2] = freqz2(h,f1,f2) [H,f1,f2] = freqz2(h,f1,f2)
[H,f1,f2] = freqz2(h) [H,f1,f2] = freqz2(h)
[...] = freqz2(h,...,[dx dy]) [...] = freqz2(h,...,[dx dy])
[...] = freqz2(h,...,dx) [...] = freqz2(h,...,dx)
freqz2(...) freqz2(...)
举例 example
Hd = zeros(16,16); Hd = zeros(16,16);
Hd(5:12,5:12) = 1; Hd(5:12,5:12) = 1;
Hd(7:10,7:10) = 0; Hd(7:10,7:10) = 0;
h = fwind1(Hd,bartlett(16)); h = fwind1(Hd, bartlett(16));
colormap(jet(64)) colormap(jet(64))
freqz2(h,[32 32]); axis ([–1 1 –1 1 0 1]) freqz2(h,[32 32]); axis ([–1 1 –1 1 0 1])
fsamp2 fsamp2
功能: Function:
用频率采样法设计二维FIR过滤器。 Design two-dimensional FIR filter by frequency sampling method.
语法: grammar:
h = fsamp2(Hd) h = fsamp2(Hd)
h = fsamp2(f1,f2,Hd,[m n]) h = fsamp2(f1,f2,Hd,[m n])
举例 example
[f1,f2] = freqspace(21,'meshgrid'); [f1,f2] = freqspace(21,'meshgrid');
Hd = ones(21); Hd = ones(21);
r = sqrt(f1.^2 + f2.^2); r = sqrt(f1.^2 + f2.^2);
Hd((r<0.1)|(r>0.5)) = 0; Hd((r<0.1)|(r>0.5)) = 0;
colormap(jet(64)) colormap(jet(64))
mesh(f1,f2,Hd) mesh(f1,f2,Hd)
相关命令: Related commands:
conv2, filter2, freqspace, ftrans2, fwind1, fwind2 conv2, filter2, freqspace, ftrans2, fwind1, fwind2
fspecial fspecial
功能: Function:
创建预定义过滤器。 Create a predefined filter.
语法: grammar:
h = fspecial(type) h = fspecial(type)
h = fspecial(type,parameters) h = fspecial(type,parameters)
举例 example
I = imread('saturn.GIF'); I = imread('saturn. GIF');
h = fspecial('unsharp',0.5); h = fspecial('unsharp',0.5);
I2 = filter2(h,I)/255; I2 = filter2(h,I)/255;
imshow(I) imshow(I)
figure, imshow(I2) figure, imshow(I2)
如图9a和图9b所示。 As shown in Figure 9a and Figure 9b.
相关命令: Related commands:
conv2, edge, filter2, fsamp2, fwind1, fwind2 conv2, edge, filter2, fsamp2, fwind1, fwind2
ftrans2 ftrans2
功能: Function:
通过频率转换设计二维FIR过滤器。 Design 2-D FIR Filters by Frequency Transformation.
语法: grammar:
h = ftrans2(b,t) h = ftrans2(b,t)
h = ftrans2(b) h = ftrans2(b)
举例 example
colormap(jet(64)) colormap(jet(64))
b = remez(10,[0 0.05 0.15 0.55 0.65 1],[0 0 1 1 0 0]); b = remez(10,[0 0.05 0.15 0.55 0.65 1],[0 0 1 1 0 0]);
[H,w] = freqz(b,1,128,'whole'); [H,w] = freqz(b,1,128,'whole');
plot(w/pi–1,fftshift(abs(H))) plot(w/pi–1,fftshift(abs(H)))
相关命令: Related commands:
conv2, filter2, fsamp2, fwind1, fwind2 conv2, filter2, fsamp2, fwind1, fwind2
fwind1 fwind1
功能: Function:
用一维窗口方法设计二维FIR过滤器。 Design a 2D FIR filter with a 1D window method.
语法: grammar:
h = fwind1(Hd,win) h = fwind1(Hd,win)
h = fwind1(Hd,win1,win2) h = fwind1(Hd,win1,win2)
h = fwind1(f1,f2,Hd,...) h = fwind1(f1,f2,Hd,...)
举例 example
[f1,f2] = freqspace(21,'meshgrid'); [f1,f2] = freqspace(21,'meshgrid');
Hd = ones(21); Hd = ones(21);
r = sqrt(f1.^2 + f2.^2); r = sqrt(f1.^2 + f2.^2);
Hd((r<0.1)|(r>0.5)) = 0; Hd((r<0.1)|(r>0.5)) = 0;
colormap(jet(64)) colormap(jet(64))
mesh(f1,f2,Hd) mesh(f1,f2,Hd)
相关命令: Related commands:
conv2, filter2, fsamp2, freqspace, ftrans2, fwind2 Conv2, filter2, fsamp2, freqspace, ftrans2, fwind2
fwind2 fwind2
功能: Function:
用二维窗口方法设计二维FIR过滤器。 Design a 2D FIR filter with a 2D window method.
语法: grammar:
h = fwind2(Hd,win) h = fwind2(Hd,win)
h = fwind2(f1,f2,Hd,win) h = fwind2(f1,f2,Hd,win)
举例 example
[f1,f2] = freqspace(21,'meshgrid'); [f1,f2] = freqspace(21,'meshgrid');
Hd = ones(21); Hd = ones(21);
r = sqrt(f1.^2 + f2.^2); r = sqrt(f1.^2 + f2.^2);
Hd((r<0.1)|(r>0.5)) = 0; Hd((r<0.1)|(r>0.5)) = 0;
colormap(jet(64)) colormap(jet(64))
mesh(f1,f2,Hd) mesh(f1,f2,Hd)
相关命令: Related commands:
conv2, filter2, fsamp2, freqspace, ftrans2, fwind1 conv2, filter2, fsamp2, freqspace, ftrans2, fwind1
经过这些复杂的操作之后图像数据已经可以用来进行分析。此时会用到一个很重要的操作,即边缘寻找。 edge After these complex operations the image data is ready for analysis. A very important operation will be used at this time, that is, edge finding. edge
功能: Function:
识别强度图像中的边界。 Identify boundaries in an intensity image.
语法: grammar:
BW = edge(I,'sobel') BW = edge(I,'sobel')
BW = edge(I,'sobel',thresh) BW = edge(I,'sobel',thresh)
BW = edge(I,'sobel',thresh,direction) BW = edge(I,'sobel',thresh,direction)
[BW,thresh] = edge(I,'sobel',...) [BW,thresh] = edge(I,'sobel',...)
BW = edge(I,'prewitt') BW = edge(I,'prewitt')
BW = edge(I,'prewitt',thresh) BW = edge(I,'prewitt',thresh)
BW = edge(I,'prewitt',thresh,direction) BW = edge(I,'prewitt',thresh,direction)
[BW,thresh] = edge(I,'prewitt',...) [BW,thresh] = edge(I,'prewitt',...)
BW = edge(I,'roberts') BW = edge(I,'roberts')
BW = edge(I,'roberts',thresh) BW = edge(I,'roberts',thresh)
[BW,thresh] = edge(I,'roberts',...) [BW,thresh] = edge(I,'roberts',...)
BW = edge(I,'log') BW = edge(I,'log')
BW = edge(I,'log',thresh) BW = edge(I,'log',thresh)
BW = edge(I,'log',thresh,sigma) BW = edge(I,'log',thresh,sigma)
[BW,threshold] = edge(I,'log',...) [BW,threshold] = edge(I,'log',...)
BW = edge(I,'zerocross',thresh,h) BW = edge(I,'zerocross',thresh,h)
[BW,thresh] = edge(I,'zerocross',...) [BW,thresh] = edge(I,'zerocross',...)
BW = edge(I,'canny') BW = edge(I,'canny')
BW = edge(I,'canny',thresh) BW = edge(I,'canny',thresh)
BW = edge(I,'canny',thresh,sigma) BW = edge(I,'canny',thresh,sigma)
[BW,threshold] = edge(I,'canny',...) [BW,threshold] = edge(I,'canny',...)
举例 example
I = imread('rice.GIF'); I = imread('rice. GIF');
BW1 = edge(I,'prewitt'); BW1 = edge(I,'prewitt');
BW2 = edge(I,'canny'); BW2 = edge(I,'canny');
imshow(BW1); imshow(BW1);
figure, imshow(BW2) figure, imshow(BW2)
如图10a和图10b所示。 As shown in Figure 10a and Figure 10b.
利用VC和Matlab的接口,用VC调用Matlab内核中的大量有用的图像数据处理功能完成以上图像处理操作。最后得到的数据就是正式建立算法的原始数据。这里将他定义为PCAL[640][480] 下面将对计算数据进行建模。 Using the interface between VC and Matlab, use VC to call a large number of useful image data processing functions in the Matlab kernel to complete the above image processing operations. The final data is the raw data for the formal establishment of the algorithm. Here it is defined as PCAL [640] [480] The calculation data will be modeled below.
首先看这个原始数据原型,当数据原型最理想的状况下如下所示: First look at the original data prototype. When the data prototype is ideal, it looks like this:
情况一:如图11所示,所有的獭兔被毛在显微镜下呈现的是无交叉。但是这是不可能的。最理想状况下是这样 Situation 1: As shown in Figure 11, all the coats of Rex rabbits show no cross under the microscope. But this is impossible. ideally like this
情况二:如图12所示,被毛交叉或重叠,这种情况很普片而且出现很多。 Situation 2: As shown in Figure 12, the coat is crossed or overlapped, which is very common and happens a lot.
情况三:被毛图像不清晰,边缘模糊。 Situation 3: The coat image is not clear and the edges are fuzzy.
这种情况即便是经过了去噪,模糊,滤波,边缘识别等操作之后仍然不能很好的判别。 This situation cannot be judged well even after denoising, blurring, filtering, edge recognition and other operations. ``
综上所示,即便是用复杂的人脑既人为识别,也很难辨识出,当一方面要求从獭兔被毛检测仪的结果出发,让被毛尽可能的方向一致,重叠减少。另一方面要从概率统计学的理论为依据寻早一个可行的统计方法出来。 To sum up, even with a complex human brain, it is difficult to identify. On the one hand, it is required to start from the results of the Rex Rabbit Coat Tester, so that the direction of the coat is as consistent as possible and the overlap is reduced. On the other hand, it is necessary to find a feasible statistical method based on the theory of probability and statistics.
从信号分析处理理论出发,设计出一个可行的数学模型算法,再加上概率统计学的计算可以基本上达到獭兔被毛检测的结果误差要求。 Starting from the signal analysis and processing theory, a feasible mathematical model algorithm is designed, coupled with the calculation of probability and statistics, which can basically meet the error requirements of the rex rabbit coat detection results. ``
信号分析一般处理的信号都是点对点的数据,序列化的数据。假设所有的毛发都是从图像的上方向下“生长”,这种要求可以通过数据采集头的结构调整办到。那么假设所有的毛发都从图像上方向下生长,可以肯定的是,如果从左至右的对图像进行切片操作,如图13所示。 Signal analysis generally deals with signals that are point-to-point data and serialized data. Assuming that all hairs "grow" downward from the top of the image, this requirement can be achieved by adjusting the structure of the data acquisition head. Then assuming that all the hairs grow downward from the top of the image, it is certain that if the image is sliced from left to right, as shown in Figure 13.
可以看到红线所经过的位置,像素点的变换可以用一个连续的序列化信号进行表示: You can see the position of the red line, and the transformation of the pixel point can be represented by a continuous serialized signal:
例如:黑,黑,黑,白,白,白,黑,黑,黑,白,白。这种序列化的数据。 For example: black, black, black, white, white, white, black, black, black, white, white. This serialized data.
当然实际的图像通过上面的操作不可能得到如此分明的数据。灰度值是从0-255,0代表极黑,255代表极白,这里给出一组序列化之后的实际数据。 Of course, it is impossible to obtain such clear data from the actual image through the above operations. The gray value is from 0-255, 0 represents extremely black, 255 represents extremely white, here is a set of actual data after serialization.
从图14可以看出来实际上,从某一行的图像灰度值从左至右一共640个数据,这个数据的变化就反映了灰度值的变化。建立的数据模型,就要求识别出底色的灰度平均值,以这个值为准,定义出一根阈值线,这根阈值线的值就可以将数据被毛部分的像素位置和布什被毛部分的像素位置分类出来。这样就可以将连续的被毛值部分得到,这个连续的被毛副本的点长度就是这一个切片组里面的被毛“假直径”,最所以定义为“假直径”是因为这个直径不是和毛发生长方向所垂直,需要修正,从这里可以看出,如图15所示的一个统计结果。 It can be seen from Figure 14 that in fact, there are a total of 640 data from the left to right of the image gray value of a certain row, and the change of this data reflects the change of the gray value. The established data model requires the identification of the average gray level of the background color, and based on this value, a threshold line is defined. Part of the pixel position is sorted out. In this way, the continuous coat value can be partially obtained. The point length of this continuous coat copy is the "false diameter" of the coat in this slice group. The reason why it is defined as "false diameter" is because this diameter is not related to hair. The growth direction is vertical and needs to be corrected. It can be seen from here that a statistical result is shown in Figure 15.
如上图所示,假如在一切片组里面寻找到4组在阈值线之上的副本,那么可以看出连续的被毛颜色部分包含了4组,可以认为这个4组就是这一切片部分的毛发经过根数。如果对一幅图做N个切片,那么N个切片再经过概率统计,可以得到一个可信的毛发根数值,这个值的误差应该在统计误差之内接受。 As shown in the figure above, if 4 groups of copies above the threshold line are found in the slice group, then it can be seen that the continuous coat color part contains 4 groups, which can be considered as the hair of this slice part Through the number of roots. If N slices are made on a picture, then after the N slices are subjected to probability statistics, a credible hair root value can be obtained, and the error of this value should be accepted within the statistical error.
但是这里又会出现一种情况,毛发交叉,重叠,特别是当2根或2根以上毛发重叠交叉之后,会是单一切片组里面某一个毛发组里面的数据量大大超过单一被毛通过切片组的正常像素数目。所以还要设计一个数学处理公式来将重叠毛发进行分割,分割之后单一切片组里面的毛发组数就是毛发根数。将N个切片组的毛发根数值进行,去掉最大,最小之后,叠平均之后的值就是可信的毛发根数。 But there will be another situation here, the hairs cross and overlap, especially when 2 or more hairs overlap and cross, the amount of data in a certain hair group in a single slice group will greatly exceed that of a single coat through the slice group normal pixel count. So it is necessary to design a mathematical processing formula to divide the overlapping hairs. After the division, the number of hair groups in a single slice group is the number of hair roots. Carry out the hair root values of N slice groups, remove the largest and smallest values, and the value after stacking and averaging is the credible number of hair roots. ``
至于毛发直径,需要将不同切片组的直径进行比较,设计出一个斜率组,这个斜率组代表的是,每一个毛发切片组,出现毛发集合位置的信息形成一个集合组,生成一个直线公式,这个直线公式的斜率就是毛发直径的修正值,修正之后,可以得到毛发的真直径。 As for the hair diameter, it is necessary to compare the diameters of different slice groups and design a slope group. This slope group represents that for each hair slice group, the information of the hair collection position forms a set group and generates a straight line formula. The slope of the straight line formula is the correction value of the hair diameter. After correction, the true diameter of the hair can be obtained. ``
这里详细说明一下数据阈值线的设计和分类统计的方法: Here is a detailed description of the design of the data threshold line and the method of classification statistics:
从上面知道,每一个切片组,实际上就是图像数据对应的每一行的数据序列。如果毛发穿过了这个列,那么只有毛发穿过的部分是毛发的颜色,其他的都是背景色,由于背景色定义为了黑色,即便是有光照干扰,也不会呈现出毛发的颜色。所以很好判别。 From the above, we know that each slice group is actually the data sequence of each row corresponding to the image data. If the hair passes through this column, only the part where the hair passes is the color of the hair, and the rest is the background color. Since the background color is defined as black, even if there is light interference, the color of the hair will not appear. So it's easy to judge. ``
例如可以这样来看颜色的走向,开始是背景色,从左至右开始移动,当开始出现被毛部分是,颜色开始变浅,就是灰度值从小开始变大,当大到一定值是,就是被毛的边缘之后位置一部分的抖动,但是这种数值的抖动都在被毛颜色范围之内,之后开始慢慢离开被毛部分,当离开之后再次从大变小的变化,进入背景色部分,之后循环,需要统计的数据是,什么时候开始出现被毛,什么时候离开被毛部分,这个维持的被毛部分就是被毛的“假长度”,一共有多少组被毛出现副本,就是被毛在这一切片组上的根数。 For example, you can look at the direction of the color in this way. It starts with the background color and moves from left to right. When the fur part starts to appear, the color starts to become lighter, that is, the gray value starts to increase from a small value. When it reaches a certain value, It is the jitter of the part behind the edge of the coat, but the jitter of this value is within the range of the coat color, and then slowly leaves the coat part, and when it leaves, it changes from large to small again and enters the background color part , and then cycle, the data that needs to be counted is when the coat starts to appear and when it leaves the coat part. The maintained coat part is the "false length" of the coat. The number of hairs on this slice group.
定义这一个切片组的数组为B【640】 The array defining this slice group is B [640]
首先计算出数组的最大灰度值Bmax,最小灰度值Bmin,将BY=(Bmax+Bmin)/2定义为阈值线。那么可以设计如下的阈值线统计部分程序。由于会出现像素小幅抖动的问题,还要设计出一个阈值线抖动噪音处理方法,定义颜色抖动像素值不超过5,那么将BY上下5个像素的值进行量化,如果某一像素值大于BY-5,小于BY+5,那么都将这个值认为是BY-5,那么这些值始终小于BY+5,那么只要发现BY+5以上的值,才会认为像素值穿越了阈值线BY,这样就可以将小幅度抖动去掉。 First calculate the maximum gray value Bmax and the minimum gray value Bmin of the array, and define BY=(Bmax+Bmin)/2 as the threshold line. Then the threshold line statistics part program can be designed as follows. Due to the problem of small pixel jitter, a threshold line jitter noise processing method must be designed to define that the color jitter pixel value does not exceed 5, then quantize the values of the upper and lower 5 pixels of BY, if a pixel value is greater than BY- 5, less than BY+5, then this value is regarded as BY-5, then these values are always less than BY+5, then only when a value above BY+5 is found, the pixel value will be considered to have crossed the threshold line BY, so that Small jitter can be removed.
数据统计结果报告的设计 Design of statistical results report
统计结果报告的设计,必须按照通用分析软件的设计要求来实施。 大致需要包括如下几个内容: The design of the statistical result report must be implemented in accordance with the design requirements of the general analysis software. It generally needs to include the following contents:
1)单幅图像统计,即使点击“采集”之后,图像开始采集,之后需要对当前图像实施进行分析统计。 1) Single image statistics, even after clicking "collect", the image starts to be collected, and then the current image needs to be analyzed and counted.
2)单幅图像统计之后,必须添加到备用数据库,例如:当对一只獭兔多个部位进行统计之后,需要将这些统计的若干次数据,进行整合,平均处理。 2) After a single image is counted, it must be added to the backup database. For example, after counting multiple parts of a Rex rabbit, it is necessary to integrate and average the data of several counts. ``
3)形成报表,直方图,便于用户观察。 3) Form reports and histograms, which are convenient for users to observe.
4)可以对每只獭兔测量的结果进行保存,并且随时可以调入。 4) The measured results of each rex rabbit can be saved and loaded at any time.
5)打印功能,由于利用的是最先进的UMPC嵌入式操作系统技术,所以掌上便携系统支持Windows打印功能,所以只需要接上通用的打印机,只需要编写需要的打印数据格式即可。 5) Printing function, because the most advanced UMPC embedded operating system technology is used, the handheld portable system supports Windows printing function, so it only needs to be connected to a general-purpose printer, and only need to write the required printing data format. ``
整个软件设计流程用到了DirectShow,GDI图像编程,利用VC++编程工具编写软件。 The entire software design process uses DirectShow, GDI image programming, and uses VC++ programming tools to write software.
整个软件的实现最关键的几步是: The most critical steps in the realization of the entire software are:
1、数学模型的建立 1. Establishment of mathematical model
数学模型的好坏,直接影响了数据结果的可信度,重复度,甚至直接影响了能否测量出结果。 The quality of the mathematical model directly affects the reliability and repeatability of the data results, and even directly affects whether the results can be measured. ``
2、数据源的采集好坏 2. The collection of data sources is good or bad
所谓数据源的好坏前面也提到过,这个过程是数据模型建立之外的最难的一步,毕竟计算机软件设计的再好,模型建立的再智能化,数据源不理想,也没法实现测量。计算机编程设计的分析功能不能和人脑相比,也许人的肉眼能够区分的东西,通过计算机并不能实现。所以要在计算机能力范围之内设计数据模型,和收集采集处理数据源。 The quality of the so-called data source has also been mentioned before. This process is the most difficult step besides the establishment of the data model. After all, no matter how well the computer software is designed, no matter how intelligent the model is established, the data source is not ideal, and it cannot be realized. Measurement. The analysis function of computer programming design cannot be compared with that of the human brain. Perhaps the things that can be distinguished by the human naked eye cannot be realized by the computer. Therefore, it is necessary to design data models within the scope of computer capabilities, and collect, collect, and process data sources. ``
3.最理想的数据源 3. The most ideal data source
最理想的数据源是底色和毛发颜色色阶分别明显,交叉部分少。这些都要求摄像头的清晰,底色(环境干扰)等各种因素的处理。毛发交叉的问题可以解决,这些都可以通过有效数据范围来进行分析处理。 The most ideal data source is that the background color and hair color have obvious color gradations, and there are few intersections. These all require the clarity of the camera, background color (environmental interference) and other factors to be processed. The problem of hair crossing can be solved, and these can be analyzed and processed through the effective data range. ``
数据模型的是整个软件设计的关键,用到的分析方法包括图像灰度,腐蚀,滤波等方法,这些方法都是排除环境色干扰的有效方法,至于毛发直径,根数统计这些涉及到聚集统计,几何学,统计学,概率统计(可信度)等分析。 The data model is the key to the entire software design. The analysis methods used include image grayscale, corrosion, filtering and other methods. These methods are effective methods to eliminate environmental color interference. As for hair diameter and root number statistics, these involve aggregation statistics , geometry, statistics, probability statistics (credibility) and other analysis.
到此为止已经得到了獭兔毛发的直径和獭兔毛发的根数的结果值,但是这些数值还是不可信的,因为这样的数据结果还没有进行数据校验,没有进行数据后期处理。因为算法是死的,信号(采集的图像)是千变万化的,得到的结果也有真值,假值。 So far, the results of the diameter of the hair of the rex rabbit and the number of roots of the hair of the rex rabbit have been obtained, but these values are still unreliable, because such data results have not been verified and post-processed. Because the algorithm is dead, the signal (collected image) is ever-changing, and the results obtained also have true and false values. ``
所谓真值,就是处于有效数据范围之内的,例如一根獭兔的毛发直径不可能小到1um,也不可能大到100乃至200多um,所以数据还需要进行校验。需要设计一个理想的处理模块来排除假值,留下真值。 The so-called true value is within the range of valid data. For example, the diameter of a rex rabbit’s hair cannot be as small as 1um, nor can it be as large as 100 or even 200um, so the data still needs to be verified. An ideal processing module needs to be designed to exclude false values and leave true values. ``
第一步,对阈值线分割得到毛发直径的算法进行改进。进行处理的数据都是一个串数组,简单来说就是一串数,640个整数(范围在0~255)。通过信号处理数学方法,设计了一个计算直径的算法。(MAX+MIN)/2作为阈值线的值,有时可能出错,假如MAX或者MIN偏差特别大,这样会导致阈值线望极大或者极小偏向过大,导致直径计算结果偏大,偏小。因此,设计的模型如下: The first step is to improve the algorithm for obtaining hair diameter by threshold line segmentation. The data to be processed is a string array, which is simply a string of numbers, 640 integers (ranging from 0 to 255). Through signal processing mathematical method, an algorithm for calculating the diameter is designed. (MAX+MIN)/2 is used as the value of the threshold line, and sometimes it may be wrong. If the deviation of MAX or MIN is particularly large, this will cause the threshold line to look too large or too small, resulting in a larger or smaller diameter calculation result. Therefore, the designed model is as follows:
1.计算出最大值MAX,最小值MIN。 1. Calculate the maximum value MAX and the minimum value MIN. ``
2.去掉MAX,MIN对应的数值,回到步骤1,将留下的数据在进行去除最大,最小,如此循环5次之后,直到上一轮去掉的MAX和下一轮去掉的MAX相差不到5以内即可。 2. Remove the values corresponding to MAX and MIN, return to step 1, and remove the maximum and minimum of the remaining data. After 5 cycles, the difference between the MAX removed in the previous round and the MAX removed in the next round is less than Within 5 is fine.
3.剩下的数据串将是最后计算的数组。计算数据串的平均值,将这个平均值作为阈值线。 3. The remaining data string will be the last calculated array. Calculate the average value of the data string and use this average value as the threshold line. ``
4.添加噪音去除算法。 4. Add noise removal algorithm. ``
所谓去噪算法:例如,数据出现图16所示情况。 The so-called denoising algorithm: For example, the data appears as shown in Figure 16.
可以看到图中过阈值线第一次的位置有个小噪音,如果不加判断,将会导致噪音部分出现一个很小的直径值,这个将直接导致结果数据不可用。图像数据极为丰富,而且受环境影响很大,所以必须加以排除。 It can be seen that there is a small noise at the first position of the threshold line in the figure. If no judgment is made, a small diameter value will appear in the noise part, which will directly cause the resulting data to be unusable. Image data is extremely rich and heavily influenced by the environment, so it must be excluded. ``
排除算法如下,阈值线V,设计阈值线V1,阈值线V2,V1=V-T,V2=V+T。T的大小根据人为需要,如果需要排除的噪音范围大点,T就大点,需要排除的噪音范围小点,T就小点。然后判断的时候这样计算: 上升边数据值前一点R1,后一点R2,如果R1<=V1且R2>=V2,这样的结果才算是真的穿越了阈值线,否则将R2设为下一次判断的R1=V1。同理下降边数据值前一点R1,后一点R2,如果R1>=V2且R2<=V1,这样的结果才算是真的穿越了阈值线,否则将R2设为下一次判断的R1=V2。 一个完整上升和一个完整的下降就是一个直径的范围点的索引差值。这个差值就是直径所占的像素个数,个数即可换算为直径。 The exclusion algorithm is as follows, threshold line V, design threshold line V1, threshold line V2, V1=V-T, V2=V+T. The size of T is based on human needs. If the range of noise to be excluded is larger, T should be larger, and if the range of noise to be excluded is smaller, T should be smaller. Then calculate as follows when judging: The data value of the rising edge is one point before R1 and one point after R2. If R1<=V1 and R2>=V2, such a result is considered to have crossed the threshold line, otherwise set R2 as the next judgment R1 = V1. Similarly, the data value of the falling edge is R1 at the previous point and R2 at the next point. If R1>=V2 and R2<=V1, the result is considered to have crossed the threshold line. Otherwise, set R2 to R1=V2 for the next judgment. A full rise and a full fall are the index difference of a range point of one diameter. This difference is the number of pixels occupied by the diameter, and the number can be converted into a diameter. ``
得到一幅图的毛发直径数据串,大约至少应该有30组,将这30组数据的数组长度分别罗列出来,排除最大个数的5组,最小个数的5组,剩下20组作为数据计算。 Get the hair diameter data string of a picture, there should be at least 30 groups, list the array lengths of these 30 groups of data separately, exclude the largest number of 5 groups, the smallest number of 5 groups, and the remaining 20 groups as data calculate. ``
20组数据就是20组直径值,每组数组的个数,就是每组数据计算出的直径个数,也就是毛发的根数。其中个数比较小的肯定是毛发在图像上粘连的部分,这样才会导致毛发根减小。设计如下算法排除: The 20 sets of data are 20 sets of diameter values, and the number of arrays in each set is the number of diameters calculated by each set of data, that is, the number of hairs. The smaller number of them must be the part where the hair sticks to the image, which will lead to the reduction of the hair root. Design the following algorithm to exclude:
1.将每组数据进行排查,毛发直径经过比例换算之后【(数值×屏幕实际实现宽度)/640】大于40以上的除2,生成2个新的数值,小于10的直接排除掉,放入备份数组,所谓备份数组就是假值表,这些假值已然要放入统计结果数组里面。 1. Check each group of data. After the hair diameter is proportionally converted [(value × actual width of the screen)/640] if it is greater than 40, divide it by 2 to generate 2 new values. If it is less than 10, directly exclude it and put it in The backup array, the so-called backup array is the false value table, and these false values have to be put into the statistical result array. ``
2.计算每组数据根数值,将相同根数的数组进行归类。例如20根5组,21根6组,22根7组…… 2. Calculate the root value of each group of data, and classify the arrays with the same number of roots. For example, 5 groups of 20 roots, 6 groups of 21 roots, 7 groups of 22 roots...
3.将拥有最多相同根数的数组的根数作为毛发基本根数M,然后将比M大2以内,小2以内的数组,去掉最小或者最大的毛发值,将数组根数放到和基本毛发根数一样的M之后,也归到最多相同根数数组里面。例如:20根5组,21根6组,22根7组,25根2组。那么25根的那2组去掉。21根的每组数据去掉一个最小值归为20根组里,22根的每组数据去掉一个最小值也归为20根组里,这样20根的组数为18组。那么将这18组数据依次从1-20根,相互叠加起来再除去组数,得到实际的每根毛发的直径平均值。 G[18][20];实际上最后得到的就是这样一个二维数组。 for(I=0,I<20,I++) { for(j=0;j<18;j++) { AVG[I]=AVG+G[j][I]; } AVG[I]=AVG[I]/18; } 3. Use the number of the array with the most same number of roots as the basic number of hairs M, and then remove the smallest or largest hair value for the arrays that are within 2 greater than M and smaller than 2, and put the number of hairs into the basic number of hairs After M with the same number of hair roots, they are also classified into the array with the same number of hairs at most. For example: 5 groups of 20 roots, 6 groups of 21 roots, 7 groups of 22 roots, and 2 groups of 25 roots. Then the 2 groups with 25 roots are removed. Each group of data of 21 roots removes a minimum value and belongs to the group of 20 roots, and each group of data of 22 roots removes a minimum value and also belongs to the group of 20 roots, so the number of groups of 20 roots is 18 groups. Then these 18 groups of data are sequentially stacked from 1 to 20, and then the number of groups is removed to obtain the actual average diameter of each hair. G[18][20]; In fact, the final result is such a two-dimensional array. for(I=0,I<20,I++) { for(j=0;j<18;j++) { AVG[I]=AVG+G[j][I]; } AVG[I]=AVG[I]/ 18; }
可以得到如下一个18个元素的数组AVG[18],那么毛发根数18根,数组值对应的就是毛发直径。 The following 18-element array AVG[18] can be obtained, then the number of hairs is 18, and the array value corresponds to the hair diameter. ``
这个数组就是最后得到的真值数据,填入列表进入后期分析。 This array is the final truth value data, fill in the list and enter the later analysis.
本发明已经通过上述实施例进行了说明,但应当理解的是,上述实施例只是用于举例和说明的目的,而非意在将本发明限制于所描述的实施例范围内。此外本领域技术人员可以理解的是,本发明并不局限于上述实施例,根据本发明的教导还可以做出更多种的变型和修改,这些变型和修改均落在本发明所要求保护的范围以内。本发明的保护范围由附属的权利要求书及其等效范围所界定。 The present invention has been described through the above-mentioned embodiments, but it should be understood that the above-mentioned embodiments are only for the purpose of illustration and description, and are not intended to limit the present invention to the scope of the described embodiments. In addition, those skilled in the art can understand that the present invention is not limited to the above-mentioned embodiments, and more variations and modifications can be made according to the teachings of the present invention, and these variations and modifications all fall within the scope of the claimed invention. within the range. The protection scope of the present invention is defined by the appended claims and their equivalent scope.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2013100728438A CN103234472A (en) | 2013-03-07 | 2013-03-07 | Detecting method and detecting system for fiber fineness and density of Rex-rabbit clothing hair |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2013100728438A CN103234472A (en) | 2013-03-07 | 2013-03-07 | Detecting method and detecting system for fiber fineness and density of Rex-rabbit clothing hair |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103234472A true CN103234472A (en) | 2013-08-07 |
Family
ID=48882524
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2013100728438A Pending CN103234472A (en) | 2013-03-07 | 2013-03-07 | Detecting method and detecting system for fiber fineness and density of Rex-rabbit clothing hair |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103234472A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106091955A (en) * | 2016-04-21 | 2016-11-09 | 克拉玛依市白碱滩区林牧生态研究院 | A rapid detection method for animal fiber fineness |
CN106091956A (en) * | 2016-04-21 | 2016-11-09 | 克拉玛依市白碱滩区林牧生态研究院 | A rapid detection method and system for the fineness and length of animal fibers |
CN109544627A (en) * | 2018-11-22 | 2019-03-29 | 深圳市吉斯迪科技有限公司 | A kind of intelligence hair analysis device and analysis method |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6032071A (en) * | 1994-12-01 | 2000-02-29 | Norbert Artner | Skin examination device |
CN1451944A (en) * | 2003-05-09 | 2003-10-29 | 河北圣奥达科技开发有限公司 | Method for measuring length of textile fibre |
JP2005205213A (en) * | 2004-01-20 | 2005-08-04 | Siemens Ag | Method and apparatus for inspecting subject skin |
CN1793844A (en) * | 2005-11-30 | 2006-06-28 | 江苏科技大学 | Grade test method and device of textile colour fastness colour difference |
WO2010044650A1 (en) * | 2008-10-16 | 2010-04-22 | Pardo Guzman Dino Alejandro | Mobile device and interactive universal classification method for meat using computer vision |
CN101893557A (en) * | 2009-05-20 | 2010-11-24 | 中国农业科学院兰州畜牧与兽药研究所 | Rapid and non-destructive identification method of animal fur species |
CN102288607A (en) * | 2011-06-20 | 2011-12-21 | 江南大学 | Woven fabric count detector based on digital microscope |
-
2013
- 2013-03-07 CN CN2013100728438A patent/CN103234472A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6032071A (en) * | 1994-12-01 | 2000-02-29 | Norbert Artner | Skin examination device |
CN1451944A (en) * | 2003-05-09 | 2003-10-29 | 河北圣奥达科技开发有限公司 | Method for measuring length of textile fibre |
JP2005205213A (en) * | 2004-01-20 | 2005-08-04 | Siemens Ag | Method and apparatus for inspecting subject skin |
CN1793844A (en) * | 2005-11-30 | 2006-06-28 | 江苏科技大学 | Grade test method and device of textile colour fastness colour difference |
WO2010044650A1 (en) * | 2008-10-16 | 2010-04-22 | Pardo Guzman Dino Alejandro | Mobile device and interactive universal classification method for meat using computer vision |
CN101893557A (en) * | 2009-05-20 | 2010-11-24 | 中国农业科学院兰州畜牧与兽药研究所 | Rapid and non-destructive identification method of animal fur species |
CN102288607A (en) * | 2011-06-20 | 2011-12-21 | 江南大学 | Woven fabric count detector based on digital microscope |
Non-Patent Citations (1)
Title |
---|
陈芸莹: "便携式獭兔被毛测试仪的研制与开发", 《硕士学位论文》, 15 January 2012 (2012-01-15) * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106091955A (en) * | 2016-04-21 | 2016-11-09 | 克拉玛依市白碱滩区林牧生态研究院 | A rapid detection method for animal fiber fineness |
CN106091956A (en) * | 2016-04-21 | 2016-11-09 | 克拉玛依市白碱滩区林牧生态研究院 | A rapid detection method and system for the fineness and length of animal fibers |
CN109544627A (en) * | 2018-11-22 | 2019-03-29 | 深圳市吉斯迪科技有限公司 | A kind of intelligence hair analysis device and analysis method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109961426B (en) | A kind of detection method of human face skin | |
JP2021166062A (en) | Focal point weighting machine learning classifier error prediction for microscope slide image | |
JP6110992B2 (en) | Image-adaptive physiologically relevant color separation | |
CN112215790A (en) | KI67 index analysis method based on deep learning | |
JP2022506135A (en) | Segmentation of 3D intercellular structures in microscopic images using iterative deep learning flows that incorporate human contributions | |
CN113129281B (en) | A deep learning-based detection method for wheat stalk cross-section parameters | |
CN107066829A (en) | Pathological analysis system and method based on cloud computing | |
CN104000593B (en) | Skin test method | |
CN101739570A (en) | Cotton foreign fiber online classifying method and system | |
Behera | Image-processing in textiles | |
CN109829879B (en) | Method and device for detecting vascular bundle | |
CN110647876B (en) | Blood smear full-field intelligent analysis method | |
CN111160451A (en) | Flexible material detection method and storage medium thereof | |
Schnepf et al. | A practical primer for image-based particle measurements in microplastic research | |
CN105023272A (en) | Crop leaf insect pest detection method and system | |
CN118505693B (en) | Holographic printing quality detection method and system based on computer vision | |
CN115184283A (en) | Intelligent screening method and system for traditional Chinese medicine decoction pieces | |
CN118351100A (en) | Image definition detection and processing method based on deep learning and gradient analysis | |
JP2006507579A (en) | Histological evaluation of nuclear polymorphism | |
CN103234472A (en) | Detecting method and detecting system for fiber fineness and density of Rex-rabbit clothing hair | |
CN119540231B (en) | Method, device, equipment and storage medium for detecting seed quality | |
CN105046265A (en) | Iris image intestinal loop area detection method based on texture difference | |
CN112837271B (en) | Melon germplasm resource character extraction method and system | |
CN118014443B (en) | Medicine monitoring method and device | |
CN117686411B (en) | Flow cytometer detection data analysis method, medium and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20130807 |