Search

CN-121982107-A - Method and device for determining knob angle, electronic equipment and storage medium

CN121982107ACN 121982107 ACN121982107 ACN 121982107ACN-121982107-A

Abstract

The embodiment of the application provides a method, a device, electronic equipment and a storage medium for determining a knob angle, wherein a first image comprising a target knob can be acquired firstly, then an edge detection image of the target knob can be generated based on the first image, and the line inclination angle with the largest occurrence number in the edge detection image is determined. Finally, the angle of the target knob can be automatically determined according to the line inclination angle with the largest occurrence number in the edge detection image. Compared with the mode that needs manual observation among the prior art, can greatly improve the discernment efficiency of knob angle.

Inventors

  • LIU XUYAN
  • LIU YANG
  • REN XUELIANG
  • PAN YALU
  • Ni Weilun

Assignees

  • 远景能源有限公司

Dates

Publication Date
20260505
Application Date
20251203

Claims (10)

  1. 1. A method for determining a knob angle, comprising: Acquiring a first image including a target knob; Generating an edge detection image of the target knob based on the first image; determining a first inclination angle according to the edge detection image, wherein the first inclination angle is the line inclination angle with the largest occurrence frequency in the edge detection image; and determining the angle of the target knob according to the first inclination angle.
  2. 2. The method of determining a knob angle according to claim 1, wherein the determining the angle of the target knob according to the first inclination angle includes: determining a first weight coefficient matrix according to the first inclination angle and the Gaussian covariance matrix; determining the saturation mean value and the color brightness mean value of all pixel points in the first image according to the saturation value, the color brightness value and the first weight coefficient matrix of each pixel point in the first image; processing the first image according to the saturation mean value and the color brightness mean value of all pixel points in the first image to obtain a binarization sequence corresponding to the first image; and determining the angle of the target knob according to the binarization sequence corresponding to the first image.
  3. 3. The method of determining a knob angle according to claim 2, wherein the determining a first weight coefficient matrix according to the first inclination angle and a gaussian covariance matrix includes: rotating Gao Sixie the variance matrix to the first tilt angle to obtain a first matrix; And carrying out normalization processing on the first matrix to obtain a first weight coefficient matrix.
  4. 4. The method for determining a knob angle according to claim 2, wherein, Before determining the saturation mean value and the color brightness mean value of all the pixel points in the first image according to the saturation value, the color brightness value and the first weight coefficient matrix of each pixel point in the first image, the method further includes: Acquiring a red channel value, a green channel value and a blue channel value of each pixel point in the first image; And determining the saturation value and the color brightness value of each pixel point in the first image according to the red channel value, the green channel value and the blue channel value of each pixel point in the first image.
  5. 5. The method for determining a knob angle according to any one of claims 2 to 4, wherein the processing the first image according to the saturation mean and the color brightness mean of all pixels in the first image to obtain the binarized sequence corresponding to the first image includes: taking the saturation mean value and the color definition mean value as screening thresholds, and screening the pixel points in the first image according to the saturation value and the color definition value of each pixel point in the first image to determine the pixel points meeting the screening conditions and the pixel points not meeting the screening conditions; and setting the brightness value of the pixel points which meet the screening condition as a first value, and setting the brightness value of the pixel points which do not meet the screening condition as a second value so as to obtain a binarization sequence corresponding to the first image.
  6. 6. The method for determining a knob angle according to claim 2, wherein determining the angle of the target knob according to the binarized sequence corresponding to the first image comprises: performing corrosion operation on the binarization sequence to obtain a new binarization sequence; determining a maximum connected region in the new binarization sequence; and performing linear fitting operation on the maximum communication area to determine the angle of the target knob.
  7. 7. The method for determining a knob angle according to claim 1, wherein, The generating an edge detection image of the target knob based on the first image includes: Processing the first image by adopting a target detection model to obtain a second image; gray processing is carried out on the second image so as to obtain a third image; and processing the third image by adopting an edge detection algorithm to obtain an edge detection image of the target knob.
  8. 8. A knob angle determining device, comprising: an acquisition module for acquiring a first image including a target knob; a generation module for generating an edge detection image of the target knob based on the first image; The first determining module is used for determining a first inclination angle according to the edge detection image, wherein the first inclination angle is a line inclination angle with the largest occurrence frequency in the edge detection image; and the second determining module is used for determining the angle of the target knob according to the first inclination angle.
  9. 9. An electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, wherein execution of the computer program by the processor causes the electronic device to implement the method of any one of claims 1 to 7.
  10. 10. A computer readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, implements the method according to any one of claims 1 to 7.

Description

Method and device for determining knob angle, electronic equipment and storage medium Technical Field The present application relates to the field of image processing technologies, and in particular, to a method and apparatus for determining a knob angle, an electronic device, and a storage medium. Background In the wind power field, a plurality of knobs can be arranged on a pitch control cabinet, and pitch control modes and the like can be set through the knobs. The real-time accurate monitoring of the knob state (namely the knob angle) is related to whether the wind power system can run safely and reliably. At present, most of the knob angle is identified by taking photos regularly through the inspection robot and then identifying the photos through a manual observation mode, and the identification accuracy is high but the identification efficiency is low. The same technical problem exists with knobs on other types of control cabinets, such as power switch cabinets. Therefore, how to improve the recognition efficiency of the knob angle becomes a technical problem to be solved at present. Disclosure of Invention The embodiment of the application provides a method and a device for determining a knob angle, electronic equipment and a storage medium, which can improve the recognition efficiency of a target knob angle. In a first aspect, an embodiment of the present application provides a method for determining a knob angle, including obtaining a first image including a target knob, generating an edge detection image of the target knob based on the first image, determining a first inclination angle according to the edge detection image, where the first inclination angle is a line inclination angle with a maximum occurrence number in the edge detection image, and determining an angle of the target knob according to the first inclination angle. Optionally, the determining the angle of the target knob according to the first inclination angle includes determining a first weight coefficient matrix according to the first inclination angle and a gaussian covariance matrix, determining a saturation mean value and a color mean value of all pixel points in the first image according to saturation values, color brightness values and the first weight coefficient matrix of all pixel points in the first image, processing the first image according to the saturation mean value and the color brightness mean value of all pixel points in the first image to obtain a binarization sequence corresponding to the first image, and determining the angle of the target knob according to the binarization sequence corresponding to the first image. Optionally, the determining a first weight coefficient matrix according to the first inclination angle and the gaussian covariance matrix includes rotating Gao Sixie the variance matrix to the first inclination angle to obtain a first matrix, and normalizing the first matrix to obtain the first weight coefficient matrix. Optionally, before determining the saturation mean value and the color mean value of all the pixel points in the first image according to the saturation value, the color mean value and the first weight coefficient matrix of each pixel point in the first image, the method further includes obtaining a red channel value, a green channel value and a blue channel value of each pixel point in the first image, and determining the saturation value and the color mean value of each pixel point in the first image according to the red channel value, the green channel value and the blue channel value of each pixel point in the first image. Optionally, the processing the first image according to the saturation average value and the color brightness average value of all the pixel points in the first image to obtain a binarization sequence corresponding to the first image includes using the saturation average value and the color brightness average value as a screening threshold, screening the pixel points in the first image according to the saturation value and the color brightness value of each pixel point in the first image to determine a pixel point meeting a screening condition and a pixel point not meeting the screening condition, setting the brightness value of the pixel point meeting the screening condition as a first value, and setting the brightness value of the pixel point not meeting the screening condition as a second value to obtain the binarization sequence corresponding to the first image. Optionally, determining the angle of the target knob according to the binarization sequence corresponding to the first image includes performing corrosion operation on the binarization sequence to obtain a new binarization sequence, determining a maximum connected region in the new binarization sequence, and performing linear fitting operation on the maximum connected region to determine the angle of the target knob. Optionally, the generating the edge detection image of the target knob based on t