Program and detection device

A computer program analyzes optical images of woven fabrics to detect specific portions by using positional and attribute information, addressing inefficiencies in existing techniques for fabric inspection.

WO2025089044A1PCT designated stage expired Publication Date: 2025-05-01BROTHER KOGYO KK
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/JP2024/035912
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-10-27
Filing Date
2024-10-08
Publication Date
2025-05-01

AI Technical Summary

Technical Problem

Existing techniques for detecting specific portions of a fabric, such as thread loss or abnormalities, are not efficient in accurately identifying positional relationships and attribute differences between warp and weft threads.

Method used

A computer program is implemented to detect specific portions of a woven fabric by analyzing optical images, using positional information related to the positional relationship between warp and weft regions, and detecting attribute differences such as color and width variations.

Benefits of technology

The program effectively detects specific portions of the fabric, including gap regions and attribute difference portions, by utilizing positional and attribute information, thereby improving the accuracy and efficiency of fabric inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure JP2024035912_01052025_PF_FP_ABST
    Figure JP2024035912_01052025_PF_FP_ABST
Patent Text Reader

Abstract

The present invention detects a specific portion of a woven fabric. In the present invention, a plurality of regions, which include a plurality of warp regions and a plurality of weft regions, are detected from an image representing an optically read woven fabric. The plurality of warp regions and the plurality of weft regions are used to detect a specific portion of the woven fabric or a portion having a region attribute different from a reference attribute. A plurality of gap regions between a plurality of warps and a plurality of wefts are detected from the image representing the optically read woven fabric. The plurality of gap regions are used to detect a gap difference portion, which is a gap region having a size different from a reference size.
Need to check novelty before this filing date? Find Prior Art

Description

Program and detection device

[0001] The present specification relates to a technique for detecting a specific portion of a textile.

[0002] Woven fabrics may have defects such as loose threads. Inspection devices for inspecting woven fabrics for defects have been proposed. For example, Patent Document 1 proposes a technique for calculating the texture period of the woven fabric, setting a comparison region of image data based on the texture period, extracting statistics from the image data within the comparison region, and extracting defects based on the statistics.

[0003] Japanese Patent Application Publication No. 10-121368

[0004] There was room for improvement in detecting specific parts of the fabric.

[0005] This specification discloses a technique for detecting specific portions of a fabric.

[0006] The techniques disclosed in this specification can be implemented 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 without being hidden by the multiple weft threads, and each of the multiple weft areas represents a portion of the multiple weft threads that is visible without being 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 specific portions of the woven fabric.

[0008] According to this configuration, by using position information relating to the positional relationship between a plurality of warp regions and a plurality of weft regions, a specific portion of the fabric can be appropriately detected.

[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. a function to acquire area attribute information including one or both of color and width by analyzing the image, wherein the attributes include one or both of color and width; and a function to detect attribute difference portions including one or both of a portion where the attribute of a warp thread differs from the reference attribute of the warp thread and a portion where the 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 area attribute information.

[0010] According to this configuration, it is possible to appropriately detect parts with different attributes 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 multiple warp threads and multiple weft threads that has been optically read; and using the multiple gap areas to detect gap difference portions, which are gap areas having a size different from a reference size.

[0012] According to this configuration, the gap difference portion can be appropriately detected using a plurality of gap regions.

[0013] The techniques disclosed in this specification can be realized in various forms, such as a detection method and a detection device, a computer program for realizing the functions of the method or device, a recording medium (e.g., a non-transitory recording medium) on which the computer program is recorded, and the like.

[0014] 1 is an explanatory diagram showing a data processing device as an embodiment; FIG. 2 is a perspective view showing an example of a scanner 100; FIG. 3 is a flowchart showing an example of an inspection process; (A)-(C) are diagrams showing examples of images processed in the inspection process; (A)-(C) are diagrams showing examples of warp regions, weft regions, and gap regions; FIG. 4 is a flowchart showing an example of a division process; (A) and (B) are diagrams showing examples 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 a warp region Ap; (D) is a diagram showing an example of the correspondence relationship between length and the number of divisions; (E) is a diagram showing another example of the correspondence relationship between length and the number of divisions; (A) and (B) are diagrams showing examples of multiple warp regions Ap and multiple weft regions Af; (C) is a diagram showing the correspondence relationship between a center Ct and the type of region; and FIG. 5 is a flowchart showing an example of a connection process. 1A-1F are diagrams showing an example of connections between warp regions Ap and weft regions Af. A flowchart showing an example of a comparison process. A diagram showing an example of a comparison process between an intersection pattern and a reference intersection pattern. B diagram showing an example of a comparison process between a color pattern and a reference color pattern. A diagram showing an example of a width calculation method. B diagram showing multiple warp regions Ap associated with one warp thread Wp. C diagram showing a scanned image I20. A flowchart showing an example of a comparison process. A diagram showing an example of a warp region Ap, a weft region Af, and a gap region Ag. B diagram showing an example of the size of one gap region Ag. C diagram showing an example of the reference size. A flowchart showing a second embodiment of a process for acquiring information on warp regions Ap and weft regions Af. A diagram showing an example of a portion of scanned image I20. B diagram showing an example of a detection result. 10A to 10G are diagrams showing examples of methods for determining the type of candidate region.

[0015] A. First Example: A1. Device Configuration: Fig. 1 is an explanatory diagram showing a data processing device as one example. Data processing device 200 is, for example, a personal computer. Data processing device 200 performs various data processing for inspecting the appearance of an object (in this example, a textile). Hereinafter, it is assumed that the appearance of a textile 700 is to be 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 process data, 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 for 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 perform various numerical calculations such as image processing and machine learning. The GPU 260 performs various calculations in accordance with instructions from the processor 210. 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 (for example, it includes one or more of a USB interface, a wired LAN interface, an IEEE802.11 wireless interface, and an industrial camera interface (for example, CameraLink, CoaXPress, etc.)). In this embodiment, the communication interface 270 is connected to the 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, the first direction D1 and the second direction D2 indicate horizontal directions, and the 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 charge coupled devices (CCDs) and complementary metal oxide semiconductors (CMOSs). 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 using the reading sensor 122, thereby outputting data representing 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 includes a rail that supports the sensor unit 120 slidably in a direction parallel to the second direction D2, multiple pulleys, a belt that is wound around the multiple pulleys and is partially fixed to the sensor unit 120, and an electric motor that rotates the pulleys. The electric motor rotates the pulleys, causing the sensor unit 120 to move 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 repeatedly reads the textile 700 during transportation. 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 the 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 the textile 700 is placed, 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. Note that the start instruction may be input to the data processing device 200 via the communication interface 270 by a device other than the data processing device 200.

[0027] The processor 210 of the data processing device 200 executes the inspection process in accordance with 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 fabric 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] 4A to 4C are diagrams showing examples of images processed in the inspection process. Image I10 in Fig. 4A shows an example of a scanned image of the textile 700. In this embodiment, scanned 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 intersect with 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 the 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 the multiple weft threads Wf. The multiple weft threads Wf may be formed by folding back a single long thread multiple times. In this way, a single long thread may form multiple thread portions extending in the horizontal direction at multiple positions in the vertical direction (i.e., multiple weft threads Wf). The same applies to the multiple warp threads Wp.

[0030] Various deformations can occur in a woven fabric. Two line segments Df and Dp are shown on the scanned image I10. The first line segment Df is a line segment parallel to the weft yarn Wf, and the second line segment Dp is a line segment parallel to the warp yarn 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, a skew occurs in the woven fabric 700.

[0031] In S115 (FIG. 3), the processor 210 performs skew correction on the scanned image I10. The skew correction may be any of various processes (e.g., affine transformation) that correct the scanned image I10 so that it represents the textile 700 without skew. FIG. 4B shows an example of a scanned image I20 after skew correction. As shown in the figure, 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] Various methods may be used to determine the skew correction parameters. For example, the processor 210 may analyze the scanned image I10 to detect skew in the fabric 700 and correct the detected skew. Various methods may be used to detect skew. For example, the processor 210 may use a Hough transform to detect the direction parallel to the weft yarn Wf and the direction parallel to the warp yarn Wp. Alternatively, the processor 210 may determine the skew correction parameters according to information input by an operator. For example, the processor 210 may display the scanned 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 scanned image I10 by operating the operation unit 250. The processor 210 may perform skew correction according to the line segments Df and Dp specified by the operator.

[0033] FIG. 4C is a diagram showing an example of an enlarged view of a portion I20p of the scanned image I20 (FIG. 4B) after skew correction. The scanned image I20 shows multiple weft threads Wf, multiple warp threads Wp, and the gaps Wg between these multiple threads Wf and Wp. The multiple weft threads Wf are each approximately parallel to the first direction Dx. The multiple warp threads Wp are each approximately parallel to the second direction Dy. The weave of the fabric 700 can be various, such as a "plain weave," a "twill weave," or a "satin weave."

[0034] In S120 (FIG. 3), the processor 210 analyzes the skew-corrected scanned image I20 to obtain information on the warp region, weft region, and gap region. FIG. 5 is a flowchart showing an example of a process for obtaining information on these regions. In S210, the processor 210 detects the warp region, weft region, and gap region from the scanned image I20. FIGS. 6(A) to 6(C) show examples of the detected warp region, weft region, and gap region, respectively. Each figure shows a portion I20p of the scanned image I20.

[0035] 6A, each of the multiple warp regions Ap (including multiple warp regions Ap1-Ap5) is hatched. Each of the multiple warp regions Ap represents a visible portion of the multiple warp threads Wp that is not hidden by the weft threads Wf. In this embodiment, a continuous region representing 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 Figure 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 visible portion of the multiple wefts Wf that is not hidden by the warp threads Wp. In this embodiment, a continuous region representing 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 to Ag6) is hatched. Each of the gap regions Ag represents a gap between the warp yarns Wp and the weft yarns Wf.

[0038] Various methods may be used to detect these regions Ap, Af, and Ag. 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 segmentation known as instance segmentation. This region segmentation detects the object region and object type (class) for each object. This region segmentation determines, for each pixel, which object region the pixel belongs to. The object detection model 300 is pre-trained to appropriately segment multiple types of regions, including warp regions Ap, weft regions Af, gap regions Ag, and other regions. The training method may be, for example, the training method for 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 of the regions Ap and Af representing the yarns in the storage device 215 (e.g., the non-volatile storage device 230). The type data indicates 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 processing in FIG. 5, i.e., the processing at S120 in FIG. 3.

[0041] The position data may be various data representing the position of an area within the scanned 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 (e.g., the smallest rectangle circumscribing the area). The position data may represent the coordinates of the 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, within the scanned 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 to each of the detected areas Ap, Af, Ag, distinguishing each area from the others. Then, in S215 and S220, the processor 210 generates data representing the correspondence between the pixels of the scanned image I20 and the area identifier for each pixel as position data.

[0042] In S125 (FIG. 3), the processor 210 analyzes the scanned image I20 to determine color values ​​for each of the multiple warp regions Ap and each of the multiple weft regions Af. The color values ​​of the regions may be various values ​​that represent the color of the region represented by the scanned image I20. For example, the color value of the region may be determined as a statistical quantity (e.g., the average or mode of multiple color values ​​of multiple pixels) that indicates the magnitude of the gradation value of each color component within the region. Here, a portion of the multiple pixels within the region may be used. Alternatively, the color value of the region may be determined as the color value of a specific pixel within the region (e.g., the pixel at the center of the region). The processor 210 stores data representing the color values ​​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, 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 and Api) and multiple weft regions Af (including weft regions Afj and Afk). FIG. 8(A) shows the state before division, and FIG. 8(B) shows the state after division. Each diagram shows a portion of the woven fabric 700 represented by the scanned image I20 (FIG. 4(B)). Lengths Lph and Lpi indicate the lengths of the warp regions Aph and Api, respectively (here, the lengths in the second direction Dy). Lengths Lfj and Lfk indicate the lengths of the weft regions Afj and Afk, respectively (here, the lengths in the first direction Dx).

[0045] FIG. 8(C) is a diagram showing an example of a method for calculating the length of a warp region Ap. As shown in the figure, the outline 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. The figure shows lengths Lp1-Lp4 in the second direction Dy at four pixel positions Px1-Px4 in the first direction Dx. The lengths Lp1-Lp4 can be different from one another.

[0046] In this embodiment, a statistical quantity 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, a portion of the multiple pixel positions in the first direction Dx within the warp area Ap may be used. Furthermore, 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 pixel positions in the first direction Dx that show such a recess CV are excluded from the calculation of the length Lp. In other words, it is preferable that the length Lp is calculated using the length of the continuous portion within 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 side (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 scanned image I20 (S210 (FIG. 5)). The processor 210 obtains the length Lp by analyzing the scanned 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., the 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 two or more wefts Wf is selected as the long warp region. The total number Np of warp regions Ap formed by division (also referred to as 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 one weft Wf.

[0049] FIG. 8(D) is a diagram showing an example of the correspondence relationship between length and number of divisions. The diagram shows a warp correspondence relationship 10pa between the length Lp of the warp area Ap and the number of divisions Np, as well as a weft correspondence relationship 10fa, which will be described later. In the diagram, the warp correspondence relationship 10pa is represented by the horizontal axis showing the length Lp and the number of divisions Np written on the horizontal axis. The larger the length Lp, the larger the number of divisions Np. The diagram also shows thresholds for the length Lp: "Lps," "2*Lps," and "3*Lps." The thresholds are integer multiples of the first standard length Lps. The first standard length Lps indicates the standard length Lp of the warp area Ap overlapping with one weft Wf. The first standard length Lps is predetermined depending on 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 a warp area Ap into two or more warp areas Ap is the same as the first standard length Lps. Such a warp correspondence relationship 10pa can derive an appropriate number of divisions Np.

[0050] The processor 210 determines the number of divisions Np from the length Lp of the long warp region in accordance with 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 lines parallel to the first direction Dx. As a result, the long warp region is divided into Np warp regions Ap, each overlapping one weft Wf. For example, the warp region Aph in FIG. 8(A) overlaps two wefts Wf. The length Lph of the warp region Aph is associated with the number of divisions Np of 2 (FIG. 8(D)). As shown in FIG. 8(B), the long warp region Aph is divided into two warp regions Ap, each overlapping one weft Wf. The length Lpi of the long warp region Api, which overlaps three wefts Wf, is associated with the number of divisions Np of 3. The long warp area Api is divided into three warp areas Ap, each overlapping one weft Wf.

[0051] In S315 (Figure 7), the processor 210 stores 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 in the memory device 215 (e.g., non-volatile memory device 230).

[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 Figure 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 two or more warp threads Wp is selected as the long weft region. The total number Nf of weft regions Af formed by division (also referred to as the number of divisions Nf) is determined based on the length Lf. The correspondence relationship between the length Lf and the number of divisions Nf is determined in advance so that the long weft region is divided into multiple weft regions Af, each overlapping one warp thread Wp.

[0054] The weft correspondence relationship 10fa in FIG. 8(D) may be used as the correspondence relationship between the length Lf and the number of divisions Nf. 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 region 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 less than or equal to k*Lfs, the number of divisions Nf is k (k is an integer greater than or equal to 1). The second reference length L2s for dividing the weft region Af into two or more weft regions Af is the same as the second standard length Lfs. Such a weft correspondence relationship 10fa can derive an appropriate number of divisions Nf.

[0055] The processor 210 determines the number of divisions Nf from the length Lf of the long weft region in accordance with the weft correspondence relationship 10fa. The processor 210 equally divides the long weft region into Nf weft regions Af having the same length (Lf / Nf) by 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. 8A overlaps two warps Wp. The length Lfj of the weft region Afj is associated with the number of divisions Nf of 2 (FIG. 8D). As shown in FIG. 8B, the long weft region Afj is divided into two weft regions Af, each overlapping one warp thread Wp. The length Lfk of the weft region Afk, each overlapping one warp thread Wp, is associated with the number of divisions Nf of 1. The weft region Afk is not selected as a long weft region and is not divided.

[0056] In S325 (FIG. 7), the processor 210 stores data representing the correspondence between information (in this embodiment, positions and types) of the multiple weft regions Af generated by division and the identifiers of the original long weft regions 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 length and number of divisions may be various, as long as multiple regions overlapping with one yarn are obtained from an area overlapping with two or more yarns. FIG. 8(E) shows another example of the correspondence relationship. The figure shows a warp correspondence relationship 10pb and a weft correspondence relationship 10fb. 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 for 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 for the length Lf of the weft region Af is (k+0.5)*Lfs (k is an integer greater than or equal to 1). If 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. 9A and 9B are diagrams showing examples of multiple warp regions Ap and multiple weft regions Af. Each diagram shows multiple regions Ap and Af, including the multiple regions Ap and Af shown in FIG. 8B. In FIG. 9B, the center Ct of each region Ap and Af is indicated by a black dot. The processor 210 uses, for example, the position of the center of gravity of the regions Ap and Af as the center position of each region Ap and Af in the scanned image I20. Alternatively, the regions Ap and Af may be approximated by a rectangle (e.g., the smallest rectangle circumscribing the region). The processor 210 may use the average position of the four corners of the rectangle as the center position. 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] 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, weft area Af or warp area Ap) are associated by the processes of S120, S130, and S135 in FIG. 3.

[0060] As explained 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 will also be 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) to 11(F) are diagrams showing examples of connections between warp regions Ap and weft regions Af. Each diagram shows multiple weft centers Ctf corresponding to multiple weft regions Af and multiple warp centers Ctp corresponding to multiple warp regions Ap. FIGS. 11(A) and 11(B) show the same multiple centers Ctf and Ctp as those in FIG. 9(C). The horizontally elongated rectangular region AfL indicated by dotted lines indicates a long weft region (referred to as the long weft region AfL). The vertically elongated rectangular region ApL indicated by dotted lines indicates a 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 area 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 area ApL extends (here, the second direction Dy). The processor 210 repeatedly selects a new combination of two adjacent warp centers Ctp and connects the two warp centers Ctp of the selected combination. This forms a line connecting the multiple warp centers Ctp included in the long warp area ApL. The processor 210 performs this connection process for each long warp area ApL. In FIG. 11(B), two connected warp centers Ctp are connected by a straight line. For example, two warp centers Ctp included in the long warp area Aph are connected, and three warp centers Ctp included in the long warp area 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 direction in which the long weft region AfL extends (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 connected weft centers Ctf 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 (e.g., 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 will be described later, the processor 210 connects a plurality of warp regions Ap and a plurality of weft regions Af to form grid lines corresponding to a plurality of warp threads Wp and a plurality of weft threads Wf. Various methods for such connection may be used. 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 area of ​​interest. The processor 210 connects the area of ​​interest to the nearest area in the second direction Dy and the nearest area in the -Dy direction. Figure 11 (C) shows the center of interest Cti, which is the center Ct of the area of ​​interest, and eight centers Ct of the eight areas surrounding the area of ​​interest. These nine centers Ct indicate nine intersection positions between the three warp threads Wp aligned in the first direction Dx and the three weft threads Wf aligned in the second direction Dy.

[0067] The figure shows a first range Rxi, which is a range in the first direction Dx. The first range Rxi is a range of a predetermined width centered at 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 the 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 a region of interest. The processor 210 connects the closest area in the first direction Dx and the closest area in the opposite direction (also referred to as the -Dx direction) to the region of interest. FIG. 11(E) shows the same nine centers Ct as those in FIG. 11(C). The second range Ryi is a range of a predetermined width centered on the position Pyi of the center of interest Cti in the second direction Dy. The width of the second range Ryi is experimentally determined in advance so that the centers Ct associated with one weft Wf associated with the center of interest Cti are included within the second range Ryi, and the centers Ct associated with other wefts 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 and 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 wefts Wf are formed. The connection process performed by S410, S415, and S420 in Fig. 10 forms grid lines representing the 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). The processor 210 then 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 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 flowchart showing an example of the comparison process. In S510, the processor 210 determines a crossing pattern using the connection result from S140 (FIG. 3). FIG. 13(A) is a diagram showing an example of the comparison process between the crossing pattern and a reference crossing pattern. The same connection result RC as that shown in FIG. 11(F) is shown in the figure. The crossing pattern PI1 shows a portion of the crossing pattern PI1 that corresponds to the connection result RC. The crossing pattern PI1 represents the threads visible at each of the multiple intersection positions between multiple warp threads Wp and multiple weft threads Wf (i.e., the positions where the warp threads Wp and the weft threads Wf overlap). Such a crossing pattern PI1 is also called a texture diagram. Although not shown, the crossing pattern PI1 represents the entire pattern of the woven fabric 700 represented by the scanned image I20 (FIG. 4(B)).

[0075] In this embodiment, the warp center Ctp indicates the crossing position where the warp thread Wp is visible without being hidden by the weft thread Wf, and the weft center Ctf indicates the 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 multiple warp centers Ctp and multiple weft centers Ctf according to the connection result. The processor 210 generates data for the crossing pattern PI1 according to this arrangement. The crossing pattern PI1 indicates the type of thread (called a thread flag) visible at each of the multiple 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 an unhatched square. One column represents one warp thread Wp, and one row represents one weft thread Wf.

[0076] In S515 (FIG. 12), the processor 210 detects abnormal interlacing portions by comparing the interlacing pattern with a reference interlacing pattern. The reference interlacing pattern PI2 represents the reference yarn flag pattern (i.e., the reference weave diagram) for the entire fabric 700 represented by the scanned image I20 (FIG. 4B). The abnormal interlacing portions are crossing positions that show yarn flags that differ from the reference yarn flags. In this embodiment, the abnormal interlacing portions indicate errors in the weaving of the fabric 700. FIG. 13(A) shows a portion of the reference interlacing pattern PI2 that corresponds to the connection result RC.

[0077] In this embodiment, the reference interlacing pattern PI2 is obtained by repeating unit patterns (not shown) in the first direction Dx and the second direction Dy. Of the patterns represented by the repetition of the unit patterns, predetermined portions corresponding to the rows and columns of the interlacing pattern PI1 (i.e., the weft yarns Wf and the warp yarns Wp of the textile 700) are used as the reference interlacing pattern PI2. For example, the end columns in the first direction Dx of the reference interlacing pattern PI2 represent appropriate yarn flag patterns for the end columns in the first direction Dx of the interlacing pattern PI1 (i.e., the warp yarns Wp at the ends of the textile 700 in the first direction Dx of the textile 700 in the scanned image I20).

[0078] The processor 210 detects crossing positions where the yarn flags differ between the crossing pattern PI1 and the reference crossing pattern PI2 (i.e., abnormal crossing portions). FIG. 13A shows a portion of the crossing result pattern PI3 representing the detection results, 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 abnormal crossing portion BLIe is associated with the crossing position Pa. In the crossing result pattern PI3, various information may be associated with crossing positions where the yarn flags match (e.g., yarn flags). Although not shown, the crossing result pattern PI3 represents the pattern of the detection results for the entire woven fabric 700 represented by the scanned image I20 ( FIG. 4B ).

[0079] At 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 represents the color values ​​of each of the multiple warp yarns Wp and the multiple weft yarns Wf. FIG. 13B illustrates an example of a comparison process between a color pattern and a reference color pattern. The figure shows a portion of the color pattern PC1 that corresponds to the connection result RC (FIG. 13A). In this example, the yarn color is assumed to be black BLb or white BLw. In this example, the color pattern PC1 represents the color values ​​of the yarns visible at each of the multiple intersection positions of the woven fabric 700 represented by the scanned image I20 (FIG. 4B). The processor 210 obtains the color values ​​of each intersection position using the color values ​​of each area Ap and Af determined in S125 (FIG. 3), the division results of S130, and the connection results of S140. The processor 210 generates data for the color pattern PC1 by arranging the color values ​​of each intersection position according to the 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 fabric 700 represented by the scanned image I20 (FIG. 4B). In this embodiment, the appropriate colors of the multiple warp yarns Wp and the multiple weft yarns Wf are predetermined according to the configuration of the fabric 700. The reference color pattern PC2 is predetermined using the yarns of each yarn 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 thread of the warp yarn Wp or the weft yarn Wf that has an inappropriate color.

[0083] The processor 210 uses the color pattern PC1 and the reference color pattern PC2 to detect intersection positions (i.e., color abnormality portions) that show a color different from the reference color. FIG. 13B shows a portion of the color result pattern PC3 representing the detection result, corresponding to the connection result RC. The color is different at multiple intersection positions Pb between the color pattern PC1 and the reference color pattern PC2. Information indicating color abnormality portions BLCe is associated with multiple intersection positions Pb in the color result pattern PC3. Various information may be associated with intersection positions showing the same color in the color result pattern PC3 (e.g., color values ​​indicated by the reference intersection pattern PI2). Although not shown, the color result pattern PC3 represents the overall detection result pattern of the textile 700 represented by the scanned image I20 ( FIG. 4B ).

[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 determined in advance through experimentation so that the color value is within the reference range when the thread color is appropriate and 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. Figure 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 the same as the method for calculating the length Lp of the warp region Ap described in Figure 8(C). The diagram shows widths ApW1-ApW7 in the first direction Dx at seven pixel positions Py1-Py4 in the second direction Dy. The widths ApW1-ApW7 may be different from one another.

[0087] In this embodiment, a statistical quantity 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 the multiple pixel positions in the second direction Dy within the warp area Ap may be used. Furthermore, the outline OL of the warp area Ap may form a recess CVy that is recessed in a direction parallel to the second direction Dy. Pixel positions in the second direction Dy that indicate such a recess CVy are preferably 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 ApW of each of the multiple weft regions Af in the second direction Dy. The method for calculating the width of the weft region Af is the same as the method for calculating the width ApW of the warp region Ap, except that the first direction Dx and the second direction Dy are interchanged. The widths of the regions Ap and Af are calculated by analyzing the position data of the regions Ap and Af (S210-S215 (FIG. 5), FIG. 7). The position data is data obtained by analyzing the scanned image I20 (S210-S215 (FIG. 5), FIG. 7). The processor 210 obtains the widths of the regions Ap and Af by analyzing the scanned 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 will also be 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 calculates the width of each of the multiple warp threads Wp and the width of each of the multiple weft threads Wf using the connection result from S140 (FIG. 3). FIG. 14(B) is a diagram showing multiple warp areas Ap associated with one warp thread Wp. Multiple warp areas Ap, including warp areas Apa-Apc, are associated with the same warp thread Wp based on the connection result (S140 (FIG. 3)).

[0092] The width pW of the warp thread Wp can be any of various values ​​indicating the size of the warp thread Wp in the first direction Dx. 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 or maximum value of the multiple widths of the multiple warp regions Ap associated with the warp thread Wp (including the widths ApaW-ApcW of the warp regions 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 regions 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 for calculating the width of the weft thread Wf is the same as the method for 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 width abnormalities by comparing the width pattern with a reference width pattern. FIG. 14C is a diagram showing a scanned image I20. Assume that the fabric 700 has u warp threads Wp and v weft threads Wf. As described in S545 (FIG. 12), the processor 210 generates a width pattern PW1 from a cross width pattern PWc1, which is a pattern of multiple widths of multiple warp regions Ap and multiple widths of multiple weft 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 plurality of warp threads Wp and the plurality of weft threads Wf are determined in advance according to the configuration of the woven fabric 700. The reference width pattern PW2 is determined in advance 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 having widths 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 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 processing in FIG. 12, i.e., the processing of S145 in FIG. 3.

[0097] In S150, the processor 210 compares the gap with a reference gap. FIG. 15 is a flowchart showing an example of the comparison process. In S610, the processor 210 acquires the size of each gap region Ag (FIG. 6C). FIG. 16A 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 threads Wp and the weft threads Wf are flexible and easily deformed. The shapes of the warp region Ap and the weft region Af can vary in various ways. Therefore, the shape of the gap region Ag can vary 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 of the gap region Ag is determined by 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). The method for calculating the width AgW may be the same as the method for calculating the width ApW of the warp region Ap (FIG. 14(A)). The method for calculating the height AgH may be the same as the method for 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. An abnormal gap portion is a gap region Ag whose size differs from the reference size. FIG. 16C 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 equal to or greater than a lower limit HL and equal to or less than an upper limit HH) and a reference range RW of the width AgW (here, a range equal to or greater than a lower limit WL and equal to or less than an upper limit WH). In this embodiment, the reference size is determined in advance depending on the configuration of the fabric 700. In this embodiment, the reference size is common to multiple 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 and RH. Through this comparison, the processor 210 detects intersection positions (i.e., gap abnormality portions) where the width AgW or height AgH is outside the corresponding reference ranges RW and RH. An example of a gap abnormality portion is shown in FIG. 16(A). The first gap abnormality portion Age1 has a width AgW greater than the upper limit value WH. The second gap abnormality portion Age2 has a height AgH smaller than the lower limit value HL.

[0101] In S620 (FIG. 15), the processor 210 stores 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 processing in FIG. 15, i.e., the processing of S150 in FIG. 3.

[0102] In S190, the processor 210 notifies the operator of the comparison results. The comparison results include the detection results of abnormal weaving portions ( S515 in FIG. 12 ), abnormal color portions ( S530 in FIG. 12 ), abnormal width portions ( S550 in FIG. 12 ), and abnormal gap portions ( S615 in FIG. 15 ). Any method of notification may be used. For example, the processor 210 may display information representing the comparison results (e.g., text, a table, etc.) on the display unit 240. The notified comparison results may also include various information, including information indicating whether or not an abnormal portion was detected. For example, if an abnormal portion is detected, the processor 210 may display an image of the fabric 700 on the display unit 240, along with information indicating the location of each abnormal portion (e.g., arrows, etc.).

[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 processing. In S120 and S130 (FIG. 3), the processor 210 detects multiple regions including multiple warp regions Ap (FIG. 6A) and multiple weft regions Af (FIG. 6B) from the scanned image I20 (FIG. 4B) (the functions of S120 and S130 are examples of region detection functions). The scanned image I20 is an optically scanned image representing the woven fabric 700. As shown in FIG. 4C, the woven fabric 700 has multiple warp threads Wp and multiple weft threads Wf. As shown in FIG. 6A, each of the multiple warp regions Ap represents a visible portion of the multiple warp threads Wp that is not obscured by the multiple weft threads Wf. As shown in FIG. 6B, each of the multiple weft regions Af represents a visible portion of the multiple weft threads Wf that is not obscured by the multiple warp threads Wp.

[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] With this configuration, the processor 210 can determine the 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 woven fabric 700 has a deformation (such as a skew or distortion) in the scanned image I20, the processor 210 can determine the appropriate position information PI1. Then, by using the position information PI1, the processor 210 can appropriately detect a specific portion of the woven 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 also includes a crossing pattern PI1 representing the threads visible at each of the multiple crossing positions Ct between the warp yarns Wp and the weft yarns 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. 13A) by connecting multiple warp regions Ap and multiple weft regions Af. As described in FIG. 13A, the specific portion to be detected includes a crossing abnormality portion (e.g., a crossing abnormality portion BLIe). The crossing abnormality portion is an example of a crossing difference portion corresponding to a difference between the crossing pattern PI1 and the reference crossing pattern PI2. The crossing difference portion indicates a difference between the weave indicated by the crossing pattern PI1 and the reference weave indicated by the reference crossing pattern PI2. As explained in S145, the process of detecting the 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. With this configuration, the processor 210 can appropriately determine the crossing pattern PI1 by connecting multiple warp regions Ap and multiple 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 region detection process for detecting the warp region Ap and the weft region Af includes the process of S130. The process of S130 includes S310 and S320 of FIG. 7. In S310, if the multiple warp regions Ap detected by the region detection process include a long warp region (e.g., long warp regions Aph, Api (FIG. 8A)) that is a warp region longer than the first reference length L1s, the processor 210 divides the long warp region into multiple warp regions Ap. In S320, if the multiple weft regions Af detected by the region detection process include a long weft region (e.g., long weft region Afj (FIG. 8A)) that is a weft region longer than the second reference length L2s, the processor 210 divides the long weft region into multiple weft regions Af. With this configuration, the processor 210 can appropriately determine the interlacing pattern PI1 by connecting multiple warp regions Ap, each including a divided warp region Ap, and multiple weft regions Af, each including a divided weft region Af. If a weft region Af is connected to the long warp region before division, the error in the connection position between the long warp region and 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 interlacing 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. As a result, the processor 210 can appropriately determine the interlacing pattern PI1.

[0110] In this embodiment, the processor 210 analyzes the scanned image I20 in S125 (FIG. 3) to acquire information including both the color of each of the warp regions Ap (e.g., white BLw or black BLb) and the color of each of the weft regions Af. The color of each region is an example of a region attribute. The information acquired in S125 is an example of region attribute information that represents the attributes of the warp regions Ap and the weft regions Af.

[0111] In S145 (specifically, S540 in FIG. 12), the processor 210 acquires information including both the width ApW (FIG. 14A) 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 scanned 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] In this manner, 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 in S125 (FIG. 3) and S540 (FIG. 12).

[0113] The process of detecting a specific portion (S145 (FIG. 3)) includes S530 and S545-S550 in FIG. As described in S530 and S545-S550, the specific portions to be detected include the abnormal color portions (for example, the abnormal color portion BLCe ( FIG. 13B )) and abnormal width portions (for example, the abnormal width portions Wpe, Wfe ( FIG. 14C )) of each of the warp thread Wp and the weft thread Wf. The abnormal color 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 abnormal color 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 abnormal width 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 abnormal width 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 abnormal color portions and abnormal width portions are examples of attribute difference portions that indicate 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 that represents both the reference colors of the multiple warp threads Wp and the reference colors of the multiple weft threads Wf. The color pattern PC1 represents the colors 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 abnormal width 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. 14C , in this embodiment, the reference width is a width within the reference range. The width pattern PW1 is determined using the widths of each of the regions Ap and Af (i.e., the region attribute information), as described in S145 of FIG. 3 (specifically, S545 of FIG. 12 ). In this way, the processor 210 detects the abnormal width portion using the region attribute information and the reference width pattern PW2.

[0116] According to the above configuration, the processor 210 can appropriately detect parts with different attributes by using the reference information and the region 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 an abnormal gap portion (e.g., abnormal gap portions Age1 and Age2 in FIG. 16(A) ). An abnormal gap portion is an example of a gap difference portion, which 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. This configuration allows the processor 210 to appropriately detect the gap difference portion using multiple gap regions Ag.

[0118] B. Second Example: Figure 17 is a flowchart showing a second example of the process for acquiring information on the warp area Ap and the weft area Af. The process in Figure 17 is executed in S120 (Figure 3) instead of the process in Figure 5. In S710, the processor 210 detects candidate areas for the warp area and the weft area.

[0119] FIG. 18A is a diagram showing an example of a portion of the scanned image I20. The figure shows the same portion as portion I20p in FIG. 4C. The processor 210 detects bright areas in the scanned image I20 as candidate areas. When scanning the fabric 700, a light source such as light source 121 (FIG. 2) irradiates light onto the fabric 700. A scanning device such as scanner 100 reads the light reflected from the fabric 700. The portions of the warp threads Wp and weft threads Wf that are visible at the intersections are more susceptible to light and are therefore displayed in bright colors in the scanned image I20. The other portions of the warp threads Wp and weft threads Wf are less susceptible to light and are therefore displayed in dark colors in the scanned image I20. Shadows are likely to form at the boundaries between threads (warp threads Wp or weft threads Wf) and other threads. The boundaries are displayed in dark colors in the scanned image I20. The gaps between the warp threads Wp and the weft threads Wf are also represented in dark colors in the scanned image I20. The gaps may be represented in a darker color than the threads. Thus, the lighter areas represent the warp or weft thread 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 scanned image I20. A first graph G1 below the scanned 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 to the right of the scanned 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 portions of the warp threads Wp and weft threads Wf that are not hidden at the intersection and are visible is large. The luminance value BV of the other portions of the warp threads Wp and weft threads Wf is small. The luminance value BV of the boundary portion between one thread and another thread is small. If the color components of the scanned image I20 do not include the brightness value BV, the processor 210 obtains the brightness value BV by a known color conversion.

[0121] The processor 210 detects, as a candidate area, an area where pixels having a luminance value BV equal to or greater than the threshold value BVth. 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 a warp area Ap or a weft area Af in Figs. 6(A) and 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 candidate area (here, warp area or weft area) by analyzing the image of the candidate area. FIGS. 19(A) to 19(G) are diagrams showing examples of methods for determining the type of candidate area. FIGS. 19(A) to 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 uses the arrangement of light and dark regions within the candidate regions. FIG. 19(A) shows a first candidate region Ath1 representing the warp thread Wp and a second candidate region Ath2 representing the weft thread Wf. When scanning the fabric 700, a light source such as light source 121 (FIG. 2) illuminates the fabric 700. Relatively light and dark regions may occur in the three-dimensional warp threads Wp and weft threads Wf. The dark regions are formed, for example, in portions of the threads on the side opposite the light source direction. The first candidate region Ath1 has a light region AB1 and a dark region AD1, and the second candidate region Ath2 has a light region AB2 and a dark region AD2. The arrangement of the light and dark regions is determined according to the arrangement of the light source. In the example of FIG. 19(A), the dark regions AD1 and AD2 are formed in the portions of the candidate regions 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. Furthermore, the threads may cast shadows on the surfaces of the other threads. Dark areas indicating shadows may be formed at the boundaries between multiple adjacent candidate areas Ath.

[0124] 19(B) shows an example of an analysis of the first candidate area Ath1. The processor 210 divides the first candidate area Ath1 into a first partial area AR1 on the first direction Dx side and a second partial area AL1 on the -Dx side along a line CL1 that passes through the center of gravity C1 of the first candidate area Ath1 and is parallel to the second direction Dy. The processor 210 calculates a first luminance value BR1 of the first partial area AR1 and a second luminance value BL1 of the second partial area AL1. The luminance values ​​BR1 and BL1 may be various statistical quantities (e.g., the average value or the mode within the area).

[0125] If the first candidate area Ath1 represents the warp thread Wp, the first candidate area Ath1 extends in the second direction Dy. The size of the first candidate area Ath1 in the first direction Dx is smaller than the size of the first candidate area Ath1 in the second direction Dy. In this case, most of the dark area AD1 is included in the second partial area AL1, and most of the light area AB1 is included in the first partial area AR1. Therefore, the second luminance value BL1 is smaller than the first luminance value BR1. If the luminance ratio (BL1 / BR1) is less than the threshold value Bth, the processor 210 determines that the type of the first candidate area Ath1 is the warp thread area Ap.

[0126] FIG. 19(C) shows an example of analysis of second candidate area Ath2. Processor 210 divides second candidate area Ath2 into a first partial area AR2 on the first direction Dx side and a second partial area AL2 on the -Dx direction side along a line CL2 that passes through the center of gravity C2 of second candidate area Ath2 and is parallel to the second direction Dy. Processor 210 calculates a first luminance value BR2 of first partial area AR2 and a second luminance value BL2 of second partial area AL2. The method of calculating the luminance values ​​BR2 and BL2 is the same as the method of calculating the luminance values ​​BR1 and BL1 described in FIG. 19(B).

[0127] When the second candidate area Ath2 represents the weft thread Wf, the second candidate area Ath2 extends in the first direction Dx. The size in the first direction Dx is larger than the size in the second direction Dy. In this case, most of the dark area AD2 is included in the second partial area AL2. The light area AB2 extends from the first partial area AR2 to the second partial area AL2. Therefore, the luminance ratio (BL2 / BR2) is larger than the luminance ratio (BL1 / BR1) in FIG. 19(B). If the luminance ratio (BL2 / BR2) is equal to or greater than the threshold value Bth, the processor 210 determines that the type of the second candidate area Ath2 is the weft thread area Af.

[0128] The processor 210 determines the type of each of the multiple candidate areas Ath as either a warp area Ap or a weft area Af using the brightness ratio and the threshold value Bth. This completes the processing of S715 ( FIG. 17 ). The threshold value Bth is determined experimentally in advance so that the type of each of the multiple candidate areas 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 (e.g., 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 in Figure 17 detects warp regions Ap and weft regions Af. In S120 (Figure 3), the processor 210 may further detect gap regions Ag. Various methods may be used to detect gap regions Ag. For example, the processor 210 may detect, as gap regions Ag, regions in which pixels having a luminance value BV equal to or less than a gap threshold value are consecutive. The gap threshold value is determined experimentally 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 Figures 19(B) and 19(C), and may be various conditions suitable for the characteristics of the scanned 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 ratio of the brightness of the two partial regions.

[0132] The method for determining the type of candidate area Ath may be other than the first determination method. The second determination method (FIGS. 19(D) and 19(E)) uses an image of the candidate area Ath. FIG. 19(D) shows a first candidate area Ath1 representing the warp yarn Wp, and FIG. 19(E) shows a second candidate area Ath2 representing the weft yarn Wf. In this example, the warp yarn Wp and the weft yarn Wf are twisted yarns produced by twisting multiple fibers. In this case, the images of the candidate areas Ath1 and Ath2 represent multiple twisted fibers. As shown in FIG. 19(D), the image of the first candidate area Ath1 representing the warp yarn Wp represents multiple twisted fibers extending in the second direction Dy. As shown in FIG. 19(E), the image of the second candidate area Ath2 representing the weft yarn Wf represents multiple twisted fibers extending in the first direction Dx. The processor 210 may use such image differences to determine the type of candidate region Ath. For example, the processor 210 may determine the type of 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 use a trained machine learning model (e.g., a classification model) to determine the type of candidate region Ath.

[0133] The third determination method (FIGS. 19(F) and 19(G)) uses the aspect ratio of the candidate area Ath. In this embodiment, the candidate area Ath representing the warp yarn Wp is long in the second direction Dy, and the candidate area Ath representing the weft yarn Wf is long in the first direction Dx. As shown in FIG. 19(F), when the first candidate area Ath1 represents the warp yarn Wp, the height H1 (size in the second direction Dy) of the first candidate area Ath1 is greater than the width W1 (size in the first direction Dx) of the first candidate area Ath1. If the height H1 is greater than the width W1, the processor 210 determines that the type of the first candidate area Ath1 is a warp area Ap. As shown in FIG. 19(G), when the second candidate area Ath2 represents the weft yarn Wf, the height H2 of the second candidate area Ath2 is smaller than the width W2 of the second candidate area Ath2. If 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 way, the processor 210 may determine the type of the candidate area Ath using the height and width 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. Modifications: (1) The object detection model 300 is not limited to Mask R-CNN, and may be any of various trained machine learning models capable of detecting target regions (e.g., warp region Ap, weft region Af, and gap region Ag) from a scanned image (e.g., YOLO (You Only Look Once)).

[0135] (2) The process of detecting target areas (e.g., warp area Ap, weft area Af, and gap area Ag) from the scanned image (S120 ( FIG. 3 )) may be performed using various methods instead of the area detection process using the object detection model 300 ( FIG. 5 ) and the bright area detection process ( FIG. 17 ). For example, the processor 210 may detect each area Ap, Af, and Ag by template matching using template images of each area Ap, Af, and Ag. Note that the yarns (e.g., warp yarns Wp and weft yarns Wf) may contain either or both natural and chemical fibers. When the yarns contain natural fibers, the yarn attributes (e.g., color, thickness, etc.) may vary significantly. The machine learning model can appropriately detect the target areas even when the yarn attributes vary significantly.

[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 division numbers Np and Nf may be determined by various methods. For example, the processor 210 may determine the division numbers Np and Nf by the following method.

[0138] As shown in FIG. 6B, multiple weft regions Af are arranged in the scanned image I20, with positions in the second direction Dy that do not overlap (for example, the positions in the second direction Dy of weft regions Af1, Af2, and Af3 do not overlap). Within the range of positions in the second direction Dy of warp region Ap4 ( FIG. 6A ), two weft regions Af2 and Af3 that do not overlap with each other in the second direction Dy are included. In this case, it is preferable to divide warp region Ap4 into two warp regions Ap. In this way, the processor 210 may use, as the division number Np of the target warp region Ap, the number of weft regions Af included within the range of positions in the second direction Dy of the target warp region Ap, which do not overlap with each other in the second direction Dy. The method for determining the division number Nf of the long weft region Af is the same as the method for 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) Step S130 in Fig. 3, i.e., dividing the long warp area Ap and the long weft area Af, may be omitted. In either case, various methods may be used to determine the positional relationship between the multiple warp areas Ap and the multiple weft areas Af. Furthermore, various methods may be used to determine the arrangement of the grid lines (e.g., Fig. 11(F)), i.e., the multiple intersection positions.

[0140] For example, the processor 210 connects a warp region Ap and a weft region Af that are adjacent in the first direction Dx or the second direction Dy. This connects the weft region Af to the first direction Dx or -Dx side of the warp region Ap. For example, the weft region Af2 (FIG. 6B) is connected to the -Dx side of the warp region Ap3 in FIG. 6A. The processor 210 determines the intersection position of the weft Wf corresponding to the weft region Af2 in the warp region Ap3 to be the point on a line that passes through the center of the warp region Ap3 and is parallel to the second direction Dy, and that is closest to the weft region Af2. The processor 210 similarly determines the intersection positions within the warp region Ap for other combinations of the warp region Ap and the weft region Af. The warp region Ap is also connected to the second direction Dy or -Dy side of the weft region Af. For example, warp regions Ap4 and Ap5 (FIG. 6A) are connected to the -Dx direction side of weft region Af4 in FIG. 6B. The processor 210 determines the intersection position within the weft region Af in the same way as the intersection position within the warp region Ap. For example, the processor 210 determines the intersection position between the warp thread Wp corresponding to the warp region Ap4 within the weft region Af4 as the point on a line passing through the center of the weft region Af4 and parallel to the first direction Dx, which is closest to the warp region Ap4. The processor 210 connects the multiple intersection positions according to the connection results between the warp region Ap and the weft region Af. This allows the processor 210 to determine the positional relationship between the multiple warp regions Ap and the multiple weft regions Af, as well as the grid lines.

[0141] The processor 210 may also use the positions of the centers of the warp and weft regions Ap and Af to determine the positional relationship between the warp and weft regions Ap and the grid lines. As shown in FIGS. 6A and 6B, the warp threads Wp are approximately parallel to the second direction Dy. Therefore, the positions of the centers in the first direction Dx of multiple warp regions Ap associated with the same warp thread Wp are approximately the same. The distribution of the center positions in the first direction Dx forms a cluster for each warp thread Wp. The processor 210 may use a representative position of the cluster as the position of the warp thread Wp in the first direction Dx. Examples of the representative position include the peak position of the cluster, the center position of the distribution range of multiple positions included in the cluster, or the average position of multiple positions included in the cluster. Various clustering methods are possible. For example, k-means may be used (the total number of clusters, k, may be set to the total number of warp threads Wp). The position of the weft thread Wf is determined in a similar manner. The distribution of the positions in the second direction Dy of the centers of the multiple weft regions Af forms a cluster for each weft thread Wf. The processor 210 may use a representative position of the cluster as the position in the second direction Dy of the weft thread Wf. The processor 210 uses multiple combinations of the position in the first direction Dx of the warp thread Wp and the position in the second direction Dy of the weft thread Wf 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, as well as the grid lines.

[0142] The processor 210 may also perform a process for connecting a target warp area Ap with an adjacent warp area Ap located in the extension direction of the target warp area Ap for each of the multiple warp areas Ap. For example, the processor 210 calculates a straight line that passes through the center (e.g., the center of gravity) of the target warp area Ap and is parallel to the extension direction of the target warp area Ap. Of the warp areas Ap that touch the straight line, the processor 210 selects the warp area Ap closest to the target warp area Ap as the adjacent warp area Ap. This makes it possible to connect multiple warp areas Ap associated with the same warp thread Wp.

[0143] The extension direction of the warp region Ap may be determined by analyzing the warp region Ap. For example, the processor 210 thins the warp region Ap by performing a shrinking process in the first direction Dx. The processor 210 then calculates a straight line approximating the thinned warp region Apf and adopts a direction parallel to the calculated straight line as the extension direction. The shrinking process may, for example, be a process of setting the target pixel as a non-region pixel when multiple peripheral pixels defined by a filter placed at the position of the target pixel include a non-region pixel. The filter may, for example, be a pixel line of a predetermined length (e.g., three pixels) centered on the target pixel and extending in the first direction Dx. The processor 210 repeats the shrinking process until the size in the first direction Dx becomes sufficiently small. As described in FIG. 14(A), the size of the warp region Ap in the first direction Dx may vary 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 less 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 perform a process for connecting a target weft area Af with an adjacent weft area Af located in the direction of extension of the target 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 described above, the multiple warp areas Ap and the multiple weft areas Af are connected to represent the multiple warp threads Wp and the multiple weft threads Wf. The processor 210 may use the multiple warp areas Ap associated with the same warp thread Wp to determine the line representing the warp thread Wp. For example, the processor 210 may determine a curve approximating the multiple centers of the multiple warp areas Ap as the line representing the warp thread Wp (e.g., a spline curve). Similarly, the processor 210 may determine a curve approximating the multiple centers of the multiple weft areas Af as the line representing the weft thread Wf. The processor 210 may use the multiple intersection points between the multiple lines representing the warp threads Wp and the multiple lines representing the weft threads Wf as the multiple intersection positions. In this way, the processor 210 can determine the positional relationship between the multiple warp areas Ap and the multiple weft areas Af, as well as the grid lines.

[0146] (6) The process of detecting attribute difference portions related to differences between the attributes of the region representing the threads and the reference attributes may be various processes. For example, one of the warp threads Wp and the weft threads Wf may be excluded from the detection of attribute difference portions. The attributes to be processed may include one or more attributes arbitrarily selected in advance from the type of thread (warp threads Wp or weft threads Wf) that is not hidden and is visible, color, and width. For example, one of color and width may be omitted. Here, the attributes to be processed may include one of color and width and the type of visible thread. Alternatively, both color and width may be omitted. Here, the attributes to be processed may include the type of visible thread. Alternatively, the type of visible thread may be omitted. Here, the attributes to be processed may include one or both of color and width. In either case, the processor 210 may detect the width difference for each region representing a thread, instead of for each thread (FIG. 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 for detecting specific portions may be various other processes instead of the processes in the above-described embodiments and modifications. For example, the process for detecting attribute-difference portions (S145 (FIG. 3)) may be omitted, and the process for detecting gap-difference portions (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 woven fabric. For example, the specific portion may include a portion of the woven 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 warps Wp intersecting with the weft region Af is different from a reference total number. Furthermore, the specific portion is not limited to a portion showing an abnormality, but may also be a portion that satisfies a specific condition. For example, the specific portion may include a portion corresponding to a specific structure diagram. Furthermore, the specific portion may include a portion that represents a specific pattern (e.g., a symbol, a mark, a character string, etc.).

[0149] In either case, the processor 210 may detect the specific portion without generating a tissue 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 where the total number of wefts Wf intersecting with the warp region Ap is different from the reference total number. As in the above modification, the processor 210 may connect multiple warp regions Ap and multiple weft regions Af to represent multiple warps Wp and multiple wefts Wf. The processor 210 may detect the specific portion by calculating the total number of connection lines of the weft region Af that intersect with the warp region Ap (i.e., lines indicating wefts Wf).

[0150] (9) When a specific portion is detected, the processor 210 may execute various processes (referred to as a "specification process"), in addition to the 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 internal to 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. Furthermore, 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, but 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 being 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, thereby generating 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, or CMYK.

[0152] (11) In the above embodiment and modifications, the processor 210 may cause the GPU 260 to execute various calculations. For example, the processor 210 may cause the GPU 260 to execute some or all of the calculations performed by 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., a digital camera, a scanner, a smartphone). Furthermore, multiple 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 together 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 on a computer-readable recording medium (e.g., a non-transitory recording medium). The program can be used while stored on 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 can 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-described examples and modifications can be combined as appropriate. The above-described examples and modifications are provided to facilitate understanding of the present disclosure and are not intended to limit the present invention. The present invention may be modified or improved without departing from the spirit thereof, and the present invention includes equivalents thereof.

[0157] 100...scanner, 120...sensor unit, 121...light source, 122...reading sensor, 130...conveyor 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 that causes a computer to realize the following functions: 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 fabric.

2. A program as described in claim 1, wherein the position information includes an interlacing pattern representing threads visible at each of a plurality of interlacing positions between warp threads and weft threads, the function of determining the position information includes a function of determining the interlacing pattern by connecting the plurality of warp thread regions and the plurality of weft thread regions, the specific portion includes an interlacing difference portion corresponding to a different portion between the interlacing pattern and a reference interlacing pattern, and 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.

3. A program as described in claim 2, wherein the area detection function includes: a function for dividing a long warp area into a plurality of warp areas when the plurality of warp areas detected by the area detection function includes a long warp area that is a warp area longer than a first reference length; and a function for dividing the long weft area into a plurality of weft areas when the plurality of weft areas detected by the area detection function includes a long weft area that is a weft area longer than a second reference length.

4. A program as claimed in claim 3, wherein the function of determining the crossing pattern includes a function of connecting multiple warp regions included in the same long warp region, and a function of connecting multiple weft regions included in the same long weft region.

5. A program as claimed in any one of claims 1 to 4, further comprising: a function for causing a computer to obtain area attribute information including one or both of an attribute of each of the plurality of warp areas and an attribute of each of the plurality of weft areas by analyzing the image, the attribute including one or both of color and width; 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; and the function for detecting the specific portion includes a function for detecting the attribute difference portion using reference information indicating 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.

6. A program as described in any one of claims 1 to 4, further comprising: the multiple areas detected by the area detection function including multiple gap areas between the multiple warp threads and the multiple weft threads; the specific portion including a gap difference portion which is a gap area having a size different from a reference size; and the function of detecting the specific portion including a function of detecting the gap difference portion using the multiple gap areas.

7. A program comprising: 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, the image representing the woven fabric being optically read, the function being such that 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 for acquiring region 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 color and width; and a function for detecting attribute difference portions including one or both of a portion where a warp attribute differs from a reference attribute of the warp threads and a portion where a weft attribute differs from a 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 that causes a computer to realize the following functions: detecting a plurality of gap areas between a plurality of warp threads and a plurality of weft threads from an image representing a woven fabric having the plurality of warp threads and a plurality of weft threads that is optically read; and detecting a gap difference portion, which is a gap area having a size different from a reference size, using the plurality of gap areas.

9. A detection device comprising: an area detection unit that detects 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 that has been optically read, wherein each of the plurality of warp areas 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 areas represents a portion of the plurality of weft threads that is visible and not hidden by the plurality of warp threads; a position information determination unit that determines position information relating to a positional relationship between the plurality of warp areas and the plurality of weft areas; and a detection unit that detects a specific portion of the fabric using the position information.

Citation Information

Patent Citations

  • Textile texture defect automatic detection method based on statistical analysis

    CN113643276A

  • Method for automatically detecting weft density of wide fabric

    CN116223497A

  • Surface pattern generating device for textile

    JP1992199370A

  • MONITORING DEVICE FOR LOOM, LOOM AND METHOD FOR SUCH MONITORING

    JP2016528400A

  • Apparatus and method for real-time identification of fabric defects during weaving

    JP2022529097A