A cutting region determination method and apparatus

By acquiring images of the tangential section of wood using machine vision technology and segmenting them to determine the maximum inscribed rectangle, the problem of wood waste caused by relying on operator experience in existing technologies is solved, and efficient determination of wood cutting areas and material utilization are achieved.

CN116758145BActive Publication Date: 2026-03-31HANGZHOU HIKROBOT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-13
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

In the wood processing process, existing technologies rely on the operator's experience to determine the cutting position, resulting in serious wood waste and an inability to accurately find the cutting area with the largest area.

Method used

Machine vision technology is used to acquire images of the core material of the tangential section of wood, perform image segmentation, determine the original cutting area, and then find the largest inscribed rectangle as the area to be cut, reducing the reliance on operator experience.

Benefits of technology

It enables accurate determination of the maximum cutting area during wood cutting, reducing wood waste and improving cutting efficiency and material utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116758145B_ABST
    Figure CN116758145B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a cutting area determination method and device, which can determine an original cutting area by performing image segmentation on a core material image, and find a maximum inscribed rectangle in the original cutting area as a cutting area. In the embodiment of the present application, based on the original cutting image, since the areas of all inscribed rectangles in the original cutting area are calculated, the area of the maximum inscribed rectangle obtained can meet the cutting requirement, and then the cutting position is determined without depending on the experience of an operator, and the waste of material is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of wood processing and lumbering technology, and in particular to a method and apparatus for determining the cutting area. Background Technology

[0002] In the processing of wood, it is often necessary to cut rectangular cores from irregularly shaped raw materials for subsequent processing. For example, ... Figure 1-1 For the log image shown, if you want to cut it perpendicular to the tangential section to retain as much core material as possible, you need to find the inscribed rectangle with the largest area in the core material region of the current tangential section as the cutting area.

[0003] As the shape of the wood to be cut changes, the size and position of the inscribed rectangle of its largest area also change accordingly. In the current processing, the cutting position is determined solely by the operator's experience, which requires a high level of expertise and results in wood waste.

[0004] Therefore, there is an urgent need for a method to determine the cutting area that can accurately locate the cutting position without relying on the operator's experience, thereby reducing wood waste. Summary of the Invention

[0005] The purpose of this application is to provide a method and apparatus for determining the cutting area, so as to accurately locate the cutting position based on machine vision without relying on the operator's experience, thereby reducing wood waste. The specific technical solution is as follows:

[0006] In a first aspect of this application, a method for determining a cutting region is provided, the method comprising:

[0007] Acquire a core image including the chord section of the target object;

[0008] The core material image is segmented to determine the original cutting area containing the core material region of the target object;

[0009] The inscribed rectangle with the largest area among all inscribed rectangles within the original cutting area is selected as the area to be cut.

[0010] In one possible embodiment, determining the inscribed rectangle with the largest area among all inscribed rectangles within the original cutting region as the region to be cut includes:

[0011] Identify all inscribed rectangles within the original cutting area whose angles with the coordinate axes satisfy a preset angle condition;

[0012] Select the inscribed rectangle with the largest area from all the defined inscribed rectangles, and use it as the region to be cut.

[0013] In one possible embodiment, determining all inscribed rectangles within the original cutting region that satisfy a preset angle with the coordinate axis includes:

[0014] Step 1: Determine the current first vertex located within the original cutting region. The initial coordinates of the current first vertex are (X0, Y0). Initialize W. The current first vertex is different each time it is obtained. Then execute Step 2.

[0015] Step 2: Determine (X0+W, Y0) as the current second vertex; W is initially set to the first preset value; if (X0+W, Y0) is within the original cutting area, proceed to step 3; if (X0+W, Y0) is not within the original cutting area, proceed to step 5.

[0016] Step 3: Initialize H, which is initially set to the second preset value, and then proceed to Step 4;

[0017] Step 4: Determine (X0, Y0+H) as the current third vertex and (X0+W, Y0+H) as the current fourth vertex. If the line segment formed by the current third vertex and the current fourth vertex is within the original cutting area, then proceed to step 6; if the line segment formed by the current third vertex and the current fourth vertex is not within the original cutting area, then proceed to step 7.

[0018] Step 5: Return to step 1 until there are no more pixels to be traversed in the original cutting region, wherein the pixels to be traversed have not been used as the pixels of the current first vertex;

[0019] Step 6: Determine the region enclosed by the current first vertex, the current second vertex, the current third vertex, and the current fourth vertex as the inscribed rectangle, and use H+δ as the new H, then return to execute step 4; where δ is the preset step size of the height value;

[0020] Step 7: Use W+θ as the new W, and return to execute step 2; where θ is the preset step size of the width value;

[0021] The step of determining the inscribed rectangle with the largest area from all determined inscribed rectangles as the region to be cut includes:

[0022] If there are no pixels to be traversed in the original cutting region, then the inscribed rectangle with the largest area is selected from all the determined inscribed rectangles and used as the region to be cut.

[0023] In one possible embodiment, determining the inscribed rectangle with the largest area among all inscribed rectangles within the original cutting region as the region to be cut includes:

[0024] The original cutting area is rotated along the first direction by a first preset angle so that the long side of the circumscribed rectangle of the original cutting area is parallel to the coordinate axis or the second-order center distance principal axis is parallel to the coordinate axis, thus obtaining the first cutting area;

[0025] Identify all inscribed rectangles within the first cutting region whose angles with the coordinate axes satisfy a preset angle condition;

[0026] From all the defined inscribed rectangles, determine the inscribed rectangle with the largest area;

[0027] The inscribed rectangle with the largest area is rotated along the second direction by a first preset angle to obtain the area to be cut; wherein the first direction and the second direction are opposite.

[0028] In one possible embodiment, the step of performing image segmentation on the core material image to determine the original cut region containing the core material region of the target object includes:

[0029] The core material image is segmented to determine the foreground and background regions;

[0030] The largest connected region within the foreground region is determined as the original cutting region.

[0031] In one possible embodiment, the background region includes a defect region, and the method further includes:

[0032] If the defect processing mode for the original cut area is a fillable mode, then the defect area within the range of the original cut area is determined as a fillable area.

[0033] The fillable area is incorporated into the original cut area.

[0034] In one possible embodiment, determining a background region within the original cut area as a fillable region includes:

[0035] The background area whose size meets the preset filling conditions within the original cutting area is identified as the fillable area.

[0036] In a second aspect of this application, a cutting region determining device is provided, the device comprising:

[0037] The acquisition module is used to acquire core material images, including the chordal section of the target object;

[0038] The original cutting region determination module is used to perform image segmentation on the core material image to determine the original cutting region containing the core material region of the target object;

[0039] The module for determining the region to be cut is used to determine the inscribed rectangle with the largest area among all inscribed rectangles within the original cutting region, and to use it as the region to be cut.

[0040] In one possible embodiment, the region to be cut determination module specifically includes:

[0041] The first determining module is used to determine all inscribed rectangles within the original cutting area whose angle with the coordinate axis satisfies a preset angle condition;

[0042] The second determining module is used to determine the inscribed rectangle with the largest area from all the determined inscribed rectangles, as the area to be cut.

[0043] The first determining module is specifically used to perform the following steps:

[0044] Step 1: Determine the current first vertex located within the original cutting region. The initial coordinates of the current first vertex are (X0, Y0). Initialize W. The current first vertex is different each time it is obtained. Then execute Step 2.

[0045] Step 2: Determine (X0+W, Y0) as the current second vertex; W is initially set to the first preset value; if (X0+W, Y0) is within the original cutting area, proceed to step 3; if (X0+W, Y0) is not within the original cutting area, proceed to step 5.

[0046] Step 3: Initialize H, which is initially set to the second preset value, and then proceed to Step 4;

[0047] Step 4: Determine (X0, Y0+H) as the current third vertex and (X0+W, Y0+H) as the current fourth vertex. If the line segment formed by the current third vertex and the current fourth vertex is within the original cutting area, then proceed to step 6; if the line segment formed by the current third vertex and the current fourth vertex is not within the original cutting area, then proceed to step 7.

[0048] Step 5: Return to step 1 until there are no more pixels to be traversed in the original cutting region, wherein the pixels to be traversed have not been used as the pixels of the current first vertex;

[0049] Step 6: Determine the region enclosed by the current first vertex, the current second vertex, the current third vertex, and the current fourth vertex as the inscribed rectangle, and use H+δ as the new H, then return to execute step 4; where δ is the preset step size of the height value;

[0050] Step 7: Use W+θ as the new W, and return to execute step 2; where θ is the preset step size of the width value;

[0051] The second determining module is specifically used to determine the largest inscribed rectangle from all the determined inscribed rectangles if there are no pixels to be traversed in the original cutting region, and use it as the region to be cut.

[0052] The second determining module is specifically used to rotate the original cutting area along the first direction by a first preset angle, so that the long side of the outer rectangle of the original cutting area is parallel to the coordinate axis or the second-order center distance principal axis is parallel to the coordinate axis, thereby obtaining the first cutting area;

[0053] Identify all inscribed rectangles within the first cutting region whose angles with the coordinate axes satisfy a preset angle condition;

[0054] From all the defined inscribed rectangles, determine the inscribed rectangle with the largest area;

[0055] The inscribed rectangle with the largest area is rotated along the second direction by a first preset angle to obtain the area to be cut; wherein the first direction and the second direction are opposite.

[0056] The original cutting area determination module is specifically used to perform image segmentation on the core material image to determine the foreground area and the background area.

[0057] The largest connected component within the foreground region is determined as the original cutting region;

[0058] The background area includes a defect area. If the defect processing mode for the original cut area is a fillable mode, then the defect area within the range of the original cut area is determined as a fillable area.

[0059] The fillable area is incorporated into the original cut area;

[0060] The background area whose size meets the preset filling conditions within the original cutting area is identified as the fillable area;

[0061] The cutting device is controlled to cut along the straight line containing the boundary of the area to be cut.

[0062] In a third aspect of this application, a cutting system is provided, the system comprising a camera, a computer, and cutting equipment;

[0063] The camera is used to photograph the target object, obtain a core image including the chordal section of the target object, and send the core image to the computer;

[0064] The computer is used to perform image segmentation on the core material image to determine the original cutting region containing the core material area of ​​the target object; to determine the largest inscribed rectangle among all inscribed rectangles within the original cutting region as the region to be cut; and to control the cutting device to cut along the straight line containing the boundary of the region to be cut.

[0065] The cutting device is used to cut along the straight line containing the boundary of the area to be cut under the control of the computer.

[0066] In one feasible embodiment, the system further includes:

[0067] A light source device for providing a light source for the camera when photographing the target object.

[0068] In a fourth aspect of this application, an electronic device is provided, comprising:

[0069] Memory, used to store computer programs;

[0070] When a processor executes a program stored in memory, it implements the method described in the first aspect.

[0071] In a fifth aspect of this application, a computer-readable storage medium is provided, wherein a computer program is stored therein, and the computer program, when executed by a processor, implements the method described in the first aspect.

[0072] Beneficial effects of the embodiments in this application:

[0073] This application provides a method and apparatus for determining a cutting area. This method involves segmenting a core material image to determine the original cutting area, and then identifying the largest inscribed rectangle within that original cutting area as the area to be cut. In this embodiment, based on the original cutting image, since the area to be cut is determined from the core material area, cutting is performed within the core material itself. Furthermore, because the area to be cut is the largest inscribed rectangle, the area of ​​the area to be cut greatly satisfies the cutting requirements. This allows for determining the cutting position without relying on the operator's experience, reducing wood waste.

[0074] Of course, implementing any product or method of this application does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description

[0075] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other embodiments can be obtained based on these drawings.

[0076] Figure 1-1 A schematic diagram of a log image provided in an embodiment of this application;

[0077] Figure 1-2 This is a schematic diagram of a tangential section cutting provided in an embodiment of this application;

[0078] Figure 2-1 This is a schematic flowchart of a method for determining a cutting region provided in an embodiment of this application;

[0079] Figure 2-2 A schematic diagram illustrating a method for fixing wood to be cut, as provided in an embodiment of this application;

[0080] Figure 2-3 A schematic diagram of a core material region provided in an embodiment of this application;

[0081] Figure 2-4 A schematic diagram of a maximum area inscribed rectangle provided in an embodiment of this application;

[0082] Figure 2-5 A schematic diagram illustrating a preset condition provided for an embodiment of this application;

[0083] Figure 2-6 A schematic diagram of an original cutting region in different directions provided for an embodiment of this application;

[0084] Figure 2-7 A schematic diagram of an original cutting area provided in an embodiment of this application;

[0085] Figure 3-1 A flowchart illustrating the process of determining the inscribed rectangle with the largest area is provided in an embodiment of this application.

[0086] Figure 3-2 A schematic diagram illustrating the determination of an inscribed rectangle provided in an embodiment of this application;

[0087] Figure 3-3 This is a schematic diagram illustrating the redetering of the current second vertex, as provided in an embodiment of this application.

[0088] Figure 3-4 A schematic diagram illustrating the process of determining the maximum inscribed rectangle provided in this application embodiment;

[0089] Figure 4 This is a schematic diagram of the original cut area after rotation, provided in an embodiment of this application;

[0090] Figure 5 A schematic diagram of a foreground region and a background region provided in an embodiment of this application;

[0091] Figure 6This is a schematic diagram of a cutting area determination device provided in an embodiment of this application;

[0092] Figure 7 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0093] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of this application.

[0094] In some scenarios, it's necessary to initially cut a target object before further processing it into the desired item. For example, in furniture making (where the target object is wood), some pre-cut wood, such as wood cut into cuboids, is often needed for easier processing. During this initial cutting process, to minimize waste, the logs should be cut into cuboids with the largest possible face area. However, different types of wood have varying shapes, making it impossible to cut them in the same way. Therefore, to cut the logs into cuboids with the largest possible face area, the operator needs to rationally plan the cutting method based on their experience, which demands a high level of expertise.

[0095] During the cutting process, the target object is often first cut with a tangential surface, such as... Figure 1-2 The diagram shows a schematic of tangential section cutting. Then, the cutting area is determined on the tangential section, and cutting is performed along the boundary of this area. The area of ​​the cutting area is the size of the area cut on the tangential section of the target object. Since a larger cutting area results in a larger finished product volume, less material waste is avoided. Therefore, determining the largest possible cutting area on the tangential section is crucial for minimizing material waste. Here, "log" refers to a finite-length section of wood (approximately cylindrical), with bark on the surface and heartwood inside.

[0096] Based on this, embodiments of this application provide a method for determining a cutting region, used to determine the region to be cut with the largest area from the tangential plane. For example... Figure 2-1 As shown, the method includes:

[0097] S201. Obtain a core material image including the chordal section of the target object.

[0098] S202. Perform image segmentation on the core material image to determine the original cutting area containing the core material region of the target object.

[0099] S203. Determine the inscribed rectangle with the largest area among all inscribed rectangles within the original cutting area, and use it as the area to be cut.

[0100] In this embodiment, the original cutting area can be determined by image segmentation of the core material image. The largest inscribed rectangle within this original cutting area is then identified as the area to be cut. In this embodiment, based on the original cutting image, since the area to be cut is determined from the core material area, all cutting is performed within the core material region. Furthermore, the area to be cut is the largest inscribed rectangle, ensuring that the area of ​​the area to be cut greatly meets the cutting requirements. This allows for determining the cutting position without relying on the operator's experience, reducing material waste.

[0101] S201-S203 will be described in detail below.

[0102] In S201, the target object is an object enclosed by an outer surface. For example, it could be a log or a piece of jade. In this application's embodiments, the core material does not specifically refer to the core of wood, but rather to a general category of internal materials enclosed by an outer surface. For example, if it is a piece of jade, then the interior of the outer shell is the core material. For ease of description, the following description uses a log as the target object. The principle remains the same for other objects besides logs, and will not be repeated here.

[0103] The core material image is obtained by taking a picture with a camera. Specifically, the side of the tangential section of the wood to be cut can be facing the camera. For easier shooting, the wood can also be fixed in place. The method of fixing the wood can be as follows: Figure 2-2 As shown, the wood to be cut is fixed by two fixing rods. The wood to be cut is wood with a portion already cut off, exhibiting a tangential section. The core image can be a grayscale image or a color image. This application embodiment does not limit the method of acquiring the core image or the format of the core image. Any method that can be used to acquire the core image can be applied to this application embodiment, and any core image in different image formats that can be segmented can be applied to this application embodiment.

[0104] In S202, deep learning algorithms or traditional image processing algorithms can be used to segment the core material image. Image segmentation of the core material image yields a binary image of the core material, in which the background and foreground regions are clearly separated to distinguish the core material region from the background region outside the core material. The original segmented region is the foreground region containing the core material region. Clear segmentation means that the difference between the pixel values ​​of the background region and the pixel values ​​of the foreground region is greater than a preset threshold. For example... Figure 2-3 As shown in the image, the core material region is the pixel area where the core material is located in the core material image.

[0105] In S203, the inscribed rectangle in this application refers to a rectangle located within the original cutting area, rather than specifically a rectangle whose four vertices are on the boundary line of the core material area.

[0106] In this step, such as Figure 2-4 As shown, Figure 2-4 The diagram illustrates the maximum area inscribed rectangle. As is known to those skilled in the art, a rectangle is a special type of parallelogram composed of four vertices, characterized by a 90° angle between any two adjacent sides. That is, a rectangle can be uniquely determined simply by determining the lengths and positions of two adjacent sides. Therefore, the rectangle can be uniquely determined by identifying the three vertices on the adjacent sides, namely the first, second, and third vertices, where the second and third vertices are diagonal points, and the first and second vertices are adjacent to each other. To find all inscribed rectangles within the original cutting region, the first vertex can be used as a reference point, and then the second and third vertices can be determined separately. Specifically, this can be achieved by traversing as many pixels as possible within the original cutting region as the first vertex, then determining all possible third and second vertices within the original cutting region, and finally identifying all inscribed rectangles within the original cutting region formed by these three vertices. The inscribed rectangle with the largest area is selected as the region to be cut.

[0107] In another possible embodiment, those skilled in the art will find that the vertices of the largest inscribed rectangle determined in the original cutting region are often located at the edges of the original cutting region, and the closer to the center of the original cutting region, the lower the probability of determining the largest inscribed rectangle. To improve the efficiency of determining the largest inscribed rectangle, it is not necessary to traverse all pixels. Only traversing a subset of pixels that meet preset conditions is sufficient to determine the largest inscribed rectangle, such as... Figure 2-5 The shaded area is shown. The preset conditions can be either a preset value for the distance from the original cutting region's boundary pixels, or a condition that the distance to the original region's boundary pixels is less than or equal to a preset threshold. The specific method for determining the area of ​​the inscribed rectangle that maximizes the area can be selected based on the actual application scenario.

[0108] In one possible embodiment, since the original cutting area is an irregular shape and the cutting directions of the original cutting area are also different, such as... Figure 2-6 As shown, these are the original cut areas in different directions. For ease of description, in... Figure 2-6The X and Y axes of the coordinate system are shown in the diagram. The X and Y axes of the coordinate system in this embodiment are the same as those shown here, and will not be repeated hereafter. However, when the cutting direction of the original cutting region is not parallel to the X or Y axes, the traversal process often involves determining the vertices of the inscribed rectangle based on a specific step size. Since the step size is often an integer, according to trigonometric functions, the increments in the X and Y axes during the traversal are non-integers, meaning the coordinates of the determined vertices are non-integers. Since the coordinates of each pixel in the image are integers, it becomes difficult to select pixels as vertices in the inscribed rectangle during the traversal process. Therefore, the process of traversing pixels is difficult, resulting in a large workload when determining the inscribed rectangle. In this embodiment, the X-axis is the horizontal direction of the coordinate system, and the Y-axis is the vertical direction. To further improve the efficiency of determining the inscribed rectangle, the above S203 may specifically include:

[0109] S2031. Determine all inscribed rectangles within the original cutting area whose angles with the coordinate axes satisfy the preset angle conditions; where the coordinate axes are the coordinate axes of the image coordinate system.

[0110] In this step, the preset angle condition can be the angle between the long side of the circumscribed rectangle of the original cutting region with the coordinate axis or the angle between the second-order center distance principal axis and the coordinate axis. For example, as Figure 2-7 As shown, if the angle between the long side of the circumscribed rectangle of the original cutting region's minimum area and the coordinate axis, or the angle between the second-order center distance principal axis and the coordinate axis, is α, then the inscribed rectangle is determined along the direction of the long side of the circumscribed rectangle of the original cutting region's minimum area or the second-order center distance principal axis. The circumscribed rectangle is the rectangle that completely encloses the original cutting region. For example... Figure 2-6 As shown, the X-axis of the coordinate system is parallel to the pixel rows, and the Y-axis is perpendicular to the pixel rows.

[0111] S2032. From all the determined inscribed rectangles, select the inscribed rectangle with the largest area as the region to be cut.

[0112] In this step, each time an inscribed rectangle is determined, its area is calculated and compared with the area of ​​a previously saved inscribed rectangle. If the area is greater than the area of ​​the previously determined inscribed rectangle, the currently determined inscribed rectangle is retained as the current inscribed rectangle; if the area is less than the area of ​​the previously determined inscribed rectangle, the previously determined inscribed rectangle is retained as the current inscribed rectangle. This process continues until all inscribed rectangles are traversed, and the current inscribed rectangle is the one with the largest area. Alternatively, the calculated areas of all inscribed rectangles can be arranged in descending order, and the inscribed rectangle with the largest area can be selected. In this embodiment, the method for determining the largest inscribed rectangle is not limited.

[0113] In this embodiment, the inscribed rectangle is determined along the angle between the long side of the circumscribed rectangle with the smallest area of ​​the original cutting region and the coordinate axis, or along the angle between the second-order center distance principal axis and the coordinate axis. For example... Figure 2-6 As shown, determining the inscribed rectangle along the direction of the arrow can quickly identify the inscribed rectangle with the largest area, thus improving computational efficiency.

[0114] In one possible embodiment, for ease of calculation, the included angle α is 0° or 90°, meaning the longer side of the circumscribed rectangle of the original cutting region's minimum area is parallel or perpendicular to the coordinate axis or the second-order center distance principal axis and the X-axis. When α is 0°, the longer side of the circumscribed rectangle of the original cutting region's minimum area is parallel to the coordinate axis or the second-order center distance principal axis and the X-axis; when α is 0°, the longer side of the circumscribed rectangle of the original cutting region's minimum area is perpendicular to the coordinate axis or the second-order center distance principal axis and the X-axis. The inscribed rectangle can be determined along the horizontal direction of the X-axis or along the vertical direction of the X-axis, so that the coordinates of the four vertices of the inscribed rectangle can be represented in integer form, making it easier to determine the inscribed rectangle on the coordinate axis and to calculate the area of ​​the inscribed rectangle. Figure 3-1 The diagram shows a flowchart for determining the inscribed rectangle with the largest area. Step S2031 specifically includes:

[0115] S301: Determine the current first vertex within the original cutting region. The initial coordinates of the current first vertex are (X0, Y0). The current first vertex is different each time it is determined.

[0116] S302: Initialize W, which is initially set to the first preset value.

[0117] The above steps are Figure 3-1 The steps shown are for determining the current first vertex and setting the initial first preset threshold W. In this step, any pixel within the original cutting area can be selected as the current first vertex. The coordinates of the current first vertex are the initial coordinates (X0, Y0), where X0 and Y0 are merely symbols used to represent numbers and do not refer to the horizontal and vertical coordinates. For example, the initial coordinates can also be represented as (Y0, X0). Because it is necessary to traverse as many inscribed rectangles as possible within the original cutting area, the current first vertex needs to be determined again after all inscribed rectangles determined by the current first vertex have been determined. Therefore, each time the current first vertex is obtained, it is a different point from the previously determined current first vertex.

[0118] S303: Define (X0+W, Y0) as the current second vertex;

[0119] S304: If (X0+W, Y0) is within the original cutting area, then execute S305; if (X0+W, Y0) is not within the original cutting area, then execute S310.

[0120] The above steps are Figure 3-1 The steps shown illustrate determining the current second vertex and whether it is within the original cutting region. In this step, the inscribed rectangle has the characteristic that its top and bottom edges are parallel and equal. Therefore, the inscribed rectangle includes four vertices: the first vertex, the second vertex, the third vertex, and the fourth vertex. The first and second vertices are on the same horizontal line. Specifically, the line segment formed by the first and second vertices is parallel and equal to the line segment formed by the third and fourth vertices, or the line segment formed by the first and third vertices is parallel and equal to the line segment formed by the second and fourth vertices. Once the initial coordinates (X0, Y0) of the current first vertex are determined, as follows... Figure 3-2 As shown, the current rectangle is initially set with a width and height, where the width and height are the width along the horizontal direction of the inscribed rectangle along the X-axis and the height along the vertical direction of the Y-axis in this embodiment. The current second vertex is obtained by adding the width of the current rectangle to the x-coordinate of the current first vertex. Assuming W is the width of the current rectangle, the coordinates of the current second vertex are (X0 + W, Y0). W is initially a first preset value, which is set by those skilled in the art based on the actual application scenario. In this embodiment, |W| is the width initially set for the current rectangle.

[0121] S305: Initialize H. H is initially set to the second preset value.

[0122] This step is... Figure 3-1 The steps shown are for setting the initial second preset value H.

[0123] S306: Determine (X0, Y0+H) as the current third vertex and (X0+W, Y0+H) as the current fourth vertex.

[0124] S307: If the line segment formed by the current third vertex and the current fourth vertex is within the original cutting area, then execute S308; if the line segment formed by the current third vertex and the current fourth vertex is not within the original cutting area, then execute S311.

[0125] The above steps are Figure 3-1The steps involve determining the current third vertex, the current fourth vertex, and whether the line segment formed by the current third vertex and the current fourth vertex is within the original cutting area. In this step, the current third vertex is obtained by adding the height of the current rectangle to the ordinate of the current first vertex. Assuming |H| is the height of the current rectangle, the coordinates of the current third vertex are (X0, Y0+H). H is initially a second preset value, which is set by those skilled in the art according to the actual application scenario. In this embodiment, H is the height of the current rectangle initially set in S303 above.

[0126] S308: Define the region enclosed by the current first vertex, the current second vertex, the current third vertex, and the current fourth vertex as the inscribed rectangle, where δ is the preset step size of the height value.

[0127] S309: Use H+δ as the new H and return to execute S306;

[0128] The above steps are Figure 3-1 The steps shown are for determining the current inscribed rectangle and setting H+δ as the new H. In this step, as... Figure 3-2 As shown, if the line segment formed by the current third vertex and the current fourth vertex is within the original cutting region, then the region enclosed by the current first vertex, the current second vertex, the current third vertex, and the current fourth vertex is defined as the inscribed rectangle. Figure 3-2 The shaded area in the diagram. At this point, it is necessary to determine all inscribed rectangles whose width is defined by the line segment formed by the current first vertex and the current second vertex; that is, keeping the width constant, determine all inscribed rectangles with different lengths. Then, it is necessary to redetermine the current third vertex and the current fourth vertex, i.e., to reset a second preset value. The second preset threshold can be set according to a preset step size. Each time, the initial second preset value H is increased by δ, where δ is the preset step size for the height value, and δ is set by those skilled in the art based on the actual application scenario.

[0129] S310: Determine if there are any pixels to be traversed in the original cutting region. If yes, return to execute S301. Otherwise, determine the inscribed rectangle with the largest area and end the process. The pixels to be traversed have not been used as the pixels of the current first vertex.

[0130] This step is... Figure 3-1 The steps shown are for determining whether there are pixels to be traversed in the original cut region.

[0131] In this step, the current first vertex has already traversed all original cutting regions, meaning every pixel in the original cutting region has been considered as the current first vertex. After determining the current first vertex, a first preset value W is initialized. When a current inscribed rectangle is determined, if the current first vertex remains unchanged, a new first preset value W is set. The current second vertex is determined, and a new second preset value H is set. The current third vertex is determined, and then a new current inscribed rectangle is determined. This process continues until all inscribed rectangles within the original cutting region with the current first vertex as the vertex are determined. That is, until (X0+W, Y0) is no longer within the original cutting region, the process returns to redetermine the current first vertex.

[0132] In one possible implementation, when redetermining the current first vertex, in order to avoid repeatedly using the previous current first vertex as the new current first vertex, the current first vertex can be determined from the pixels to be traversed each time a new current first vertex is determined.

[0133] S311: Take W+θ as the new W and return to execute S303; θ is the preset step size of the width value.

[0134] This step is... Figure 3-1 The step shown is to use W+θ as the new W. In this step, if the line segment formed by the current third vertex and the current fourth vertex is not within the original cutting area, it means that all inscribed rectangles with the width of the inscribed rectangle formed by the line segment formed by the current first vertex and the current second vertex have been determined, and it is necessary to change the width of the inscribed rectangle to continue determining the inscribed rectangle. At this time, it is necessary to reset a first preset value. The first preset value can be set according to a preset step size. Each time, θ is added to the initial first preset value W, where θ is the preset step size of the width value, and θ is set by those skilled in the art according to the actual application scenario. Figure 3-3 The diagram shows a return to execution S303 to redetermine the current second vertex.

[0135] For example, the above S301-S303 will be described in detail below using the original cutting area 1 as an example.

[0136] like Figure 3-4 As shown, within the original cutting region 1, coordinate axes are established with any point as the origin. Assume that the current first vertex a0(-11, 6) is determined, and the initial preset value W is set to 5.

[0137] The current second vertex is determined to be b0(-6, 6), and b0 is within the original cutting region 1.

[0138] (1) If the initial second preset value H is set to 2, then the current third vertex is determined to be c0(-11, 4) and the current fourth vertex is determined to be d0(-6, 4). Since the line segment c0-d0 is within the original cutting area 1, the current rectangle 1 can be determined to be rectangle a0-b0-c0-d0.

[0139] (2) Take H+δ as the new H. Assuming δ is 2, the new H is 4. The current third vertex is c1(-11, 2) and the current fourth vertex is d1(-6, 2). Since the line segment c1-d1 is within the original cutting area 1, the current rectangle 2 can be determined as rectangle a0-b0-c1-d1.

[0140] (3) If H+δ is taken as the new H, then the new H is 6, the current third vertex is c2(-11, 0), the current fourth vertex is d2(-6, 0), and the line segment c2-d2 is within the original cutting area 1, then the current rectangle 3 can be determined as rectangle a0-b0-c2-d2.

[0141] (4) If H+δ is taken as the new H, then the new H is 8, the current third vertex is c3(-11, -2), the current fourth vertex is d3(-6, -2), and the line segment c3-d3 is not within the original cutting area 1.

[0142] Then we take W+θ as the new W and initialize H. Assuming θ is 5, the new W is 10, and H is 2.

[0143] The current second vertex is determined to be b1(-1, 6), and b1 is within the original cutting region 1.

[0144] Continue determining the current third and fourth vertices and the current inscribed rectangle until the line segment formed by the third and fourth vertices is no longer within the original cutting region 1. The process of determining the current third and fourth vertices and the current inscribed rectangle is the same as (1)-(4), and will not be elaborated further here.

[0145] Until it is determined that the current second vertex is b4(14, 6), b4 is not in the original cutting region 1.

[0146] Then, the current first vertex is redefined as a1(-10, 5), and all inscribed rectangles with the current first vertex as a1 are determined. The determination method is the same as the previous steps, and so on, until the current first vertex has traversed all original cutting regions 1, and all inscribed rectangles within the original cutting region 1 are obtained.

[0147] The above step S2032 may specifically include:

[0148] If there are no pixels to be traversed in the original cutting region, select the inscribed rectangle with the largest area from all the determined inscribed rectangles and use it as the cutting region.

[0149] In this step, if there are no pixels in the original cutting region that are not all used as the current first vertex, it means that all inscribed rectangles within the original cutting region have been determined. Then, the largest inscribed rectangle can be determined from all inscribed rectangles. Since the preset step sizes for width and height can be infinitely small, the number of determined inscribed rectangles is close to infinite. Therefore, the maximum area in this embodiment refers to the maximum value that is feasible for practical operation.

[0150] In one possible embodiment, in order to determine the inscribed rectangle with the largest area within the original cutting area, the preset step size of the width value and the preset step size of the height value can be set small enough to be used as a minimum value for calculation. In this way, the inscribed rectangle with the largest area can be determined within the calculable limit value.

[0151] In one possible embodiment, since the four vertices of the inscribed rectangle are determined with reference to the coordinate axes when the long side of the circumscribed rectangle of the original cutting region is parallel to the coordinate axes or the second-order center distance principal axis is parallel to the coordinate axes, it is easier to calculate the area of ​​the inscribed rectangle, thereby improving the efficiency of determining the region to be cut. Therefore, before S2031, the method further includes:

[0152] a) Rotate the original cutting region along the first direction by a first preset angle so that the long side of the outer rectangle of the original cutting region is parallel to the coordinate axis or the second-order center distance principal axis is parallel to the coordinate axis, thus obtaining the first cutting region.

[0153] In this step, the rotation angle of the original cutting region relative to the coordinate axis can be determined. Then, rotating the original cutting region in the opposite direction will make the long side of the circumscribed rectangle of the original cutting region parallel to the coordinate axis, or the second-order center distance principal axis parallel to the coordinate axis. The rotation angle is the same as the included angle α in S2031. The specific determination method of the included angle in S2031 can be referred to above, and will not be repeated here. For example, as shown... Figure 4 As shown, rotating the original cutting region in the opposite direction by α will make the long side of the circumscribed rectangle of the original cutting region parallel to the coordinate axis or the second-order center distance principal axis parallel to the coordinate axis.

[0154] b) Determine all inscribed rectangles within the first cutting region whose angles with the coordinate axes satisfy the preset angle conditions.

[0155] The steps for determining all inscribed rectangles in this step are the same as those in S2031 above, and will not be elaborated further here.

[0156] c) Determine the inscribed rectangle with the largest area from all the defined inscribed rectangles.

[0157] d) Rotate the largest inscribed rectangle along the second direction by a first preset angle to obtain the area to be cut; wherein the first direction and the second direction are opposite.

[0158] In this step, the first direction and the second direction are opposite; that is, the original cutting area is first rotated and aligned, such as... Figure 2-4 As shown, this facilitates the determination of the inscribed rectangle. After determining the largest inscribed rectangle, the original cutting area is rotated back to its original state, as shown below. Figure 2-3 As shown, this allows for cutting according to the orientation of the target object during the actual cutting process, making it convenient to operate.

[0159] In one possible embodiment, the area to be cut only needs to be determined from the core material area. Therefore, to improve the efficiency of determining the original cutting area, the above-mentioned S202 may specifically include:

[0160] S2021. Perform image segmentation on the core material image to determine the foreground and background regions.

[0161] In this step, we determine the area to be cut from the original cutting region. Therefore, we only need to find the original cutting region in the core material image; other regions can be omitted. Thus, we can perform image segmentation on the core material image to obtain a binary image of the core material. Image segmentation can use deep learning algorithms or traditional image processing algorithms. We then determine the foreground and background regions from the binary image. The foreground region includes the original cutting region.

[0162] S2022, Determine the largest connected region within the foreground region as the original cutting region.

[0163] In this step, since the original cutting region is often the largest area in the foreground region, the largest connected component within the foreground region can be determined as the original cutting region. For example... Figure 2-3 As shown.

[0164] In one possible embodiment, the core material of the target object may have defects, resulting in holes on the tangential surface of the target object. Therefore, to avoid these holes affecting the determination of the inscribed rectangle with the largest area, the holes can be filled for tolerable defects. The background area includes the defect area, which is as follows: Figure 2-3 The core material portion shown includes porous areas. The background area includes areas that are not part of the target object or the core material portion, such as the surface area of ​​the target object. The method further includes:

[0165] S2023. If the defect handling mode for the original cut area is the fillable mode, then the defect area within the original cut area is determined as the fillable area.

[0166] In this step, the "fillable mode" refers to the acceptable presence of defective areas in the finished product. The "unfillable mode" refers to the unacceptable presence of defective areas in the finished product.

[0167] S2024. Incorporate the fillable area into the original cut area.

[0168] In this step, the pixel values ​​of the background area within the foreground region are assigned the same values ​​as the pixel values ​​of the foreground region. That is, the fillable area is merged into the original cut region to obtain a new original cut region, such as... Figure 5 As shown.

[0169] In another possible embodiment, some smaller holes may be tolerable, but some larger holes may not be. In this case, only the tolerable holes need to be filled. Step S2023 above can specifically be:

[0170] The background area whose size meets the preset filling conditions within the original cutting area is identified as the fillable area.

[0171] In this step, the preset filling condition can be an area smaller than a preset threshold. For example, if the area of ​​the background region within the original cutting area is smaller than the preset threshold, it is considered a fillable area. That is, holes with an area smaller than the preset threshold are filled. The preset threshold is set by those skilled in the art based on the actual application scenario.

[0172] The preset filling condition can also be set if the size in a specific direction is less than a preset threshold. If the size of a hole in the X-axis direction is less than the preset threshold, then the hole will be filled. Here, the size of the hole in the specific direction refers to the length of the projection of the hole in that specific direction.

[0173] In one feasible embodiment, after determining the region to be cut, the method further includes:

[0174] The cutting device is controlled to cut along the straight line containing the boundary of the area to be cut.

[0175] In this step, after obtaining the inscribed rectangle with the largest area within the core material region, i.e. the area to be cut, a wood cutting device is used to cut along the straight line containing the edge of the rectangle.

[0176] The cutting line can coincide with the rectangle's edge, or an offset can be set according to the actual situation to make the cutting line parallel to the rectangle's edge without coinciding with it.

[0177] You can cut along all four sides of the rectangle, or you can cut along only 1 to 3 of the sides. For example... Figure 2-2 The log shown has bark on only the top and bottom sides of its core area, while the left and right sides are barkless and nearly parallel. Therefore, it can be cut only along the straight lines of the top and bottom sides of the rectangle.

[0178] This application is not limited to blade cutting; it can also be laser cutting or high-pressure water jet cutting.

[0179] Corresponding to the above-described method for determining the cutting region, this application also provides a device for determining the cutting region, such as... Figure 6 As shown, the device includes:

[0180] The acquisition module 601 is used to acquire a core material image including the chord section of the target object;

[0181] The original cutting area determination module 602 is used to perform image segmentation on the core material image to determine the original cutting area containing the core material region of the target object;

[0182] The region to be cut module 603 is used to determine the inscribed rectangle with the largest area among all inscribed rectangles within the original cutting region, and use it as the region to be cut.

[0183] In one possible embodiment, the region to be cut determination module 603 specifically includes:

[0184] The first determining module 6031 is used to determine all inscribed rectangles within the original cutting area whose angle with the coordinate axis satisfies a preset angle condition;

[0185] The second determining module 6032 is used to determine the inscribed rectangle with the largest area from all the determined inscribed rectangles, as the area to be cut;

[0186] The first determining module 6031 is specifically used to perform the following steps:

[0187] Step 1: Determine the current first vertex located within the original cutting region. The initial coordinates of the current first vertex are (X0, Y0). Initialize W. The current first vertex is different each time it is obtained. Then execute Step 2.

[0188] Step 2: Determine (X0+W, Y0) as the current second vertex; W is initially set to the first preset value; if (X0+W, Y0) is within the original cutting area, proceed to step 3; if (X0+W, Y0) is not within the original cutting area, proceed to step 5.

[0189] Step 3: Initialize H, which is initially set to the second preset value, and then proceed to Step 4;

[0190] Step 4: Determine (X0, Y0+H) as the current third vertex and (X0+W, Y0+H) as the current fourth vertex. If the line segment formed by the current third vertex and the current fourth vertex is within the original cutting area, then proceed to step 6; if the line segment formed by the current third vertex and the current fourth vertex is not within the original cutting area, then proceed to step 7.

[0191] Step 5: Return to step 1 until there are no more pixels to be traversed in the original cutting region, wherein the pixels to be traversed have not been used as the pixels of the current first vertex;

[0192] Step 6: Determine the region enclosed by the current first vertex, the current second vertex, the current third vertex, and the current fourth vertex as the inscribed rectangle, and use H+δ as the new H, then return to execute step 4; where δ is the preset step size of the height value;

[0193] Step 7: Use W+θ as the new W, and return to execute step 2; where θ is the preset step size of the width value;

[0194] The second determining module 6032, if there are no pixels to be traversed in the original cutting region, then determines the inscribed rectangle with the largest area from all the determined inscribed rectangles as the region to be cut.

[0195] The second determining module 6032 is specifically used to rotate the original cutting area along the first direction by a first preset angle so that the long side of the outer rectangle of the original cutting area is parallel to the coordinate axis or the second-order center distance principal axis is parallel to the coordinate axis, thereby obtaining the first cutting area;

[0196] Identify all inscribed rectangles within the first cutting region whose angles with the coordinate axes satisfy a preset angle condition;

[0197] From all the defined inscribed rectangles, determine the inscribed rectangle with the largest area;

[0198] The inscribed rectangle with the largest area is rotated along the second direction by a first preset angle to obtain the area to be cut; wherein the first direction and the second direction are opposite.

[0199] The original cutting area determination module 602 is specifically used to perform image segmentation on the core material image to determine the foreground area and the background area.

[0200] The largest connected component within the foreground region is determined as the original cutting region;

[0201] The background area includes a defect area. If the defect processing mode for the original cut area is a fillable mode, then the defect area within the range of the original cut area is determined as a fillable area.

[0202] The fillable area is incorporated into the original cut area;

[0203] The background area whose size meets the preset filling conditions within the original cutting area is identified as the fillable area;

[0204] The cutting device is controlled to cut along the straight line containing the boundary of the area to be cut.

[0205] This application also provides an electronic device, such as... Figure 7 As shown, it includes:

[0206] Memory 701 is used to store computer programs;

[0207] When processor 702 executes a program stored in memory 701, it performs the following steps:

[0208] Acquire a core image including the chord section of the target object;

[0209] The core material image is segmented to determine the original cutting area containing the core material region of the target object;

[0210] The inscribed rectangle with the largest area among all inscribed rectangles within the original cutting area is selected as the area to be cut.

[0211] Furthermore, the aforementioned electronic device may also include a communication bus and / or a communication interface, with the processor 702, the communication interface, and the memory 701 communicating with each other via the communication bus.

[0212] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0213] The communication interface is used for communication between the aforementioned electronic devices and other devices.

[0214] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0215] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0216] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described methods for determining the cutting region.

[0217] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the cutting region determination methods in the above embodiments.

[0218] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), etc.

[0219] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0220] The various embodiments in this specification are described in a related manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.

[0221] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.

Claims

1. A cutting region determination method characterized by, The method comprises: acquiring a core material image including a tangent section of a target object; performing image segmentation on the core material image to determine a raw cutting region of a core material region containing the target object; determining a largest-area inscribed rectangle among all inscribed rectangles within the range of the raw cutting region as a cutting region to be cut; the determination of the largest-area inscribed rectangle among all inscribed rectangles within the range of the raw cutting region as the cutting region to be cut comprises: determining all inscribed rectangles within the range of the raw cutting region that meet a preset angle condition with a coordinate axis; wherein the coordinate axis is a coordinate axis of an image coordinate system, and the preset angle condition is a direction of an angle between a long side of a minimum-area circumscribed rectangle of the raw cutting region and the coordinate axis or a direction of an angle between a major axis of a second-order center distance and the coordinate axis; determining, from the determined all inscribed rectangles, an inscribed rectangle with the largest area as the cutting region to be cut.

2. The method of claim 1, wherein, the determination of all inscribed rectangles within the range of the raw cutting region that meet the preset angle with the coordinate axis comprises: Step 1: determining a current first vertex located within the range of the raw cutting region, the initial coordinates of the current first vertex being (X0, Y0), and initializing W; wherein each time the current first vertex is obtained, it is different, and Step 2 is performed; Step 2: determining (X0+W, Y0) as a current second vertex; the W is initially a first preset value; if (X0+W, Y0) is within the range of the raw cutting region, Step 3 is performed; if (X0+W, Y0) is not within the range of the raw cutting region, Step 5 is performed; Step 3: initializing H, which is initially a second preset value, and performing Step 4; Step 4: determining (X0, Y0+H) as a current third vertex and (X0+W, Y0+H) as a current fourth vertex, and if a line segment formed by the current third vertex and the current fourth vertex is within the raw cutting region, Step 6 is performed; if the line segment formed by the current third vertex and the current fourth vertex is not within the raw cutting region, Step 7 is performed; Step 5: returning to perform Step 1 until there is no pixel point to be traversed in the raw cutting region, wherein the pixel point to be traversed is not a pixel point that has been the current first vertex; Step 6: determining a region surrounded by the current first vertex, the current second vertex, the current third vertex, and the current fourth vertex as an inscribed rectangle, and taking H+δ as a new H, and returning to perform Step 4; the δ is a preset step length of the height value; Step 7: W+ is added to the value of W Step 2 is executed again as a new W; the a preset step size for the width value; the determination of the largest-area inscribed rectangle among all inscribed rectangles within the range of the raw cutting region as the cutting region to be cut comprises: if there is no pixel point to be traversed in the raw cutting region, determining, from the determined all inscribed rectangles, an inscribed rectangle with the largest area as the cutting region to be cut.

3. The method of claim 1, wherein, the determination of the largest-area inscribed rectangle among all inscribed rectangles within the range of the raw cutting region as the cutting region to be cut comprises: rotating the original cutting region by a first preset angle along a first direction, so that a long side of a circumscribed rectangle of the original cutting region is parallel to a coordinate axis or a second principal axis of a two-order center distance is parallel to the coordinate axis, to obtain a first cutting region; determining all inscribed rectangles in the first cutting region range that meet a preset angle condition with the coordinate axis; determining a largest-area inscribed rectangle from all the determined inscribed rectangles; rotating the largest-area inscribed rectangle by the first preset angle along a second direction to obtain a cutting region to be cut, wherein the first direction and the second direction are opposite.

4. The method of claim 1, wherein, The image segmentation on the core material image to determine the original cutting region containing the core material region of the target object comprises: segmenting the core material image to determine a foreground region and a background region; determining a largest connected domain in the foreground region range as the original cutting region.

5. The method of claim 4, wherein, The background region includes a defect region, and the method further comprises: if a defect processing mode for the original cutting region is a fillable mode, determining a defect region in the original cutting region range as a fillable region; incorporating the fillable region into the original cutting region.

6. The method of claim 5, wherein, The determination of the background region in the original cutting region range as the fillable region comprises: determining a background region in the original cutting region range that meets a preset filling condition as the fillable region.

7. The method of claim 1, wherein, The method further comprises: controlling a cutting device to cut along a straight line where a boundary of the cutting region to be cut is located.

8. A cutting region determination apparatus characterized by comprising: The device comprises: an acquisition module configured to acquire a core material image including a chord section of a target object; an original cutting region determination module configured to perform image segmentation on the core material image to determine an original cutting region containing a core material region of the target object; a cutting region to be cut determination module configured to determine a largest-area inscribed rectangle from all inscribed rectangles in the original cutting region range as a cutting region to be cut; The cutting region to be cut determination module specifically comprises: a first determination module configured to determine all inscribed rectangles in the original cutting region range that meet a preset angle condition with a coordinate axis, wherein the coordinate axis is a coordinate axis of an image coordinate system, and the preset angle condition is a direction of an angle between a long side of a minimum-area circumscribed rectangle of the original cutting region and the coordinate axis or an angle between a second principal axis of a two-order center distance and the coordinate axis; a second determination module configured to determine a largest-area inscribed rectangle from all the determined inscribed rectangles as a cutting region to be cut.

9. The apparatus of claim 8, wherein, The first determination module is specifically configured to perform the following steps: Step 1: determining a current first vertex located in the original cutting region range, the initial coordinates of the current first vertex being (X0, Y0), and initializing W; wherein the current first vertex obtained each time is different, and step 2 is performed; Step 2: determining (X0+W, Y0) as a current second vertex; the W is initially a first preset value; if (X0+W, Y0) is in the original cutting region range, step 3 is performed; if (X0+W, Y0) is not in the original cutting region range, step 5 is performed; Step 3: initialize H, the H is a second preset value initially, and execute step 4; Step 4: determine (X0, Y0+H) as a current third vertex, determine (X0+W, Y0+H) as a current fourth vertex, if a line segment formed by the current third vertex and the current fourth vertex is in the original cutting region, execute step 6; if the line segment formed by the current third vertex and the current fourth vertex is not in the original cutting region, execute step 7; Step 5: return to execute the step 1 until the original cutting region does not exist a pixel point to be traversed, wherein the pixel point to be traversed is not a pixel point of the current first vertex; Step 6: determine a region surrounded by the current first vertex, the current second vertex, the current third vertex and the current fourth vertex as an inscribed rectangle, and take H+delta as a new H, return to execute the step 4; the delta is a preset step length of height value; Step 7: W+ is added to the current W and the step 2 is executed again. a preset step size for the width value.​ The second determination module is specifically configured to determine, if the original cutting region does not exist a pixel point to be traversed, a largest inscribed rectangle from all the determined inscribed rectangles as a cutting region to be cut; The second determination module is specifically configured to rotate the original cutting region along a first direction by a first preset angle, so that a long side of a circumscribed rectangle of the original cutting region is parallel to a coordinate axis or a second central distance main shaft is parallel to the coordinate axis, to obtain a first cutting region; Determine all the inscribed rectangles in the first cutting region range and the coordinate axis angle that meet the preset angle condition; Determine the largest inscribed rectangle from all the determined inscribed rectangles; Rotate the largest inscribed rectangle along a second direction by a first preset angle to obtain a cutting region to be cut; wherein the first direction and the second direction are opposite; The original cutting region determination module is specifically configured to perform image segmentation on the core material image to determine a foreground region and a background region; Determine the largest connected domain in the foreground region range as the original cutting region; The background region includes a defect region, if a defect processing mode for the original cutting region is a fillable mode, determine the defect region in the original cutting region range as a fillable region; Integrate the fillable region into the original cutting region; Determine the background region in the original cutting region range whose size meets a preset filling condition as a fillable region; Control the cutting device to cut along a straight line where a boundary of the cutting region to be cut is located.

10. A cutting system characterized by, The system comprises a camera, a computer and a cutting device; The camera is configured to photograph a target object to obtain a core material image including a tangent plane of the target object, and send the core material image to the computer; The computer is configured to perform image segmentation on the core material image to determine an original cutting region of a core material region containing the target object; determine a largest inscribed rectangle from all the inscribed rectangles in the original cutting region range as a cutting region to be cut; and control the cutting device to cut along a straight line where a boundary of the cutting region to be cut is located. The cutting device is used for cutting along a straight line where the boundary of the to-be-cut region is located under the computer control; The method further includes: determining all the inscribed rectangles in the original cutting region range that meet a preset angle condition with a coordinate axis, wherein the coordinate axis is a coordinate axis of an image coordinate system, and the preset angle condition is a direction of an angle between a long side of a minimum area circumscribed rectangle of the original cutting region or a second central distance major axis and the coordinate axis; determining an inscribed rectangle with a maximum area from the determined all inscribed rectangles as the to-be-cut region.

11. The system of claim 10, wherein, The system further includes: a light source device configured to provide a light source for the camera when capturing the target object.

12. A cutting apparatus characterized by, The system further includes: a memory configured to store a computer program; a processor configured to execute the program stored in the memory to implement the method of any one of claims 1-7.

13. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the method of any one of claims 1-7.

Citation Information

Patent Citations

  • Image cutting method and device

    CN112634286A

  • In-circle loading rectangle optimization method based on simulated annealing and SkyLine

    CN114898012A