Image processing method and device, medium and electronic terminal
Through image processing technology, the fabric image is obtained for edge detection, and the offset angle and distance are calculated, which solves the problem of low edge accuracy of fabric and achieves higher edge accuracy and customization capabilities.
Patent Information
- Application Number
- CN202510028892.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-08
- Publication Date
- 2025-05-06
AI Technical Summary
The prior art has the problem of low accuracy in the fabric edge-to-edge process, especially when detecting the edges of non-linear fabrics and the attitude of the fabrics, the error is relatively large.
By acquiring the fabric image, edge detection is performed to obtain the contour boundary, edge straight lines are obtained based on the contour boundary, and compared with the preset standard to-edge line, the offset angle and offset distance are calculated to determine the fabric to-edge state.
It improves the accuracy of fabric to the edge, can more accurately judge the accuracy of the fabric to the edge process, and enhances the types and customization of edge adjustment parameters.
Smart Images

Figure CN119941769A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure belongs to the field of textiles and relates to image processing, in particular to an image processing method, device, medium and electronic terminal. Background Art
[0002] In the textile industry, rolled fabrics are laid out in multiple layers to facilitate subsequent process operations, and this operation is mostly completed by a laying machine. During this process, the laid fabrics need to be aligned at each layer according to the edge to ensure the accuracy of the position of the subsequent multi-layer cutting pieces relative to the fabric. This operation is called fabric alignment.
[0003] Most edge alignment methods on the market often use color mark sensors to identify colors, emit modulated light and receive reflected light from the object being measured, and determine whether there is cloth based on the strength of the received light signal. Since this method has errors in detecting non-linear cloth edges and cannot detect the overall inclination angle of the cloth when detecting the cloth posture, there is a problem of low cloth edge alignment accuracy. Summary of the invention
[0004] The purpose of the present disclosure is to provide an image processing method, device, medium and electronic terminal for solving the current problem of low edge alignment accuracy of fabrics.
[0005] In a first aspect, an embodiment of the present disclosure provides an image processing method, comprising: acquiring a fabric image, the fabric image including an edge portion of the fabric, the fabric image being an image collected during a fabric edge alignment process; performing edge detection on a first region of interest of the fabric image to acquire a contour boundary between the fabric and a background in the first region of interest; based on the contour boundary, acquiring an edge straight line of the contour boundary; based on the edge straight line and a preset standard edge alignment straight line, acquiring an offset angle and an offset distance of the edge straight line, the offset angle and the offset distance being used to determine the fabric edge alignment state.
[0006] In the image processing method, based on the contour boundary obtained by edge detection, and the offset angle and offset distance obtained based on the edge straight line of the contour boundary and the preset standard opposite edge straight line, it is possible to further determine whether the current cloth edge alignment process is accurate, thereby improving the accuracy of the cloth edge alignment.
[0007] In one embodiment of the present disclosure, the fabric is a composite lace fabric, and the method for performing edge detection on the first region of interest of the fabric image to obtain the contour boundary between the fabric and the background in the first region of interest includes: segmenting the fabric image to obtain the second region of interest in the fabric image; transforming the second region of interest to obtain a grayscale image of the second region of interest; eliminating holes and burrs in the fabric in the grayscale image to obtain the first region of interest; performing edge detection on the first region of interest to obtain the contour boundary between the fabric and the background in the first region of interest.
[0008] In one embodiment of the present disclosure, based on the contour boundary, a method for obtaining an edge straight line of the contour boundary includes: based on the contour boundary, obtaining boundary pixel points of the contour boundary; fitting the boundary pixel points to obtain a fitting straight line, and the edge straight line is the fitting straight line.
[0009] In one embodiment of the present disclosure, a method for obtaining the offset angle and offset distance of the edge straight line based on the edge straight line and a preset standard opposite side straight line includes: obtaining the offset distance based on the midpoint coordinates of the edge straight line and the standard opposite side straight line in the first area of interest on the y-axis; and obtaining the offset angle based on the slope of the fitting straight line.
[0010] In one embodiment of the present disclosure, the slope of the fitting straight line is expressed as:
[0011]
[0012] Among them, x i represents the horizontal coordinate of the i-th boundary pixel point, y i represents the ordinate of the i-th boundary pixel point, represents the average horizontal coordinate of the boundary pixels, represents the average ordinate of the boundary pixel points, n represents the total number of the boundary pixel points, represents the slope of the fitting line, and i represents the i-th boundary pixel point.
[0013] In one embodiment of the present disclosure, the image processing method further includes: triggering an offset alarm when the offset angle is greater than a preset value; and sending the offset distance to a lower computer so that the cloth-dispensing device can move in the opposite direction by the offset distance.
[0014] In one embodiment of the present disclosure, the standard opposite side straight line is a straight line in the middle of the field of view of a photographing tool for photographing the fabric image.
[0015] In a second aspect, the present disclosure provides an image processing device, comprising: an image acquisition module, used to acquire a fabric image, the fabric image including an edge portion of the fabric, the fabric image being an image collected during the fabric edge alignment process; an edge detection module, used to perform edge detection on a first interest region of the fabric image to acquire a contour boundary between the fabric and a background in the first interest region; a straight line acquisition module, used to acquire an edge straight line of the contour boundary based on the contour boundary; an offset acquisition module, used to acquire an offset angle and an offset distance of the edge straight line based on the edge straight line and a preset standard edge alignment straight line, the offset angle and the offset distance being used to determine the fabric edge alignment state.
[0016] In a third aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the image processing method described in any one of the first aspects.
[0017] In a fourth aspect, the present disclosure provides an electronic terminal, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the image processing method described in any one of the first aspects.
[0018] As described above, the image processing method, device, medium and electronic terminal described in the present application have the following beneficial effects:
[0019] In the image processing method, the offset angle and offset distance obtained according to the contour boundary obtained by edge detection and the edge straight line of the contour boundary and the preset standard straight line can further determine whether the current cloth edge alignment process is accurate, thereby improving the accuracy of cloth edge alignment. In addition, the offset angle can be used to determine the state of the cloth laying, increase the types of edge adjustment parameters, and improve the degree of customization and personalization, and different recognition parameters can be set according to the shape of the cloth edge. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 Shown is a schematic diagram of the settings of the shooting tool described in an embodiment of the present disclosure.
[0021] Figure 2 Shown is a flowchart of the image processing method described in an embodiment of the present disclosure.
[0022] Figure 3 Shown is a schematic diagram of the composite lace fabric described in an embodiment of the present disclosure.
[0023] Figure 4 A schematic diagram showing the edge of a fabric according to an embodiment of the present disclosure is shown.
[0024] Figure 5Shown is a schematic diagram of the fitting straight line and the standard opposite side straight line described in an embodiment of the present disclosure.
[0025] Figure 6 Shown is a flowchart of a method for performing edge detection on a first region of interest of the fabric image to obtain a contour boundary between the fabric and the background in the first region of interest according to an embodiment of the present disclosure.
[0026] Figure 7 A schematic diagram showing a contour boundary according to an embodiment of the present disclosure is shown.
[0027] Figure 8 Shown is a structural schematic diagram of the image processing device described in an embodiment of the present disclosure.
[0028] Fig. 9 Shown is a schematic block diagram of the electronic terminal described in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0029] The following is an explanation of the embodiments of the present disclosure by specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0030] It should be noted that the illustrations provided in the following embodiments are only used to illustrate the basic concept of the present disclosure in a schematic manner, and thus the illustrations only show components related to the present disclosure rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0031] The technical solutions in the embodiments of the present disclosure are described in detail below in conjunction with the drawings in the embodiments of the present disclosure.
[0032] Figure 1 Schematic diagram showing the setting of the shooting tool of the embodiment of the present disclosure. Figure 1 As shown, the photographing tool is installed between the spitting wheel and the edge shifting, and photographs the edge of the fabric from top to bottom. At this time, the fabric is stretched and opened, which has a good recognition effect. The photographing tool can be an industrial camera.
[0033] The principles and implementation methods of the image processing method and the image processing device of the embodiments of the present disclosure will be explained in detail below so that those skilled in the art can understand the image processing method and the image processing device of the embodiments of the present disclosure without creative work.
[0034] Figure 2 FIG. 1 is a flow chart showing an image processing method according to an embodiment of the present disclosure. Figure 1 As shown, this embodiment provides an image processing method, and the image processing method includes:
[0035] S11, obtaining a fabric image, wherein the fabric image includes an edge portion of the fabric, and the fabric image is an image collected during the fabric edge alignment process.
[0036] Optionally, the fabric can be regarded as cloth, and the fabric can be a composite lace fabric, such as Figure 3 As shown, compared with ordinary fabrics, the edge of the composite lace fabric is a non-linear contour with a certain regularity, and the surface includes fabrics of different thicknesses and hollow parts. The edge can refer to the edge of the fabric that the laying machine needs to align.
[0037] Optionally, the method for obtaining the fabric image includes: acquiring a video stream containing the fabric image; and extracting the fabric image from the video stream.
[0038] Optionally, the photographing tool is arranged between the cloth-discharging wheel / cloth-discharging shaft and the edge-discharging machine. The photographing tool may be an industrial camera, which is installed outside the fixed shaft of the cloth-discharging machine. The cloth-discharging wheel of the cloth-discharging machine may refer to a wheel-shaped structure that drives the cloth-discharging shaft to rotate.
[0039] Optionally, the fabric image can show the position of the edge of the fabric relative to the camera field of view, such as Figure 4 As shown, the right side in the camera field of view is a composite lace fabric, whose edge is a regular shape of a non-straight line and has protruding wool lines, and the edge can be on the left side in the camera field of view.
[0040] S12: Perform edge detection on a first region of interest of the fabric image to obtain a contour boundary between the fabric and the background in the first region of interest.
[0041] Optionally, the first region of interest refers to a region of interest in the fabric image, and the background may be the background of the fabric in the first region of interest. The edge detection refers to detecting the edge of the fabric in the first region of interest, and the detected edge may be regarded as the contour boundary.
[0042] Optionally, the contour boundary may be a regular non-linear shape, specifically a regular curved shape.
[0043] S13: Based on the contour boundary, obtain an edge straight line of the contour boundary.
[0044] Optionally, based on the contour boundary, a method for obtaining an edge straight line of the contour boundary includes: processing the contour boundary by a recognition method of straight line detection to obtain the edge straight line.
[0045] Optionally, a method for obtaining an edge straight line of the contour boundary based on the contour boundary includes: obtaining boundary pixel points of the contour boundary based on the contour boundary; fitting the boundary pixel points to obtain a fitting straight line, and the edge straight line is the fitting straight line.
[0046] Optionally, the method for fitting the boundary pixel points to obtain the fitted straight line includes: fitting the boundary pixel points according to the least square method to obtain the fitted straight line. The least square method is not described in detail in this embodiment.
[0047] Optionally, the boundary pixel points may refer to pixel points on the boundary of the contour.
[0048] Preferably, the boundary pixel points may be the pixel points of the maximum value on the horizontal axis of the contour boundary. For example, the pixel points of the maximum value include (5, 3), (7, 6), etc. The boundary pixel points may be (5, 3), (7, 6), etc. The pixel points of the maximum value on the horizontal axis may be obtained according to the pixel coordinates of the pixel points on the contour boundary. This embodiment will not be described in detail. The selection of the boundary pixel points may be flexibly set according to the actual situation. This embodiment does not explicitly limit this. For example, the number of the boundary pixel points may be selected according to the cloth speed and the error accuracy. When the cloth speed is relatively fast or the error accuracy requirement is relatively low, the image processing time is required to be relatively short, and the number of the boundary pixel points collected may be relatively small. When the cloth speed is relatively slow or the error accuracy requirement is relatively high, the image processing time is required to be relatively long, and the number of the boundary pixel points collected may be relatively large.
[0049] S14, based on the edge straight line and a preset standard opposite edge straight line, obtaining an offset angle and an offset distance of the edge straight line, wherein the offset angle and the offset distance are used to determine the opposite edge state of the fabric.
[0050] Optionally, the standard opposite side straight line can be a straight line in the middle of the field of view of the shooting tool mentioned above, which is parallel to the longitudinal axis in the fabric image, and in the middle of the fabric image. The standard opposite side straight line can be a straight line in the middle of the field of view of the industrial camera.
[0051] Alternatively, if Figure 5 As shown, the edge straight line can be Figure 5 The left straight line of the two straight lines, and the standard opposite side straight line can be the right straight line of the two straight lines. The positional relationship between these two lines can determine the state of the fabric at this time.
[0052] Optionally, the fabric edge state may include an offset distance and an inclination angle of the fabric relative to a shooting tool, the offset angle of the edge straight line may be the inclination angle, and the offset distance of the edge straight line may be an offset distance of the fabric relative to the shooting tool.
[0053] Optionally, the fabric edge state may also refer to whether a deviation alarm needs to be triggered or not. When the deviation angle is greater than a preset value, the fabric edge state may refer to whether a deviation alarm needs to be triggered. When the deviation angle is not greater than the preset value, the fabric edge state may refer to whether a deviation alarm does not need to be triggered. The preset value may be flexibly set according to actual conditions, and this embodiment does not explicitly limit this.
[0054] Optionally, the method for obtaining the offset angle and offset distance of the fitting line based on the edge line and the preset standard opposite line includes: obtaining the offset distance based on the midpoint coordinates of the y-axis length of the edge line and the standard opposite line in the first region of interest; and obtaining the offset angle based on the slope of the fitting line. The y-axis may refer to the vertical axis, and the x-axis may refer to the horizontal axis.
[0055] Optionally, the slope of the fitted straight line is expressed as:
[0056]
[0057] Among them, x i represents the horizontal coordinate of the i-th boundary pixel point, y i represents the ordinate of the i-th boundary pixel point, represents the average horizontal coordinate of the boundary pixels, represents the average ordinate of the boundary pixel points, n represents the total number of the boundary pixel points, represents the slope of the fitting line, and i represents the i-th boundary pixel point.
[0058] Optionally, the fitting straight line can be expressed as:
[0059]
[0060] Among them, Y i The ordinate corresponding to the abscissa of the boundary pixel point on the fitting line may be represented, a represents the slope of the fitting line, b represents the intercept of the fitting line, and f(x) represents the fitting line.
[0061] Optionally, the offset angle may be the slope of the edge line, the offset distance may be the distance difference between the midpoint coordinates of the edge line and the midpoint coordinates of the standard opposite side line on the x-axis, the midpoint coordinates of the edge line may be the midpoint coordinates of the length of the edge line on the y-axis in the first region of interest, and the midpoint coordinates of the standard opposite side line may be the midpoint coordinates of the length of the standard opposite side line on the y-axis in the first region of interest. For example, the midpoint coordinates of the edge line are (3, 5), the midpoint coordinates of the standard opposite side line are (5, 5), and the offset distance is 2.
[0062] Optionally, the image processing method further includes: triggering an offset alarm when the offset angle is greater than a preset value; and sending the offset distance to a lower computer so that the cloth-discharging device can move the offset distance in the opposite direction. The lower computer may refer to the lower computer of the cloth-spreading machine. The cloth-discharging device may refer to the cloth-discharging mechanism in the cloth-spreading machine, and the cloth-discharging mechanism moving the offset distance in the opposite direction may refer to that when the offset distance is the distance to the left of the standard opposite side straight line, the cloth-discharging mechanism moves the offset distance to the right, and when the offset distance is the distance to the right of the standard opposite side straight line, the cloth-discharging mechanism moves the offset distance to the left.
[0063] Optionally, the preset value may be flexibly set according to actual conditions, and this embodiment does not explicitly limit this. The deviation alarm may refer to an alarm for prompting that the deviation is abnormal.
[0064] According to the above description, this embodiment provides an image processing method, including: acquiring a fabric image, the fabric image including an edge portion of the fabric, the fabric image being an image collected during the fabric edge alignment process; performing edge detection on a first region of interest of the fabric image to obtain a contour boundary between the fabric and a background in the first region of interest; based on the contour boundary, obtaining an edge straight line of the contour boundary; based on the edge straight line and a preset standard edge straight line, obtaining an offset angle and an offset distance of the edge straight line, the offset angle and the offset distance being used to determine the fabric edge alignment state.
[0065] In the image processing method, based on the contour boundary obtained by edge detection, and the offset angle and offset distance obtained based on the edge straight line of the contour boundary and the preset standard opposite edge straight line, it is possible to further determine whether the current cloth edge alignment process is accurate, thereby improving the accuracy of the cloth edge alignment.
[0066] Figure 6 FIG. 1 is a flowchart showing a method for implementing edge detection of a first region of interest of a fabric image to obtain a contour boundary between the fabric and the background in the first region of interest according to an embodiment of the present disclosure. Figure 6As shown, the embodiment of the present disclosure provides a method for performing edge detection on a first region of interest of the fabric image to obtain a contour boundary between the fabric and the background in the first region of interest, including:
[0067] S21, segmenting the fabric image to obtain a second region of interest in the fabric image.
[0068] Optionally, the second region of interest may refer to a region of interest segmented from the fabric image, and the first region of interest may be a region after the second region of interest has been preprocessed. The preprocessing may include: converting the second region of interest into a grayscale image, and removing holes and burrs in the lace fabric in the grayscale image.
[0069] S22: transform the second region of interest to obtain a grayscale image of the second region of interest.
[0070] S23, eliminating holes and burrs in the lace fabric in the grayscale image to obtain the first region of interest.
[0071] Optionally, the method for eliminating the holes and burrs in the lace fabric in the grayscale image to obtain the first region of interest includes: eliminating the holes in the lace fabric in the grayscale image by continuously using a morphological dilation algorithm, and then eliminating the burrs in the lace fabric in the grayscale image by using a morphological corrosion algorithm to obtain the first region of interest.
[0072] S24: Perform edge detection on the first region of interest to obtain a contour boundary between the fabric and the background in the first region of interest.
[0073] Optionally, the process of performing edge detection on the first region of interest to obtain the contour boundary is not described in detail in this embodiment. Figure 7 As shown, the contour boundary may be wavy.
[0074] In one embodiment of the present disclosure, the image processing method includes:
[0075] Step 1: Collect a video stream containing an image of the composite lace fabric, where the video stream contains an edge portion of the composite lace fabric.
[0076] Step 2: Extract a single frame image from the video stream captured by the camera as the analysis object, which shows the position of the edge of the cloth relative to the lens field of view.
[0077] Step 3: Preprocess the lace fabric image, segment the region of interest in the extracted image, convert it into a grayscale image, and then continuously use the morphological expansion algorithm to eliminate the holes in the lace fabric, and then use the morphological corrosion algorithm to eliminate the burrs in the lace fabric.
[0078] Step 4: Apply edge detection to distinguish the contour boundary between the lace fabric and the background in the region of interest.
[0079] Step 5: Extract the pixel point positions on the wavy boundary and fit the straight line. Select different numbers of position points for fitting according to the speed and error accuracy.
[0080] Step 6: Determine the offset angle and distance by comparing the slope and position of the fitted straight line with the preset standard opposite side straight line.
[0081] Step 7: When the offset angle is greater than the preset value, the offset alarm is triggered; when the offset distance is generated, the offset data is sent to the lower computer, and the cloth-dispensing device moves the offset distance in the opposite direction, and the above process is repeated.
[0082] The image processing method has the following advantages:
[0083] 1. The edge accuracy is improved, and the recognition effect of non-straight regular edges is better than the original recognition method.
[0084] 2. It can provide feedback on the fabric deflection angle, judge the fabric spreading status, and increase the types of edge adjustment parameters.
[0085] 3. The degree of customization and personalization is improved, and different recognition parameters can be set according to the shape of the fabric edge.
[0086] The protection scope of the image processing method described in the embodiment of the present disclosure is not limited to the execution order of the steps listed in the present embodiment. All solutions implemented by adding, reducing or replacing steps in the prior art based on the principles of the present disclosure are included in the protection scope of the present disclosure.
[0087] Figure 8 FIG. 8 is a schematic diagram showing the structure of an image processing device 80 according to an embodiment of the present disclosure. Figure 8 As shown, this embodiment provides an image processing device, including:
[0088] The image acquisition module 810 is used to acquire a fabric image, wherein the fabric image includes an edge portion of the fabric, and the fabric image is an image collected during the fabric edge alignment process.
[0089] The edge detection module 820 is used to perform edge detection on the first region of interest of the fabric image to obtain a contour boundary between the fabric and the background in the first region of interest.
[0090] The straight line acquisition module 830 is used to acquire an edge straight line of the contour boundary based on the contour boundary.
[0091] The offset acquisition module 840 is used to acquire the offset angle and offset distance of the edge straight line based on the edge straight line and a preset standard opposite edge straight line, and the offset angle and the offset distance are used to determine the opposite edge state of the fabric.
[0092] The image acquisition module 810 in the image processing device 80 is Figure 1 The step S11 of the image processing method shown in FIG. 1 corresponds to the step S12 of the image processing method shown in FIG. 1 . The edge detection module 820 corresponds to the step S11 of the image processing method shown in FIG. Figure 1 The step S12 of the image processing method shown in FIG. 1 corresponds to the step S13 of the image processing method shown in FIG. 1 . The straight line acquisition module 830 corresponds to the step S12 of the image processing method shown in FIG. Figure 1 The step S13 of the image processing method shown in FIG. 1 corresponds to the step S13 of the image processing method shown in FIG. 1 . The offset acquisition module 840 corresponds to the step S13 of the image processing method shown in FIG. Figure 1 Step S14 of the image processing method shown corresponds one to one.
[0093] In the several embodiments provided in the present disclosure, it should be understood that the disclosed device or method can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules / units is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules or units, which can be electrical, mechanical or other forms.
[0094] The modules / units described as separate components may or may not be physically separated, and the components displayed as modules / units may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules / units may be selected according to actual needs to achieve the purpose of the embodiments of the present disclosure. For example, the functional modules / units in the various embodiments of the present disclosure may be integrated into one processing module, or each module / unit may exist physically separately, or two or more modules / units may be integrated into one module / unit.
[0095] Those of ordinary skill in the art should further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this disclosure.
[0096] Fig. 9 is a schematic block diagram of an electronic terminal provided in an embodiment of the present application. Fig. 9 As shown, the electronic terminal 900 includes: at least one processor 901, a memory 902, at least one network interface 903 and a user interface 905. The various components in the device are coupled together through a bus system 904. It can be understood that the bus system 904 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 904 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Fig. 9 In the specification, various buses are labeled as bus systems.
[0097] The user interface 905 may include a display, a keyboard, a mouse, a trackball, a click gun, keys, buttons, a touch pad or a touch screen.
[0098] It is understood that the memory 902 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM). The memory described in the embodiments of the present invention is intended to include but is not limited to these and any other suitable categories of memory.
[0099] The memory 902 in the embodiment of the present invention is used to store various types of data to support the operation of the electronic terminal 900. Examples of these data include: any executable program for operating on the electronic terminal 900, such as an operating system 9021 and an application 9022; the operating system 9021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks. The application 9022 can include various applications, such as a media player (Media Player), a browser (Browser), etc., for implementing various application services. The probability table update method provided by the embodiment of the present invention can be included in the application 9022.
[0100] The method disclosed in the above embodiment of the present invention can be applied to the processor 901, or implemented by the processor 901. The processor 901 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 901 or the instruction in the form of software. The above processor 901 may be a general processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 901 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiment of the present invention. The general processor 901 may be a microprocessor or any conventional processor, etc. In combination with the steps of the accessory optimization method provided in the embodiment of the present invention, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in a memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0101] In an exemplary embodiment, the electronic terminal 900 may be implemented by one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD) to execute the aforementioned method.
[0102] The present disclosure embodiment also provides a computer-readable storage medium. A person of ordinary skill in the art can understand that all or part of the steps in the method for implementing the above embodiment can be completed by instructing the processor through a program, and the program can be stored in a computer-readable storage medium, and the storage medium is a non-transitory medium, such as a random access memory, a read-only memory, a flash memory, a hard disk, a solid-state hard disk, a magnetic tape, a floppy disk, an optical disc, and any combination thereof. The above storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., a solid-state disk (SSD)), etc.
[0103] The embodiments of the present disclosure may also provide a computer program product, which includes one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the process or function described in the embodiments of the present disclosure is generated in whole or in part. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website site, computer or data center to another website site, computer or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.
[0104] When the computer program product is executed by a computer, the computer executes the method described in the above method embodiment. The computer program product may be a software installation package, and when the above method is required, the computer program product may be downloaded and executed on a computer.
[0105] The descriptions of the processes or structures corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.
[0106] The above embodiments are merely illustrative of the principles and effects of the present disclosure, and are not intended to limit the present disclosure. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present disclosure. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present disclosure shall still be covered by the claims of the present disclosure.
Claims
1. An image processing method, characterized in that: include: Acquire a fabric image, wherein the fabric image includes an edge portion of the fabric, and the fabric image is an image collected during the fabric edge alignment process; Performing edge detection on a first region of interest of the fabric image to obtain a contour boundary between the fabric and the background in the first region of interest; Based on the contour boundary, obtaining an edge straight line of the contour boundary; Based on the edge straight line and a preset standard opposite edge straight line, an offset angle and an offset distance of the edge straight line are obtained, and the offset angle and the offset distance are used to determine the opposite edge state of the fabric.
2. The image processing method according to claim 1, characterized in that: The fabric is a composite lace fabric, and a method for performing edge detection on a first region of interest of the fabric image to obtain a contour boundary between the fabric and the background in the first region of interest includes: Segmenting the fabric image to obtain a second region of interest in the fabric image; transforming the second region of interest to obtain a grayscale image of the second region of interest; Eliminate holes and burrs in the fabric in the grayscale image to obtain the first region of interest; Perform edge detection on the first region of interest to obtain the contour boundary in the first region of interest.
3. The image processing method according to claim 1, characterized in that: Based on the contour boundary, the method for obtaining the edge straight line of the contour boundary includes: Based on the contour boundary, obtaining boundary pixel points of the contour boundary; The boundary pixel points are fitted to obtain a fitting straight line, and the edge straight line is the fitting straight line.
4. The image processing method according to claim 3, characterized in that: The method for obtaining the offset angle and offset distance of the edge straight line based on the edge straight line and the preset standard opposite edge straight line includes: Acquire the offset distance based on the midpoint coordinates of the y-axis lengths of the edge straight line and the standard opposite side straight line in the first region of interest; The offset angle is obtained based on the slope of the fitting straight line.
5. The image processing method according to claim 4, characterized in that: The slope of the fitted straight line is expressed as: Among them, x i represents the horizontal coordinate of the i-th boundary pixel point, y i represents the ordinate of the i-th boundary pixel point, represents the average horizontal coordinate of the boundary pixels, represents the average ordinate of the boundary pixel points, n represents the total number of the boundary pixel points, represents the slope of the fitting line, and i represents the i-th boundary pixel point.
6. The image processing method according to claim 1, characterized in that: Also includes: When the deviation angle is greater than a preset value, a deviation alarm is triggered; The offset distance is sent to the lower computer so that the cloth dispensing device can move the offset distance in the opposite direction.
7. The image processing method according to claim 1, characterized in that: The standard opposite side straight line is a straight line in the middle of the field of view of the shooting tool used to shoot the fabric image.
8. An image processing device, characterized in that: include: An image acquisition module, used for acquiring a fabric image, wherein the fabric image includes an edge portion of the fabric, and the fabric image is an image acquired during the fabric edge alignment process; An edge detection module is used to perform edge detection on a first region of interest of the fabric image to obtain a contour boundary between the fabric and the background in the first region of interest; A straight line acquisition module, used for acquiring an edge straight line of the contour boundary based on the contour boundary; The offset acquisition module is used to acquire the offset angle and offset distance of the edge straight line based on the edge straight line and a preset standard opposite edge straight line, and the offset angle and the offset distance are used to determine the opposite edge state of the fabric.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the image processing method according to any one of claims 1 to 7 is implemented.
10. An electronic terminal comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the image processing method according to any one of claims 1 to 7.