Program and detection device
A computer program analyzes optical images of woven fabrics to detect specific portions, including warp and weft threads, by using positional information and attribute analysis, addressing the limitations of existing techniques.
Patent Information
- Application Number
- JP2023184814
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-10-27
- Publication Date
- 2025-05-13
AI Technical Summary
Existing techniques for detecting specific portions of a fabric, such as thread loss, are limited in their ability to accurately identify and analyze the positional relationships and attributes of warp and weft threads.
A computer program is implemented to detect specific portions of a woven fabric by analyzing optical images, using positional information to identify regions of warp and weft threads, and detecting attribute differences and gap regions.
The program effectively detects specific parts of the fabric, including attribute differences and gap regions, by utilizing positional information and attribute analysis, thereby improving the accuracy of fabric inspection.
Smart Images

Figure 2025073763000001_ABST
Abstract
Description
[Technical field]
[0001] The present specification relates to a technique for detecting a specific portion of a textile fabric. [Background technology]
[0002] Woven fabrics may have abnormalities such as loose threads. Inspection devices have been proposed to inspect woven fabrics for abnormalities. For example, Patent Document 1 proposes a technique for calculating the texture period of a woven fabric, setting a comparison region of image data based on the texture period, extracting statistics from the image data in the comparison region, and extracting defects based on the statistics. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Japanese Patent Application Publication No. 10-121368 Summary of the Invention [Problem to be solved by the invention]
[0004] There was room for improvement when it came to detecting specific parts of the fabric.
[0005] This specification discloses a technique for detecting specific portions of a textile fabric. [Means for solving the problem]
[0006] The technology disclosed in this specification can be realized in the following application examples.
[0007] [Application Example 1] A program that causes a computer to realize an area detection function that detects multiple areas, including multiple warp areas and multiple weft areas, from an image representing a woven fabric having multiple warp threads and multiple weft threads that has been optically read, wherein each of the multiple warp areas represents a portion of the multiple warp threads that is visible and not hidden by the multiple weft threads, and each of the multiple weft areas represents a portion of the multiple weft threads that is visible and not hidden by the multiple warp threads, a function that determines positional information related to the positional relationship between the multiple warp areas and the multiple weft areas, and a function that uses the positional information to detect a specific portion of the woven fabric.
[0008] According to this configuration, a specific portion of the fabric can be appropriately detected by using position information related to the positional relationship between a plurality of warp regions and a plurality of weft regions.
[0009] [Application Example 2] A program having a function of detecting a plurality of regions including a plurality of warp regions and a plurality of weft regions from an image representing a woven fabric having a plurality of warp threads and a plurality of weft threads that has been optically read, wherein each of the plurality of warp regions represents a portion of the plurality of warp threads that is visible without being hidden by the plurality of weft threads, and each of the plurality of weft regions represents a portion of the plurality of weft threads that is visible without being hidden by the plurality of warp threads, and wherein one of the function, an attribute of each of the plurality of warp regions, and an attribute of each of the plurality of weft regions is selected from the above function, a function of acquiring area attribute information including one or both of color and width by analyzing the image, the attributes including one or both of color and width; and a function of detecting attribute difference portions including one or both of a portion where a warp attribute differs from the reference attribute of the warp thread and a portion where a weft attribute differs from the reference attribute of the weft thread, using reference information representing one or both of a reference attribute of each of the plurality of warp threads and a reference attribute of each of the plurality of weft threads and the area attribute information.
[0010] According to this configuration, the attribute difference portion can be appropriately detected by using the reference information and the area attribute information.
[0011] [Application Example 3] A program that causes a computer to realize the following functions: detecting multiple gap areas between multiple warp threads and multiple weft threads from an image representing a woven fabric having the multiple warp threads and multiple weft threads that has been optically read; and detecting gap difference portions, which are gap areas having a size different from a reference size, using the multiple gap areas.
[0012] According to this configuration, the gap difference portion can be appropriately detected by using a plurality of gap regions.
[0013] The technology disclosed in this specification can be realized in various forms, for example, as a detection method and detection device, a computer program for realizing the functions of those methods or devices, a recording medium (e.g., a non-transitory recording medium) on which that computer program is recorded, and the like. [Brief description of the drawings]
[0014] [Figure 1] FIG. 1 is an explanatory diagram illustrating a data processing device according to an embodiment; [Diagram 2] FIG. 1 is a perspective view showing an example of a scanner 100. [Diagram 3] 13 is a flowchart illustrating an example of an inspection process. [Figure 4] 13A to 13C are diagrams showing examples of images processed in the inspection process. [Diagram 5] 10 is a flowchart illustrating an example of a process for acquiring information on a warp region, a weft region, and a gap region. [Figure 6] 13(A)-(C) are diagrams showing examples of warp regions, weft regions, and gap regions. [Figure 7] 13 is a flowchart illustrating an example of a division process. [Figure 8](A) and (B) are diagrams showing an example of multiple warp regions Ap and multiple weft regions Af. (C) is a diagram showing an example of a method for calculating the length of the warp region Ap. (D) is a diagram showing an example of the correspondence relationship between the length and the number of divisions. (E) is a diagram showing another example of the correspondence relationship between the length and the number of divisions. [Figure 9] 13A and 13B are diagrams showing an example of a plurality of warp regions Ap and a plurality of weft regions Af, and FIG. 13C is a diagram showing the correspondence between the center Ct and the type of region. [Figure 10] 13 is a flowchart illustrating an example of a connection process. [Figure 11] 13(A)-(F) are diagrams showing examples of connections between warp regions Ap and weft regions Af. [Figure 12] 13 is a flowchart illustrating an example of a comparison process. [Figure 13] 1A is a diagram showing an example of a comparison process between a crossing pattern and a reference crossing pattern, and FIG. 1B is a diagram showing an example of a comparison process between a color pattern and a reference color pattern. [Figure 14] 1A is a diagram showing an example of a width calculation method, FIG. 1B is a diagram showing a plurality of warp regions Ap associated with one warp thread Wp, and FIG. 1C is a diagram showing a scanned image I20. [Figure 15] 13 is a flowchart illustrating an example of a comparison process. [Figure 16] 1A is a diagram showing an example of a warp region Ap, a weft region Af, and a gap region Ag; FIG. 1B is a diagram showing an example of the size of one gap region Ag; and FIG. 1C is a diagram showing an example of the reference size. [Figure 17] 10 is a flowchart showing a second embodiment of the process for acquiring information on the warp area Ap and the weft area Af. [Figure 18] 13A is a diagram showing an example of a portion of a scanned image I20, and FIG. 13B is a diagram showing an example of a detection result. [Figure 19] 13A to 13G are diagrams showing examples of methods for determining the type of a candidate region. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0015] A. First Example: A1. Equipment configuration: 1 is an explanatory diagram showing a data processing device according to an embodiment. The data processing device 200 is, for example, a personal computer. The data processing device 200 performs various data processing for inspecting the appearance of an object (a woven fabric in this embodiment). Hereinafter, it is assumed that the appearance of a woven fabric 700 is inspected.
[0016] The data processing device 200 includes a processor 210, a storage device 215, a display unit 240, an operation unit 250, a graphics processing unit 260 (referred to as GPU 260), and a communication interface 270. These elements are connected to each other via a bus. The storage device 215 includes a volatile storage device 220 and a non-volatile storage device 230.
[0017] The processor 210 is a device configured to perform data processing, and is, for example, a central processing unit (CPU) or a system on a chip (SoC). The volatile storage device 220 is, for example, a dynamic random access memory (DRAM), and the non-volatile storage device 230 is, for example, a flash memory. The non-volatile storage device 230 stores data of a program 231 and an object detection model 300. In this embodiment, the object detection model 300 is a program module that forms a machine learning model. Details of the program 231 and the object detection model 300 will be described later.
[0018] The display unit 240 is a device configured to display images, such as a liquid crystal display or an organic EL display. The operation unit 250 is a device configured to receive operations by a user, such as a button, a lever, or a touch panel overlaid on the display unit 240. The display unit 240 and the operation unit 250 may form a so-called touch screen. The user can input various requests and instructions to the data processing device 200 by operating the operation unit 250.
[0019] The GPU 260 is a computing device configured to execute various numerical calculations such as image processing, machine learning, etc. The GPU 260 executes various calculations according to instructions from the processor 210. Note that a driver program (not shown) for controlling the GPU 260 may be provided by the manufacturer of the GPU 260.
[0020] The communication interface 270 is an interface for communicating with other devices (e.g., one or more of a USB interface, a wired LAN interface, an IEEE802.11 wireless interface, and an industrial camera interface (e.g., CameraLink, CoaXPress, etc.)). In this embodiment, the communication interface 270 is connected to a scanner 100. The scanner 100 optically reads the textile 700 and generates data of the read image.
[0021] 2 is a perspective view showing an example of the scanner 100. In the figure, a first direction D1 and a second direction D2 indicate a horizontal direction, and a third direction D3 indicates a vertically upward direction. The first direction D1 and the second direction D2 are perpendicular to each other.
[0022] In this embodiment, the scanner 100 is a so-called flatbed scanner. The scanner 100 includes a housing 190 and a cover 192 attached to the upper side of the housing 190 in an openable and closable manner. The upper surface of the housing 190 includes a frame 193 and a support base 194 arranged inside the frame 193. The support base 194 is a substantially rectangular transparent plate (e.g., a glass plate). The upper surface of the support base 194 is a support surface Us that supports an object to be read (e.g., a textile 700).
[0023] The scanner 100 includes a sensor unit 120, a conveying device 130, and a control device 140. These devices 120, 130, and 140 are arranged inside a housing 190. The sensor unit 120 is arranged below a support stand 194. In this embodiment, the sensor unit 120 is a one-dimensional image sensor that optically reads an object (here, a textile 700) on a support surface Us. The sensor unit 120 is a rod-shaped device that includes a light source 121 extending in a first direction D1 and a plurality of reading sensors 122 arranged side by side in the first direction D1. The reading sensors 122 are photoelectric conversion elements such as a Charge Coupled Device (CCD) or a Complementary Metal Oxide Semiconductor (CMOS). The sensor unit 120 illuminates the fabric 700 on the support table 194 with light from the light source 121 and optically reads the light reflected from the fabric 700 with the read sensor 122, thereby outputting data representative of the read fabric 700.
[0024] The conveying device 130 is a device that conveys the sensor unit 120 parallel to the second direction D2. The conveying device 130 may have various configurations. Although not shown, in this embodiment, the conveying device 130 has a rail that supports the sensor unit 120 slidably in a direction parallel to the second direction D2, a plurality of pulleys, a belt that is wound around the plurality of pulleys and a part of which is fixed to the sensor unit 120, and an electric motor that rotates the pulley. The electric motor rotates the pulley, so that the sensor unit 120 moves in a direction parallel to the second direction D2. When reading the textile 700, the conveying device 130 conveys the sensor unit 120 in the second direction D2. The sensor unit 120 repeats reading the textile 700 during the conveying. This allows the sensor unit 120 to read the textile 700 from approximately the entire support surface Us of the support stand 194.
[0025] The control device 140 is an electric circuit configured to control the sensor unit 120 and the transport device 130. The control device 140 is configured using, for example, a computer or dedicated hardware (such as an Application Specific Integrated Circuit (ASIC)). The control device 140 generates data of a read image by controlling the sensor unit 120 and the transport device 130. In this embodiment, the data of the read image is bitmap data representing the color values of each of a plurality of pixels (here, the gradation values of each of the three color components of red R, green G, and blue B).
[0026] A2.Inspection process: FIG. 3 is a flowchart showing an example of the inspection process. As described in FIG. 2, the textile 700 is placed on the support surface Us of the scanner 100 for inspection. In this embodiment, an operator places the textile 700 on the support surface Us. Alternatively, a machine (e.g., a robot arm) may place the textile 700 on the support surface Us. After placing the textile 700, an instruction to start the inspection process is input to the data processing device 200 (FIG. 1). In this embodiment, the operator inputs the instruction to start the inspection by operating the operation unit 250. The processor 210 starts the inspection process in response to the start instruction. The start instruction may be input to the data processing device 200 via the communication interface 270 by another device different from the data processing device 200.
[0027] The processor 210 of the data processing device 200 executes the inspection process according to the program 231. In S110, the processor 210 supplies a reading instruction to the scanner 100. The control device 140 of the scanner 100 reads the textile 700 by controlling the sensor unit 120 and the conveying device 130 in response to the reading instruction. The control device 140 generates data of the read image and supplies the generated data to the data processing device 200.
[0028] 4(A) to 4(C) are diagrams showing examples of images processed in the inspection process. Image I10 in Fig. 4(A) shows an example of a read image of the textile 700. In this embodiment, the read image I10 is a rectangular image having two sides parallel to a first direction Dx and two sides parallel to a second direction Dy perpendicular to the first direction Dx.
[0029] In this embodiment, the woven fabric 700 is configured such that multiple warp threads Wp and multiple weft threads Wf cross each other. The warp threads Wp are threads extending in the vertical direction. Multiple thread portions extending in the vertical direction at multiple positions in the horizontal direction of the woven fabric 700 correspond to multiple warp threads Wp. The weft threads Wf are threads extending in the horizontal direction. Multiple thread portions extending in the horizontal direction at multiple positions in the vertical direction of the woven fabric 700 correspond to multiple weft threads Wf. The multiple weft threads Wf may be formed by folding back one long thread multiple times. In this way, one long thread may form multiple thread portions (i.e., multiple weft threads Wf) extending in the horizontal direction at multiple positions in the vertical direction. The same applies to the multiple warp threads Wp.
[0030] Various deformations may occur in the woven fabric. Two line segments Df and Dp are shown on the scanned image I10. The first line segment Df is parallel to the weft thread Wf, and the second line segment Dp is parallel to the warp thread Wp. As shown in the figure, the first line segment Df is not perpendicular to the second line segment Dp, but is inclined. In this way, the woven fabric 700 is skewed.
[0031] In S115 (FIG. 3), the processor 210 performs skew correction on the scanned image I10. The skew correction may be various processes (e.g., affine transformation) that correct the scanned image I10 to represent the non-skewed textile 700. FIG. 4(B) shows an example of a scanned image I20 that has been skew corrected. As shown, in the image I20, the first line segment Df is approximately parallel to the first direction Dx, and the second line segment Dp is approximately parallel to the second direction Dy.
[0032] The method of determining the parameters of the skew correction may be various methods. For example, the processor 210 may detect the skew of the woven fabric 700 by analyzing the read image I10, and correct the detected skew. The method of detecting the skew may be various methods. For example, the processor 210 may detect the direction parallel to the weft yarn Wf and the direction parallel to the warp yarn Wp by the Hough transform. Alternatively, the processor 210 may determine the parameters of the skew correction according to information input by the operator. For example, the processor 210 may display the read image I10 on the display unit 240 (FIG. 1). The operator may specify the positions of both ends of the line segments Df and Dp on the read image I10 by operating the operation unit 250. The processor 210 may perform the skew correction according to the line segments Df and Dp specified by the operator.
[0033] FIG. 4(C) is a diagram showing an example of an enlarged view of a portion I20p of the scanned image I20 (FIG. 4(B)) after skew correction. The scanned image I20 shows a plurality of weft threads Wf, a plurality of warp threads Wp, and gaps Wg between the plurality of threads Wf, Wp. The plurality of weft threads Wf are each approximately parallel to a first direction Dx. The plurality of warp threads Wp are each approximately parallel to a second direction Dy. The weave of the woven fabric 700 may be various, such as a "plain weave", a "twill weave", or a "satin weave".
[0034] In S120 (FIG. 3), the processor 210 acquires information on the warp region, weft region, and gap region by analyzing the skew-corrected read image I20. FIG. 5 is a flowchart showing an example of a process for acquiring information on these regions. In S210, the processor 210 detects the warp region, weft region, and gap region from the read image I20. FIGS. 6(A)-6(C) show examples of the detected warp region, weft region, and gap region, respectively. Each figure shows a portion I20p of the read image I20.
[0035] In Fig. 6(A), each of the multiple warp regions Ap (including multiple warp regions Ap1-Ap5) is hatched. Each of the multiple warp regions Ap represents a portion of the multiple warp threads Wp that is not hidden by the weft threads Wf and is visible. In this embodiment, a continuous region that represents a portion of the warp threads Wp that overlaps with one or more weft threads Wf is used as the warp region Ap.
[0036] In Fig. 6(B), each of the multiple weft regions Af (including multiple weft regions Af1-Af4) is hatched. Each of the multiple weft regions Af represents a portion of the multiple wefts Wf that is not hidden by the warp threads Wp and is visible. In this embodiment, a continuous region that represents a portion of the wefts Wf that overlaps with one or more warp threads Wp is used as the weft region Af.
[0037] In Fig. 6(C), each of the gap regions Ag (including the gap regions Ag1-Ag6) is hatched. Each of the gap regions Ag represents a gap between the warp yarns Wp and the weft yarns Wf.
[0038] The method of detecting these regions Ap, Af, and Ag may be various methods. In this embodiment, the processor 210 detects the regions Ap, Af, and Ag using a trained object detection model 300. The object detection model 300 may be various models capable of detecting the regions Ap, Af, and Ag. In this embodiment, the object detection model 300 is a model called "Mask R-CNN" disclosed in the following paper. Kaiming He, Georgia Gkioxari, Piotr Dollar (the "a" has an acute accent) and Ross Girshick, "Mask R-CNN", arXiv:1703.06870, 24 Jan. 2018, http: / / arxiv.org / abs / 1703.06870
[0039] Mask R-CNN is a model that performs region division called instance segmentation. This region division detects the region of the object and the type (class) of the object for each object. This region division determines which object region the pixel is included in for each pixel. The object detection model 300 is trained in advance so that it can appropriately divide multiple types of regions including the warp region Ap, the weft region Af, the gap region Ag, and other regions. The training method may be, for example, the training method of Mask R-CNN described in the above-mentioned paper.
[0040] In S215 (FIG. 5), the processor 210 stores position data (described below) and type data of each region Ap, Af representing a yarn in the storage device 215 (e.g., the non-volatile storage device 230). The type data is data indicating the type of region (here, warp region Ap or weft region Af). In S220, the processor 210 stores position data of each gap region Ag in the storage device 215 (e.g., the non-volatile storage device 230). Then, the processor 210 ends the process of FIG. 5, i.e., the process of S120 in FIG. 3.
[0041] The position data may be various data representing the position of the area in the read image. For example, the shape of each area Ap, Af, Ag may be approximated by a rectangle having two sides parallel to the first direction Dx and two sides parallel to the second direction Dy (for example, the smallest rectangle circumscribing the area). The position data may represent the coordinates of four vertices of the rectangle approximating the corresponding area. Note that the warp threads Wp and the weft threads Wf are flexible and easily deformed. Although not shown, in the read image I20, the warp threads Wp may be curved rather than straight. Similarly, the weft threads Wf may be curved rather than straight. The shape of each area Ap, Af, Ag may differ from a rectangle. The position data may represent various information representing the position of such an area. In this embodiment, in S210 (FIG. 5), the processor 210 assigns area identifiers that distinguish each area to each of the multiple areas Ap, Af, Ag detected. Then, in S215 and S220, the processor 210 generates data representing the correspondence between the pixels of the scanned image I20 and the area identifiers for each pixel as position data.
[0042] In S125 (FIG. 3), the processor 210 determines color values of each of the multiple warp regions Ap and each of the multiple weft regions Af by analyzing the read image I20. The color values of the regions may be various values that represent the color of the region represented by the read image I20. For example, the color value of the region may be determined to be a statistic (e.g., an average value or a mode value of multiple color values of multiple pixels) that indicates the magnitude of the gradation value of each color component in the region. Here, a portion of multiple pixels among the multiple pixels in the region may be used. Alternatively, the color value of the region may be determined to be the color value of a specific pixel in the region (e.g., a pixel at the center of the region). The processor 210 stores data representing the color value of each region in the storage device 215 (e.g., the non-volatile storage device 230).
[0043] In S130, the processor 210 divides the long warp region and the long weft region. Fig. 7 is a flowchart showing an example of the division process. In S310, the processor 210 divides the long warp region Ap, which is a warp region Ap longer than the first reference length L1s, into multiple warp regions Ap.
[0044] 8(A) and 8(B) are diagrams showing examples of multiple warp regions Ap (including warp regions Aph, Api) and multiple weft regions Af (including weft regions Afj, Afk). FIG. 8(A) shows the state before division, and FIG. 8(B) shows the state after division. Each diagram shows a part of the woven fabric 700 shown by the read image I20 (FIG. 4(B)). Lengths Lph and Lpi indicate the lengths of the warp regions Aph and Api (here, the length in the second direction Dy), respectively. Lengths Lfj and Lfk indicate the lengths of the weft regions Afj and Afk (here, the length in the first direction Dx), respectively.
[0045] Fig. 8(C) is a diagram showing an example of a method for calculating the length of the warp region Ap. As shown in the figure, the contour OL of the warp region Ap can bend in various directions. The length of the warp region Ap in the second direction Dy can vary depending on the position in the first direction Dx. In the figure, lengths Lp1-Lp4 in the second direction Dy at four pixel positions Px1-Px4 in the first direction Dx are shown. The lengths Lp1-Lp4 can be different from each other.
[0046] In this embodiment, a statistic indicating the length of the warp area Ap in the second direction Dy is used as the length Lp of the warp area Ap. For example, the average or maximum value of multiple lengths at multiple pixel positions in the first direction Dx may be used as the length Lp. Here, some of the multiple pixel positions in the first direction Dx in the warp area Ap may be used. In addition, the contour OL of the warp area Ap may form a recess CV that is recessed in a direction parallel to the first direction Dx. It is preferable that the pixel position in the first direction Dx that indicates such a recess CV is excluded from the calculation of the length Lp. That is, it is preferable that the length Lp is calculated by using the length of a continuous portion in the warp area Ap from the end ey1 on the second direction Dy side of the warp area Ap to the end ey2 on the opposite direction (referred to as the -Dy direction). In addition, instead of a statistical quantity, the length Lp may be the length of a specific portion of the warp area Ap (for example, the distance in the second direction Dy between the end of the warp area Ap on the second direction Dy side and the end on the -Dy direction side).
[0047] In this embodiment, the processor 210 calculates the length Lp of each of the multiple warp regions Ap using the position data of each of the multiple regions Ap (S210-S215 (FIG. 5)). The position data is data obtained by analyzing the read image I20 (S210 (FIG. 5)). The processor 210 obtains the length Lp by analyzing the read image I20.
[0048] In S310 (FIG. 7), the processor 210 divides a warp region Ap having a length Lp longer than the first reference length L1s (i.e., a long warp region) into Np warp regions Ap. The first reference length L1s is determined in advance according to the configuration of the fabric 700 so that a warp region Ap overlapping with two or more wefts Wf is selected as a long warp region. The total number Np of warp regions Ap formed by division (also called the number of divisions Np) is determined based on the length Lp. The correspondence relationship between the length Lp and the number of divisions Np is determined in advance so that the long warp region is divided into Np warp regions Ap each overlapping with one weft Wf.
[0049] FIG. 8(D) is a diagram showing an example of the correspondence between the length and the number of divisions. In the figure, a warp correspondence 10pa between the length Lp of the warp region Ap and the number of divisions Np, and a weft correspondence 10fa described later are shown. In the figure, the warp correspondence 10pa is represented by a horizontal axis showing the length Lp and the number of divisions Np added to the horizontal axis. The larger the length Lp, the larger the number of divisions Np. In the figure, thresholds "Lps", "2*Lps", and "3*Lps" of the length Lp are shown. The thresholds are integer multiples of the first standard length Lps. The first standard length Lps indicates the standard length Lp of the warp region Ap overlapping with one weft Wf. The first standard length Lps is predetermined according to the configuration of the woven fabric 700. When the length Lp is greater than (k-1)*Lps and less than or equal to k*Lps, the number of divisions Np is k (k is an integer greater than or equal to 1). The first reference length L1s for dividing the warp region Ap into two or more warp regions Ap is the same as the first standard length Lps. From such a warp correspondence relationship 10pa, an appropriate division number Np can be derived.
[0050] The processor 210 determines the division number Np from the length Lp of the long warp region according to the warp correspondence relationship 10pa. The processor 210 equally divides the long warp region into Np warp regions Ap having the same length (Lp / Np) by straight lines parallel to the first direction Dx. As a result, the long warp region is divided into Np warp regions Ap, each of which overlaps with one weft Wf. For example, the warp region Aph in FIG. 8(A) overlaps with two wefts Wf. The division number Np of 2 is associated with the length Lph of the warp region Aph (FIG. 8(D)). As shown in FIG. 8(B), the long warp region Aph is divided into two warp regions Ap, each of which overlaps with one weft Wf. The division number Np of 3 is associated with the length Lpi of the long warp region Api, which overlaps with three wefts Wf. The long warp area Api is divided into three warp areas Ap, each of which overlaps with one weft Wf.
[0051] In S315 (Figure 7), the processor 210 stores in the memory device 215 (e.g., the non-volatile memory device 230) data representing the correspondence between information (in this embodiment, position and type) of the multiple warp areas Ap generated by division and the identifier of the original long warp area.
[0052] In S320, the processor 210 divides the long weft region Af, which is a weft region Af longer than the second reference length L2s, into multiple weft regions Af. The division method is the same as the division method in S310. The processor 210 calculates the length Lf of each of the multiple weft regions Af. The calculation method of the length Lf is the same as the calculation method of the length Lp of the warp region Ap described in FIG. 8(C), except that the first direction Dx and the second direction Dy are interchanged.
[0053] The processor 210 divides a weft region Af having a length Lf longer than the second reference length L2s (i.e., a long weft region) into Nf weft regions Af. The second reference length L2s is determined in advance according to the configuration of the fabric 700 so that a weft region Af overlapping with two or more warp threads Wp is selected as a long weft region. The total number Nf of weft regions Af formed by division (also called the division number Nf) is determined based on the length Lf. The correspondence relationship between the length Lf and the division number Nf is determined in advance so that the long weft region is divided into a plurality of weft regions Af each overlapping with one warp thread Wp.
[0054] As the correspondence relationship between the length Lf and the division number Nf, the weft correspondence relationship 10fa in FIG. 8(D) may be adopted. The weft correspondence relationship 10fa is determined in the same manner as the warp correspondence relationship 10pa. The threshold value of the length Lf is an integer multiple of the second standard length Lfs. The second standard length Lfs indicates the standard length Lf of the weft area Af overlapping with one warp thread Wp. The second standard length Lfs is determined in advance according to the configuration of the woven fabric 700. When the length Lf is greater than (k-1)*Lfs and is equal to or less than k*Lfs, the division number Nf is k (k is an integer equal to or greater than 1). The second reference length L2s for dividing the weft area Af into two or more weft areas Af is the same as the second standard length Lfs. Such a weft correspondence relationship 10fa can derive an appropriate division number Nf.
[0055] The processor 210 determines the division number Nf from the length Lf of the long weft region according to the weft correspondence relationship 10fa. The processor 210 divides the long weft region into Nf weft regions Af having the same length (Lf / Nf) evenly by straight lines parallel to the second direction Dy. As a result, the long weft region is divided into Nf weft regions Af each overlapping one warp thread Wp. For example, the weft region Afj in FIG. 8(A) overlaps two warps Wp. The division number Nf of 2 is associated with the length Lfj of the weft region Afj (FIG. 8(D)). As shown in FIG. 8(B), the long weft region Afj is divided into two weft regions Af each overlapping one warp thread Wp. The division number Nf of 1 is associated with the length Lfk of the weft region Afk overlapping one warp thread Wp. The weft area Afk is not selected as a long weft area and is not divided.
[0056] In S325 (FIG. 7), the processor 210 stores data representing the correspondence between the information (positions and types in this embodiment) of the multiple weft areas Af generated by division and the identifiers of the original long weft areas in the storage device 215 (for example, the non-volatile storage device 230). Then, the process in FIG. 7, i.e., the process in S130 in FIG. 3, ends.
[0057] The correspondence relationship between the length and the number of divisions may be various, such that a plurality of regions each overlapping one thread can be obtained from a region overlapping two or more threads. FIG. 8(E) is a diagram showing another example of the correspondence relationship. In the figure, a warp correspondence relationship 10pb and a weft correspondence relationship 10fb are shown. The warp correspondence relationship 10pb derives the number of divisions Np (=k) corresponding to the length closest to the length Lp of the long warp region among the standard lengths (here, k times the first standard length Lps) of the warp region Ap overlapping with k wefts Wf. As shown by the warp correspondence relationship 10pb, the threshold value of the length Lp of the warp region Ap is (k+0.5)*Lps (k is an integer equal to or greater than 1). When the length Lp is greater than (k+0.5)*Lps and less than or equal to (k+1+0.5)*Lps, the number of divisions Np is k+1. The first reference length L1s for dividing the warp region Ap into two or more warp regions Ap is 1.5*Lps. The weft correspondence relationship 10fb is determined in the same manner as the warp correspondence relationship 10pb. The threshold value of the length Lf of the weft region Af is (k+0.5)*Lfs (k is an integer equal to or greater than 1). When the length Lf is greater than (k+0.5)*Lfs and less than or equal to (k+1+0.5)*Lfs, the number of divisions Nf is k+1. The second reference length L2s for dividing the weft region Af into two or more weft regions Af is 1.5*Lfs. The warp correspondence relationship 10pb and the weft correspondence relationship 10fb can appropriately derive the number of divisions for dividing a long region overlapping two or more threads into multiple regions each overlapping one thread.
[0058] In S135 (FIG. 3), the processor 210 determines the center of each of the multiple warp regions Ap and the center of each of the multiple weft regions Af. FIGS. 9(A) and 9(B) are diagrams showing examples of multiple warp regions Ap and multiple weft regions Af. In each diagram, multiple regions Ap and Af including the multiple regions Ap and Af of FIG. 8(B) are shown. In FIG. 9(B), the center Ct of each region Ap and Af is shown by a black dot. The processor 210 adopts, for example, the position of the center of gravity of the regions Ap and Af as the position of the center of each region Ap and Af in the scanned image I20. Alternatively, the regions Ap and Af may be approximated by a rectangle (for example, the smallest rectangle circumscribing the region). The processor 210 may adopt the average position of the four corners of the rectangle as the position of the center. The processor 210 stores data representing the positions of the centers of the regions Ap and Af in the storage device 215 (for example, the non-volatile storage device 230).
[0059] Fig. 9(C) is a diagram showing the correspondence between the center Ct in Fig. 9(B) and the type of area. A white circle indicates a weft center Ctf, which is the center Ct of the weft area Af, and a black circle indicates a warp center Ctp, which is the center Ct of the warp area Ap. The center Ct and the type of area (here, the weft area Af or the warp area Ap) are associated with each other by the processes of S120, S130, and S135 in Fig. 3.
[0060] As described in FIG. 8(B), each warp region Ap after the division of the long warp region indicates a region overlapping with one weft thread Wf. Similarly, each weft region Af after the division of the long weft region indicates a region overlapping with one warp thread Wp. The center Ct (and hence centers Ctp, Ctf) of each region Ap, Af can be used as the intersection position of the warp thread Wp and the weft thread Wf. Hereinafter, the centers Ct, Ctp, Ctf are also referred to as the intersection positions Ct, Ctp, Ctf.
[0061] In S140 (FIG. 3), the processor 210 connects multiple warp regions Ap and multiple weft regions Af. FIG. 10 is a flowchart showing an example of the connection process. In S410, the processor 210 connects multiple warp regions Ap associated with the same long warp region. In S415, the processor 210 connects multiple weft regions Af associated with the same long weft region.
[0062] 11(A)-11(F) are diagrams showing examples of connections between warp regions Ap and weft regions Af. In each diagram, multiple weft centers Ctf corresponding to multiple weft regions Af and multiple warp centers Ctp corresponding to multiple warp regions Ap are shown. In Fig. 11(A) and Fig. 11(B), the same multiple centers Ctf and Ctp as those in Fig. 9(C) are shown. The horizontally long rectangular region AfL indicated by the dotted line indicates the long weft region (referred to as the long weft region AfL). The vertically long rectangular region ApL indicated by the dotted line indicates the long warp region (referred to as the long warp region ApL).
[0063] In S410 (FIG. 10), the processor 210 connects multiple warp centers Ctp included in the same long warp region ApL. FIG. 11(B) shows the connection result. The processor 210 connects two warp centers Ctp adjacent to each other in the direction in which the long warp region ApL extends (here, the second direction Dy). The processor 210 repeats the selection of a new combination of two adjacent warp centers Ctp and the connection of the two warp centers Ctp of the selected combination. As a result, one line is formed that connects multiple warp centers Ctp included in the long warp region ApL. The processor 210 executes such a connection process for each long warp region ApL. In FIG. 11(B), two warp centers Ctp that are connected to each other are connected by a straight line. For example, two warp centers Ctp included in the long warp region Aph are connected, and three warp centers Ctp included in the long warp region Api are connected. The processor 210 generates connection data representing a combination of warp centers Ctp to be connected, and stores the generated connection data in the storage device 215 (for example, the non-volatile storage device 230).
[0064] In S415 (FIG. 10), the processor 210 connects multiple weft centers Ctf included in the same long weft region AfL. The connection method is the same as the connection method in S410. The processor 210 connects two weft centers Ctf adjacent to each other in the extending direction of the long weft region AfL (here, the first direction Dx). The processor 210 connects all combinations of two adjacent weft centers Ctf included in the same long weft region AfL. In FIG. 11(B), two weft centers Ctf connected to each other are connected by a straight line. For example, two weft centers Ctf included in the long weft region Afj are connected. The processor 210 generates connection data representing combinations of weft centers Ctf to be connected, and stores the generated connection data in the storage device 215 (for example, the non-volatile storage device 230).
[0065] In S420 (FIG. 10), the processor 210 connects a plurality of warp regions Ap and a plurality of weft regions Af. As described below, the processor 210 forms grid lines corresponding to a plurality of warp threads Wp and a plurality of weft threads Wf by connecting the plurality of warp regions Ap and the plurality of weft regions Af. There may be various methods for such connection. In this embodiment, S420 includes S423 and S425.
[0066] In S423, the processor 210 selects an unprocessed area from the multiple warp areas Ap and multiple weft areas Af as the attention area. The processor 210 connects the nearest area on the second direction Dy side and the nearest area on the -Dy direction side to the attention area. FIG. 11(C) shows the attention center Cti, which is the center Ct of the attention area, and eight centers Ct of eight areas surrounding the attention area. These nine centers Ct indicate nine intersection positions of three warp threads Wp aligned in the first direction Dx and three weft threads Wf aligned in the second direction Dy.
[0067] In the figure, a first range Rxi, which is a range in the first direction Dx, is shown. The first range Rxi is a range of a predetermined width centered on the position Pxi of the attention center Cti in the first direction Dx. The width of the first range Rxi is experimentally determined in advance so that multiple centers Ct associated with one warp thread Wp associated with the attention center Cti are included within the first range Rxi, and centers Ct associated with other warp threads Wp are located outside the first range Rxi.
[0068] The processor 210 selects a first nearest center CtD and a second nearest center CtU from the multiple centers Ct located within the first range Rxi. The first nearest center CtD is the center Ct closest to the center of attention Cti among the centers Ct located on the second direction Dy side of the center of attention Cti. The second nearest center CtU is the center Ct closest to the center of attention Cti among the centers Ct located on the -Dy direction side of the center of attention Cti. The processor 210 connects the first nearest center CtD and the second nearest center CtU to the center of attention Cti.
[0069] The processor 210 executes the process of connecting the nearest centers CtD and CtU to the target center Cti for each of the multiple warp centers Ctp and multiple weft centers Ctf (i.e., for each of the multiple warp areas Ap and multiple weft areas Af). Figure 11(D) shows the connection result obtained from the example of Figure 11(B). As shown in the figure, multiple lines representing multiple warp threads Wp are formed.
[0070] In S425 (FIG. 10), the processor 210 selects an unprocessed area from the multiple warp areas Ap and multiple weft areas Af as an attention area. The processor 210 connects the nearest area on the first direction Dx side and the nearest area on the opposite side to the first direction Dx (also called the -Dx direction) to the attention area. FIG. 11(E) shows nine centers Ct, the same as those in FIG. 11(C). The second range Ryi is a range of a predetermined width centered on the position Pyi of the attention center Cti in the second direction Dy. The width of the second range Ryi is experimentally determined in advance so that the multiple centers Ct associated with one weft Wf associated with the attention center Cti are included within the second range Ryi, and the centers Ct associated with other weft Wf are located outside the second range Ryi.
[0071] The processor 210 selects a third nearest center CtR and a fourth nearest center CtL from the multiple centers Ct located within the second range Ryi. The third nearest center CtR is the center Ct closest to the center of attention Cti among the centers Ct located on the first direction Dx side of the center of attention Cti. The fourth nearest center CtL is the center Ct closest to the center of attention Cti among the centers Ct located on the -Dx direction side of the center of attention Cti. The processor 210 connects the third nearest center CtR and the fourth nearest center CtL to the center of attention Cti.
[0072] The processor 210 executes a process of connecting the nearest centers CtR, CtL to the target center Cti for each of the multiple warp centers Ctp and multiple weft centers Ctf (i.e., for each of the multiple warp areas Ap and multiple weft areas Af). FIG. 11(F) shows a connection result RC obtained from the example of FIG. 11(D). As shown, multiple lines representing multiple weft threads Wf are formed. The connection process by S410, S415, and S420 in FIG. 10 forms grid lines representing multiple warp threads Wp and multiple weft threads Wf (the connection result RC in FIG. 11(F) represents a portion of the grid lines).
[0073] In S430 (FIG. 10), the processor 210 stores data representing the connection results (i.e., grid lines) in the storage device 215 (e.g., the non-volatile storage device 230). Then, the processor 210 ends the process of FIG. 10, i.e., the process of S140 in FIG. 3. The connection results obtained by the process of FIG. 10 represent all combinations of two centers Ct connected in each of the processes of S410, S415, and S420.
[0074] In S145 (FIG. 3), the processor 210 compares the attribute pattern with a reference attribute. FIG. 12 is a flow chart showing an example of the comparison process. In S510, the processor 210 uses the connection result from S140 (FIG. 3) to determine the interlacing pattern. FIG. 13(A) is a diagram showing an example of the comparison process between the interlacing pattern and the reference interlacing pattern. The same connection result RC as that in FIG. 11(F) is shown in the figure. A part of the interlacing pattern PI1 corresponding to the connection result RC is shown in the figure. The interlacing pattern PI1 represents threads that are visible at each of a plurality of intersecting positions (i.e., positions where the warp threads Wp and the weft threads Wf overlap) between a plurality of warp threads Wp and a plurality of weft threads Wf. Such an interlacing pattern PI1 is also called a texture diagram. Although not shown, the interlacing pattern PI1 represents the entire pattern of the woven fabric 700 represented by the read image I20 (FIG. 4(B)).
[0075] In this embodiment, the warp center Ctp indicates a crossing position where the warp thread Wp is visible without being hidden by the weft thread Wf, and the weft center Ctf indicates a crossing position where the weft thread Wf is visible without being hidden by the warp thread Wp. The processor 210 determines a matrix arrangement of a plurality of warp centers Ctp and a plurality of weft centers Ctf according to the connection result. The processor 210 generates data of the crossing pattern PI1 according to this arrangement. The crossing pattern PI1 indicates the type of thread (called a thread flag) that is visible at each of the plurality of crossing positions. The thread flag is set to the warp flag BLp corresponding to the warp center Ctp or the weft flag BLf corresponding to the weft center Ctf. In FIG. 13(A), the warp flag BLp is indicated by a hatched square, and the weft flag BLf is indicated by a non-hatched square. One column indicates one warp thread Wp, and one row indicates one weft thread Wf.
[0076] In S515 (FIG. 12), the processor 210 detects the abnormal crossing portion by comparing the crossing pattern with a reference crossing pattern. The reference crossing pattern PI2 represents the reference yarn flag pattern (i.e., the reference structure diagram) of the entire textile 700 represented by the read image I20 (FIG. 4(B)). The abnormal crossing portion is a crossing position that indicates a yarn flag different from the reference yarn flag. In this embodiment, the abnormal crossing portion indicates an error in the weaving method of the textile 700. FIG. 13(A) shows a portion of the reference crossing pattern PI2 that corresponds to the connection result RC.
[0077] In this embodiment, the reference interlacing pattern PI2 is obtained by repeating a unit pattern (not shown) in the first direction Dx and the second direction Dy. Among the patterns represented by the repetition of the unit patterns, a predetermined portion corresponding to the multiple rows and multiple columns of the interlacing pattern PI1 (i.e., the multiple weft threads Wf and multiple warp threads Wp of the textile 700) is used as the reference interlacing pattern PI2. For example, the end column in the first direction Dx of the reference interlacing pattern PI2 represents an appropriate yarn flag pattern of the end column in the first direction Dx of the interlacing pattern PI1 (i.e., the end warp threads Wp of the textile 700 in the first direction Dx of the scanned image I20).
[0078] The processor 210 detects a crossing position where the yarn flags are different between the crossing pattern PI1 and the reference crossing pattern PI2 (i.e., a crossing abnormal portion). FIG. 13(A) shows a portion of the crossing result pattern PI3 representing the detection result, which corresponds to the connection result RC. The yarn flags at the crossing position Pa do not match between the crossing pattern PI1 and the reference crossing pattern PI2. In the crossing result pattern PI3, information indicating the crossing abnormal portion BLIe is associated with the crossing position Pa. In the crossing result pattern PI3, various information may be associated with the crossing positions where the yarn flags match (e.g., a yarn flag). Although not shown, the crossing result pattern PI3 represents the pattern of the overall detection result of the fabric 700 represented by the read image I20 (FIG. 4(B)).
[0079] In S520 (FIG. 12), the processor 210 stores data representing the interlace result pattern PI3 in the storage device 215 (eg, the non-volatile storage device 230).
[0080] In S525, the processor 210 determines a color pattern. The color pattern is a pattern that represents the color values of each of the multiple warp threads Wp and the multiple weft threads Wf. FIG. 13B is a diagram showing an example of a comparison process between a color pattern and a reference color pattern. In the figure, a part of the color pattern PC1 that corresponds to the connection result RC (FIG. 13A) is shown. In this embodiment, the color of the thread is black BLb or white BLw. In this embodiment, the color pattern PC1 represents the color values of the threads that are visible at each of the multiple intersection positions of the woven fabric 700 represented by the read image I20 (FIG. 4B). The processor 210 obtains the color values of each intersection position using the color values of each area Ap, Af determined in S125 (FIG. 3), the division result of S130, and the connection result of S140. The processor 210 generates data of the color pattern PC1 by arranging the color values of each intersection position according to the above-mentioned matrix arrangement of the multiple intersection positions.
[0081] In S530 (FIG. 12), the processor 210 detects color abnormalities by comparing the color pattern with a reference color pattern. The reference color pattern PC2 represents the reference color pattern of the entire textile 700 represented by the read image I20 (FIG. 4(B)). In this embodiment, appropriate colors of the multiple warp threads Wp and the multiple weft threads Wf are predetermined according to the configuration of the textile 700. The reference color pattern PC2 is predetermined using the threads of each thread and the reference intersection pattern PI2. FIG. 13(A) shows a portion of the reference color pattern PC2 that corresponds to the connection result RC (FIG. 13(A)).
[0082] The color abnormality portion is a crossing position that shows a color different from the reference color, i.e., the color abnormality portion indicates a visible yarn among the warp yarns Wp and the weft yarns Wf that has an inappropriate color.
[0083] The processor 210 detects an intersection position (i.e., a color abnormality portion) showing a color different from the reference color by using the color pattern PC1 and the reference color pattern PC2. FIG. 13(B) shows a part of the color result pattern PC3 showing the detection result corresponding to the connection result RC. The color is different at a plurality of intersection positions Pb between the color pattern PC1 and the reference color pattern PC2. In the color result pattern PC3, information showing a color abnormality portion BLCe is associated with a plurality of intersection positions Pb. In the color result pattern PC3, various information may be associated with intersection positions showing the same color (for example, a color value shown by the reference intersection pattern PI2). Although not shown, the color result pattern PC3 shows the pattern of the entire detection result of the textile 700 shown by the read image I20 (FIG. 4(B)).
[0084] Even if the thread color is appropriate, the color values determined in S125 (FIG. 3) may deviate from the color values represented by the reference color pattern PC2. The reference color pattern PC2 may represent a reference range of color values for each thread. The processor 210 may determine that the colors are the same if the color value of the color pattern PC1 is within the corresponding reference range of the reference color pattern PC2. The reference range of the color values is experimentally determined in advance such that the color value is within the reference range when the thread color is appropriate and the color value is outside the reference range when the thread color is inappropriate.
[0085] In S535 (FIG. 12), the processor 210 stores the data of the color result pattern PC3 in the storage device 215 (for example, the non-volatile storage device 230).
[0086] In S540, the processor 210 calculates the width of each of the multiple warp regions Ap and the width of each of the multiple weft regions Af. Fig. 14(A) is a diagram showing an example of a method for calculating the width of the warp region Ap. The method for calculating the width ApW is similar to the method for calculating the length Lp of the warp region Ap described in Fig. 8(C). In the diagram, widths ApW1-ApW7 in the first direction Dx at seven pixel positions Py1-Py4 in the second direction Dy are shown. The widths ApW1-ApW7 may be different from each other.
[0087] In this embodiment, a statistic indicating the width of the warp area Ap in the first direction Dx is used as the width ApW of the warp area Ap. For example, the average or maximum value of multiple widths at multiple pixel positions in the second direction Dy may be used as the width ApW. Here, a portion of multiple pixel positions among the multiple pixel positions in the second direction Dy within the warp area Ap may be used. In addition, the contour OL of the warp area Ap may form a recess CVy that is recessed in a direction parallel to the second direction Dy. It is preferable that pixel positions in the second direction Dy that indicate such a recess CVy are excluded from the calculation of the width ApW.
[0088] The processor 210 calculates the width ApW of each of the multiple warp regions Ap in the first direction Dx. The processor 210 also calculates the width of each of the multiple weft regions Af in the second direction Dy. The method of calculating the width of the weft region Af is the same as the method of calculating the width ApW of the warp region Ap, but with the first direction Dx and the second direction Dy interchanged. The widths of the regions Ap, Af are calculated by analyzing the position data of the regions Ap, Af (S210-S215 (FIG. 5), FIG. 7). The position data is data obtained by analyzing the read image I20 (S210-S215 (FIG. 5), FIG. 7). The processor 210 obtains the widths of the regions Ap, Af by analyzing the read image I20.
[0089] The width of the warp region Ap indicates the width of the thread (here, warp thread Wp) visible at the crossing position. Similarly, the width of the weft region Af indicates the width of the thread (here, weft thread Wf) visible at the crossing position. Hereinafter, the pattern of the multiple widths of the multiple warp regions Ap and the multiple widths of the multiple weft regions Af is also referred to as the crossing width pattern.
[0090] The width ApW of the warp region Ap on the scanned image I20 indicates the thickness of the portion of the warp thread Wp represented by the warp region Ap. The width of the weft region Af on the scanned image I20 indicates the thickness of the portion of the weft thread Wf represented by the weft region Af.
[0091] In S545 (FIG. 12), the processor 210 uses the connection result from S140 (FIG. 3) to calculate the width of each of the multiple warp threads Wp and the width of each of the multiple weft threads Wf. FIG. 14(B) is a diagram showing multiple warp thread areas Ap associated with one warp thread Wp. Multiple warp thread areas Ap including warp thread areas Apa-Apc are associated with the same warp thread Wp by the connection result (S140 (FIG. 3)).
[0092] As the width pW of the warp thread Wp, various values indicating the size of the warp thread Wp in the first direction Dx can be used. In this embodiment, a statistical quantity indicating the width of the warp thread Wp in the first direction Dx is used as the width pW. For example, the average value or maximum value of the multiple widths of the multiple warp thread areas Ap associated with the warp thread Wp (including the widths ApaW-ApcW of the warp thread areas Apa-Apc) may be used as the width pW. In calculating the width pW of the warp thread Wp, a portion of the multiple warp thread areas Ap associated with the warp thread Wp may be used.
[0093] The processor 210 calculates the width pW of each of the multiple warp threads Wp in the first direction Dx. The processor 210 also calculates the width of each of the multiple weft threads Wf in the second direction Dy. The method of calculating the width of the weft thread Wf is the same as the method of calculating the width pW of the warp thread Wp. The processor 210 calculates the width of the weft thread Wf using the multiple widths of the multiple weft thread areas Af associated with the weft thread Wf. The calculated width pW of the warp thread Wp indicates the thickness of the warp thread Wp. The calculated width of the weft thread Wf indicates the thickness of the weft thread Wf.
[0094] In S550 (FIG. 12), the processor 210 detects the width abnormal portion by comparing the width pattern with the reference width pattern. FIG. 14(C) is a diagram showing the read image I20. Here, it is assumed that the woven fabric 700 has u warp threads Wp and v weft threads Wf. As described in S545 (FIG. 12), the processor 210 generates the width pattern PW1 from the cross width pattern PWc1, which is a pattern of a plurality of widths of a plurality of warp thread regions Ap and a plurality of widths of a plurality of weft thread regions Af. The width pattern PW1 represents the respective widths pW1-pWu of the u warp threads Wp and the respective widths fW1-fWv of the v weft threads Wf. The reference width pattern PW2 represents the respective width reference ranges Rp1-Rpu of the u warp threads Wp and the respective width reference ranges Rf1-Rfv of the v weft threads Wf. In this embodiment, the appropriate thicknesses of the multiple warp threads Wp and the multiple weft threads Wf are predetermined according to the configuration of the woven fabric 700. The reference width pattern PW2 is predetermined based on the appropriate thickness of each thread.
[0095] An abnormal width portion is a portion of a yarn that exhibits a width different from the reference width. The processor 210 uses the width pattern PW1 and the reference width pattern PW2 to detect yarns that have a width outside the reference range. The detected yarns are examples of abnormal width portions. In FIG. 14(C), the width pWi of the i-th warp yarn Wp is outside the corresponding reference range Rpi, and the width fWj of the j-th weft yarn Wf is outside the corresponding reference range Rfj. The i-th warp yarn Wp is detected as the abnormal width portion Wpe, and the j-th weft yarn Wf is detected as the abnormal width portion Wfe.
[0096] In S555 (FIG. 12), the processor 210 stores the data representing the width abnormal portion in the storage device 215 (for example, the non-volatile storage device 230). Then, the processor 210 ends the process in FIG. 12, that is, the process of S145 in FIG.
[0097] In S150, the processor 210 compares the gap with a reference gap. FIG. 15 is a flow chart showing an example of the comparison process. In S610, the processor 210 acquires the size of each gap region Ag (FIG. 6(C)). FIG. 16(A) is a diagram showing an example of the warp region Ap, the weft region Af, and the gap region Ag. As described above, the warp thread Wp and the weft thread Wf are flexible and easily deformed. The shapes of the warp thread region Ap and the weft thread region Af can be changed in various ways. Therefore, the shape of the gap region Ag can be changed in various ways.
[0098] FIG. 16(B) is a diagram showing an example of the size of one gap region Ag. In this embodiment, the size AgW in the first direction Dx (referred to as width AgW) and the size AgH in the second direction Dy (referred to as height AgH) are adopted as the size of the gap region Ag. The method of calculating the width AgW may be the same as the method of calculating the width ApW of the warp region Ap (FIG. 14(A)). The method of calculating the height AgH may be the same as the method of calculating the length Lp of the warp region Ap (FIG. 8(C)). The processor 210 calculates the width AgW and height AgH of each of the multiple gap regions Ag.
[0099] In S615 (FIG. 15), the processor 210 detects an abnormal gap portion by comparing the size of the gap region Ag with a reference size. The abnormal gap portion is a gap region Ag having a size different from the reference size. FIG. 16(C) is a diagram showing an example of the reference size. In this embodiment, the reference size indicates a reference range RH of the height AgH (here, a range from a lower limit value HL to an upper limit value HH) and a reference range RW of the width AgW (here, a range from a lower limit value WL to an upper limit value WH). In this embodiment, the reference size is determined in advance according to the configuration of the woven fabric 700. In this embodiment, the reference size is common to a plurality of gap regions Ag. Alternatively, the reference size may be determined for each gap region Ag.
[0100] The processor 210 compares the width AgW and height AgH of each gap region Ag with the corresponding reference ranges RW, RH. Through this comparison, the processor 210 detects an intersection position (i.e., an abnormal gap portion) where the width AgW or height AgH is outside the corresponding reference ranges RW, RH. An example of an abnormal gap portion is shown in FIG. 16(A). The first abnormal gap portion Age1 has a width AgW larger than the upper limit value WH. The second abnormal gap portion Age2 has a height AgH smaller than the lower limit value HL.
[0101] In S620 (FIG. 15), the processor 210 stores the data representing the gap abnormal portion in the storage device 215 (for example, the non-volatile storage device 230). Then, the processor 210 ends the process in FIG. 15, that is, the process of S150 in FIG.
[0102] In S190, the processor 210 notifies the operator of the comparison result. The comparison result includes the detection result of the interlacing abnormal portion (FIG. 12: S515), the detection result of the color abnormal portion (FIG. 12: S530), the detection result of the width abnormal portion (FIG. 12: S550), and the detection result of the gap abnormal portion (FIG. 15: S615). The notification method may be any method. For example, the processor 210 may display information (e.g., text, table, etc.) representing the comparison result on the display unit 240. The notified comparison result may be various information including information indicating whether or not an abnormal portion has been detected. For example, when an abnormal portion is detected, the processor 210 may display an image of the fabric 700 having information (e.g., arrows, etc.) indicating the position of each abnormal portion on the display unit 240.
[0103] After S190, the processor 210 ends the inspection process of FIG.
[0104] As described above, in this embodiment, the processor 210 of the data processing device 200 executes the following processes. In S120 and S130 (FIG. 3), the processor 210 detects a plurality of regions including a plurality of warp regions Ap (FIG. 6(A)) and a plurality of weft regions Af (FIG. 6(B)) from the read image I20 (FIG. 4(B)) (the functions of S120 and S130 are examples of region detection functions). The read image I20 is an image representing the optically read woven fabric 700. As shown in FIG. 4(C), the woven fabric 700 has a plurality of warp threads Wp and a plurality of weft threads Wf. As shown in FIG. 6(A), each of the plurality of warp thread regions Ap represents a portion of the plurality of warp threads Wp that is not hidden by the plurality of weft threads Wf and is visible. As shown in FIG. 6(B), each of the plurality of weft thread regions Af represents a portion of the plurality of weft threads Wf that is not hidden by the plurality of warp threads Wp and is visible.
[0105] In S135-S140 (FIG. 3), the processor 210 determines a crossing pattern PI1 (FIG. 13(A)). The crossing pattern PI1 represents the positional relationship between multiple warp centers Ctp and multiple weft centers Ctf, i.e., the positional relationship between multiple warp regions Ap and multiple weft regions Af. The crossing pattern PI1 is an example of positional information related to the positional relationship between multiple warp regions Ap and multiple weft regions Af (also referred to as positional information PI1). In S145 (FIG. 3), the processor 210 uses the positional information PI1 to detect a crossing abnormality portion of the fabric 700 (for example, the crossing abnormality portion BLIe in FIG. 13(B)). The specific portion to be detected includes the crossing abnormality portion BLIe.
[0106] According to this configuration, the processor 210 can determine an appropriate positional relationship between the multiple warp regions Ap and the multiple weft regions Af (and thus the position information PI1). For example, even if the fabric 700 has a deformation (such as skewing or distortion) in the scanned image I20, the processor 210 can determine appropriate position information PI1. Then, by using the position information PI1, the processor 210 can appropriately detect a specific portion of the fabric 700 (including the abnormal interlacing portion BLIe in this embodiment). The data processing device 200 is an example of a detection device that detects a specific portion.
[0107] In this embodiment, the position information PI1 includes a crossing pattern PI1 that represents a thread that is visible at each of a plurality of crossing positions Ct between the warp thread Wp and the weft thread Wf. As described in S140 and S145 (FIG. 3), the process of determining the position information PI1 includes a process of determining the crossing pattern PI1 (FIG. 13(A)) by connecting a plurality of warp thread regions Ap and a plurality of weft thread regions Af. As described in FIG. 13(A), the specific portion to be detected includes a crossing abnormal portion (e.g., a crossing abnormal portion BLIe). The crossing abnormal portion is an example of a crossing difference portion that corresponds to a different portion between the crossing pattern PI1 and the reference crossing pattern PI2. The crossing difference portion indicates a difference portion between the weave indicated by the crossing pattern PI1 and the reference weave indicated by the reference crossing pattern PI2. As described in S145, the process of detecting a specific portion (here, the crossing difference portion) includes a process of detecting the crossing difference portion by comparing the crossing pattern PI1 with the reference crossing pattern PI2. According to this configuration, the processor 210 can appropriately determine the crossing pattern PI1 by connecting a plurality of warp regions Ap and a plurality of weft regions Af. Then, the processor 210 can appropriately detect the crossing difference portion by comparing the crossing pattern PI1 with the reference crossing pattern PI2.
[0108] In this embodiment, the area detection process for detecting the warp area Ap and the weft area Af includes the process of S130. The process of S130 includes S310 and S320 in FIG. 7. In S310, when the multiple warp areas Ap detected by the area detection process include a long warp area (e.g., long warp areas Aph, Api (FIG. 8A)) that is a warp area longer than the first reference length L1s, the processor 210 divides the long warp area into multiple warp areas Ap. In S320, when the multiple weft areas Af detected by the area detection process include a long weft area (e.g., long weft area Afj (FIG. 8A)) that is a weft area longer than the second reference length L2s, the processor 210 divides the long weft area into multiple weft areas Af. According to this configuration, the processor 210 can appropriately determine the interlacing pattern PI1 by connecting multiple warp regions Ap including the divided warp regions Ap and multiple weft regions Af including the divided weft regions Af. If the weft region Af is connected to the long warp region before division, the error in the connection position of the long warp region to the weft region Af may increase. In this embodiment, the possibility of such a problem is reduced.
[0109] In this embodiment, the process of determining the intersecting pattern PI1 (FIG. 13(A)) includes a process of connecting a plurality of warp regions Ap and a plurality of weft regions Af (S140 (FIG. 3)). The process of S140 includes the processes of S410 and S415 in FIG. 10. In S410, the processor 210 connects a plurality of warp regions Ap included in the same long warp region. A plurality of warp regions Ap included in the same long warp region represent the same warp thread Wp. By connecting such a plurality of warp regions Ap, the processor 210 can reduce the possibility of erroneously connecting a plurality of warp regions Ap representing different warp threads Wp. In S415, the processor 210 connects a plurality of weft regions Af included in the same long weft region. A plurality of weft regions Af included in the same long weft region represent the same weft thread Wf. By connecting such a plurality of weft regions Af, the processor 210 can reduce the possibility of erroneously connecting a plurality of weft regions Af representing different weft threads Wf. In this way, the processor 210 can appropriately determine the interlacing pattern PI1.
[0110] In this embodiment, the processor 210 acquires information including both the color of each of the multiple warp regions Ap (e.g., white BLw or black BLb) and the color of each of the multiple weft regions Af by analyzing the scanned image I20 in S125 (FIG. 3). The color of the region is an example of an attribute of the region. The information acquired in S125 is an example of region attribute information that represents the attributes of the warp region Ap and the weft region Af.
[0111] In S145 (specifically, S540 in FIG. 12), the processor 210 acquires information including both the width ApW (FIG. 14(A)) of each of the multiple warp regions Ap and the width of each of the multiple weft regions Af. As described above, the width of the warp region Ap and the width of the weft region Af are calculated by analyzing the position data of the regions Ap and Af (and thus the read image I20). The width of the region is an example of an attribute of the region. The information acquired in S540 is an example of region attribute information that represents the attributes of the warp region Ap and the weft region Af.
[0112] Thus, in S125 (FIG. 3) and S540 (FIG. 12), the processor 210 obtains attributes including the color and width of the warp region Ap and the weft region Af by analyzing the scanned image I20.
[0113] The process of detecting the specific portion (S145 (FIG. 3)) includes S530 and S545-S550 in FIG. 12. As described in S530 and S545-S550, the specific portion to be detected includes the color abnormal portion (e.g., color abnormal portion BLCe (FIG. 13(B))) and width abnormal portion (e.g., width abnormal portion Wpe, Wfe (FIG. 14(C))) of each of the warp thread Wp and the weft thread Wf. The color abnormal portion of the warp thread Wp indicates a warp thread Wp having a color different from the reference color of the warp thread Wp. The color abnormal portion of the weft thread Wf indicates a weft thread Wf having a color different from the reference color of the weft thread Wf. The width abnormal portion of the warp thread Wp indicates a warp thread Wp having a width different from the reference width of the warp thread Wp. The width abnormal portion of the weft thread Wf indicates a weft thread Wf having a width different from the reference width of the weft thread Wf. The color abnormal portion and the width abnormal portion are examples of attribute difference portions indicating threads having attributes different from the reference attributes.
[0114] In S530 (FIG. 12), the processor 210 detects color abnormalities using the reference color pattern PC2 and the color pattern PC1. The reference color pattern PC2 is an example of reference information representing both the reference color of each of the multiple warp threads Wp and the reference color of each of the multiple weft threads Wf. The color pattern PC1 represents the color of each of the areas Ap and Af (i.e., area attribute information) as described in S145 of FIG. 3 (specifically, S525 of FIG. 12).
[0115] In S550, the processor 210 detects the width abnormal portion using the reference width pattern PW2 and the width pattern PW1. The reference width pattern PW2 is an example of reference information representing both the reference width of each of the multiple warp threads Wp and the reference width of each of the multiple weft threads Wf. As described in FIG. 14(C), in this embodiment, the reference width is a width within the reference range. The width pattern PW1 is determined using the width of each of the regions Ap, Af (i.e., region attribute information) as described in S145 of FIG. 3 (specifically, S545 of FIG. 12). In this way, the processor 210 detects the width abnormal portion using the region attribute information and the reference width pattern PW2.
[0116] According to the above configuration, the processor 210 can appropriately detect the attribute difference part by using the reference information and the area attribute information.
[0117] In this embodiment, the multiple regions detected in S120 (FIG. 3) include multiple gap regions Ag between multiple warp yarns Wp and multiple weft yarns Wf (FIG. 6(C)). As described in S150 of FIG. 3 (specifically, FIG. 15), the specific portion to be detected includes a gap abnormal portion (for example, the gap abnormal portion Age1, Age2 in FIG. 16(A)). The gap abnormal portion is an example of a gap difference portion that is a gap region Ag having a size different from the reference size. As described in FIG. 16(C), in this embodiment, the reference size is determined by a reference range RH of height AgH and a reference range RW of width AgW. As described in S615 (FIG. 15), the process of detecting the specific portion (here, the gap difference portion) includes a process of detecting the gap difference portion using multiple gap regions Ag. According to this configuration, the processor 210 can appropriately detect the gap difference portion using multiple gap regions Ag.
[0118] B. Second Example: Fig. 17 is a flow chart showing a second embodiment of the process for acquiring information on the warp region Ap and the weft region Af. The process in Fig. 17 is executed in S120 (Fig. 3) instead of the process in Fig. 5. In S710, the processor 210 detects candidate regions for the warp region and the weft region.
[0119] FIG. 18(A) is a diagram showing an example of a portion of the read image I20. The same portion as the portion I20p in FIG. 4(C) is shown in the figure. The processor 210 detects bright areas in the read image I20 as candidate areas. When reading the textile 700, a light source such as the light source 121 (FIG. 2) irradiates the textile 700 with light. A reading device such as the scanner 100 reads the reflected light from the textile 700. The portions of the warp threads Wp and weft threads Wf that are not hidden at the intersections are easily exposed to light, and are therefore shown in bright colors in the read image I20. The other portions of the warp threads Wp and weft threads Wf are less likely to receive light, and are therefore shown in dark colors in the read image I20. Shadows are easily generated at the boundary between a thread (warp threads Wp or weft threads Wf) and another thread. The boundary portion is shown in dark colors in the read image I20. The gaps between the warp and weft yarns Wp and Wf are also represented in a dark color in the scanned image I20. The gaps may be represented in a darker color than the yarns. Thus, the light areas represent the warp or weft yarn areas.
[0120] In the figure, a first line Lx parallel to the first direction Dx and a second line Ly parallel to the second direction Dy are shown on the read image I20. A first graph G1 below the read image I20 shows an example of the luminance value BV on the first line Lx. The horizontal axis indicates the pixel position Px in the first direction Dx, and the vertical axis indicates the luminance value BV. A second graph G2 on the right of the read image I20 shows an example of the luminance value BV on the second line Ly. The vertical axis indicates the pixel position Py in the second direction Dy, and the horizontal axis indicates the luminance value BV. As shown in the figure, the luminance value BV of the part of the warp thread Wp and the weft thread Wf that is not hidden at the intersection position is large. The luminance value BV of the other part of the warp thread Wp and the weft thread Wf is small. The luminance value BV of the boundary part between the thread and other threads is small. When the color components of the scanned image I20 do not include the luminance value BV, the processor 210 obtains the luminance value BV by a known color conversion.
[0121] The processor 210 detects an area where pixels having a luminance value BV equal to or greater than the threshold value BVth are consecutive as a candidate area. Fig. 18(B) is a diagram showing an example of the detection result. A plurality of candidate areas Ath are detected from the scanned image I20. Each candidate area Ath corresponds to the warp area Ap or the weft area Af in Fig. 6(A) and Fig. 6(B). The threshold value BVth is experimentally determined in advance so that an appropriate candidate area Ath can be detected.
[0122] In S715 (FIG. 17), the processor 210 determines the type of the candidate area (here, warp area or weft area) by analyzing the image of the candidate area. FIGS. 19(A)-19(G) are diagrams showing examples of methods for determining the type of the candidate area. FIGS. 19(A)-19(C) show a first determination method, FIGS. 19(D) and 19(E) show a second determination method, and FIGS. 19(F) and 19(G) show a third determination method. Hereinafter, it is assumed that the first determination method is adopted.
[0123] The first determination method is a method using the arrangement of light and dark areas in the candidate area. FIG. 19(A) shows a first candidate area Ath1 representing the warp thread Wp and a second candidate area Ath2 representing the weft thread Wf. When reading the woven fabric 700, a light source such as the light source 121 (FIG. 2) irradiates the woven fabric 700 with light. The three-dimensional warp thread Wp and weft thread Wf may have relatively light and dark areas. The dark area is formed, for example, in a part of the thread on the side opposite to the direction of the light source. The first candidate area Ath1 has a light area AB1 and a dark area AD1, and the second candidate area Ath2 has a light area AB2 and a dark area AD2. The arrangement of the light and dark areas is determined according to the arrangement of the light source. In the example of FIG. 19(A), the dark areas AD1 and AD2 are formed in the parts of the candidate areas Ath1 and Ath2 on the -Dx direction side. The light areas AB1 and AB2 are formed in other parts of the first candidate areas Ath1 and Ath2. The thread may cast a shadow on the surface of the other thread. The dark area indicating the shadow may be formed in the boundary part between the multiple candidate areas Ath adjacent to each other.
[0124] 19B shows an example of an analysis of the first candidate region Ath1. The processor 210 divides the first candidate region Ath1 into a first partial region AR1 on the first direction Dx side and a second partial region AL1 on the -Dx direction side along a line CL1 that passes through the center of gravity C1 of the first candidate region Ath1 and is parallel to the second direction Dy. The processor 210 calculates a first luminance value BR1 of the first partial region AR1 and a second luminance value BL1 of the second partial region AL1. The luminance values BR1 and BL1 may be various statistics (for example, the average value or the mode within the region).
[0125] When the first candidate region Ath1 represents a warp thread Wp, the first candidate region Ath1 extends in the second direction Dy. The size in the first direction Dx is smaller than the size in the second direction Dy. In this case, most of the dark region AD1 is included in the second partial region AL1, and most of the light region AB1 is included in the first partial region AR1. Therefore, the second luminance value BL1 is smaller than the first luminance value BR1. When the luminance ratio (BL1 / BR1) is less than the threshold value Bth, the processor 210 determines that the type of the first candidate region Ath1 is a warp thread region Ap.
[0126] Fig. 19(C) shows an example of analysis of the second candidate region Ath2. The processor 210 divides the second candidate region Ath2 into a first partial region AR2 on the first direction Dx side and a second partial region AL2 on the -Dx direction side by a line CL2 passing through the center of gravity C2 of the second candidate region Ath2 and parallel to the second direction Dy. The processor 210 calculates a first luminance value BR2 of the first partial region AR2 and a second luminance value BL2 of the second partial region AL2. The calculation method of the luminance values BR2 and BL2 is the same as the calculation method of the luminance values BR1 and BL1 described in Fig. 19(B).
[0127] When the second candidate region Ath2 represents a weft thread Wf, the second candidate region Ath2 extends in the first direction Dx. The size of the first direction Dx is larger than the size of the second direction Dy. In this case, most of the dark region AD2 is included in the second partial region AL2. The light region AB2 extends from the first partial region AR2 to the second partial region AL2. Therefore, the brightness ratio (BL2 / BR2) is larger than the brightness ratio (BL1 / BR1) in FIG. 19(B). When the brightness ratio (BL2 / BR2) is equal to or greater than the threshold value Bth, the processor 210 determines that the type of the second candidate region Ath2 is a weft thread region Af.
[0128] The processor 210 determines the type of each of the multiple candidate regions Ath as either the warp region Ap or the weft region Af using the brightness ratio and the threshold value Bth. The process of S715 (FIG. 17) is then terminated. The threshold value Bth is determined experimentally in advance so that the type of each of the multiple candidate regions Ath can be appropriately determined.
[0129] After S715, in S720, the processor 210 stores the position data and type data of each of the areas Ap and Af in the storage device 215 (for example, the non-volatile storage device 230). This process is the same as the process of S215 (FIG. 5). Then, the processor 210 ends the process of FIG. 17 (and thus the process of S120 (FIG. 3)).
[0130] The process of Fig. 17 detects the warp region Ap and the weft region Af. In S120 (Fig. 3), the processor 210 may further detect the gap region Ag. There may be various methods for detecting the gap region Ag. For example, the processor 210 may detect, as the gap region Ag, a region in which pixels having a luminance value BV equal to or less than a gap threshold value are consecutive. The gap threshold value is experimentally determined in advance so that an appropriate gap region Ag can be detected.
[0131] The conditions for determining the type of region in the first determination method are not limited to the conditions described in Fig. 19(B) and Fig. 19(C), and may be various conditions suitable for the characteristics of the read image. For example, a dark region may be formed in a portion of the candidate region on the second direction Dy side. In this case, processor 210 may divide the candidate region into two partial regions by a line passing through the center of gravity and parallel to the first direction Dx. Then, processor 210 may determine the type of the candidate region using the brightness ratio of the two partial regions.
[0132] The method of determining the type of the candidate region Ath may be another method instead of the first method. The second method (FIG. 19(D) and FIG. 19(E)) is a method of using an image of the candidate region Ath. FIG. 19(D) shows a first candidate region Ath1 representing the warp thread Wp, and FIG. 19(E) shows a second candidate region Ath2 representing the weft thread Wf. In this embodiment, the warp thread Wp and the weft thread Wf are twisted yarns produced by twisting multiple fibers. In this case, the images of the candidate regions Ath1 and Ath2 represent multiple twisted fibers. As shown in FIG. 19(D), the image of the first candidate region Ath1 representing the warp thread Wp represents multiple twisted fibers extending toward the second direction Dy. As shown in FIG. 19(E), the image of the second candidate region Ath2 representing the weft thread Wf represents multiple twisted fibers extending toward the first direction Dx. The processor 210 may use such a difference between images to determine the type of the candidate region Ath. For example, the processor 210 may determine the type of the candidate region Ath by template matching using a template image of the warp region Ap and a template image of the weft region Af. Alternatively, the processor 210 may determine the type of the candidate region Ath using a trained machine learning model (e.g., a classification model).
[0133] The third determination method (FIGS. 19(F) and 19(G)) is a method that uses the aspect ratio of the candidate area Ath. In this embodiment, the candidate area Ath representing the warp thread Wp is long in the second direction Dy, and the candidate area Ath representing the weft thread Wf is long in the first direction Dx. As shown in FIG. 19(F), when the first candidate area Ath1 represents the warp thread Wp, the height H1 (size in the second direction Dy) of the first candidate area Ath1 is larger than the width W1 (size in the first direction Dx) of the first candidate area Ath1. When the height H1 is larger than the width W1, the processor 210 determines that the type of the first candidate area Ath1 is the warp area Ap. As shown in FIG. 19(G), when the second candidate area Ath2 represents the weft thread Wf, the height H2 of the second candidate area Ath2 is smaller than the width W2 of the second candidate area Ath2. When the height H2 is smaller than the width W2, the processor 210 determines that the type of the second candidate area Ath2 is the weft area Af. In this manner, the processor 210 may use the height and width of the candidate area Ath to determine the type of the candidate area Ath. The method for calculating the width of the candidate area Ath may be the same as the method for calculating the width ApW (FIG. 14(A)). The method for calculating the height of the candidate area Ath may be the same as the method for calculating the length Lp (FIG. 8(C)).
[0134] C. Variations: (1) The object detection model 300 is not limited to Mask R-CNN, but may be any of various pre-trained machine learning models capable of detecting the areas to be processed (e.g., warp area Ap, weft area Af, and gap area Ag) from the scanned image (e.g., YOLO (You only look once)).
[0135] (2) The process of detecting the processing target area (e.g., warp area Ap, weft area Af, and gap area Ag) from the read image (S120 (FIG. 3)) may be various other methods instead of the area detection process by the object detection model 300 (FIG. 5) and the process of detecting bright areas (FIG. 17). For example, the processor 210 may detect each area Ap, Af, Ag by template matching using a template image of each area Ap, Af, Ag. Note that the threads (e.g., warp threads Wp and weft threads Wf) may include one or both of natural fibers and chemical fibers. When the threads include natural fibers, the attributes of the threads (color, thickness, etc.) may vary greatly. The machine learning model can appropriately detect the processing target area even when the attributes of the threads vary greatly.
[0136] (3) In the process of connecting multiple warp regions Ap and multiple weft regions Af (S140 (FIG. 3), FIG. 10), S410 and S415 may be omitted. The processor 210 may connect all of the warp regions Ap and all of the weft regions Af in S420.
[0137] (4) In the process of S130 in Fig. 3 (specifically, the process of Fig. 7), the method of determining the division numbers Np and Nf may be various methods. For example, the processor 210 may determine the division numbers Np and Nf in the following method.
[0138] As shown in FIG. 6B, a plurality of weft regions Af that do not overlap in the second direction Dy are arranged in the scanned image I20 (for example, the positions in the second direction Dy of the weft regions Af1, Af2, and Af3 do not overlap). Within the range of the position in the second direction Dy of the warp region Ap4 (FIG. 6A), two weft regions Af2 and Af3 that do not overlap in the second direction Dy are included. In this case, it is preferable that the warp region Ap4 is divided into two warp regions Ap. In this way, the processor 210 may adopt, as the division number Np of the target warp region Ap, the number of weft regions Af that are included within the range of the position in the second direction Dy of the target warp region Ap and that do not overlap in the second direction Dy. The method of determining the division number Nf of the long weft region Af is the same as the method of determining the division number Np of the long warp region Ap. Here, the warp region Ap and the weft region Af are interchanged, and the first direction Dx and the second direction Dy are interchanged.
[0139] (5) S130 in Fig. 3, i.e., the division of the long warp area Ap and the division of the long weft area Af, may be omitted. In either case, the method for determining the positional relationship between the multiple warp areas Ap and the multiple weft areas Af may be various. Also, the method for determining the arrangement of the lattice lines (e.g., Fig. 11(F)), i.e., the multiple intersection positions, may be various.
[0140] For example, the processor 210 connects the warp region Ap and the weft region Af adjacent to each other in the first direction Dx or the second direction Dy. As a result, the weft region Af is connected to the first direction Dx side or the -Dx direction side of the warp region Ap. For example, the weft region Af2 (FIG. 6(B)) is connected to the -Dx direction side of the warp region Ap3 in FIG. 6(A). The processor 210 determines the intersection position of the weft Wf corresponding to the weft region Af2 in the warp region Ap3 to be a point on a line passing through the center of the warp region Ap3 and parallel to the second direction Dy, and closest to the weft region Af2. The processor 210 similarly determines the intersection positions in the warp region Ap of other combinations of the warp region Ap and the weft region Af. The warp region Ap is also connected to the second direction Dy side or the -Dy direction side of the weft region Af. For example, warp regions Ap4 and Ap5 (FIG. 6(A)) are connected to the -Dx direction side of weft region Af4 in FIG. 6(B). Processor 210 determines the intersection position within weft region Af in the same way as the intersection position within warp region Ap. For example, processor 210 determines the intersection position with warp thread Wp corresponding to warp region Ap4 within weft region Af4 to be a point on a line passing through the center of weft region Af4 and parallel to the first direction Dx, and closest to warp region Ap4. Processor 210 connects multiple intersection positions according to the connection results between warp region Ap and weft region Af. This allows processor 210 to determine the positional relationship between multiple warp regions Ap and multiple weft regions Af, and further the grid lines.
[0141] The processor 210 may also use the arrangement of the center of the warp area Ap and the center of the weft area Af to determine the positional relationship between the warp area Ap and the weft area Af, and further the lattice lines. As shown in FIG. 6(A) and FIG. 6(B), the warp Wp is approximately parallel to the second direction Dy. Therefore, the positions in the first direction Dx of the centers of the multiple warp areas Ap associated with the same warp Wp are approximately the same. The distribution of the positions of the centers in the first direction Dx forms a cluster for each warp Wp. The processor 210 may adopt a representative position of the cluster as the position in the first direction Dx of the warp Wp. As the representative position, for example, the peak position of the cluster, the center position of the distribution range of the multiple positions included in the cluster, or the average position of the multiple positions included in the cluster may be adopted. Various methods can be adopted as the clustering method. For example, the k-means method may be adopted (the total number of clusters k may be set to the total number of warp Wp). The position of the weft Wf is also determined in a similar manner. The distribution of the positions of the centers of the multiple weft regions Af in the second direction Dy forms a cluster for each weft Wf. The processor 210 may adopt a representative position of the cluster as the position of the weft Wf in the second direction Dy. The processor 210 adopts multiple combinations of the position of the warp Wp in the first direction Dx and the position of the weft Wf in the second direction Dy as multiple intersection positions. This allows the processor 210 to determine the positional relationship between the multiple warp regions Ap and the multiple weft regions Af, and further the grid lines.
[0142] The processor 210 may also execute a process for each of the multiple warp thread areas Ap to connect the current warp thread area Ap with an adjacent warp thread area Ap located in the extension direction of the current warp thread area Ap. For example, the processor 210 calculates a straight line that passes through the center (e.g., center of gravity) of the current warp thread area Ap and is parallel to the extension direction of the current warp thread area Ap. The processor 210 selects the warp thread area Ap closest to the current warp thread area Ap from among the warp thread areas Ap that are in contact with the straight line as the adjacent warp thread area Ap. This allows multiple warp thread areas Ap associated with the same warp thread Wp to be connected.
[0143] The direction in which the warp region Ap extends may be determined by an analysis of the warp region Ap. For example, the processor 210 executes a contraction process in the first direction Dx to thin the warp region Ap. Then, the processor 210 calculates a straight line that approximates the thinned warp region Apf, and adopts a direction parallel to the calculated straight line as the extension direction. The contraction process may be, for example, a process of setting the target pixel to a non-region pixel when a plurality of peripheral pixels determined by a filter arranged at the position of the target pixel include a non-region pixel. The filter may be, for example, a pixel line of a predetermined length (for example, three pixels) that extends in the first direction Dx centered on the target pixel. The processor 210 repeats the contraction process until the size in the first direction Dx becomes sufficiently small. As described in FIG. 14(A), the size in the first direction Dx of the warp region Ap may differ depending on the position in the second direction Dy. The processor 210 may repeat the shrinking process until the maximum value of the magnitude in the first direction Dx becomes equal to or smaller than a threshold value (e.g., 3 pixels). Alternatively, a predetermined direction (e.g., the second direction Dy) may be used as the direction in which the warp region Ap extends.
[0144] Similarly, the processor 210 may execute a process for connecting the current weft area Af to an adjacent weft area Af located in the extension direction of the current weft area Af for each of the multiple weft areas Af, thereby connecting multiple weft areas Af associated with the same weft thread Wf.
[0145] As a result, the multiple warp regions Ap and the multiple weft regions Af are connected to represent the multiple warps Wp and the multiple wefts Wf. The processor 210 may use the multiple warp regions Ap associated with the same warp Wp to determine a line representing the warp Wp. For example, the processor 210 may determine a curve approximating the multiple centers of the multiple warp regions Ap as a line representing the warp Wp (e.g., a spline curve). Similarly, the processor 210 may determine a curve approximating the multiple centers of the multiple weft regions Af as a line representing the weft Wf. The processor 210 may adopt the multiple intersection points of the multiple lines representing the warp Wp and the multiple lines representing the weft Wf as the multiple intersection positions. In this way, the processor 210 can determine the positional relationship between the multiple warp regions Ap and the multiple weft regions Af, and further the lattice lines.
[0146] (6) The process of detecting the attribute difference portion related to the difference between the attribute of the region representing the thread and the reference attribute may be various processes. For example, one of the warp thread Wp and the weft thread Wf may be excluded from the detection of the attribute difference portion. The attributes to be processed may include one or more attributes arbitrarily selected in advance from the type of thread that is not hidden and is visible (warp thread Wp or weft thread Wf), the color, and the width. For example, one of the color and the width may be omitted. Here, the attributes to be processed may include one of the color and the width, and the type of thread that is visible. Also, both the color and the width may be omitted. Here, the attributes to be processed may include the type of thread that is visible. Also, the type of thread that is visible may be omitted. Here, the attributes to be processed may include one or both of the color and the width. In either case, the processor 210 may detect the width differences for each region representing a thread instead of for each thread (Figure 14(C)). In this case, the reference width pattern PW2 may indicate a reference range of width for each warp region Ap and a reference range of width for each weft region Af.
[0147] (7) The process of detecting a specific portion may be various other processes instead of the processes of the above-mentioned embodiments and modifications. For example, the process of detecting an attribute difference portion (S145 (FIG. 3)) may be omitted, and the process of detecting a gap difference portion (S150) may be executed. Alternatively, S150 may be omitted, and S145 may be executed. Also, the skew correction (S115) may be omitted.
[0148] (8) The specific portion to be detected may be various portions of the fabric. For example, the specific portion may include a portion of the fabric 700 where the total number of wefts Wf intersecting with the warp region Ap is different from a reference total number, and a portion where the total number of warp threads Wp intersecting with the weft region Af is different from a reference total number. The specific portion is not limited to a portion showing an abnormality, but may be a portion that satisfies a specific condition. For example, the specific portion may include a portion corresponding to a specific structure diagram. The specific portion may also include a portion showing a specific pattern (for example, a symbol, a mark, a character string, etc.).
[0149] In either case, the processor 210 may detect the specific portion without generating a texture diagram (e.g., the interlacing pattern PI1 (FIG. 13(A))). For example, the specific portion may be a portion whose color is different from a reference color. The processor 210 may detect, as the specific portion, a warp region Ap or a weft region Af that shows a color not included in the list of reference colors. The specific portion may also be a portion whose total number of wefts Wf intersecting with the warp region Ap is different from a reference total number. The processor 210 may connect multiple warp regions Ap and multiple weft regions Af to represent multiple warps Wp and multiple wefts Wf, as in the above modification. The processor 210 may detect the specific portion by calculating the total number of connection lines (i.e., lines indicating wefts Wf) of the weft region Af that intersect with the warp region Ap.
[0150] (9) When a specific portion is detected, the processor 210 may execute various processes (referred to as a specific process) in addition to notification (S190 (FIG. 3)). The specific process may include a process of outputting output data representing the specific portion. The device to which the output data is output may include one or more devices arbitrarily selected from a display device, a printing device, and a storage device (for example, a storage device inside the data processing device 200 (such as the non-volatile storage device 230), or an external storage device connected to the data processing device 200). In this manner, information representing the specific portion may be displayed, printed, or stored. The information representing the specific portion may include an image representing the specific portion of the textile 700, or a flag indicating whether the specific portion has been detected. In addition, the textile 700 may be transported by a transport device for reading. The specific process may include a process of stopping the transport device for the textile 700.
[0151] (10) The reading device that optically reads the textile 700 is not limited to the scanner 100, and may be a digital camera such as a line camera or an area camera. Although not shown, the digital camera may read the textile 700 transported by a transport device. For example, while the transport device is transporting the textile 700, the line camera may repeatedly read the textile 700 to generate data of a read image representing the textile 700. In either case, the color components of the read image may be any color components such as grayscale, RGB, YCbCr, CMYK, etc.
[0152] (11) In the above embodiment and modified examples, the processor 210 may cause the GPU 260 to execute various calculations. For example, the processor 210 may cause the GPU 260 to execute a part or all of the calculations of the object detection model 300. Note that the GPU 260 may be omitted.
[0153] (12) The detection device is not limited to a personal computer (e.g., data processing device 200 (FIG. 1)), but may be various other devices (e.g., digital camera, scanner, smartphone). Furthermore, a plurality of devices (e.g., computers) that can communicate with each other via a network may share part of the data processing function of the detection device, and collectively provide the data processing function (a system including these devices corresponds to the detection device).
[0154] In each of the above embodiments and modifications, a part of the configuration realized by hardware may be replaced by software, and conversely, a part or all of the configuration realized by software may be replaced by hardware. For example, the process of S120 in Fig. 3 may be executed by a dedicated hardware circuit such as an Application Specific Integrated Circuit (ASIC).
[0155] Furthermore, when some or all of the functions of the present disclosure are realized by a computer program, the program can be provided in a form stored in a computer-readable recording medium (e.g., a non-transitory recording medium). The program can be used in a state stored in the same or a different recording medium (computer-readable recording medium) from when it was provided. The "computer-readable recording medium" is not limited to portable recording media such as memory cards and CD-ROMs, but may also include internal storage devices within a computer, such as various ROMs, and external storage devices connected to a computer, such as a hard disk drive.
[0156] The above-mentioned examples and modifications can be combined as appropriate. The above-mentioned examples and modifications are provided to facilitate understanding of the present disclosure, and do not limit the present invention. The present invention may be modified or improved without departing from the spirit of the present invention, and the present invention includes equivalents thereof. [Explanation of symbols]
[0157] 100...scanner, 120...sensor unit, 121...light source, 122...reading sensor, 130...transport device, 140...control device, 190...casing, 192...cover, 193...frame, 194...support stand, 200...data processing device, 210...processor, 215...storage device, 220...volatile storage device, 230...non-volatile storage device, 231...program, 240...display unit, 250...operation unit, 260...graphics processing unit (GPU), 27 0...communication interface, 300...object detection model, 700...woven fabric, Af, Af1-Af4, Afk...weft region, Ap, Ap1-Ap5, Apa, Apf...warp region, Afj, AfL...long weft region, Aph, Api, ApL...long warp region, Ag, Ag1-Ag6...gap region, Ct, Pa, Pb...crossing position, I10, I20...read image, L1s...first reference length, L2s...second reference length, PI1...crossing pattern (position information), Wf...weft, Wp...warp
Claims
1. A program, an area detection function for detecting a plurality of areas including a plurality of warp areas and a plurality of weft areas from an image representing a woven fabric having a plurality of warp threads and a plurality of weft threads and optically read, the area detection function detecting a plurality of areas including a plurality of warp areas and a plurality of weft areas from an image representing the woven fabric ... a woven fabric having a plurality of warp threads and a plurality of weft threads, the area detection function detecting a plurality of areas including a plurality of warp areas and a plurality of weft thread areas from an image representing a woven fabric having a plurality of warp threads and a plurality of weft thread areas determining position information relating to a positional relationship between the plurality of warp regions and the plurality of weft regions; using said position information to locate a particular portion of said textile; A program that enables a computer to achieve this.
2. The program according to claim 1, the position information includes an interlacing pattern representing a yarn visible at each of a plurality of interlacing positions of the warp yarn and the weft yarn; The function of determining the position information includes a function of determining the interlacing pattern by connecting the plurality of warp regions and the plurality of weft regions, the specific portion includes an interlace difference portion corresponding to a difference between the interlace pattern and a reference interlace pattern; The function of detecting the specific portion includes a function of detecting the interlacing difference portion by comparing the interlacing pattern with the reference interlacing pattern. program.
3. The program according to claim 2, The area detection function includes: When the plurality of warp regions detected by the region detection function include a long warp region that is a warp region longer than a first reference length, the long warp region is divided into a plurality of warp regions; A function of dividing the long weft region into a plurality of weft regions when the plurality of weft regions detected by the region detection function include a long weft region that is a weft region longer than a second reference length; Including, the program.
4. The program according to claim 3, The function of determining the interlacing pattern is A function for connecting multiple warp regions included in the same long warp region; A function for connecting multiple weft regions included in the same long weft region; Including, the program.
5. The program according to any one of claims 1 to 4, further comprising: A function of acquiring area attribute information including one or both of an attribute of each of the plurality of warp regions and an attribute of each of the plurality of weft regions by analyzing the image, the attribute including one or both of a color and a width, the function being realized by a computer; The specific portion includes an attribute difference portion indicating one or both of a warp thread having an attribute different from a reference attribute of a warp thread and a weft thread having an attribute different from a reference attribute of a weft thread, The function of detecting the specific portion includes a function of detecting the attribute difference portion using reference information representing one or both of a reference attribute of each of the plurality of warp yarns and a reference attribute of each of the plurality of weft yarns, and the region attribute information. program.
6. The program according to any one of claims 1 to 4, further comprising: the plurality of regions detected by the region detection function include a plurality of gap regions between the plurality of warp yarns and the plurality of weft yarns, The specific portion includes a gap difference portion, which is a gap region having a size different from a reference size, The function of detecting the specific portion includes a function of detecting the gap difference portion using the plurality of gap regions. program.
7. A program, A function for detecting a plurality of regions including a plurality of warp regions and a plurality of weft regions from an image representing a woven fabric having a plurality of warp threads and a plurality of weft threads and optically read, wherein each of the plurality of warp regions represents a portion of the plurality of warp threads that is visible and not hidden by the plurality of weft threads, and each of the plurality of weft regions represents a portion of the plurality of weft threads that is visible and not hidden by the plurality of warp threads; A function of acquiring area attribute information including one or both of an attribute of each of the plurality of warp regions and an attribute of each of the plurality of weft regions by analyzing the image, the attribute including one or both of a color and a width; a function of detecting attribute difference portions including one or both of a portion where an attribute of a warp thread differs from the reference attribute of the warp thread and a portion where an attribute of a weft thread differs from the reference attribute of the weft thread, using reference information representing one or both of a reference attribute of each of the plurality of warp threads and a reference attribute of each of the plurality of weft threads, and the region attribute information; A program that enables a computer to achieve the above.
8. A program, A function of detecting a plurality of gap regions between a plurality of warp threads and a plurality of weft threads from an optically read image representing a woven fabric having the plurality of warp threads and a plurality of weft threads; A function of detecting a gap difference portion, which is a gap area having a size different from a reference size, using the plurality of gap areas; A program that enables a computer to achieve this.
9. A detection device, comprising: a region detection unit that detects a plurality of regions including a plurality of warp regions and a plurality of weft regions from an image representing a woven fabric having a plurality of warp threads and a plurality of weft threads and that is optically read, the region detection unit detecting a plurality of regions including a plurality of warp regions and a plurality of weft regions, the region detection unit detecting a plurality of regions including a plurality of warp regions and a plurality of weft regions, the region detection unit detecting a plurality of regions including a plurality of warp regions and a plurality of weft threads ... a position information determination unit that determines position information related to a positional relationship between the plurality of warp regions and the plurality of weft regions; a detection unit that detects a specific portion of the textile using the position information; A detection device comprising:
Citation Information
Patent Citations
Inspection apparatus for woven fabric
JP1998121368A