Disclosure of Invention
The invention aims to solve at least one of technical problems in the related technology to a certain extent, and therefore, the first purpose of the invention is to provide a photovoltaic panel positioning method and device based on deep learning image segmentation, the technology is simple and efficient to realize, and the positioning accuracy of a photovoltaic panel is effectively improved, so that when the photovoltaic panel breaks down, a fault point can be accurately positioned, the operation and maintenance cost of the broken-down photovoltaic panel of a power generation enterprise is reduced, the purposes of increasing energy and reducing cost are achieved, the fault point is quickly positioned, the operation efficiency of the power generation enterprise is greatly improved, and the economic loss is reduced.
The second purpose of the invention is to provide a photovoltaic panel positioning device based on deep learning image segmentation.
A third object of the invention is to propose an electronic device.
A fourth object of the invention is to propose a storage medium.
In order to achieve the above object, an embodiment of a first aspect of the present invention provides a method for positioning a photovoltaic panel based on deep learning image segmentation, where the method includes:
acquiring attribute effective data of the area image through the area image shot by the unmanned aerial vehicle, and positioning the image of the photovoltaic panel on the same row by adopting a proper program rule;
acquiring the number of rows of the photovoltaic panel in the area based on the number of rows of the area image and a photovoltaic panel row number mapping program in the area;
and carrying out image segmentation on the photovoltaic panel image of any row based on the U2-net deep learning network to obtain a photovoltaic panel image mask, processing the photovoltaic panel image mask to obtain the parameter of any single photovoltaic panel component in the photovoltaic panel image, and thus obtaining the precise row and column coordinate position of the photovoltaic panel.
Further, the attribute valid data includes the characteristics of "CreateDate", "FlightXSpeed", "FlightYSpeed" and "flightzsped" of the acquired photovoltaic panel image, where CreateDate is the photographing time of the photographed photovoltaic panel image, flightXSpeed is the speed in the x-axis direction when the photographed photovoltaic panel image is photographed, that is, the north speed in the space, flightYSpeed is the speed in the y-axis direction when the photographed photovoltaic panel image is photographed, that is, the east speed in the space, and flightzsped is the speed in the z-axis direction when the photographed photovoltaic panel image is photographed, that is, the down speed in the space;
the appropriate program rules are: when the differences of three direction values of 'FlightXSpeed', 'FlightYSpeed' and 'FlightZpeed' of the images of the adjacent photovoltaic panels are within 1.3 and the number of the continuous images is more than 4, the photovoltaic panels in the same row are judged, and the row number of the photovoltaic panels is coded from top to bottom.
According to the photovoltaic panel positioning method based on deep learning image segmentation, the mapping program comprises the following steps: and each photovoltaic panel image comprises m rows of photovoltaic panels, one row of photovoltaic panels is overlapped longitudinally, and the number of rows of the photovoltaic panel image is n rows, so that the number of rows of the photovoltaic panels is = (m-1) × n +1.
According to the photovoltaic panel positioning method based on deep learning image segmentation, the photovoltaic panel image mask processing mode comprises the following steps: and determining the coordinate parameters of the single assemblies of the photovoltaic panel images in any row by adopting outline detection of opencv.
According to the photovoltaic panel positioning method based on deep learning image segmentation, the outline detection of the opencv comprises the following steps: a findcounters function in opencv obtains coordinates of 4 vertex pixels of the image assembly by using a photovoltaic panel image mask, numbers the small assemblies in sequence, and cuts original images of the area images according to the coordinates to obtain coordinate parameters of the assembly images.
According to the photovoltaic panel positioning method based on the deep learning image segmentation, the area image comprises a visible light image and an infrared image.
The embodiment of the second aspect of the invention provides a photovoltaic panel positioning device based on deep learning image segmentation, which comprises:
the image processing module is used for acquiring attribute effective data of the area image through the area image shot by the unmanned aerial vehicle and positioning the image of the same row of photovoltaic panels by adopting a proper program rule;
the mapping module is used for acquiring the number of lines of the photovoltaic panel in the area based on the number of lines of the area image and a photovoltaic panel line number mapping program in the area;
and the processing and positioning module is used for carrying out image segmentation on the photovoltaic panel image of any row based on the U2-net deep learning network to obtain a photovoltaic panel image mask, processing the photovoltaic panel image mask to obtain the parameter of any photovoltaic panel single component in the photovoltaic panel image, and further obtaining the accurate row and column coordinate position of the photovoltaic panel.
According to an embodiment of the present invention, the attribute valid data obtained by the image processing module includes characteristics of "createdadate", "FlightXSpeed", "FlightYSpeed", and flightzsped "for obtaining the photovoltaic panel image, createDate is a photographing time for photographing the photovoltaic panel image, flightXSpeed is an x-axis direction speed when photographing the photovoltaic panel image, that is, a north-direction speed in space, flightYSpeed is a y-axis direction speed when photographing the photovoltaic panel image, that is, an east-direction speed in space, and flightzsped is a z-axis direction speed when photographing the photovoltaic panel image, that is, a down-direction speed in space;
the suitable program rules in the image processing module are: when the differences of three direction values of 'FlightXSpeed', 'FlightYSpeed' and 'FlightZpeed' of the images of the adjacent photovoltaic panels are within 1.3 and the number of the continuous images is more than 4, the photovoltaic panels in the same row are judged, and the row number of the photovoltaic panels is coded from top to bottom.
According to an embodiment of the invention, the mapping program of the mapping module comprises: each photovoltaic panel image comprises m rows of photovoltaic panels, one row of photovoltaic panels is longitudinally overlapped, and the number of rows of the photovoltaic panel image is n rows, so that the number of rows of the photovoltaic panels is = (m-1) × n +1.
According to one embodiment of the invention, the processing and positioning module adopts opencv contour detection to determine the coordinate parameters of the single photovoltaic panel image components in any row;
specifically, a findcount function in opencv obtains coordinates of 4 vertex pixels of an image component by using a photovoltaic panel image mask, numbers small components in sequence, and cuts an original image of an area image according to the coordinates to obtain coordinate parameters of the component image, wherein the area image comprises a visible light image and an infrared image.
In an embodiment of a third aspect of the present invention, an electronic device is provided, which includes a memory and a processor, where the memory stores a computer program, and the computer program is configured to implement, when executed in runtime, the method for positioning a photovoltaic panel based on deep learning image segmentation as set forth in the embodiment of the first aspect of the present invention;
the processor is configured to implement the method for positioning a photovoltaic panel based on deep learning image segmentation as set forth in an embodiment of the first aspect of the present invention when the computer program is executed.
A fourth aspect of the present invention provides a storage medium, in which a computer program is stored, where the computer program is configured to, when running, implement the method for positioning a photovoltaic panel based on deep learning image segmentation as set forth in the first aspect of the present invention.
Compared with the prior art, the invention has the beneficial effects that: according to the photovoltaic panel positioning method, the effective attribute data of the area image is obtained through the area image shot by the unmanned aerial vehicle, and the images of the photovoltaic panels in the same row are positioned by adopting a proper program rule; acquiring the number of lines of the photovoltaic panel in the area based on the number of lines of the area image and a photovoltaic panel line number mapping program in the area; and then, carrying out image segmentation on the photovoltaic panel image of any row through a U2-net-based deep learning network to obtain a photovoltaic panel image mask, processing the photovoltaic panel image mask to obtain the parameter of any photovoltaic panel single component in the photovoltaic panel image, and obtaining the accurate row and column coordinate position of the photovoltaic panel.
Detailed Description
The following description of the embodiments of the present application is provided by way of specific examples, and other advantages and effects of the present application will be readily apparent to those skilled in the art from the disclosure herein. The present application is capable of other and different embodiments and its several details are capable of modifications and variations in various respects, all without departing from the spirit of the present application. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
The photovoltaic panel positioning method and device based on deep learning image segmentation according to the embodiments of the present invention will be described in detail with reference to the drawings and specific embodiments.
Fig. 1 is a flowchart of a photovoltaic panel positioning method based on deep learning image segmentation according to an embodiment of the present invention, and as shown in fig. 1, the photovoltaic panel positioning method includes:
s1, obtaining attribute effective data of an area image shot by an unmanned aerial vehicle, wherein the area image comprises a visible light image and an infrared image, and positioning the images of the same row of photovoltaic panels by adopting a proper program rule;
specifically, the attribute valid data includes the characteristics of "CreateDate", "flightxseed", "FlightYSpeed", and flightzsped "of the acquired photovoltaic panel image, where CreateDate is the photographing time of the photographed photovoltaic panel image, flightXSpeed is the speed in the x-axis direction when the photographed photovoltaic panel image is photographed, that is, the north speed in the space, flightYSpeed is the speed in the y-axis direction when the photographed photovoltaic panel image is photographed, that is, the east speed in the space, and flightzsped is the speed in the z-axis direction when the photographed photovoltaic panel image is photographed, that is, the down speed in the space;
suitable program rules are: when the differences of three direction values of 'flight XSpeed', 'flight YSpeed' and 'flight Zsped' of adjacent photovoltaic panel images are within 1.3 and the number of the continuous images is larger than 4, the photovoltaic panels in the same row are judged, the row numbers of the photovoltaic panels are numbered from top to bottom, and the photovoltaic panels are numbered quickly according to the creating time and the direction value deviation when the photovoltaic panels are shot.
S2, acquiring the number of lines of the photovoltaic panel in the area based on the number of lines of the area image and a photovoltaic panel line number mapping program in the area;
the mapping program comprises: each image of the photovoltaic panel includes m rows of photovoltaic panels, one row of the photovoltaic panels is overlapped in the longitudinal direction, and the number of rows of the image of the photovoltaic panel is n rows, then the number of rows of the photovoltaic panel = (m-1) × n +1, for example, when each image includes 2 rows of the number of rows of the photovoltaic panels, and one row of the photovoltaic panels is overlapped in the longitudinal direction, then the number of rows of the photovoltaic panels is equal to the number of rows of the image plus 1.
S3, image segmentation is carried out on the photovoltaic panel image of any line based on a U2-net deep learning network, the photovoltaic panel visible light image and the infrared image are input into the U2-net network, a black-and-white contour map of the photovoltaic panel assembly is obtained through U2net model identification and segmentation, namely the black-and-white contour map of the photovoltaic panel assembly is obtained through a model for the main purpose, in the training process, the loss function loss value is smaller than 0.005 storage model, and a photovoltaic panel image mask is obtained; and then carrying out outline detection of opencv on the photovoltaic panel image mask to obtain parameters of any single photovoltaic panel component in the photovoltaic panel image, so as to obtain the accurate row-column coordinate position of the photovoltaic panel.
In the step, a findcount function in opencv obtains coordinates of 4 vertex pixels of the image component by using a photovoltaic panel image mask, numbers the small components in sequence, and cuts an original image of the area image according to the coordinates to obtain coordinate parameters of the component image.
An embodiment of the present invention further provides a photovoltaic panel positioning apparatus based on deep learning image segmentation, as shown in fig. 2, including an image processing module 610, a mapping module 620, and a processing and positioning module 630.
In this embodiment, the image processing module 610 is configured to obtain the attribute valid data of the area image through the area image shot by the unmanned aerial vehicle, where the area image includes a visible light image and an infrared image, and position the image of the same row of photovoltaic panels by using a suitable program rule;
in this step, the attribute valid data obtained by the image processing module 610 includes the features of "CreateDate", "FlightXSpeed", "FlightYSpeed", and "flightzsped" of the obtained photovoltaic panel image, where CreateDate is the photographing time of the photographed photovoltaic panel image, flightXSpeed is the speed in the x-axis direction when the photovoltaic panel image is photographed, that is, the north speed in space, flightYSpeed is the speed in the y-axis direction when the photovoltaic panel image is photographed, that is, the east speed in space, and flightzsped is the speed in the z-axis direction when the photovoltaic panel image is photographed, that is, the down speed in space; suitable program rules in the image processing module 610 are: when the differences of three direction values of 'FlightXSpeed', 'FlightYSpeed' and 'FlightZpeed' of the images of the adjacent photovoltaic panels are within 1.3 and the number of the continuous images is more than 4, the photovoltaic panels in the same row are judged, and the row number of the photovoltaic panels is coded from top to bottom.
In this embodiment, the mapping module 620 is configured to obtain the number of rows of photovoltaic panels in the area based on the number of rows of the area image and the number of rows of photovoltaic panels in the area; the mapping procedure of the mapping module 610 includes: in the step, when each image contains 2 rows of photovoltaic panels and one row of photovoltaic panels is longitudinally overlapped, the number of the rows of the photovoltaic panels is equal to the number of the rows of the image plus 1.
In this embodiment, the processing and positioning module 630 is configured to perform image segmentation on a photovoltaic panel image of any row based on a U2-net deep learning network, input a visible light image and an infrared image of the photovoltaic panel into the U2-net network, and obtain a black-and-white profile of the photovoltaic panel assembly through U2net model identification and segmentation, that is, obtain a black-and-white profile of the photovoltaic panel assembly through the model, in a training process, a loss function loss value is smaller than 0.005 storage model, obtain a photovoltaic panel image mask, perform opencv profile detection on the photovoltaic panel image mask, obtain a parameter of any single photovoltaic panel assembly in the photovoltaic panel image, and thus obtain an accurate row-column coordinate position of the photovoltaic panel.
The findcount function in opencv obtains the pixel coordinates of 4 vertexes of the image assembly by using the image mask of the photovoltaic panel, numbers the small assemblies in sequence, and cuts the original image of the area image according to the coordinates to obtain the coordinate parameters of the assembly image.
In some embodiments, as shown in fig. 3, an electronic device 700 is further provided in an embodiment of the present application, and includes a processor 701, a memory 702, and a computer program stored in the memory 702 and capable of being executed on the processor 701, where the computer program, when executed by the processor 701, implements each process of the ultra-short term prediction method for wind power, and can achieve the same technical effect, and is not described herein again to avoid repetition.
It should be noted that the electronic device in the embodiment of the present application includes the mobile electronic device and the non-mobile electronic device described above.
An embodiment of the present invention further provides a storage medium, where a computer program is stored in the storage medium, and the computer program is configured to, when running, implement the photovoltaic panel positioning method based on deep learning image segmentation as provided in the embodiment of the present invention.
It should be noted that the logic and/or steps shown in the flowcharts or otherwise described herein, such as an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
In the description of the present invention, it is to be understood that the terms "central," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," "circumferential," and the like are used in the orientations and positional relationships indicated in the drawings for convenience in describing the invention and to simplify the description, and are not intended to indicate or imply that the referenced devices or elements must have a particular orientation, be constructed and operated in a particular orientation, and are therefore not to be considered limiting of the invention.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless explicitly specified otherwise.
In the present invention, unless otherwise explicitly stated or limited, the terms "mounted," "connected," "fixed," and the like are to be construed broadly, e.g., as being permanently connected, detachably connected, or integral; can be mechanically or electrically connected; they may be directly connected or indirectly connected through intervening media, or they may be connected internally or in any other suitable relationship, unless expressly stated otherwise. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In the present invention, unless expressly stated or limited otherwise, the first feature "on" or "under" the second feature may be directly contacting the second feature or the first and second features may be indirectly contacting each other through intervening media. Also, a first feature "on," "over," and "above" a second feature may be directly or diagonally above the second feature, or may simply indicate that the first feature is at a higher level than the second feature. A first feature being "under," "below," and "beneath" a second feature may be directly under or obliquely under the first feature, or may simply mean that the first feature is at a lesser elevation than the second feature.
Although embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are exemplary and not to be construed as limiting the present invention, and that changes, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.