Device region image extraction method and device in natural scene
By performing color space conversion and grayscale image processing on the appearance image of the equipment to be recycled, the equipment area is located and extracted, solving the problem of decreased detection accuracy caused by environmental interference in natural scenes, and realizing efficient recycling detection in multiple scenarios.
Patent Information
- Application Number
- CN202111491142.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-08
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2041-12-08
AI Technical Summary
When conducting equipment recycling inspection in natural settings, existing technologies are subject to environmental interference, leading to a decrease in image detection accuracy and limiting the application scenarios and flexibility of recycling inspection.
By acquiring the appearance image of the equipment to be recycled, a grayscale image is generated through color space conversion. The preset range area of the grayscale image is located, and the equipment area is extracted from it as detection data. Gaussian filtering is used to reduce noise, texture features are calculated, and binarization is performed to filter out the equipment area.
In natural scenes, environmental interference is reduced, improving the image accuracy of recovery detection and enhancing the flexibility and accuracy of recovery detection.
Smart Images

Figure CN114170419B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of recycling detection, in particular to a device region image extraction method and device in a natural scene. BACKGROUND
[0002] With the development of electronic product technology, various smart devices are emerging, such as smart phones, notebook computers and tablet computers, etc. At present, with the rapid development of economy and technology, the popularization and replacement speed of smart devices is also getting faster and faster. Taking smart phones as an example, the arrival of the 5G era has accelerated the replacement of smart phones. In the process of iteration of smart devices, effective recycling is one of the effective utilization means of the residual value of smart devices, which can reduce chemical pollution to the environment and reduce waste.
[0003] Therefore, with the recycling process of the device, various recycling methods have emerged, such as recycling through recycling machines or after-sales service. In the recycling process, appearance detection is an extremely important link. Taking mobile phone recycling as an example, when collecting device appearance images for appearance detection, the environment will introduce great interference. Therefore, in the current recycling detection, a box or cabinet machine is used to provide a stable background environment for device shooting to prevent interference from light or other factors. However, this way limits the use scene and flexibility of recycling detection, for example, in outdoor or ordinary indoor environment, the accuracy of the image taken for recycling detection will be affected. SUMMARY
[0004] Therefore, it is necessary to provide a device region image extraction method and device in a natural scene in view of the limitation of the use scene and flexibility of recycling detection by the traditional shooting environment.
[0005] A device region image extraction method in a natural scene, comprising the steps of:
[0006] Obtaining an appearance image of a device to be recycled;
[0007] Performing color space conversion processing on the appearance image to generate a corresponding grayscale image;
[0008] Positioning a preset range area of the grayscale image;
[0009] Extracting a device region from the preset range area; wherein the device region is used as detection data for recycling detection.
[0010] The device region image extraction method in the natural scene extracts the device region from the appearance image, and the device region is used as the detection data for the recycling detection. In the recycling detection in the natural scene, the effective device region is extracted from the appearance image, the environmental interference in the natural scene is reduced, and the accuracy of the subsequent recycling image detection is improved.
[0011] In one of the embodiments, before the process of converting the color space of the appearance image to generate the corresponding gray image, the process further includes the steps of
[0012] The appearance image is subjected to Gaussian filtering processing.
[0013] In one of the embodiments, the process of subjecting the appearance image to Gaussian filtering processing is as follows:
[0014]
[0015] wherein X1 represents the appearance image after Gaussian filtering processing, X represents the appearance image; j = 1, 2, …, H, i = 1, 2, …, W, j and i represent the coordinate values in the horizontal direction and the vertical direction relative to the upper left corner of the appearance image, H represents the height of X, and W represents the width of X; w represents the length of the rectangular window, which is set to 3; A represents the amplitude of the corresponding rectangular window, which is set to 16; and the rectangular window represents the template corresponding to the Gaussian filtering as follows
[0016]
[0017] In one of the embodiments, the process of converting the color space of the appearance image to generate the corresponding gray image is as follows:
[0018] G1(j, i) = 0.1140 * X1 b (j, i) + 0.5870 * X1 g (j, i) + 0.2989 * X1 r (j, i)
[0019] wherein G1(j, i) represents the gray image, X1 r , X1 g , and X1 b represent the color components of the R, G, and B channels of the appearance image X1.
[0020] In one of the embodiments, the process of locating the preset range region of the gray image includes the steps of:
[0021] extract gradient information of the gray image in horizontal and vertical directions;
[0022] determine point coordinates of corners of the gray image according to the gradient information;
[0023] frame the preset range area according to the range of the point coordinates.
[0024] In one embodiment, the process of extracting the device area from the preset range area includes the steps of:
[0025] calculate texture features in the preset range area;
[0026] perform binaryzation processing on the texture features and screen out the device area.
[0027] In one embodiment, the process of calculating the texture features in the preset range area includes the steps of:
[0028] calculate a gray level co-occurrence matrix of the preset range area; wherein the entropy value of the gray level co-occurrence matrix is positively correlated with the complexity of the texture features.
[0029] A device area image extraction device in a natural scene includes the steps of:
[0030] an image acquisition module configured to acquire an appearance image of a device to be recycled;
[0031] an image conversion module configured to perform color space conversion processing on the appearance image to generate a corresponding gray image;
[0032] a region positioning module configured to position a preset range area of the gray image;
[0033] a region extraction module configured to extract a device area from the preset range area; wherein the device area is used as detection data for recycling detection.
[0034] The device area image extraction device in a natural scene described above, after acquiring the appearance image of the device to be recycled, performs color space conversion processing on the appearance image to generate a corresponding gray image. Further, a preset range area of the gray image is positioned, and a device area is extracted from the preset range area; wherein the device area is used as detection data for recycling detection. Based on this, in recycling detection in a natural scene, by extracting an effective device area from the appearance image, environmental interference in a natural scene is reduced, and the accuracy of subsequent recycling image detection is improved.
[0035] A computer storage medium having computer instructions stored thereon, the computer instructions being executed by a processor to implement the device area image extraction method in a natural scene of any of the above embodiments.
[0036] The computer storage medium described above, after obtaining the appearance image of the device to be recycled, performs color space conversion processing on the appearance image to generate a corresponding grayscale image. Further, a preset range area of the grayscale image is located, and a device area is extracted from the preset range area; wherein the device area is used as detection data for recycling detection. Based on this, in recycling detection in a natural scene, by extracting an effective device area from the appearance image, the environmental interference in the natural scene is reduced, and the accuracy of subsequent recycling image detection is improved.
[0037] A computer device includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor implements the device area image extraction method in a natural scene of any of the embodiments when executing the program.
[0038] The computer device described above, after obtaining the appearance image of the device to be recycled, performs color space conversion processing on the appearance image to generate a corresponding grayscale image. Further, a preset range area of the grayscale image is located, and a device area is extracted from the preset range area; wherein the device area is used as detection data for recycling detection. Based on this, in recycling detection in a natural scene, by extracting an effective device area from the appearance image, the environmental interference in the natural scene is reduced, and the accuracy of subsequent recycling image detection is improved. BRIEF DESCRIPTION OF DRAWINGS
[0039] Figure 1 A flowchart of the device area image extraction method in a natural scene of an embodiment;
[0040] Figure 2 A flowchart of the device area image extraction method in a natural scene of another embodiment;
[0041] Figure 3 A block structure diagram of the device area image extraction device in a natural scene of an embodiment;
[0042] Figure 4 A schematic diagram of the internal structure of a computer of an embodiment. DETAILED DESCRIPTION
[0043] In order to better understand the purpose, technical solution and technical effects of the present application, the present application will be further explained in combination with the drawings and embodiments. It is declared that the following described embodiments are only used to explain the present application, and are not used to limit the present application.
[0044] The embodiment of the present application provides a device recycling system.
[0045] The device recycling system of an embodiment includes a detection server and a device recycling terminal.
[0046] In one embodiment, the device recycling system further comprises a third-party server or a payment server.
[0047] The user side of the device to be recycled before recycling comprises a terminal device capable of communicating with each server or other side terminal device, which can be the device to be recycled or other smart devices.
[0048] The staff side comprises a terminal device capable of communicating with each server or other side terminal device.
[0049] In one embodiment, the terminal device for communication comprises a smart device such as a mobile phone or a computer. As a preferred embodiment, the terminal device for communication has network communication capability.
[0050] The device to be recycled includes smart devices or non-smart devices such as mobile phones, computers, watches, televisions, furniture, etc.
[0051] The user side can communicate with the detection server, the third-party server or the payment server, and the staff side can communicate with the detection server or the payment server.
[0052] The payment server communicates with the user side or the staff side for interaction, and is used to complete the payment and receipt of the user account or the staff account.
[0053] The third-party server communicates with the user side, including a shopping platform, a recycling platform or a communication platform, etc., and is used to capture the recycling request of the device to be recycled discarded by the user.
[0054] The device recycling terminal establishes communication with the detection server, and the detection data obtained by performing recycling detection on the device to be recycled is analyzed by the detection server.
[0055] In one embodiment, the device recycling terminal comprises:
[0056] A detection module for detecting the device to be recycled and obtaining detection data;
[0057] A display module for displaying the detection result of the detection server;
[0058] A man-machine interaction module for collecting feedback on the display of the detection result;
[0059] A communication module connected with the detection module, the display module and the man-machine interaction module, respectively, for communicating with each server.
[0060] The detection module is used to detect the device to be recycled, obtain detection data, and send the detection data to the detection server through the communication module.
[0061] In one of the embodiments, the detection data includes appearance images or interactive data of the device to be recycled. The staff can take appearance images of the device to be recycled by operating the device recycling terminal to generate videos or pictures uploaded to the detection server. Interactive data can also be obtained by establishing a communication connection between the device recycling terminal and the device to be recycled.
[0062] In one of the embodiments, the detection module includes a camera unit or a data interaction unit.
[0063] The camera unit is used to take appearance images of the device to be recycled. The data interaction unit is used to establish a communication connection with the device to be recycled to obtain interactive data.
[0064] In one of the embodiments, the data interaction unit includes a wireless interaction unit or a wired interaction unit.
[0065] The wireless interaction unit includes a WIFI interaction unit, a 4G interaction unit, an infrared interaction unit, or a ZIGBEE interaction unit, etc. The wired interaction unit includes a USB interaction unit or a bus interaction unit.
[0066] As a preferred embodiment, the data interaction unit includes a USB interaction unit. The device recycling terminal establishes a USB connection with the device to be recycled by integrating the USB interaction unit when performing recycling detection, and obtains USB interaction data required by the detection server to obtain detection results.
[0067] The display module is used to display the detection results, including display, sound and light display, or voice display, etc.
[0068] In one of the embodiments, the display module includes a display unit. The display unit includes a display screen or a digital tube display, etc. The detection results are displayed to users or staff, etc. through the display unit.
[0069] The human-computer interaction module is used to realize human-computer interaction between relevant personnel and the device recycling terminal, which can be used to collect display feedback or adjust the display of the detection results.
[0070] As a preferred embodiment, the human-computer interaction module and the display module are the same touch display screen.
[0071] The communication module has the ability to communicate with various servers, including 4G communication, WLAN communication, or local area network communication, etc.
[0072] In order to better explain the device recycling terminal deployment characteristics of the embodiments of the application, the following describes the development and deployment of the device recycling terminal in an application by means of a specific application example. In the specific application example, the device recycling terminal can be developed by means of a common tablet computer which has network communication and shooting capabilities and can be used to shoot the device to be recycled and upload the appearance image obtained by shooting to the detection server. At the same time, the tablet computer is improved by means of software integration or hardware integration, so that the tablet computer has a USB external data line (which can include USB data lines of multiple external interface types) and is connected to the device to be recycled in the recycling process. By means of software integration, the required interactive data is quickly read or captured and uploaded to the detection server. At the same time, when the detection result issued by the detection server is received, the detection result can be displayed on the display screen or be audibly presented by means of a power amplifier. At the same time, the user or the staff and other relevant personnel can operate the tablet computer to realize the collection and display of the feedback or the adjustment of the detection result display.
[0073] The device recycling terminal of any of the above embodiments includes a detection module, a display module, a man-machine interaction module and a communication module. Based on this, the recycling detection is realized by means of the cloud detection server to reduce the cost, stability and portability of the device recycling terminal on the basis of meeting the recycling process with the detection server.
[0074] Based on this, on the side of the detection server, the embodiments of the application provide a device recycling method.
[0075] The device recycling method of an embodiment includes the following steps:
[0076] Obtaining a device recycling request;
[0077] According to the device recycling request, sending recycling information to the staff side; wherein the recycling information is used to instruct the staff to obtain the device recycling terminal at the terminal address and hold the device recycling terminal to perform recycling detection on the device to be recycled at the recycling address;
[0078] Receiving the detection data sent by the device recycling terminal performing the recycling detection, performing detection on the detection data and feeding back the detection result to the device recycling terminal; wherein the device recycling terminal is used to display the detection result;
[0079] According to the display feedback of the detection result, performing the corresponding device recycling operation.
[0080] The device recycling request is used to trigger the start of the device recycling. The device recycling request can be sent by the user side, the staff side, the server side and the like, and be obtained by the detection server. Or, the device recycling request is indirectly sent by the user side, the staff side or the server side and the like, and is finally obtained by the detection server.
[0081] In one of the embodiments, the process of obtaining the device recycling request includes the steps of:
[0082] Receiving the request information sent by the user of the device to be recycled, and determining the device recycling request.
[0083] Among them, the request information sent by the user side includes direct sending to the detection server or indirect sending to the detection server through the other side. The user communicates with the detection server by operating the smart device (including the device to be recycled) and sends the request information.
[0084] In one of the embodiments, the process of obtaining the device recycling request includes the steps of:
[0085] Obtaining the communication interaction data between the user of the device to be recycled and the third-party server as the device recycling request.
[0086] Among them, the initiation of the device recycling request is not limited to the direct communication of the user with the detection server. In the communication interaction data between the user and the third-party server, there is a device recycling request, and the communication interaction data is used as the recycling request.
[0087] In order to better explain this embodiment, taking the mobile phone as an example. The user purchases a new mobile phone on the online shopping platform (third-party server) to replace the original old mobile phone, determines the recyclable old mobile phone in the communication interaction of the online shopping platform, and sends the data to the detection server as the device recycling request based on the communication interaction data.
[0088] The detection server can be realized by an application program, such as an APP or various types of mini programs. The application program is used for sales diversion or user diversion, and provides online services related to the device recycling request: purchasing new devices, exchanging old for new, or recycling devices. The user directly operates the application program or exchanges with the interface of the third-party server and the application program to trigger the device recycling request.
[0089] In one of the embodiments, before the process of sending the recycling information to the staff side according to the device recycling request, it further includes the steps of:
[0090] Determining the corresponding staff according to the communication interaction data.
[0091] Among them, the communication interaction data between the user and the third-party server corresponds to the logistics service of purchasing or distributing new devices, and based on this, the communication process between the user and the third-party server is determined according to the communication interaction data, and the corresponding staff is determined. For example, if the interaction between the user and the third-party server is online shopping, the logistics distribution personnel of the online shopping goods are determined as the staff.
[0092] In one of the embodiments, the device recycling method of another embodiment further includes the steps of:
[0093] The delivery information is sent to the staff according to the communication interaction data, so as to instruct the staff to deliver the to-be-delivered equipment to the recycling address according to the delivery information.
[0094] The delivery information is used to realize the communication interaction purpose of the user and the third-party server. In the embodiment, the third-party server realizes the delivery of the delivery information by performing interaction with the detection server, so as to reduce the communication cost. At the same time, the staff needs to communicate with multiple servers, and only needs to communicate with the detection server to complete the corresponding work, so as to improve the work efficiency and reduce the error rate.
[0095] After determining the equipment recycling request, the recycling information is sent to the staff side, so as to instruct the staff to perform a series of operations such as terminal acquisition, recycling address confirmation, and recycling detection.
[0096] In one embodiment, the recycling information is used to determine the terminal address and the recycling address. The smart device on the staff side can be used to show the terminal address and the recycling address corresponding to the recycling information to the staff.
[0097] As a more preferred embodiment, the terminal address is associated with the recycling address.
[0098] The recycling address can be determined in advance in the process of acquiring the equipment recycling request, such as the user's delivery address or the address information filled in. The terminal address is associated with the recycling address, such as determining the terminal address with the minimum distance from the recycling address.
[0099] In a specific application example, each equipment recycling terminal is placed in a corresponding store or warehouse, and the address of the store or warehouse is the terminal address. The staff obtains the equipment recycling terminal at the terminal address with the minimum distance from the recycling address according to the recycling information, and the store or warehouse updates the inventory information of the equipment recycling terminal accordingly.
[0100] After the recycling of the to-be-recycled equipment, the staff can send the equipment recycling terminal back to the corresponding terminal address, or perform recycling detection according to the recycling information to the next recycling address.
[0101] In one embodiment, the recycling information is also used to instruct the staff to operate the equipment recycling terminal. The recycling information is sent to the smart device on the staff side to provide operation display for the staff. The operation display includes text display, picture display, or video display.
[0102] In one embodiment, the recycling information includes a startup code. The startup code is used to unlock the corresponding equipment recycling terminal.
[0103] In one embodiment, after the equipment recycling terminal is acquired, the method further includes the following steps:
[0104] The updating device recycling terminal updates the acquired information corresponding to the terminal.
[0105] Taking a store or warehouse as an example, relevant personnel can log in to the detection server to check whether the device recycling terminal corresponding to each terminal address is acquired or in use, so as to understand the state of the device recycling terminal in time. For example, the detection server can correspond to a small program, an APP, etc. by allocation, and the staff can check the number of idle device recycling terminals of the store or warehouse, whether the device recycling terminal is damaged, etc. by logging in to the corresponding small program. After the staff acquires the device recycling terminal, the corresponding device recycling terminal is updated to be acquired; after the staff returns the device recycling terminal, the corresponding device recycling terminal is updated to be not acquired.
[0106] The staff holds the device recycling terminal to a target address, collects detection data of a device to be recycled through the device recycling terminal, and sends the detection data to the detection server to obtain a detection result.
[0107] The detection result is displayed by the device recycling terminal, including text display, picture display, or video display, etc.
[0108] As a more optimal implementation, when the detection data is a picture of the device to be recycled, the detection result includes marking the defects or damage traces on the picture to prompt the user. When the detection data is the interaction data between the device to be recycled and the device recycling terminal, the detection result is displayed to the user in a text form through data anomaly marking or data processing result.
[0109] In one embodiment, the detection result includes the recycling price in addition to the problem detection of the device to be recycled. The detection and pricing process is completed at the target address by displaying the recycling price to the user.
[0110] After displaying the detection result, a corresponding device recycling operation is performed according to the display feedback.
[0111] In one embodiment, at the data communication level, the display feedback can be sent to the detection server by the user side, the staff side, and each server side. At the human-computer interaction level, the display feedback can be made by the user operating the smart device on the user side, the user operating the device recycling terminal, the staff operating the smart device on the staff side, the staff operating the device recycling terminal, etc.
[0112] According to the display feedback, a corresponding device recycling operation is performed, such as determining recycling, determining not to recycle, adjusting the recycling price, and the like. In one embodiment, the detection server completes the device recycling operation through interaction with a third-party server or a payment server. For example, in the process of the trade-in purchase, when the recycling of the device to be recycled is determined, the corresponding user deduction, user payment adjustment, staff payment bonus, and the like are completed by the payment server.
[0113] Based on this, in one embodiment, the process of performing a corresponding device recycling operation according to the display feedback of the detection result includes the steps of:
[0114] According to the display feedback, instructing the staff to hold the device to be recycled to the target address.
[0115] Among them, the target address information is directly or indirectly issued to the staff side by the detection server, and the device to be recycled is held to the target address by the staff to complete the recycling.
[0116] In one embodiment, the process of performing a corresponding device recycling operation according to the display feedback of the detection result includes the steps of:
[0117] According to the display feedback, the recycling price of the device to be recycled is adjusted.
[0118] Among them, the detection server and the payment server complete interaction through the display feedback to adjust the recycling price of the device to be recycled.
[0119] In one embodiment, the process of performing a corresponding device recycling operation according to the display feedback of the detection result includes the steps of:
[0120] According to the display feedback, logistics information is generated to instruct the staff to perform logistics delivery of the device to be recycled according to the logistics information.
[0121] Among them, the detection server can directly issue the logistics information to the staff side, or indirectly issue it by a third-party server, to instruct the staff to perform logistics delivery of the device to be recycled, further improving the efficiency of device recycling.
[0122] In one embodiment, after the process of performing a corresponding device recycling operation according to the display feedback of the detection result, the process further includes the steps of:
[0123] Sending a payment instruction to the payment server to instruct the payment server to complete the payment for the account of the target person.
[0124] After completing the recycling, the detection server sends a payment instruction to the payment server to instruct the payment server to complete the payment for the account of the target person.
[0125] In one of the embodiments, the target person includes a user, a staff or a third-party merchant, etc. to complete the timely settlement and intelligentization of the payment and receipt of the parties in the device recycling process.
[0126] In the device recycling method of any of the above embodiments, after obtaining the device recycling request, the recycling information is sent to the staff side to instruct the staff to obtain the device recycling terminal at the terminal address, and the staff holds the device recycling terminal to the recycling address to perform the recycling detection on the device to be recycled. The detection data sent by the device recycling terminal performing the recycling detection is received, the detection data is detected and the detection result is fed back to the device recycling terminal, the detection result is displayed by the device recycling terminal, and the corresponding device recycling operation is performed according to the display feedback of the detection result. Based on this, through the remote feedback of the detection result, the professional requirement for the staff is reduced, and the hardware capability requirement for the device recycling terminal is reduced, and the recycling cost is reduced in all aspects. At the same time, the detection result is displayed and fed back in advance at the recycling address, which is beneficial to reduce the dispute and communication cost in the recycling process.
[0127] Based on this, after the staff holds the device recycling terminal to perform the recycling detection on the device to be recycled, and obtains the appearance image in the detection data, a device region image extraction method in a natural scene is provided.
[0128] Figure 1 The device region image extraction method in a natural scene of an embodiment is shown in a flow chart as shown in Figure 1 The device region image extraction method in a natural scene of an embodiment includes steps S100 to S103:
[0129] S100, obtaining an appearance image of a device to be recycled;
[0130] S101, performing color space conversion processing on the appearance image to generate a corresponding grayscale image;
[0131] S102, positioning a preset range region of the grayscale image;
[0132] S103, extracting a device region from the preset range region; wherein the device region is used as detection data for recycling detection.
[0133] The appearance image can be obtained from the detection data sent by the detection server through the device recycling terminal.
[0134] In one of the embodiments, Figure 2 The device region image extraction method in a natural scene of another embodiment is shown in a flow chart as shown in Figure 2 Before the process of performing color space conversion processing on the appearance image to generate a corresponding grayscale image in step S101, step S200 is further included:
[0135] S200, performing Gaussian filtering on the appearance image.
[0136] In the Gaussian filtering process, white noise in the appearance image of the smart device is removed.
[0137] In one embodiment, the process of performing Gaussian filtering on the appearance image is as follows:
[0138]
[0139] wherein X1 represents the appearance image after Gaussian filtering, X represents the appearance image; j = 1, 2, …, H, i = 1, 2, …, W, j and i represent the coordinate values in the horizontal direction and the vertical direction relative to the upper left corner of the appearance image, H represents the height of X, and W represents the width of X; w represents the length of the rectangular window, which is set to 3; A represents the amplitude corresponding to the rectangular window, which is set to 16; and the rectangular window represents the template corresponding to the Gaussian filtering as follows
[0140]
[0141] In one embodiment, the process of performing color space conversion on the appearance image in step S101 to generate a corresponding grayscale image is as follows:
[0142] G1(j, i) = 0.1140 * X1 b (j, i) + 0.5870 * X1 g (j, i) + 0.2989 * X1 r (j, i)
[0143] wherein G1(j, i) represents the grayscale image, X1 r , X1 g , and X1 b represent the color components of the R, G, and B channels of the appearance image X1.
[0144] The corresponding grayscale image is generated through the color space conversion process. The parameter settings in the above formula facilitate image processing in natural scenes.
[0145] In one embodiment, as shown in Figure 2 , the process of positioning the preset range area of the grayscale image in step S102 includes steps S300 to S302:
[0146] S300, extracting gradient information of the grayscale image in the horizontal direction and the vertical direction;
[0147] S301, determining the point coordinates of the corners of the grayscale image according to the gradient information;
[0148] S302, according to the range of each point coordinate frame, obtain the preset range area.
[0149] Wherein, for the gray image G1, the gradient information in horizontal and vertical directions is extracted respectively. x and K y The convolution kernel of G1 in horizontal and vertical directions is respectively:
[0150]
[0151] Wherein,
[0152] Taking the gray image as a quadrilateral including four corners as an example. For the gradient image G1 x and G1 y , the point coordinates P1, P2, P3, P4 of the four corners of the virtual frame are obtained.
[0153] L1 and L2 represent the two vertical direction of the strongest gradient edge line corresponding to the gradient image G1x; L3 and L4 represent the two horizontal direction of the strongest gradient edge line corresponding to the gradient image G1y.
[0154] According to the range of each corner frame, obtain the preset range area. For example:
[0155] Connecting P1, P2, P3, P4, obtaining the preset range area Y of the appearance image.
[0156] L1: a1x+b1y+c1=0
[0157] L2: a2x+b2y+c2=0
[0158] L3: a3x+b3y+c3=0
[0159] L4: a4x+b4y+c4=0
[0160] The calculation formula of P1, P2, P3, P4 is similar, taking the intersection point of P1 as an example:
[0161] P1x=(b1c3-b3c1) / (a1b3-a3b1)
[0162] P1y=(a3c1-a1c3) / (a1b3-a3b1)
[0163] Wherein, a1, a2, a3, a4, b1, b2, b3, b4, c1, c2, c3, c4 are the general linear equation parameters of L1, L2, L3 and L4, and P1x and P1y represent the coordinate values of the intersection point P1.
[0164] In one embodiment, as Figure 2As shown, the process of extracting the device region from the preset range region in step S103 includes step S400 and step S401:
[0165] S400, calculate the texture feature in the preset range region;
[0166] S401, binarize the texture feature and screen out the device region.
[0167] In one embodiment, the size of the texture feature can be represented by the gray level co-occurrence matrix. That is, the process of calculating the texture feature in the preset range region in step S400 includes the following steps:
[0168] Calculate the gray level co-occurrence matrix of the preset range region; wherein the entropy value of the gray level co-occurrence matrix is positively correlated with the complexity of the texture feature.
[0169] In one embodiment, for the preset range region Y, the GLCM (Gray-level co-occurrence matrix) method is used to calculate the gray level co-occurrence matrix GM. The entropy value is calculated for GM, and the greater the entropy value, the greater the texture complexity of the image it represents. The formula for calculating the entropy value is:
[0170]
[0171] Where x represents a pixel point in GM, and p(x) is the probability index of the pixel point.
[0172] Binarize the texture feature of the image in the virtual frame, including setting the pixel gray value of the region corresponding to the GM entropy value greater than the threshold T to 255, and calculating the corresponding binary mask image Mask. 3) Extract the binary rectangular frame set and screen out the device region.
[0173] The device region image extraction method in the natural scene of any of the above embodiments, after obtaining the appearance image of the device to be recycled, performs color space conversion processing on the appearance image to generate a corresponding gray scale image. Further, the preset range region of the gray scale image is located, and the device region is extracted from the preset range region; wherein the device region is used as detection data for recycling detection. Based on this, in the recycling detection in the natural scene, by extracting the effective device region from the appearance image, the environmental interference in the natural scene is reduced, and the accuracy of the subsequent recycling image detection is improved.
[0174] Figure 3 The module structure diagram of the device region image extraction device in the natural scene of an embodiment is shown in Figure 3 As shown, the device region image extraction device in the natural scene of an embodiment includes:
[0175] An image acquisition module 100 is used to acquire an appearance image of the equipment to be recycled;
[0176] The image conversion module 101 is used to perform color space conversion processing on the appearance image to generate a corresponding grayscale image;
[0177] The region positioning module 102 is used to locate a preset range region of the grayscale image;
[0178] The area extraction module 103 is used to extract the device area from the preset range area; wherein the device area is used as detection data for recycling detection.
[0179] The aforementioned device area image extraction device in natural scenes, after acquiring an external image of the equipment to be recycled, performs color space conversion on the image to generate a corresponding grayscale image. Furthermore, a predetermined range of the grayscale image is located and the device area is extracted from the predetermined range; the device area is used as detection data for recycling detection. Therefore, by extracting the effective device area from the external image during recycling detection in natural scenes, environmental interference in the natural scene is reduced, thereby improving the accuracy of subsequent recycling image detection.
[0180] An embodiment of the present invention further provides a computer storage medium having computer instructions stored thereon, which, when executed by a processor, implements the device area image extraction method in a natural scene according to any of the above embodiments.
[0181] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, storage, database or other medium used in the embodiments provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0182] Alternatively, the above-mentioned integrated unit of the present application, if realized in the form of a software functional module and sold or used as an independent product, can also be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, terminal or network device, etc.) to execute all or part of the embodiments of the present application. The above-mentioned storage medium includes mobile storage devices, RAM, ROM, magnetic or optical disks and various program code storage media.
[0183] Corresponding to the above-mentioned computer storage medium, in one embodiment, a computer device is also provided, which includes a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to realize any one of the device region image extraction methods in the natural scene in the above-mentioned embodiments.
[0184] The computer device can be a terminal, and its internal structure diagram can be as follows: Figure 4As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium, an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The network interface of the computer device is used to communicate with the external terminal through the network connection. The computer program is executed by the processor to implement a device region image extraction method in a natural scene. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad or mouse, etc.
[0185] The above computer device, after obtaining the appearance image of the device to be recycled, performs color space conversion processing on the appearance image to generate a corresponding grayscale image. Further, a preset range area of the grayscale image is located, and a device region is extracted from the preset range area; wherein the device region is used as detection data for recycling detection. Based on this, in the recycling detection in the natural scene, by extracting the effective device region from the appearance image, the environmental interference in the natural scene is reduced, and the accuracy of the subsequent recycling image detection is improved.
[0186] The technical features of the above embodiments can be combined in any way. To make the description concise, not all possible combinations of the technical features in the above embodiments are described, but as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present application.
[0187] The above embodiments only express several embodiments of the present application, and the description is more specific and detailed, but it should not be understood as limiting the scope of the patent. It should be noted that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.
Claims
1. A method for extracting device area images in natural scenes, characterized in that: Including steps: Obtain appearance images of the equipment to be recycled; Performing color space conversion processing on the appearance image to generate a corresponding grayscale image; Locating a preset range area of the grayscale image includes the steps of: For the grayscale image G1, extract the gradient information K in the horizontal and vertical directions respectively x and K y ,in, Among them, G1 x Refers to the gradient image of the grayscale image G1 along the horizontal direction, G1 y Refers to the vertical gradient image of the grayscale image G1. x and G1 y In the expression, j and i represent the horizontal and vertical coordinate values relative to the origin of the upper left corner of the appearance image, respectively, and w represents the length of the rectangular window; For the gradient image G1 x and G1 y , get the coordinates of the four corners of the virtual box P1, P2, P3, P4; L1 and L2 represent the two strongest gradient edges in the vertical direction corresponding to the gradient image G1x; L3 and L4 represent the two strongest gradient edges in the horizontal direction corresponding to the gradient image G1y; L1: a1x+b1y+c1=0; L2: a2x+b2y+c2=0; L3: a3x+b3y+c3=0; L4: a4x+b4y+c4=0; where a1, a2, a3, a4, b1, b2, b3, b4, c1, c2, c3, c4 are the general straight line equation parameters of L1, L2, L3, and L4, respectively; According to L1, L2, L3 and L4, the coordinate values of P1, P2, P3 and P4 are obtained respectively; Get the preset range area according to the range of each corner frame; A device area is extracted from the preset range area; wherein the device area is used as detection data for recycling detection.
2. The method for extracting device area images in natural scenes according to claim 1, characterized in that: Before the process of converting the appearance image into a color space to generate a corresponding grayscale image, the step Perform Gaussian filtering on the appearance image.
3. The method for extracting device area images in natural scenes according to claim 2, characterized in that: The process of performing Gaussian filtering on the appearance image is as follows: Wherein, X1 represents the appearance image after Gaussian filtering, X represents the appearance image; j = 1, 2, ..., H, i = 1, 2, ..., W, j and i represent the horizontal and vertical coordinate values relative to the origin of the upper left corner of the appearance image, H represents the height of X, and W represents the width of X; w represents the length of the rectangular window, which is set to 3; A represents the amplitude of the corresponding rectangular window, which is set to 16; the rectangular window represents the template corresponding to the Gaussian filter as follows 4. The method for extracting device area images in natural scenes according to claim 1, characterized in that: The process of performing color space conversion on the appearance image to generate a corresponding grayscale image is as follows: G1(j,i)=0.1140*X1 b (j,i)+0.5870*X1 g (j,i)+0.2989*X1 r (j,i) Among them, G1(j,i) represents the grayscale image, X1 r 、X1 g and X1 b Represents the color components of the R, G, and B channels of the appearance image X1.
5. The method for extracting device area images in natural scenes according to claim 1, characterized in that: The process of locating the preset range area of the grayscale image includes the steps of: Extracting gradient information of the grayscale image in the horizontal and vertical directions; Determining the point coordinates of the grayscale image corners according to the gradient information; The preset range area is obtained by selecting the range of each point coordinate.
6. The method for extracting device area images in natural scenes according to claim 1, characterized in that: The process of extracting the device area from the preset range area includes the steps of: Calculating texture features within the preset range; Binarization is performed on the texture features, and the device area is screened out.
7. The method for extracting device area images in natural scenes according to claim 6, characterized in that: The process of calculating the texture features within the preset range includes the steps of: Calculating a gray level co-occurrence matrix of the preset range area; wherein the entropy value of the gray level co-occurrence matrix is positively correlated with the complexity of the texture feature.
8. A device for extracting device area images in natural scenes according to the device area image extraction method according to any one of claims 1 to 7, characterized in that: include: An image acquisition module is used to acquire an appearance image of the equipment to be recycled; An image conversion module, configured to perform color space conversion processing on the appearance image to generate a corresponding grayscale image; A region positioning module, configured to locate a preset range of the grayscale image; The area extraction module is used to extract the equipment area from the preset range area; wherein the equipment area is used as detection data for recycling detection.
9. A computer storage medium having computer instructions stored thereon, characterized in that: When the computer instructions are executed by a processor, the method for extracting device area images in a natural scene as described in any one of claims 1 to 7 is implemented.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method for extracting device area images in natural scenes according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
A sea antenna detection method based on image partitioning and texture features
CN109242870A
Equipment area image segmentation method and device
CN112634288A