Image cutting method and device, equipment and medium
By automatically identifying and adaptively adjusting the border area in the scanned image, the problem of complexity and inaccuracy in measuring the cropping value of the dental digital impression instrument in the existing technology is solved, achieving more efficient image cropping and lower production costs. .
Patent Information
- Application Number
- CN202410698953.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-08-23
AI Technical Summary
Existing dental digital impression machines need to measure and store cropping values for each device during the production process, which increases production costs and complexity. Moreover, the cropping values may be inaccurate after replacing the scan head, and it must adapt to scan heads of different sizes. The crop value needs to be reset, causing image quality and accuracy to be affected.
By acquiring multiple frames of scanned images, extracting the image information of each frame, determining the border area that meets the consistency conditions based on the changes in the image information, and determining the cropping value based on the border area for image cropping, achieving automatic recognition and adaptive adjustment.
It reduces production costs, improves operational convenience, ensures the accuracy of cropping values, avoids the risk of internal storage loss, and adapts to scan heads of different sizes.
Smart Images

Figure CN118537558A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing technology, and in particular to an image cropping method, device, equipment and medium. Background Art
[0002] An oral digital impression device is a device used to generate a three-dimensional model of the inside of a patient's oral cavity. It captures the geometric information of the oral cavity in a digital way by scanning the structure and shape of the patient's oral cavity.
[0003] An oral digital impression device usually consists of a scanning head and a body. The scanning head is used to extend into the patient's mouth. The top of the scanning head contains a reflector and a side opening. The body contains all electronic components such as a camera, light source, circuit board, memory, etc. The scene inside the oral cavity is transmitted to the camera through the side opening, reflector, and internal pipe of the scanning head.
[0004] Due to the position and physical shape of the scanning head, the scanning head blocks part of the camera's field of view, and the blocked part is called the border. These borders do not contain valid information about the oral structure, so they need to be cropped to improve the image quality and accuracy of the oral digital impression device.
[0005] At present, during the production stage of digital impression devices, the border of each digital impression device is measured and the cropping value is stored inside the digital impression device. When the user uses the digital impression device, the scanning software obtains the cropping value from the inside of the digital impression device and crops the image according to the cropping value. This solution requires measuring the cropping value for each digital impression device during the production process, which increases the production cost and complexity, and there is a risk of loss of the cropping value when it is stored inside the digital impression device. In addition, the scanning head is a consumable item, and users often need to replace a new scanning head. Due to the production and assembly errors of the scanning head, the border of the digital impression device may change after the scanning head is replaced, resulting in inaccurate cropping values. Furthermore, the specifications and sizes of the scanning head are adapted to adults and children, and scanning heads of different specifications and sizes are set. Scanning heads of different specifications and sizes have different borders and are adapted to different cropping values. After the digital impression device is replaced with a scanning head of different specifications and sizes, the cropping value needs to be reset. Summary of the invention
[0006] In order to solve the above technical problems, the present disclosure provides an image cropping method, device, equipment and medium.
[0007] In a first aspect, an embodiment of the present disclosure provides an image cropping method, comprising:
[0008] Acquire multiple frames of scanned images and extract image information of each frame of scanned images;
[0009] According to the change of the image information in the multiple frames of scanned images, determining the border area of the image information that meets the consistency condition from the scanned images;
[0010] A cropping value is determined according to the frame area, so as to crop the scanned image according to the cropping value.
[0011] In a second aspect, the present disclosure provides another image cropping method, including:
[0012] Acquire at least one frame of scanned image;
[0013] Performing image recognition on each frame of the scanned image to determine a frame area in the scanned image;
[0014] A cropping value is determined according to the frame area, so as to crop the scanned image according to the cropping value.
[0015] In a second aspect, an embodiment of the present disclosure provides an image cropping device, including:
[0016] An acquisition module is used to acquire multiple frames of scanned images and extract image information of each frame of the scanned image;
[0017] A determination module, configured to determine, from the scanned images, a border region where the image information satisfies a consistency condition according to changes in the image information in the multiple frames of scanned images;
[0018] A cropping module is used to determine a cropping value according to the frame area, so as to crop the scanned image according to the cropping value.
[0019] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising: a processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement the image cropping method described in the first aspect above.
[0020] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the image cropping method described in the first aspect is implemented.
[0021] The technical solution provided by the embodiments of the present disclosure has the following advantages over the prior art: by acquiring image information of each scanned image in multiple frames of scanned images, determining the border area in which the image information meets the consistency condition according to changes in the image information in the multiple frames of scanned images, determining the cropping value according to the border area to crop the scanned image by the cropping value, thereby being able to automatically determine the border area of the scanning head and the cropping value according to the scanned image, without the need for manual measurement and setting, thereby reducing production costs and improving operational convenience, and after replacing a new scanning head, the method can adaptively identify the border area and determine the cropping value to adapt to the new scanning head and ensure the accuracy of the cropping value. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0024] Figure 1 A schematic diagram of a flow chart of an image cropping method provided by an embodiment of the present disclosure;
[0025] Figure 2 A schematic diagram of a scanned image provided by an embodiment of the present disclosure;
[0026] Figure 3 A schematic diagram of another scanned image provided by an embodiment of the present disclosure;
[0027] Figure 4 A schematic diagram of another scanned image provided by an embodiment of the present disclosure;
[0028] Figure 5 A flowchart of another image cropping method provided by an embodiment of the present disclosure;
[0029] Figure 6 A schematic diagram of the structure of an image cropping device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0030] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0031] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0032] Figure 1 This is a flow chart of an image cropping method provided in an embodiment of the present disclosure. The method provided in an embodiment of the present disclosure can be executed by an image cropping device, which can be implemented in software and / or hardware and can be integrated on any electronic device with computing capabilities.
[0033] like Figure 1 As shown, the image cropping method provided by the embodiment of the present disclosure may include:
[0034] Step 101, acquiring multiple frames of scanned images, and extracting image information of each frame of the scanned image.
[0035] The method of the embodiment of the present disclosure is used for image cropping of scanned images, specifically for cropping the frame portion of the scanned image. The scanning device is, for example, a digital impression device, which can be used for intraoral scanning, industrial parts scanning, etc.
[0036] In this embodiment, multiple frames of scanned images captured by the scanning device are obtained, and image information of each frame of the scanned image is extracted. The scanned image may be an image captured by the scanning device before the scanning starts, or an image captured when the scanning actually starts, and no specific limitation is made here.
[0037] In this embodiment, the image information of the scanned image includes but is not limited to edge and depth information.
[0038] As an example, extracting image information of each frame of scanned image includes: using an edge recognition algorithm to identify edges in each frame of scanned image. Optionally, based on Hough line transform, the region of possible straight lines in the scanned image can be found, the angle of the straight line can be limited to 90° or 180° by adjusting parameters, and the histogram exposure of the current frame of scanned image can be adaptively adjusted to fill in the light for an overly dark image and reduce the exposure for an overexposed image.
[0039] As another example, extracting image information of each frame of the scanned image includes: using a three-dimensional reconstruction algorithm to perform depth reconstruction on the scanned image to obtain three-dimensional data of the object in the scanned image, and determining the depth information of each position in each frame of the scanned image based on the three-dimensional data.
[0040] As another example, extracting image information of each frame of the scanned image includes: using a pre-trained image semantic segmentation model to perform semantic segmentation processing on the scanned image to obtain multiple sub-regions belonging to different categories in the scanned image. In this example, the image semantic segmentation model is used to segment the scanned object region and the border region in the image. Taking intraoral scanning as an example, the image semantic segmentation model can be used to segment the oral region and the border region in the scanned image. Figure 2-Figure 4 The schematic diagram of the scanned image shown in FIG. Figure 2 The inside of the middle dotted frame 200 is the oral region, and the outside of the dotted frame 200 is the frame region. Figure 3 The inside of the middle dotted frame 300 is the oral region, and the outside of the dotted frame 300 is the frame region. Figure 4 The area inside the middle dotted frame 400 is the oral cavity area, and the area outside the dotted frame 400 is the frame area.
[0041] Step 102: According to the change of the image information in the multiple frames of scanned images, a frame area of the image information that meets the consistency condition is determined from the scanned images.
[0042] In this embodiment, the border is caused by blocking part of the camera's field of view due to the position and physical shape limitations of the scanning head. Without replacing the scanning head, the border has the following characteristics: the position of the border does not change, and the distance between the border and the camera does not change. Based on this, the area in the multi-frame scanned image where the image information meets the consistency condition can be determined as the border area according to the change of the image information in the multi-frame scanned image.
[0043] In one embodiment of the present disclosure, according to the change of image information in multiple frames of scanned images, a border area of the image information that meets the consistency condition is determined from the scanned images, including: determining the target edge whose position meets the consistency condition in the multiple frames of scanned images according to the change of the position of the edge in the multiple frames of scanned images, and determining the border area according to the target edge and the image boundary of the scanned image. In this embodiment, when the posture of the scanning device in acquiring the scanned image changes, the position of the scanned object in the scanned image changes, and the edge detected by the scanned object part in the image also changes accordingly, and according to the characteristics of the border, the position and posture of the border relative to the camera will not change, so that the edge detected by the border part in the image will not change. Therefore, after the edge in each frame of the scanned image is detected by the edge recognition algorithm, the edge whose position meets the consistency condition in the multiple frames of scanned images is determined from all the edges as the target edge, and the target edge represents the edge of the border area. Then, the area composed of the target edge and the image boundary of the scanned image is determined as the border area.
[0044] In one embodiment of the present disclosure, according to the change of image information in multiple frames of scanned images, a border area of the image information that meets the consistency condition is determined from the scanned images, including: according to the change of the value of the depth information of each position in the multiple frames of scanned images, the target position whose depth information value meets the consistency condition in the multiple frames of scanned images is determined, and the area formed by the target position is determined as the border area. In this embodiment, when the posture of the scanning device in collecting the scanned image changes, the position of the scanned object in the scanned image changes, so that the depth information of each position of the scanned object part also changes accordingly, and according to the characteristics of the border, the distance between the border and the camera will not change, so the depth information of each position of the border part will not change. Therefore, after obtaining the depth information of each position in each frame of the scanned image, for each position in the scanned image, it is determined whether the depth information of the position in each scanned image meets the consistency condition. If the consistency condition is met, the position is determined to be the target position, and then, according to the area formed by the target position, it is determined to be the border area.
[0045] In one embodiment of the present disclosure, according to the change of image information in multiple frames of scanned images, a border area of image information that meets the consistency condition is determined from the scanned images, including: determining the target sub-area that meets the consistency condition in the multiple frames of scanned images according to the change of the sub-area in the multiple frames of scanned images, and determining the border area according to the target sub-area. In this embodiment, when the posture of the scanning device in collecting the scanned image changes, according to the characteristics of the border, the area, shape, and position of the sub-area of the border part in the scanned image meet the consistency condition. Therefore, after acquiring multiple sub-areas in the scanned image, for each sub-area, it is determined whether the sub-area meets the consistency condition in each scanned image. If the consistency condition is met, the sub-area is determined to be the target sub-area, and then the target sub-area is determined as the border area.
[0046] The above-mentioned consistency condition may refer to complete consistency or an error within a certain range, which is not limited here.
[0047] It should be noted that the above-mentioned implementation method of determining the border area from the scanned image can be implemented individually or in combination of multiple methods.
[0048] In one embodiment of the present disclosure, based on changes in image information in multiple frames of scanned images, a border area in which image information meets a consistency condition is determined from the scanned images, including: determining a target edge whose position meets a consistency condition in the multiple frames of scanned images based on changes in the position of the edge in the multiple frames of scanned images, determining a first candidate area based on the target edge and the image boundary of the scanned image, and determining a target position whose depth information value meets a consistency condition in the multiple frames of scanned images based on changes in the value of the depth information of each position in the multiple frames of scanned images, forming a second candidate area based on the target position, and then determining a border area based on the overlapping portion of the first candidate area and the second candidate area. In this embodiment, in order to further improve the recognition accuracy, the above two methods can be used to determine the first candidate area and the second candidate area of the border area, respectively, and the border area can be determined comprehensively based on the first candidate area and the second candidate area.
[0049] Step 103: determining a cropping value according to the border area, so as to crop the scanned image according to the cropping value.
[0050] In this embodiment, after the border area is determined, a cropping value of the scanned image is generated according to the border area. The cropping value is used to crop the border area from the scanned image to improve the image quality and accuracy of the scanned image.
[0051] According to the technical solution of the embodiment of the present disclosure, by acquiring the image information of each scanned image in multiple scanned images, determining the border area where the image information meets the consistency condition according to the change of the image information in the multiple scanned images, and determining the cropping value according to the border area to crop the scanned image by the cropping value, the border area of the scanning head can be automatically determined according to the scanned image and the cropping value can be determined without manual measurement and setting, thereby reducing production costs and improving operational convenience. After replacing a new scanning head, this method can adaptively identify the border area and determine the cropping value to adapt to the new scanning head and ensure the accuracy of the cropping value. In addition, the scanning software can fine-tune the cropping value according to the actual situation to ensure the accuracy and completeness of the image cropping, and the cropping value is no longer stored inside the digital impression device, avoiding the risk of internal storage loss.
[0052] Based on the above embodiments, Figure 5 A flowchart of another image cropping method provided by an embodiment of the present disclosure is shown in FIG. Figure 5 As shown, the method includes:
[0053] Step 501, acquiring multiple frames of scanned images, extracting image information of each frame of the scanned images, and determining a border area of the scanned images whose image information meets a consistency condition according to changes in the image information in the multiple frames of the scanned images.
[0054] In this embodiment, when the user uses the scanning device to scan, the scanning software starts and communicates with the scanning device, and obtains the scanned image through the camera. After continuously acquiring multiple frames of scanned images, a preset image recognition algorithm is used to perform data analysis based on each frame of the scanned image and the corresponding three-dimensional data reconstructed from the depth to determine the border area in the scanned image, and / or the depth value of the three-dimensional data is used to perform data analysis to determine the border area in the scanned image.
[0055] In one embodiment of the present disclosure, in order to comprehensively consider the recognition time and recognition effect, and to reduce misrecognition while avoiding affecting user scanning, the following strategy can be adopted: select at least two frames of scanned images from multiple frames of scanned images, and determine the border areas corresponding to the at least two frames of scanned images based on the changes in the image information in the at least two frames of scanned images; if there are M groups of at least two frames of scanned images whose corresponding border areas are consistent and are greater than a threshold, then the border areas corresponding to the M groups of at least two frames of scanned images are determined as the border areas of the multiple frames of scanned images.
[0056] Optionally, at least two frames of scanning images are selected from multiple frames of scanning images, including: every time 2N frames of scanning images are acquired, the Kth frame of scanning image and the N+Kth frame of scanning image are selected from the 2N frames of scanning images as two frames of scanning images; K is a positive integer greater than or equal to 1 and less than or equal to N, and N is a positive integer.
[0057] An example is as follows: when the scanning device starts to collect images (regardless of whether scanning is actually started), the algorithm is started for recognition, wherein at least two frames of scanned images are used for joint recognition, and there is a certain time interval between each two adjacent frames of scanned images, such as more than 0.5 seconds. The group of at least two frames of scanned images are jointly recognized as one recognition. In order to further improve the recognition accuracy, if the recognition results of the preset number of times are consistent, the recognition is considered successful, and the cropping value is determined according to the recognized border area. In practical applications, the scanning device can collect at least 20 frames of scanned images per second, that is, the interval between each two adjacent frames of scanned images is less than 0.05 seconds. In order to make full use of the high frame rate of the scanning device and avoid multiple recognitions taking too long, the collected multiple frames of scanned images can be nested. For example, the scanning device collects 20 frames of scanned images per second, which are numbered 1-20 respectively. For the scanned images 1-10, the first recognition uses the scanned image No. 1 and the scanned image No. 6 for joint recognition, and the second recognition uses the scanned image No. 2 and the scanned image No. 7 for joint recognition. Then, for 5 consecutive recognitions, only the scanned images No. 1-10 need to be used, which takes 0.5 seconds. Among them, the recognition of the border area can be completed before the scanning starts, or it can be performed after the scanning starts. If the recognition is still unsuccessful after a certain period of time, it will be retried after a preset interval until the user stops scanning. If it is detected that the user changes the scanning head during the scanning process, the recognition will be restarted.
[0058] Step 502, verifying the identified border area according to prior information to eliminate abnormal recognition results.
[0059] As an example, the measured width and height of the border area in the scanned image are compared with the width and height reference values of the border to determine whether the border area is an abnormal recognition result. In this example, based on the physical shape of the scanning head, the width and height of the scanning head border on the scanned image are known. By comparing the border area identified by the algorithm in the previous steps with the known width and height of the scanning head border, it is possible to verify whether the recognition result is reasonable, so as to exclude abnormal recognition results.
[0060] As another example, the position of the border area in the scanned image is compared with a preset range to determine whether the border area is an abnormal recognition result. In this example, based on the position of the scanning head border, there is a range constraint on the position of the scanning head border on the scanned image, for example, not exceeding half the width and height of the scanned image. By comparing the border area identified by the algorithm in the above steps with the preset range, it is possible to verify whether the recognition result is reasonable, so as to exclude abnormal recognition results.
[0061] As another example, the depth information of each position in the frame area is compared with a preset threshold to determine whether the frame area is an abnormal recognition result. In this example, the distance between the scanning head frame and the camera is known. By comparing the depth information of the frame area recognized by the algorithm in the above steps with the known distance between the scanning head frame and the camera, it is possible to verify whether the recognition result is reasonable, so as to exclude abnormal recognition results.
[0062] As another example, for a scanning device that manually measures the calibration value of the clipped value, the border area identified by the algorithm in the previous step can be compared with the manually measured calibration value to verify whether the recognition result is reasonable in order to eliminate abnormal recognition results.
[0063] In one embodiment of the present disclosure, after determining whether the border area is an abnormal recognition result, if the border area is an abnormal recognition result, a foreign object recognition analysis is performed based on the image information to determine whether the scanning head is blocked by foreign objects, and / or, if the border area is an abnormal recognition result, a pre-trained recognition model is used to perform fog recognition on the scanned image to obtain a fog recognition result of the scanned image, and then, if it is determined that the scanning head is blocked by foreign objects, and / or the fog recognition result is that fog exists, a prompt message is generated.
[0064] In this embodiment, the image information includes depth information of each position. If there is at least one target position whose depth value is outside a preset depth value range, it is determined that the position corresponding to the target position on the lens is blocked by a foreign object; or, the image information includes the average depth value of each position within a preset time period. If there is at least one target position whose depth average value is less than a preset depth average value threshold, it is determined that the position corresponding to the target position on the lens is blocked by a foreign object.
[0065] In this embodiment, the input of the recognition model is an image, and the output is a fog recognition result. The fog recognition result is used to indicate whether there is fog. For example, the recognition model is implemented using a target detection algorithm to identify areas where fog exists in a scanned image. For another example, a statistical subnetwork in a pre-trained fog detection model is used to count the number of pixels corresponding to each grayscale value to obtain a grayscale histogram. The grayscale histogram is classified using a classifier in the fog detection model to obtain a fog recognition probability threshold.
[0066] If it is determined that the scanning head is blocked by foreign matter, and / or the fog recognition result is that fog exists, a prompt message is generated to remind the user to clean or replace the scanning head. The prompt message includes but is not limited to text prompt message and voice prompt message, which are not limited here.
[0067] Step 503: determine a cropping value according to the border area, so as to crop the scanned image according to the cropping value.
[0068] In this embodiment, the scanning software crops subsequent scanned images according to the cropping value to remove useless image data in the border portion. Taking intraoral scanning as an example, the cropped image data can be used to generate a three-dimensional model of the oral cavity or for doctors to perform further diagnosis and treatment.
[0069] In one embodiment of the present disclosure, during the scanning process, it is detected whether the scanning head has been replaced. If the scanning head has been replaced, multiple frames of scanned images are reacquired, and image information of each frame of the reacquired scanned images is extracted. Then, the border area is re-determined according to the changes in the image information in the reacquired multiple frames of scanned images. In this embodiment, corresponding identification information can be set for different scanning heads, and the identification information is used to distinguish different scanning heads. Optionally, a module for interacting with the scanner is provided on the scanning head, and the identification information of the scanning head is obtained through the interaction of the module. Whether the scanning head has been replaced is determined based on whether the obtained identification information is consistent. When the scanning head is replaced, due to the production and assembly errors of the scanning head, and the different specifications and sizes of the scanning head to adapt to adults and children, it is necessary to redetermine the border area to adapt to the new scanning head to ensure the accuracy of the cropping value.
[0070] In the disclosed embodiment, prior knowledge about the cropping value is used to verify the cropping value according to an established strategy to determine the final cropping value, thereby further improving the accuracy of image cropping. In addition, multiple frames of scanned images are nested for recognition, and the recognition time and recognition effect are comprehensively considered to reduce misrecognition while avoiding affecting user scanning.
[0071] Based on the above embodiment, the present disclosure also proposes another image cropping method, which includes the following steps:
[0072] Step 1: Acquire at least one scanned image.
[0073] Step 2: Perform image recognition on each frame of the scanned image to determine the border area in the scanned image.
[0074] Step 3: Determine a cropping value according to the border area to crop the scanned image using the cropping value.
[0075] In this embodiment, the border area can be determined based on the image features of the single-frame scanned image, or the edge line of the single-frame scanned image can be extracted based on image processing, and the border area can be determined based on the edge line. Furthermore, after the border area in the scanned image is determined, a cropping value is determined based on the determined border area, and the border line is selected and cropped by the cropping value, and the border area is cropped from the scanned image to improve the image quality and accuracy of the scanned image.
[0076] In the disclosed embodiments, the scanning head border area and cropping value can be automatically determined based on the scanned image without manual measurement and setting, thereby reducing production costs and improving operational convenience. After replacing a new scanning head, the method can adaptively identify the border area and determine the cropping value to adapt to the new scanning head and ensure the accuracy of the cropping value.
[0077] Optionally, after step 3, step 4 is further included: using multiple frames of scanned images, the border areas of the multiple frames of scanned images can be verified to determine the final border area.
[0078] In the disclosed embodiment, not only is the cropping value of each single-frame image quickly determined by performing image recognition on the border using a single-frame image, but multiple-frame images are also used for verification to verify whether the cropping value of each single-frame image previously determined is correct, and the cropping value of the erroneous single-frame image is adjusted, thereby improving the accuracy of the cropping value and increasing the robustness of the algorithm.
[0079] Figure 6 A schematic diagram of the structure of an image cropping device provided by an embodiment of the present disclosure is shown in FIG. Figure 6 As shown, the image cropping device includes: an acquisition module 61 , a determination module 62 , and a cropping module 63 .
[0080] The acquisition module 61 is used to acquire multiple frames of scanned images and extract image information of each frame of scanned images;
[0081] A determination module 62, configured to determine, from the scanned images, a border region whose image information satisfies a consistency condition according to changes in the image information in the multiple frames of scanned images;
[0082] The cropping module 63 is used to determine a cropping value according to the frame area, so as to crop the scanned image according to the cropping value.
[0083] In one embodiment of the present disclosure, the acquisition module 61 is specifically used to: identify the edge in each frame of the scanned image using an edge recognition algorithm;
[0084] The determination module 62 is specifically used to: determine the target edge whose position meets the consistency condition in the multiple scanned images according to the position change of the edge in the multiple scanned images; and determine the frame area according to the target edge and the image boundary of the scanned image.
[0085] In one embodiment of the present disclosure, the acquisition module 61 is specifically used to: perform depth reconstruction on the scanned image using a three-dimensional reconstruction algorithm to obtain depth information of each position in each frame of the scanned image;
[0086] The determination module 62 is specifically used to: determine the target position whose depth information value meets the consistency condition in the multi-frame scanned images according to the value change of the depth information of each position in the multi-frame scanned images; and determine the area formed by the target position as the frame area.
[0087] In one embodiment of the present disclosure, the image information includes edge and depth information, and the determination module 62 is specifically used to: determine the target edge whose position meets the consistency condition in the multi-frame scanned image according to the position change of the edge in the multi-frame scanned image; determine the first candidate area according to the target edge and the image boundary of the scanned image; determine the target position whose depth information value meets the consistency condition in the multi-frame scanned image according to the value change of the depth information of each position in the multi-frame scanned image; the target position constitutes the second candidate area; and determine the border area according to the overlapping part of the first candidate area and the second candidate area.
[0088] In one embodiment of the present disclosure, the device also includes: a verification module, which is used to compare the width and height measurement values of the border area in the scanned image with the width and height reference values of the border to determine whether the border area is an abnormal recognition result; or, compare the position of the border area in the scanned image with a preset range to determine whether the border area is an abnormal recognition result; or, compare the depth information of each position in the border area with a preset threshold to determine whether the border area is an abnormal recognition result.
[0089] In one embodiment of the present disclosure, the determination module 62 is specifically used to: select at least two frames of scanned images from multiple frames of scanned images, and determine the border areas corresponding to the at least two frames of scanned images based on changes in image information in the at least two frames of scanned images; if there are M groups of at least two frames of scanned images whose corresponding border areas are consistent and are greater than a threshold, then the border areas corresponding to the M groups of at least two frames of scanned images are determined as the border areas of multiple frames of scanned images.
[0090] In one embodiment of the present disclosure, the determination module 62 is specifically used to: every time 2N frames of scanning images are acquired, select the Kth frame scanning image and the N+Kth frame scanning image from the 2N frames of scanning images as at least two frames of scanning images; K is a positive integer greater than or equal to 1 and less than or equal to N.
[0091] In one embodiment of the present disclosure, the device also includes: a prompt module, which is used to perform foreign object recognition analysis based on image information to determine whether the scanning head is blocked by foreign objects if the border area is an abnormal recognition result; and / or, if the border area is an abnormal recognition result, use a pre-trained recognition model to perform fog recognition on the scanned image to obtain a fog recognition result of the scanned image; if it is determined that the scanning head is blocked by foreign objects, and / or the fog recognition result is that fog exists, a prompt message is generated.
[0092] In one embodiment of the present disclosure, the device also includes: a processing module for detecting whether the scanning head has been replaced; if the scanning head has been replaced, reacquiring multiple frames of scanning images and extracting image information of each reacquired scanning image; and redetermining the border area based on changes in image information in the reacquired multiple frames of scanning images.
[0093] The image cropping device provided in the embodiment of the present disclosure can execute any image cropping method provided in the embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method. The contents not described in detail in the embodiment of the device of the present disclosure can refer to the description in any method embodiment of the present disclosure.
[0094] The present disclosure also provides an electronic device, which includes one or more processors and a memory. The processor may be a central processing unit (CPU) or other forms of processing units with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions. The memory may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on a computer-readable storage medium, and the processor may run the program instructions to implement the method of the above embodiment of the present disclosure and / or other desired functions. Various contents such as input signals, signal components, noise components, etc. may also be stored in the computer-readable storage medium.
[0095] In one example, the electronic device may further include: an input device and an output device, and these components are interconnected through a bus system and / or other forms of connection mechanisms. In addition, the input device may also include, for example, a keyboard, a mouse, etc. The output device may output various information to the outside, including determined distance information, direction information, etc. The output device may include, for example, a display, a speaker, a printer, and a communication network and a remote output device connected thereto, etc. In addition, according to the specific application, the electronic device may also include any other appropriate components such as a bus, an input / output interface, etc.
[0096] In addition to the above methods and devices, the embodiments of the present disclosure may also be a computer program product, which includes computer program instructions. When the computer program instructions are executed by a processor, the processor executes any method provided by the embodiments of the present disclosure.
[0097] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0098] In addition, the embodiments of the present disclosure may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes any method provided by the embodiments of the present disclosure.
[0099] Computer readable storage media can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0100] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0101] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An image cropping method, It is characterized in that include: Acquire multiple frames of scanned images and extract image information of each frame of scanned images; According to the change of the image information in the multiple frames of scanned images, determining the border area of the image information that meets the consistency condition from the scanned images; A cropping value is determined according to the frame area, so as to crop the scanned image according to the cropping value.
2. The method according to claim 1, It is characterized in that The step of extracting image information of each scanned image frame includes: An edge recognition algorithm is used to identify the edges in each frame of the scanned image; The step of determining, from the scanned images, a border region in which the image information satisfies a consistency condition according to changes in the image information in the multiple frames of scanned images, comprises: Determine, according to a change in position of the edge in the multiple scanned images, a target edge whose position in the multiple scanned images satisfies a consistency condition; The frame area is determined according to the target edge and the image boundary of the scanned image.
3. The method according to claim 1, It is characterized in that The step of extracting image information of each scanned image frame includes: Reconstructing the depth of the scanned image using a three-dimensional reconstruction algorithm to obtain depth information of each position in each frame of the scanned image; The step of determining, from the scanned images, a border region in which the image information satisfies a consistency condition according to changes in the image information in the multiple frames of scanned images, comprises: Determine, according to a change in the value of the depth information of each position in the multiple scanned images, a target position whose depth information value in the multiple scanned images satisfies a consistency condition; The area formed by the target positions is determined as the frame area.
4. The method according to claim 1, It is characterized in that The image information includes edge and depth information, and determining, from the scanned images according to changes in the image information in the multiple frames of scanned images, a border area in which the image information meets a consistency condition, includes: Determine, according to a change in position of the edge in the multiple scanned images, a target edge whose position in the multiple scanned images satisfies a consistency condition; Determining a first candidate region according to the target edge and the image boundary of the scanned image; According to the value change of the depth information of each position in the multiple scanned images, determine the target position whose depth information value in the multiple scanned images meets the consistency condition; the target position constitutes the second candidate area; The frame area is determined according to an overlapping portion of the first candidate area and the second candidate area.
5. The method according to claim 1, It is characterized in that After determining from the scanned image a border area in which the image information satisfies a consistency condition, the method further includes: According to the width and height measurement values of the border area in the scanned image, the width and height reference values of the border are compared to determine whether the border area is an abnormal recognition result; or, Comparing the position of the frame area in the scanned image with a preset range to determine whether the frame area is an abnormal recognition result; or, The depth information of each position in the frame area is compared with a preset threshold to determine whether the frame area is an abnormal recognition result.
6. The method according to claim 1, It is characterized in that After determining whether the border area is an abnormal recognition result, the method further includes: If the frame area is an abnormal recognition result, a foreign object recognition analysis is performed based on the image information to determine whether the scanning head is blocked by the foreign object; and / or, If the frame area is an abnormal recognition result, use a pre-trained recognition model to perform fog recognition on the scanned image to obtain a fog recognition result of the scanned image; If it is determined that the scanning head is blocked by foreign matter, and / or the fog recognition result is that fog exists, a prompt message is generated.
7. The method according to claim 1, It is characterized in that The step of determining, from the scanned images, a border region in which the image information satisfies a consistency condition according to changes in the image information in the multiple frames of scanned images, comprises: Selecting at least two frames of scanned images from the multiple frames of scanned images, and determining the frame areas corresponding to the at least two frames of scanned images according to changes in image information in the at least two frames of scanned images; If there are M groups of at least two scanned image frames whose corresponding border areas are consistent and are greater than a threshold, the border areas corresponding to the M groups of at least two scanned image frames are determined as the border areas of the multiple scanned image frames.
8. The method according to claim 7, It is characterized in that The selecting at least two frames of scanned images from the multiple frames of scanned images comprises: Every time 2N scanned images are acquired, the Kth scanned image and the N+Kth scanned image are selected from the 2N scanned images as the at least two scanned images; K is a positive integer greater than or equal to 1 and less than or equal to N.
9. The method according to claim 1, It is characterized in that After determining from the scanned image a border area in which the image information satisfies a consistency condition, the method further includes: Detect whether the scanning head has been replaced; If the scanning head is replaced, multiple frames of scanning images are re-acquired, and image information of each frame of the re-acquired scanning image is extracted; The frame area is re-determined according to changes in the image information in the re-acquired multiple frames of scanned images.
10. An image cropping method, It is characterized in that include: Acquire at least one frame of scanned image; Performing image recognition on each frame of the scanned image to determine a frame area in the scanned image; A cropping value is determined according to the frame area, so as to crop the scanned image according to the cropping value.
11. An image cropping device, It is characterized in that include: An acquisition module is used to acquire multiple frames of scanned images and extract image information of each frame of the scanned image; A determination module, configured to determine, from the scanned images, a border region where the image information satisfies a consistency condition according to changes in the image information in the multiple frames of scanned images; A cropping module is used to determine a cropping value according to the frame area, so as to crop the scanned image according to the cropping value.
12. An electronic device, It is characterized in that include: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the image cropping method described in any one of claims 1-9.
13. A computer-readable storage medium, It is characterized in that The storage medium stores a computer program, and when the computer program is executed by a processor, the image cropping method described in any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Object detection method and device based on dynamic vision sensor
CN108073929A
Object detection method and related equipment
CN111144213A
Foreign matter identification method and device of intraoral scanner, equipment and storage medium
CN116245804A
SEM image information bar automatic identification cutting method based on Hough transform
CN117593743A
Image processing for handheld scanner
US20100295868A1
