[go: up one dir, main page]

CN105893943B - Method and system for detecting oil level - Google Patents

Method and system for detecting oil level Download PDF

Info

Publication number
CN105893943B
CN105893943B CN201610187567.3A CN201610187567A CN105893943B CN 105893943 B CN105893943 B CN 105893943B CN 201610187567 A CN201610187567 A CN 201610187567A CN 105893943 B CN105893943 B CN 105893943B
Authority
CN
China
Prior art keywords
oil level
level gauge
image
response
straight line
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610187567.3A
Other languages
Chinese (zh)
Other versions
CN105893943A (en
Inventor
周开河
俞红生
吴笑
王晶
李琪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
State Grid Corp of China SGCC
Ningbo Power Supply Co of State Grid Zhejiang Electric Power Co Ltd
Original Assignee
State Grid Corp of China SGCC
Ningbo Power Supply Co of State Grid Zhejiang Electric Power Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by State Grid Corp of China SGCC, Ningbo Power Supply Co of State Grid Zhejiang Electric Power Co Ltd filed Critical State Grid Corp of China SGCC
Priority to CN201610187567.3A priority Critical patent/CN105893943B/en
Publication of CN105893943A publication Critical patent/CN105893943A/en
Application granted granted Critical
Publication of CN105893943B publication Critical patent/CN105893943B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/50Context or environment of the image
    • G06V20/52Surveillance or monitoring of activities, e.g. for recognising suspicious objects
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01FMEASURING VOLUME, VOLUME FLOW, MASS FLOW OR LIQUID LEVEL; METERING BY VOLUME
    • G01F23/00Indicating or measuring liquid level or level of fluent solid material, e.g. indicating in terms of volume or indicating by means of an alarm

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Fluid Mechanics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a kind of oil level detection method and system, according to the geometrical characteristic of the cursor line of oil level gauge and oil level gauge dial plate grayscale information characteristic distributions, Ha Er response computation is carried out to oil level gauge dial plate image, obtain Ha Er response diagram, since there is higher Ha Er response in cursor line region relative to non-pointer region, therefore the present invention counts the distribution of Ha Er response by histogram, and using the corresponding Ha Er response of the quantile for meeting preset requirement as threshold value, the Local modulus maxima in Ha Er response diagram is filtered out;And the method for passing through straight line fitting, using the maximum straight line of the sum of Ha Er response as the cursor line in oil level gauge dial plate image, finally according to the parameter information of cursor line and the calibration points of oil level gauge dial plate image tagged, the scale value that cursor line is directed toward in oil level gauge dial plate image is obtained.Therefore, the present invention has liberated manpower, reduces security risk.

Description

A kind of oil level detection method and system
Technical field
The present invention relates to oil level gauge technical fields, more specifically, being related to a kind of oil level detection method and system.
Background technique
Oil level gauge is a kind of instrument how many for the oil mass in displaying target fuel tank, by currently reading the oil level gauge Several monitoring can understand the oil liquid amount in target fuel tank in time, to prevent from causing equipment because the oil mass in target fuel tank is very few It is burned out or problem out of service.Therefore, to oil level gauge carry out Daily Round Check be in the artificial O&M of substation it is very important One of project.
Currently, mainly being detected by way of manual inspection to the instruction state of oil level list index.But passing through people There are inspection is dangerous and the problems such as routing inspection efficiency is low for work inspection.Therefore, how a kind of oil level detection method and system are provided Patrol task is completed, is those skilled in the art's technical problem urgently to be resolved to liberate manpower, reduce security risk.
Summary of the invention
In view of this, the present invention discloses a kind of oil level detection method and system, to realize while completing patrol task, Manpower is liberated, security risk is reduced.
A kind of oil level detection method, comprising:
Obtain oil level gauge image, according to the gradient angle descriptor information of oil level gauge dial plate, to the oil level gauge image into Row template-matching operation obtains oil level gauge dial plate image;
Ha Er response computation is carried out to the oil level gauge dial plate image and obtains the Ha Er response diagram of oil level gauge dial plate image;
Histogram information statistics is carried out to each Ha Er response in the Ha Er response diagram, finds the Kazakhstan of high numerical value The percentage of your response quantity Zhan Haer response total quantity is the quantile of preset percentage, and the quantile is corresponding Ha Er response is as threshold value;
Obtain each Local modulus maxima in the Ha Er response diagram;
Each initial straight is obtained using line fitting method to each Local modulus maxima, according to the threshold value to each The initial straight is fitted amendment, obtains one group of straight line, most by the sum of Ha Er response of pixel in each straight line Big straight line is as the cursor line in oil level gauge dial plate image;
Two different points of position in the cursor line are chosen, respectively as the first mark point and the second mark point;
On straight line that is perpendicular to the cursor line and passing through first mark point and Ha Er response is obtained to be greater than The number of the continuous image vegetarian refreshments of the threshold value, is denoted as N1;
On straight line that is perpendicular to the cursor line and passing through second mark point and Ha Er response is obtained to be greater than The number of the continuous image vegetarian refreshments of the threshold value, is denoted as N2;
The size for judging the N1 and N2, when the N1 is greater than N2, using first mark point as the starting point of pointer Position, using second mark point as the final position of pointer, when the N1 is less than N2, using first mark point as The final position of pointer, using second mark point as the start position of pointer;
According to the start position and the final position, the slope and intercept of the cursor line is calculated;
According to the training stage in advance in the calibration points of oil level gauge dial plate image tagged and the start position, the end Point position, the slope and the intercept, are calculated the scale value that the cursor line is directed toward in oil level gauge dial plate image.
Preferably, described that the Kazakhstan of oil level gauge dial plate image is obtained to oil level gauge dial plate image progress Ha Er response computation That response diagram, comprising:
The color of the oil level gauge dial plate image is converted into YCbCr color space from RGB color;
Difference Calculation is carried out using red color component value and luminance component, obtains corresponding color difference diagram;
Ha Er response computation is carried out to the color difference diagram, obtains the Ha Er response diagram of oil level gauge dial plate image.
Preferably, described that Ha Er response computation is carried out to the color difference diagram, obtain the Ha Er of oil level gauge dial plate image The process of response diagram includes:
Using predetermined angle as step-length, the color difference diagram is rotated, and to the color difference of each rotation angle Image is once traversed, and the Ha Er response of each pixel is calculated;
Successively choose maximum Ha Er response of each pixel under different rotary angle, and by the maximum Final Ha Er response of the Ha Er response as the pixel;
The final Ha Er response of each pixel is combined, the Ha Er response of oil level gauge dial plate image is formed Figure.
Preferably, the process for obtaining each Local modulus maxima in the Ha Er response diagram includes:
The Ha Er response diagram is traversed, the pixel that Ha Er response is greater than the threshold value is searched;
Successively in the local neighborhood of each pixel, judge whether the corresponding Ha Er response of the pixel is office Portion's maximum point;
If it is, pixel and Local modulus maxima are stored in the form of corresponding relationship.
Preferably, described that each initial straight is obtained using line fitting method to each Local modulus maxima, according to The threshold value is fitted amendment to each initial straight, obtains one group of straight line, by the Ha Er of pixel in each straight line The maximum straight line of the sum of response includes: as the process of the cursor line in oil level gauge dial plate image
Using random sampling unification algorism, from all Local modulus maximas, each optionally two of them local maximum Point carries out straight line fitting, obtains initial straight;
It is less than the Local modulus maxima of the threshold value using the remaining distance to the initial straight, to described initial straight Line is fitted amendment, obtains a candidate straight line;
After being traversed to the Local modulus maxima, all candidate straight line set are obtained comprising a plurality of candidate straight One group of straight line of line;
The sum of the Ha Er response of pixel on every straight line is successively calculated, and the sum of described Ha Er response is made For the confidence level of the straight line, and using the highest straight line of confidence level as the cursor line in oil level gauge dial plate image.
A kind of oil level detection system, comprising:
Dial plate image acquisition unit is believed for obtaining oil level gauge image according to the gradient angle descriptor of oil level gauge dial plate Breath carries out template-matching operation to the oil level gauge image, obtains oil level gauge dial plate image;
Ha Er response unit carries out Ha Er response computation for the oil level gauge dial plate image, obtains oil level gauge dial plate figure The Ha Er response diagram of picture;
Statistic unit is looked into for carrying out histogram information statistics to each Ha Er response in the Ha Er response diagram The percentage for finding the Ha Er response quantity Zhan Haer response total quantity of high numerical value is the quantile of preset percentage, by institute The corresponding Ha Er response of quantile is stated as threshold value;
Local modulus maxima acquiring unit, for obtaining each Local modulus maxima in the Ha Er response diagram;
Cursor line acquiring unit is each initial straight for being obtained to each Local modulus maxima using line fitting method Line is fitted amendment to each initial straight according to the threshold value, obtains one group of straight line, by pixel in each straight line The maximum straight line of the sum of Ha Er response as the cursor line in oil level gauge dial plate image;
Pointer position acquiring unit as first is marked respectively for choosing two different points of position in the cursor line Note point and the second mark point;On straight line that is perpendicular to the cursor line and passing through first mark point and Ha Er is obtained to ring The number of the continuous image vegetarian refreshments greater than the threshold value should be worth, be denoted as N1;It obtains perpendicular to the cursor line and passes through described the On the straight line of two mark points and Ha Er response is greater than the number of the continuous image vegetarian refreshments of the threshold value, is denoted as N2;Described in judgement The size of N1 and N2, using first mark point as the start position of pointer, described second is marked when the N1 is greater than N2 It final position of the note point as pointer, will using first mark point as the final position of pointer when the N1 is less than N2 Start position of second mark point as pointer;
First computing unit, for the cursor line to be calculated according to the start position and the final position Slope and intercept;
Second computing unit, for according to the training stage in advance in the calibration points of oil level gauge dial plate image tagged, Yi Jisuo Start position, the final position, the slope and the intercept are stated, the cursor line is calculated in oil level gauge dial plate image The scale value of middle direction.
Preferably, in above-mentioned oil level detection system, the Ha Er response unit, comprising:
Color conversion subunit, for the color of the oil level gauge dial plate image to be converted to YCbCr from RGB color Color space;
Difference diagram converting unit obtains corresponding face for carrying out Difference Calculation using red color component value and luminance component Color difference component;
Sub- response unit obtains oil level gauge dial plate image for carrying out Ha Er response computation to the color difference diagram Ha Er response diagram.
Preferably, in above-mentioned oil level detection system, the sub- response unit includes:
Ha Er response computing unit, for being rotated to the color difference diagram, and right using predetermined angle as step-length The color difference image of each rotation angle is once traversed, and the Ha Er response of each pixel is calculated;
Subelement is chosen, for successively choosing maximum Ha Er response of each pixel under different rotary angle Value, and using the maximum Ha Er response as the final Ha Er response of the pixel;
Subelement is combined, for the final Ha Er response of each pixel to be combined, forms oil level gauge dial plate The Ha Er response diagram of image.
Preferably, in above-mentioned oil level detection system, the Local modulus maxima acquiring unit includes:
Subelement is searched, for traversing the Ha Er response diagram, searches the pixel that Ha Er response is greater than the threshold value;
Judgment sub-unit, for successively in the local neighborhood of each pixel, judging the corresponding Kazakhstan of the pixel Whether your response is Local modulus maxima, if it is, executing storing sub-units;
The storing sub-units, for storing pixel and Local modulus maxima in the form of corresponding relationship.
Preferably, in above-mentioned oil level detection system, the cursor line acquiring unit includes:
Straight line fitting subelement, for using random sampling unification algorism, from all Local modulus maximas, every time optionally Two of them Local modulus maxima carries out straight line fitting, obtains initial straight;
Revise subelemen, for being less than the local maximum of the threshold value using the remaining distance to the initial straight Point is fitted amendment to the initial straight, obtains a candidate straight line;
Gather subelement, for after traversing to the Local modulus maxima, all candidate straight line set to obtain One group of straight line comprising a plurality of candidate straight line;
Cursor line obtains subelement, for successively calculating the sum of the Ha Er response of pixel on every straight line, and Confidence level by the sum of described Ha Er response as the straight line, and using the highest straight line of confidence level as oil level gauge dial plate image In cursor line.
It can be seen from the above technical scheme that the invention discloses a kind of oil level detection method and system, according to oil level The geometrical characteristic and oil level gauge dial plate grayscale information characteristic distributions of the cursor line of table carry out Ha Er response to oil level gauge dial plate image It calculates, obtains corresponding Ha Er response diagram, since there is higher Ha Er response in cursor line region relative to non-pointer region, because This, the present invention counts the distribution of Ha Er response by histogram, and the quantile for meeting preset requirement is corresponding Ha Er response filters out the Local modulus maxima in Ha Er response diagram as threshold value.Due in the set of Local modulus maxima It include some points as straight line fitting in cursor line, therefore, the present invention is by the method for straight line fitting, by Ha Er response The sum of maximum straight line as the cursor line in oil level gauge dial plate image, finally according to the start position of cursor line, final position, Slope, intercept and training stage obtain cursor line in oil level gauge dial plate in the calibration points of oil level gauge dial plate image tagged in advance The scale value being directed toward in image.As can be seen that the present invention is compared to existing technologies, collection in worksite number is removed without patrol officer According to, therefore reached while completing patrol task, manpower is liberated, the purpose of security risk is reduced.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this The embodiment of invention for those of ordinary skill in the art without creative efforts, can also basis Disclosed attached drawing obtains other attached drawings.
Fig. 1 is a kind of oil level detection method flow diagram disclosed by the embodiments of the present invention;
Fig. 2 is a kind of structural schematic diagram of oil level detection system disclosed by the embodiments of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
The embodiment of the invention discloses a kind of oil level detection method and system, to realize while completing patrol task, Manpower is liberated, security risk is reduced.
Basic scheme of the invention are as follows: demand is detected based on oil level gauge instruction state, it is first determined oil level gauge is in acquisition Position in oil level gauge image;Then after oil level table object determines, pointer line position is found within the scope of oil level gauge dial plate;Most Afterwards according to dial reading rule, the current instruction state of oil level gauge is calculated.
Concrete scheme is as follows:
Referring to Fig. 1, a kind of oil level detection method flow diagram disclosed by the embodiments of the present invention, comprising steps of
Step S10, Image Acquisition is carried out to target oil level gauge, using the image collected as oil level gauge image;
Step S11, according to the gradient angle descriptor information of oil level gauge dial plate, template is carried out to the oil level gauge image With operation, oil level gauge dial plate image is obtained;
Wherein, oil level gauge image is obtained using video camera.
Gradient angle descriptor is a kind of feature for describing image detail, is obtained in the training stage.
The acquisition process of gradient angle descriptor is specific as follows:
(1) training image of oil level gauge is obtained using video camera, and is obtained only from the training image comprising oil level gauge table The dial plate subject area of disk;
(2) apply for one piece and training image memory headroom of the same size, for storing the mould obtained according to training image Plate image (i.e. Mask figure), the template image are a black and white binary image, and white area indicates dial plate subject area, black region Other background areas other than domain representation dial plate subject area;
(3) it for dial plate subject area, presses from left to right, then sequence from top to bottom, successively calculates each pixel Thus gradient value and angle value obtain the gradient angle descriptor information of oil level gauge dial plate, and save into memory.
Step S12, Ha Er response computation is carried out to the oil level gauge dial plate image and obtains the Ha Er of oil level gauge dial plate image Response diagram;
It is covered it should be noted that the Lis Hartel in Ha Er response diagram levies (haar) You Haer template filled black region The difference of the sum of the pixel value that is covered with white filling region of the sum of pixel value sum (black) sum (white) indicate:
Sum (black)-sum (white) or sum (white)-sum (black).
Step S13, threshold value is obtained according to the Ha Er response diagram;
Specifically, carrying out histogram information statistics to each Ha Er response in the Ha Er response diagram, height is found The percentage of the Ha Er response quantity Zhan Haer response total quantity of numerical value is the quantile of preset percentage, by the quartile The corresponding Ha Er response of point is as threshold value;
Wherein, depending on the numerical value concrete foundation actual needs of preset percentage, such as 75%, the present invention does not limit herein It is fixed.
Step S14, each Local modulus maxima in the Ha Er response diagram is obtained;
It should be noted that step S13 and step S14 in practical implementation, do not fix sequencing, Ke Yixian Step S13 is executed, it is rear to execute step S14, or step S14 is first carried out, rear execution step S13 or two steps are held simultaneously Row.
Step S15, the cursor line in oil level gauge dial plate image is obtained according to Local modulus maxima and threshold value;
Specifically, each initial straight is obtained using line fitting method to each Local modulus maxima, according to described Threshold value is fitted amendment to each initial straight, obtains one group of straight line, and the Ha Er of pixel in each straight line is responded The maximum straight line of the sum of value is as the cursor line in oil level gauge dial plate image.
Step S16, start position and the final position of cursor line are obtained;
Specifically, obtaining the pixel for being greater than the threshold value perpendicular to the continuous and Ha Er response of the cursor line Number, using the position of the cursor line with most pixels as the start position of pointer, by the position with minimum pixel Final position as pointer;Or two different positions point in the cursor line is intercepted at random, it is denoted as the first mark point With the second mark point, on straight line that is perpendicular to the cursor line and passing through first mark point and Ha Er response is obtained Greater than the number of the continuous image vegetarian refreshments of the threshold value, it is denoted as N1;It obtains perpendicular to the cursor line and passes through second mark Remember that on the straight line selected and Ha Er response is greater than the number of the continuous image vegetarian refreshments of the threshold value, is denoted as N2;Judge the N1 and The size of N2, when the N1 is greater than N2, using first mark point as the start position of pointer, by second mark point It,, will be described using first mark point as the final position of pointer when the N1 is less than N2 as the final position of pointer Start position of second mark point as pointer.
Step S17, according to the start position and the final position, the slope of the cursor line is calculated and cuts Away from;
Step S18, according to the training stage in advance in the calibration points of oil level gauge dial plate image tagged and the parameter of cursor line The scale value that the cursor line is directed toward in oil level gauge dial plate image is calculated in information.
The parameter information of cursor line includes: start position, final position, slope and intercept.
Wherein, process of the training stage in oil level gauge dial plate image tagged calibration points are as follows: on the training image of oil level gauge The calibration points in dial plate are marked, and the position of each calibration points is recorded, then, according to the calibration points of label, are manually entered Corresponding scale value, and saved.
It in summary it can be seen, the present invention is according to the geometrical characteristic and oil level gauge dial plate grayscale information of the cursor line of oil level gauge point Cloth feature carries out Ha Er response computation to oil level gauge dial plate image, obtains corresponding Ha Er response diagram, and primary filtration background is dry It disturbs;Since there is higher Ha Er response in cursor line region relative to non-pointer region, the present invention is by histogram to Kazakhstan You are counted in the distribution of response, and using the corresponding Ha Er response of the quantile for meeting preset requirement as threshold value, screening Local modulus maxima in Ha Er response diagram out, further filter background interference;Due to including in the set of Local modulus maxima There are some points as straight line fitting in cursor line, therefore, the present invention is by the method for straight line fitting, by the sum of Ha Er response Maximum straight line as the cursor line in oil level gauge dial plate image, finally according to the start position of cursor line, final position, tiltedly Rate, intercept and training stage obtain cursor line in oil level gauge dial plate figure in the calibration points of oil level gauge dial plate image tagged in advance The scale value being directed toward as in.As can be seen that the present invention is compared to existing technologies, collection in worksite data are gone without patrol officer, Therefore reached while completing patrol task, liberated manpower, reduce the purpose of security risk.
Of course, it should be understood that if oil level is too low or when oil liquid cannot be replenished in time, may will affect equipment just It is often used, therefore, when oil level is too low, in order to make prompting in time to user, after the step S18, can also wrap It includes: judging whether cursor line scale value pointed in oil level gauge dial plate is greater than preset value, if not, outputting alarm is believed Number.
In order to further optimize the above embodiments, step S12 is specifically included:
It step S121, is that YCbCr color is empty from RGB (RGB) color space conversion by the color of oil level gauge dial plate image Between;
Wherein, YCbCr can be sometimes written as: YCBCR or Y'CBCR, be one kind of color space, it will usually be used for In image continuous processing or digital photographic systems in film.Y' is brightness (luma) ingredient of color and CB and CR are then Blue and red concentration excursion amount composition.Y' and Y are different, and Y is exactly so-called lumen, are indicated the concentration of light and are non- Linearly, using gamma-corrected (gamma correction) coded treatment.
Step S122, Difference Calculation is carried out using red color component value and luminance component, obtains corresponding color difference diagram;
Step S123, Ha Er response computation is carried out to the color difference diagram, the Ha Er for obtaining oil level gauge dial plate image is rung Ying Tu.
In order to further optimize the above embodiments, step S123 is specifically included:
Step S1231, using predetermined angle as step-length, the color difference diagram is rotated, and to each rotation angle Color difference image once traversed, the Ha Er response of each pixel is calculated;
Depending on the numerical value concrete foundation actual needs of the predetermined angle, such as 10 °.
It should be noted that the oil level list index of practical substation field may be directed toward any angle, refer in order to allow Needlework and Ha Er template matching, can rotate the color difference diagram, and using predetermined angle as step-length to each rotation angle The color difference image of degree is once traversed, and the Ha Er response of each pixel is calculated.
Step S1232, maximum Ha Er response of each pixel under different rotary angle is successively chosen, and Using the maximum Ha Er response as the final Ha Er response of the pixel;
Step S1233, the final Ha Er response of each pixel is combined, forms oil level gauge dial plate image Ha Er response diagram.
In order to further optimize the above embodiments, step S14 is specifically included:
Step S141, Ha Er response diagram is traversed, the pixel that Ha Er response is greater than threshold value is searched;
Step S142, successively in the local neighborhood of each pixel, judge the corresponding Ha Er response of the pixel Whether value is Local modulus maxima, if so, thening follow the steps S143;
Step S143, pixel and Local modulus maxima are stored in the form of corresponding relationship.
It should be noted that then excluding the pixel when the corresponding Ha Er response of pixel is not Local modulus maxima Point.
In order to further optimize the above embodiments, step S15 is specifically included:
Step S151, using random sampling unification algorism, from all Local modulus maximas, each optionally two of them office Portion's maximum point carries out straight line fitting, obtains initial straight;
Wherein, random sampling unification algorism (RANdom Sample Consensus, RANSAC) is a kind of according to one group of packet Sample data set containing abnormal data calculates the mathematical model parameter of data, obtains the algorithm of effective sample data.
The basic assumption of RANSAC algorithm is in sample comprising correct data (inliers, the number that can be described by model According to), also comprising abnormal data (outliers, deviation normal range (NR) is far, can not adapt to the data of mathematical model), i.e. data set In contain noise.These abnormal datas may be due to generations such as wrong measurement, the calculating of hypothesis, mistake of mistake.Together When RANSAC also assume that, give one group of correct data, there is the method that can calculate the model parameter for meeting these data.
Step S152, it is less than the Local modulus maxima of the threshold value using the remaining distance to the initial straight, it is right The initial straight is fitted amendment, obtains a candidate straight line;
Wherein, by judging whether Local modulus maxima is less than threshold value to the distance of initial straight, to judge the local pole Whether big value point is in initial straight.
Step S153, after being traversed to the Local modulus maxima, all candidate straight line set are obtained comprising more One group of straight line of item candidate's straight line;
Step S154, the sum of the Ha Er response of pixel on every straight line is successively calculated, and the Ha Er is rung It the sum of should be worth the confidence level as the straight line, and using the highest straight line of confidence level as the cursor line in oil level gauge dial plate image.
It in summary it can be seen, the present invention is according to the geometrical characteristic and oil level gauge dial plate grayscale information of the cursor line of oil level gauge point Cloth feature carries out Ha Er response computation to the oil level gauge dial plate after progress color space conversion, obtains corresponding Ha Er response diagram, Primary filtration background interference;Since there is higher Ha Er response in cursor line region relative to non-pointer region, the present invention The distribution of Ha Er response is counted by histogram, and by the corresponding Ha Er response of the quantile for meeting preset requirement As threshold value, the Local modulus maxima in Ha Er response diagram, further filter background interference are filtered out;Due to Local modulus maxima Set in include some points as straight line fitting in cursor line, therefore, the present invention will be breathed out by the method for straight line fitting The maximum straight line of the sum of your response as the cursor line in oil level gauge dial plate image, finally according to the start position of cursor line, Final position, slope, intercept and training stage obtain cursor line in oil in the calibration points of oil level gauge dial plate image tagged in advance The scale value being directed toward in the table dial plate image of position.As can be seen that the present invention is compared to existing technologies, scene is gone to without patrol officer Data are acquired, therefore have been reached while completing patrol task, manpower is liberated, reduces the purpose of security risk.
Corresponding with above method embodiment, the invention also discloses a kind of oil level detection systems.
Referring to fig. 2, the structural schematic diagram of a kind of oil level detection system disclosed by the embodiments of the present invention, comprising:
Dial plate image acquisition unit 21, for obtaining oil level gauge image, according to the gradient angle descriptor of oil level gauge dial plate Information carries out template-matching operation to the oil level gauge image, obtains oil level gauge dial plate image;
Wherein, oil level gauge image is obtained using video camera.
Gradient angle descriptor is a kind of feature for describing image detail, is obtained in the training stage.
The acquisition process of gradient angle descriptor is specific as follows:
(1) training image of oil level gauge is obtained using video camera, and is obtained only from the training image comprising oil level gauge table The dial plate subject area of disk;
(2) apply for one piece and training image memory headroom of the same size, for storing the mould obtained according to training image Plate image (i.e. Mask figure), the template image are a black and white binary image, and white area indicates dial plate subject area, black region Other background areas other than domain representation dial plate subject area;
(3) it for dial plate subject area, presses from left to right, then sequence from top to bottom, successively calculates each pixel Thus gradient value and angle value obtain the gradient angle descriptor information of oil level gauge dial plate, and save into memory.
Ha Er response unit 22 carries out Ha Er response computation for the oil level gauge dial plate image, obtains oil level gauge dial plate The Ha Er response diagram of image;
It is covered it should be noted that the Lis Hartel in Ha Er response diagram levies (haar) You Haer template filled black region The difference of the sum of the pixel value that is covered with white filling region of the sum of pixel value sum (black) sum (white) indicate:
Sum (black)-sum (white) or sum (white)-sum (black).
Statistic unit 23, for carrying out histogram information statistics to each Ha Er response in the Ha Er response diagram, The percentage for finding the Ha Er response quantity Zhan Haer response total quantity of high numerical value is the quantile of preset percentage, will The corresponding Ha Er response of the quantile is as threshold value;
Wherein, depending on the numerical value concrete foundation actual needs of preset percentage, such as 75%, the present invention does not limit herein It is fixed.
Local modulus maxima acquiring unit 24, for obtaining each Local modulus maxima in the Ha Er response diagram;
Cursor line acquiring unit 25, it is each initial for being obtained to each Local modulus maxima using line fitting method Straight line is fitted amendment to each initial straight according to the threshold value, obtains one group of straight line, by pixel in each straight line The maximum straight line of the sum of the Ha Er response of point is as the cursor line in oil level gauge dial plate image;
Pointer position acquiring unit 26, for being respectively for choosing two different points of position in the cursor line First mark point and the second mark point;Obtain perpendicular to the cursor line and pass through first mark point straight line on and Ha Er response is greater than the number of the continuous image vegetarian refreshments of the threshold value, is denoted as N1;It obtains perpendicular to the cursor line and passes through On the straight line of second mark point and Ha Er response is greater than the number of the continuous image vegetarian refreshments of the threshold value, is denoted as N2;Sentence The size of the N1 and N2 of breaking regard first mark point as the start position of pointer when the N1 is greater than N2, will described in Final position of second mark point as pointer, when the N1 is less than N2, using first mark point as the terminal of pointer Position, using second mark point as the start position of pointer or pointer position acquiring unit 26 for obtain perpendicular to The continuous and Ha Er response of the cursor line is greater than the number of the pixel of the threshold value, by the position with most pixels The start position as pointer is set, using the position with minimum pixel as the final position of pointer;
First computing unit 27, for the cursor line to be calculated according to the start position and the final position Slope and intercept;
Second computing unit 28, for according to the training stage in advance in the calibration points of oil level gauge dial plate image tagged, and The cursor line is calculated in oil level gauge dial plate figure in the start position, the final position, the slope and the intercept The scale value being directed toward as in.
Wherein, process of the training stage in oil level gauge dial plate image tagged calibration points are as follows: on the training image of oil level gauge The calibration points in dial plate are marked, and the position of each calibration points is recorded, then, according to the calibration points of label, are manually entered Corresponding scale value, and saved.
It in summary it can be seen, the present invention is according to the geometrical characteristic and oil level gauge dial plate grayscale information of the cursor line of oil level gauge point Cloth feature carries out Ha Er response computation to the oil level gauge dial plate after progress color space conversion, obtains corresponding Ha Er response diagram, Primary filtration background interference;Since there is higher Ha Er response in cursor line region relative to non-pointer region, the present invention The distribution of Ha Er response is counted by histogram, and by the corresponding Ha Er response of the quantile for meeting preset requirement As threshold value, the Local modulus maxima in Ha Er response diagram, further filter background interference are filtered out;Due to Local modulus maxima Set in include some points as straight line fitting in cursor line, therefore, the present invention will be breathed out by the method for straight line fitting The maximum straight line of the sum of your response as the cursor line in oil level gauge dial plate image, finally according to the start position of cursor line, Final position, slope, intercept and training stage obtain cursor line in oil in the calibration points of oil level gauge dial plate image tagged in advance The scale value being directed toward in the table dial plate image of position.As can be seen that the present invention is compared to existing technologies, scene is gone to without patrol officer Data are acquired, therefore have been reached while completing patrol task, manpower is liberated, reduces the purpose of security risk.
In order to further optimize the above embodiments, Ha Er response unit 22 includes:
Color conversion subunit 221, for being converted to the color of the oil level gauge dial plate image from RGB color YCbCr color space;
First computation subunit 222 obtains corresponding for carrying out Difference Calculation using red color component value and luminance component Color difference diagram;
Sub- response unit 223 obtains oil level gauge dial plate image for carrying out Ha Er response computation to the color difference diagram Ha Er response diagram.
In order to further optimize the above embodiments, sub- response unit 223 includes:
Second computation subunit 2231, for being rotated to the color difference diagram, and right using predetermined angle as step-length The color difference image of each rotation angle is once traversed, and the Ha Er response of each pixel is calculated;
Depending on the numerical value concrete foundation actual needs of predetermined angle, such as 10 °.
It should be noted that the oil level list index of practical substation field may be directed toward any angle, refer in order to allow Needlework and Ha Er template matching, can rotate the color difference diagram, and using predetermined angle as step-length to each rotation angle The color difference image of degree is once traversed, and the Ha Er response of each pixel is calculated.
Subelement 2232 is chosen, for successively choosing maximum Ha Er of each pixel under different rotary angle Response, and using the maximum Ha Er response as the final Ha Er response of the pixel;
Subelement 2233 is combined, for the final Ha Er response of each pixel to be combined, forms oil level gauge The Ha Er response diagram of dial plate image.
In order to further optimize the above embodiments, Local modulus maxima acquiring unit 24 includes:
Subelement 241 is searched, for traversing the Ha Er response diagram, searches the pixel that Ha Er response is greater than the threshold value Point;
Judgment sub-unit 242, for successively in the local neighborhood of each pixel, judging that the pixel is corresponding Whether Ha Er response is Local modulus maxima, if it is, executing storing sub-units 243;
Storing sub-units 243, for storing pixel and Local modulus maxima in the form of corresponding relationship.
It should be noted that then excluding the pixel when the corresponding Ha Er response of pixel is not Local modulus maxima Point.
In order to further optimize the above embodiments, cursor line acquiring unit 25 includes:
Straight line fitting subelement 251, for using random sampling unification algorism, from all Local modulus maximas, every time Optional two of them Local modulus maxima carries out straight line fitting, obtains initial straight;
Wherein, random sampling unification algorism (RANdom Sample Consensus, RANSAC) is a kind of according to one group of packet Sample data set containing abnormal data calculates the mathematical model parameter of data, obtains the algorithm of effective sample data.
The basic assumption of RANSAC algorithm is in sample comprising correct data (inliers, the number that can be described by model According to), also comprising abnormal data (outliers, deviation normal range (NR) is far, can not adapt to the data of mathematical model), i.e. data set In contain noise.These abnormal datas may be due to generations such as wrong measurement, the calculating of hypothesis, mistake of mistake.Together When RANSAC also assume that, give one group of correct data, there is the method that can calculate the model parameter for meeting these data.
Revise subelemen 252, for being less than the local pole of the threshold value using the remaining distance to the initial straight Big value point, is fitted amendment to the initial straight, obtains a candidate straight line;
Wherein, by judging whether Local modulus maxima is less than threshold value to the distance of initial straight, to judge the local pole Whether big value point is in initial straight.
Gather subelement 253, for after being traversed to the Local modulus maxima, by all candidate straight line set, Obtain one group of straight line comprising a plurality of candidate straight line;
Cursor line obtains subelement 254, for successively calculating the sum of the Ha Er response of pixel on every straight line, And the confidence level by the sum of described Ha Er response as the straight line, and using the highest straight line of confidence level as oil level gauge dial plate figure Cursor line as in.
It in summary it can be seen, the present invention is according to the geometrical characteristic and oil level gauge dial plate grayscale information of the cursor line of oil level gauge point Cloth feature carries out Ha Er response computation to the oil level gauge dial plate after progress color space conversion, obtains corresponding Ha Er response diagram, Primary filtration background interference;Since there is higher Ha Er response in cursor line region relative to non-pointer region, the present invention The distribution of Ha Er response is counted by histogram, and by the corresponding Ha Er response of the quantile for meeting preset requirement As threshold value, the Local modulus maxima in Ha Er response diagram, further filter background interference are filtered out;Due to Local modulus maxima Set in include some points as straight line fitting in cursor line, therefore, the present invention will be breathed out by the method for straight line fitting The maximum straight line of the sum of your response as the cursor line in oil level gauge dial plate image, finally according to the start position of cursor line, Final position, slope, intercept and training stage obtain cursor line in oil in the calibration points of oil level gauge dial plate image tagged in advance The scale value being directed toward in the table dial plate image of position.As can be seen that the present invention is compared to existing technologies, scene is gone to without patrol officer Data are acquired, therefore have been reached while completing patrol task, manpower is liberated, reduces the purpose of security risk.
It should be noted that the concrete operating principle of each component part refers to embodiment of the method pair in system embodiment Part is answered, details are not described herein again.
Finally, it is to be noted that, herein, relational terms such as first and second and the like be used merely to by One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning Covering non-exclusive inclusion, so that the process, method, article or equipment for including a series of elements not only includes that A little elements, but also including other elements that are not explicitly listed, or further include for this process, method, article or The intrinsic element of equipment.In the absence of more restrictions, the element limited by sentence "including a ...", is not arranged Except there is also other identical elements in the process, method, article or apparatus that includes the element.
Each embodiment in this specification is described in a progressive manner, the highlights of each of the examples are with other The difference of embodiment, the same or similar parts in each embodiment may refer to each other.
The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, as defined herein General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, of the invention It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one The widest scope of cause.

Claims (10)

1.一种油位检测方法,其特征在于,包括:1. an oil level detection method, is characterized in that, comprises: 对目标油位表进行图像采集,将采集得到的图像作为油位表图像;Image acquisition is performed on the target oil level gauge, and the acquired image is used as the oil level gauge image; 根据油位表表盘的梯度角度描述符信息,对所述油位表图像进行模板匹配操作,得到油位表表盘图像;According to the gradient angle descriptor information of the oil level gauge dial, a template matching operation is performed on the oil level gauge image to obtain an oil level gauge dial image; 对所述油位表表盘图像进行哈尔响应计算得到油位表表盘图像的哈尔响应图;Carrying out the Haar response calculation on the oil level gauge dial image to obtain the Haar response diagram of the oil level gauge dial image; 对所述哈尔响应图中的各个哈尔响应值进行直方图信息统计,查找到高数值的哈尔响应值数量占哈尔响应值总数量的百分比为预设百分比的分位点,将所述分位点对应的哈尔响应值作为阈值;The histogram information statistics are performed on each Haar response value in the Haar response graph, and the percentage of the number of Haar response values with high values to the total number of Haar response values is found to be the quantile of the preset percentage, and the percentage of all Haar response values is found. The Haar response value corresponding to the above quantile is used as the threshold; 获取所述哈尔响应图中的各个局部极大值点;Obtain each local maximum point in the Haar response graph; 对各所述局部极大值点采用直线拟合方法得到各个初始直线,根据所述阈值对各所述初始直线进行拟合修正,得到一组直线,将各所述直线中像素点的哈尔响应值之和最大的直线作为油位表表盘图像中的指针线;Each initial straight line is obtained by using a straight line fitting method for each of the local maximum points, and each initial straight line is fitted and corrected according to the threshold to obtain a set of straight lines, and the Hal of the pixel points in each of the straight lines is calculated. The straight line with the largest sum of response values is used as the pointer line in the oil level gauge dial image; 选取所述指针线上位置不同的两个点,分别即为第一标记点和第二标记点;Two points with different positions on the pointer line are selected, which are respectively the first marked point and the second marked point; 获取垂直于所述指针线的且穿过所述第一标记点的直线上的且哈尔响应值大于所述阈值的连续像素点的个数,记为N1;Obtain the number of consecutive pixels whose Haar response value is greater than the threshold on the straight line perpendicular to the pointer line and passing through the first marked point, denoted as N1; 获取垂直于所述指针线的且穿过所述第二标记点的直线上的且哈尔响应值大于所述阈值的连续像素点的个数,记为N2;Obtain the number of consecutive pixels whose Haar response value is greater than the threshold on the straight line perpendicular to the pointer line and passing through the second marker point, denoted as N2; 判断所述N1和N2的大小,当所述N1大于N2时,将所述第一标记点作为指针的起点位置,将所述第二标记点作为指针的终点位置,当所述N1小于N2时,将所述第一标记点作为指针的终点位置,将所述第二标记点作为指针的起点位置;Judging the sizes of N1 and N2, when N1 is greater than N2, the first mark is used as the starting point of the pointer, and the second mark is used as the end position of the pointer, when N1 is smaller than N2 , taking the first mark point as the end position of the pointer, and taking the second mark point as the starting point position of the pointer; 根据所述起点位置和所述终点位置,计算得到所述指针线的斜率和截距;Calculate the slope and intercept of the pointer line according to the starting point position and the ending point position; 根据训练阶段预先在油位表表盘图像标记的刻度点,以及所述起点位置、所述终点位置、所述斜率和所述截距,计算得到所述指针线在油位表表盘图像中指向的刻度值;According to the scale points marked on the oil level gauge dial image in advance in the training phase, as well as the starting position, the end position, the slope and the intercept, it is calculated that the pointer line points to the oil level gauge dial image. scale value; 所述梯度角度描述符信息的获取过程包括:The acquisition process of the gradient angle descriptor information includes: 利用摄像机获取油位表的训练图像,并从所述训练图像中获取仅包含油位表表盘的表盘对象区域;Use a camera to obtain a training image of the oil level gauge, and obtain a dial object area that only includes the dial of the oil level gauge from the training image; 申请一块和所述训练图像大小一致的内存空间,用于存放根据所述训练图像得到的模板图像,所述模板图像为一张黑白二值图像,白色区域表示表盘对象区域,黑色区域表示表盘对象区域以外的其他背景区域;Apply for a memory space with the same size as the training image for storing the template image obtained according to the training image, the template image is a black and white binary image, the white area represents the dial object area, and the black area represents the dial object other background areas outside the area; 对于所述表盘对象区域,按从左到右,再从上到下的顺序,依次计算每个像素点的梯度值和角度值,由此获取油位表表盘的梯度角度描述符信息,并保存至内存中。For the dial object area, the gradient value and the angle value of each pixel point are calculated in order from left to right, and then from top to bottom, so as to obtain the gradient angle descriptor information of the oil level gauge dial, and save it into memory. 2.根据权利要求1所述的油位检测方法,其特征在于,所述对所述油位表表盘图像进行哈尔响应计算得到油位表表盘图像的哈尔响应图,包括:2. oil level detection method according to claim 1, is characterized in that, described carrying out Haar response calculation to described oil level gauge dial image to obtain the Haar response diagram of oil level gauge dial image, comprising: 将所述油位表表盘图像的颜色从RGB颜色空间转换为YCbCr颜色空间;converting the color of the oil level gauge dial image from the RGB color space to the YCbCr color space; 利用红色分量值与亮度分量进行差分计算,得到对应的颜色差分图;Use the red component value and the brightness component to perform differential calculation to obtain the corresponding color difference map; 对所述颜色差分图进行哈尔响应计算,得到油位表表盘图像的哈尔响应图。The Haar response calculation is performed on the color difference map to obtain the Haar response map of the dial image of the oil level gauge. 3.根据权利要求2所述的油位检测方法,其特征在于,所述对所述颜色差分图进行哈尔响应计算,得到油位表表盘图像的哈尔响应图的过程包括:3. oil level detection method according to claim 2, is characterized in that, described carrying out Haar response calculation to described color difference graph, the process that obtains the Haar response diagram of oil level gauge dial image comprises: 以预设角度为步长,对所述颜色差分图进行旋转,并对每个旋转角度的颜色差分图像进行一次遍历,计算得到各个像素点的哈尔响应值;Taking the preset angle as the step, rotating the color difference image, and traversing the color difference image of each rotation angle once, and calculating the Haar response value of each pixel point; 依次选取每个所述像素点在不同旋转角度下的最大的哈尔响应值,并将所述最大的哈尔响应值作为该像素点的最终哈尔响应值;Select successively the maximum Haar response value of each described pixel point under different rotation angles, and use the maximum Haar response value as the final Haar response value of this pixel point; 将各所述像素点的最终哈尔响应值进行组合,形成油位表表盘图像的哈尔响应图。The final Haar response values of each of the pixel points are combined to form a Haar response map of the oil level gauge dial image. 4.根据权利要求1所述的油位检测方法,其特征在于,所述获取所述哈尔响应图中的各个局部极大值点的过程包括:4. The oil level detection method according to claim 1, wherein the process of obtaining each local maximum point in the Haar response graph comprises: 遍历所述哈尔响应图,查找哈尔响应值大于所述阈值的像素点;Traverse the Haar response graph to find pixels whose Haar response value is greater than the threshold; 依次在每个所述像素点的局部邻域内,判断该像素点对应的哈尔响应值是否为局部极大值点;In the local neighborhood of each pixel point in turn, determine whether the Haar response value corresponding to the pixel point is a local maximum point; 如果是,则将像素点和局部极大值点以对应关系的形式进行存储。If yes, store the pixel point and the local maximum point in the form of correspondence. 5.根据权利要求1所述的油位检测方法,其特征在于,所述对各所述局部极大值点采用直线拟合方法得到各个初始直线,根据所述阈值对各所述初始直线进行拟合修正,得到一组直线,将各所述直线中像素点的哈尔响应值之和最大的直线作为油位表表盘图像中的指针线的过程包括:5 . The oil level detection method according to claim 1 , wherein each initial straight line is obtained by adopting a straight line fitting method for each of the local maximum points, and each initial straight line is performed according to the threshold. 6 . The process of fitting and correcting to obtain a set of straight lines, and using the straight line with the largest sum of the Haar response values of the pixels in each of the straight lines as the pointer line in the dial image of the oil level gauge includes: 采用随机抽样一致算法,从所有局部极大值点中,每次任选其中两个局部极大值点进行直线拟合,得到初始直线;Using the random sampling consensus algorithm, from all the local maximum points, choose two of the local maximum points for straight line fitting each time, and obtain the initial straight line; 利用剩余的到所述初始直线的距离小于所述阈值的局部极大值点,对所述初始直线进行拟合修正,得到一条候选直线;Using the remaining local maximum points whose distances to the initial straight line are less than the threshold value, the initial straight line is fitted and corrected to obtain a candidate straight line; 在对所述局部极大值点遍历结束后,将所有候选直线集合,得到包含多条候选直线的一组直线;After the traversal of the local maximum point is completed, all candidate straight lines are assembled to obtain a set of straight lines including a plurality of candidate straight lines; 依次计算每条所述直线上像素点的哈尔响应值之和,并将所述哈尔响应值之和作为该直线的置信度,并将置信度最高的直线作为油位表表盘图像中的指针线。Calculate the sum of the Haar response values of the pixels on each of the straight lines in turn, and use the sum of the Haar response values as the confidence of the straight line, and use the straight line with the highest confidence as the oil level gauge dial image. pointer line. 6.一种油位检测系统,其特征在于,包括:6. An oil level detection system, characterized in that, comprising: 表盘图像获取单元,用于获取油位表图像,根据油位表表盘的梯度角度描述符信息,对所述油位表图像进行模板匹配操作,得到油位表表盘图像;a dial image acquisition unit, configured to acquire an oil level gauge image, and perform a template matching operation on the oil level gauge image according to the gradient angle descriptor information of the oil level gauge dial to obtain an oil level gauge dial image; 哈尔响应单元,用于所述油位表表盘图像进行哈尔响应计算,得到油位表表盘图像的哈尔响应图;a Haar response unit, used for calculating the Haar response of the oil level gauge dial image to obtain a Haar response diagram of the oil level gauge dial image; 统计单元,用于对所述哈尔响应图中的各个哈尔响应值进行直方图信息统计,查找到高数值的哈尔响应值数量占哈尔响应值总数量的百分比为预设百分比的分位点,将所述分位点对应的哈尔响应值作为阈值;The statistical unit is used to perform histogram information statistics on each Haar response value in the Haar response graph, and find that the percentage of the number of Haar response values with high numerical values to the total number of Haar response values is the fraction of the preset percentage. site, the Hal response value corresponding to the quantile is used as the threshold; 局部极大值点获取单元,用于获取所述哈尔响应图中的各个局部极大值点;a local maximum point acquiring unit, used for acquiring each local maximum point in the Haar response graph; 指针线获取单元,用于对各所述局部极大值点采用直线拟合方法得到各个初始直线,根据所述阈值对各所述初始直线进行拟合修正,得到一组直线,将各所述直线中像素点的哈尔响应值之和最大的直线作为油位表表盘图像中的指针线;The pointer line acquisition unit is used to obtain each initial straight line by using a straight line fitting method for each of the local maximum points, and to perform fitting and correction on each of the initial straight lines according to the threshold to obtain a set of straight lines, and each of the described The straight line with the largest sum of the Haar response values of the pixels in the straight line is used as the pointer line in the image of the oil level gauge dial; 指针位置获取单元,用于选取所述指针线上位置不同的两个点,分别即为第一标记点和第二标记点;获取垂直于所述指针线的且穿过所述第一标记点的直线上的且哈尔响应值大于所述阈值的连续像素点的个数,记为N1;获取垂直于所述指针线的且穿过所述第二标记点的直线上的且哈尔响应值大于所述阈值的连续像素点的个数,记为N2;判断所述N1和N2的大小,当所述N1大于N2时,将所述第一标记点作为指针的起点位置,将所述第二标记点作为指针的终点位置,当所述N1小于N2时,将所述第一标记点作为指针的终点位置,将所述第二标记点作为指针的起点位置;a pointer position acquisition unit, used to select two points with different positions on the pointer line, namely the first marked point and the second marked point; acquire the points perpendicular to the pointer line and passing through the first marked point The number of consecutive pixels on the straight line with the Haar response value greater than the threshold, denoted as N1; obtain the Haar response on the straight line perpendicular to the pointer line and passing through the second marked point The number of consecutive pixels whose value is greater than the threshold is denoted as N2; the size of N1 and N2 is judged, and when N1 is greater than N2, the first marker is used as the starting point of the pointer, and the The second mark point is used as the end position of the pointer, when the N1 is less than N2, the first mark point is used as the end position of the pointer, and the second mark point is used as the start point position of the pointer; 第一计算单元,用于根据所述起点位置和所述终点位置,计算得到所述指针线的斜率和截距;a first calculation unit, configured to calculate the slope and intercept of the pointer line according to the start point position and the end point position; 第二计算单元,用于根据训练阶段预先在油位表表盘图像标记的刻度点,以及所述起点位置、所述终点位置、所述斜率和所述截距,计算得到所述指针线在油位表表盘图像中指向的刻度值;The second calculation unit is configured to calculate the oil level of the pointer line according to the scale points marked on the oil level gauge dial image in advance in the training phase, the starting point position, the ending point position, the slope and the intercept. The scale value pointed to in the bit table dial image; 所述梯度角度描述符信息的获取过程包括:The acquisition process of the gradient angle descriptor information includes: 利用摄像机获取油位表的训练图像,并从所述训练图像中获取仅包含油位表表盘的表盘对象区域;Use a camera to obtain a training image of the oil level gauge, and obtain a dial object area that only includes the dial of the oil level gauge from the training image; 申请一块和所述训练图像大小一致的内存空间,用于存放根据所述训练图像得到的模板图像,所述模板图像为一张黑白二值图像,白色区域表示表盘对象区域,黑色区域表示表盘对象区域以外的其他背景区域;Apply for a memory space with the same size as the training image for storing the template image obtained according to the training image, the template image is a black and white binary image, the white area represents the dial object area, and the black area represents the dial object other background areas outside the area; 对于所述表盘对象区域,按从左到右,再从上到下的顺序,依次计算每个像素点的梯度值和角度值,由此获取油位表表盘的梯度角度描述符信息,并保存至内存中。For the dial object area, the gradient value and the angle value of each pixel point are calculated in order from left to right, and then from top to bottom, so as to obtain the gradient angle descriptor information of the oil level gauge dial, and save it into memory. 7.根据权利要求6所述的油位检测系统,其特征在于,所述哈尔响应单元,包括:7. The oil level detection system according to claim 6, wherein the Hal response unit comprises: 颜色转换子单元,用于将所述油位表表盘图像的颜色从RGB颜色空间转换为YCbCr颜色空间;The color conversion subunit is used to convert the color of the oil level gauge dial image from the RGB color space to the YCbCr color space; 差分图转换单元,用于利用红色分量值与亮度分量进行差分计算,得到对应的颜色差分图;The difference map conversion unit is used to perform differential calculation using the red component value and the luminance component to obtain a corresponding color difference map; 子响应单元,用于对所述颜色差分图进行哈尔响应计算,得到油位表表盘图像的哈尔响应图。The sub-response unit is used for calculating the Haar response of the color difference map to obtain the Haar response map of the dial image of the oil level gauge. 8.根据权利要求7所述的油位检测系统,其特征在于,所述子响应单元包括:8. The oil level detection system according to claim 7, wherein the sub-response unit comprises: 哈尔响应值计算单元,用于以预设角度为步长,对所述颜色差分图进行旋转,并对每个旋转角度的颜色差分图像进行一次遍历,计算得到各个像素点的哈尔响应值;The Haar response value calculation unit is used to rotate the color difference image by taking the preset angle as the step size, and traverse the color difference image of each rotation angle once, and calculate the Haar response value of each pixel point ; 选取子单元,用于依次选取每个所述像素点在不同旋转角度下的最大的哈尔响应值,并将所述最大的哈尔响应值作为该像素点的最终哈尔响应值;Selecting a subunit, for successively selecting the maximum Haar response value of each described pixel point under different rotation angles, and using the maximum Haer response value as the final Haar response value of this pixel point; 组合子单元,用于将各所述像素点的最终哈尔响应值进行组合,形成油位表表盘图像的哈尔响应图。The combining subunit is used to combine the final Haar response values of the pixel points to form a Haar response map of the oil level gauge dial image. 9.根据权利要求6所述的油位检测系统,其特征在于,所述局部极大值点获取单元包括:9. The oil level detection system according to claim 6, wherein the local maximum point acquiring unit comprises: 查找子单元,用于遍历所述哈尔响应图,查找哈尔响应值大于所述阈值的像素点;Finding subunits, for traversing the Haar response graph, looking for pixels whose Haar response value is greater than the threshold; 判断子单元,用于依次在每个所述像素点的局部邻域内,判断该像素点对应的哈尔响应值是否为局部极大值点,如果是,则执行存储子单元;Judging subunit, for sequentially in the local neighborhood of each described pixel point, to judge whether the Haar response value corresponding to this pixel point is a local maximum point, if so, then execute the storage subunit; 所述存储子单元,用于将像素点和局部极大值点以对应关系的形式进行存储。The storage subunit is used to store the pixel point and the local maximum point in the form of a corresponding relationship. 10.根据权利要求6所述的油位检测系统,其特征在于,所述指针线获取单元包括:10. The oil level detection system according to claim 6, wherein the pointer line acquisition unit comprises: 直线拟合子单元,用于采用随机抽样一致算法,从所有局部极大值点中,每次任选其中两个局部极大值点进行直线拟合,得到初始直线;The straight line fitting subunit is used to adopt the random sampling consensus algorithm to perform straight line fitting from all the local maxima points and select two of them at a time to obtain the initial straight line; 修正子单元,用于利用剩余的到所述初始直线的距离小于所述阈值的局部极大值点,对所述初始直线进行拟合修正,得到一条候选直线;A correction subunit, configured to use the remaining local maximum points whose distances to the initial straight line are less than the threshold value to perform fitting and correction on the initial straight line to obtain a candidate straight line; 集合子单元,用于在对所述局部极大值点遍历结束后,将所有候选直线集合,得到包含多条候选直线的一组直线;a set subunit, used for collecting all candidate straight lines after traversing the local maximum point to obtain a set of straight lines including a plurality of candidate straight lines; 指针线获取子单元,用于依次计算每条所述直线上像素点的哈尔响应值之和,并将所述哈尔响应值之和作为该直线的置信度,并将置信度最高的直线作为油位表表盘图像中的指针线。The pointer line acquisition subunit is used to sequentially calculate the sum of the Haar response values of the pixels on each of the straight lines, and use the sum of the Haar response values as the confidence of the straight line, and use the straight line with the highest confidence As the pointer line in the oil level gauge dial image.
CN201610187567.3A 2016-03-28 2016-03-28 Method and system for detecting oil level Active CN105893943B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610187567.3A CN105893943B (en) 2016-03-28 2016-03-28 Method and system for detecting oil level

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610187567.3A CN105893943B (en) 2016-03-28 2016-03-28 Method and system for detecting oil level

Publications (2)

Publication Number Publication Date
CN105893943A CN105893943A (en) 2016-08-24
CN105893943B true CN105893943B (en) 2019-05-07

Family

ID=57014036

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610187567.3A Active CN105893943B (en) 2016-03-28 2016-03-28 Method and system for detecting oil level

Country Status (1)

Country Link
CN (1) CN105893943B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107895365B (en) * 2017-11-01 2020-08-18 国网山东省电力公司电力科学研究院 Image matching method and monitoring system for power transmission channel external damage protection
CN111272256B (en) * 2020-01-15 2021-05-18 南京智鹤电子科技有限公司 Data processing method and device for oil level abnormity monitoring
CN113483849B (en) * 2021-07-01 2023-10-17 上海申瑞继保电气有限公司 Dynamic monitoring method for liquid level of transformer

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101620268A (en) * 2008-06-30 2010-01-06 巨鸥科技股份有限公司 Remote tracking system and method thereof
CN103759758A (en) * 2014-01-26 2014-04-30 哈尔滨工业大学 Method for detecting position of automobile meter needle based on mechanical angle and scale identification

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101620268A (en) * 2008-06-30 2010-01-06 巨鸥科技股份有限公司 Remote tracking system and method thereof
CN103759758A (en) * 2014-01-26 2014-04-30 哈尔滨工业大学 Method for detecting position of automobile meter needle based on mechanical angle and scale identification

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于CANNY算子的自适应双阈值油罐油位红外成像检测;李滚;《电子测量与仪器学报》;20090930;第44-50页
基于图像处理的罐体液位检测方法的研究;杨秀君;《中国优秀硕士学位论文全文数据库信息科技辑》;20100115;I140-231

Also Published As

Publication number Publication date
CN105893943A (en) 2016-08-24

Similar Documents

Publication Publication Date Title
CN105869164A (en) Method and system for detecting on/off state of switch
US11587337B2 (en) Intelligent image segmentation prior to optical character recognition (OCR)
JP6336117B2 (en) Building height calculation method, apparatus and storage medium
CN112926685A (en) Industrial steel oxidation zone target detection method, system and equipment
CN105893943B (en) Method and system for detecting oil level
CN109447186A (en) Clustering method and Related product
WO2021082428A1 (en) Semi-supervised learning-based image classification method and apparatus, and computer device
JP2018017570A (en) Rock mass strength determination device, rock mass strength determination method, and rock mass strength determination program
CN108470195A (en) Video identity management method and device
WO2016199662A1 (en) Image information processing system
CN107909544B (en) Image correction method and system
CN110136196B (en) Automatic bridge crack width measuring method
CN111044149A (en) Method and device for detecting temperature abnormal point of voltage transformer and readable storage medium
CN105893938A (en) Oil temperature gauge reading method and system
CN105095181A (en) Spam comment detection method and device
CN106157298B (en) A kind of circle detection method based on straightway
WO2016062259A1 (en) Transparency-based matting method and device
CN114140747B (en) Detection method of objects placed on the ground in elevators in multiple scenarios
CN109724993A (en) Detection method, device and the storage medium of the degree of image recognition apparatus
CN109447902A (en) A kind of image split-joint method, device, storage medium and equipment
CN107018380B (en) A method and device for detecting the effectiveness of a preset position of a camera
CN105102607A (en) Image processing device, program, storage medium, and image processing method
CN118982650A (en) A state detection method, device and electronic equipment of a power supply lightning arrester
CN114235815A (en) Method for detecting surface defects of outdoor electrical equipment of converter station based on scene filtering
CN105868763A (en) Method and system for reading oil gauge

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant