The method and device of warning lamp is opened in tunnel driving
Technical field
The present embodiments relate to automobile technical fields, and in particular to the method and dress of warning lamp are opened in a kind of tunnel driving
It puts.
Background technology
At present, automobile becomes one of main means of transport of people's trip.It is daily when driving, vehicle is inevitably
Meeting access tunnel, culvert etc..Driver drives when having just enter into tunnel, from light place at dark, due to dark adaptation phenomenon, and one
Start all not seeing Chu's surrounding, through the profile for just gradually seeing things clearly after a while.On the contrary, from dark place into from bright,
Also it is present with and does not see whatever in a flash, can just sees object after several seconds to tens seconds clearly.Therefore, driver is in access tunnel
When, it is necessary to warning lamp of calling a taxi, warn front vehicle.
Inventor has found that traditional vehicle is typically necessary driver and goes actively to open warning in the implementation of the present invention
Lamp, and if forgetting to open warning lamp, it easily collides with rear car, influences driving safety.
The content of the invention
In view of this, the embodiment of the present invention provides the method and device that warning lamp is opened in a kind of tunnel driving, in solution
The technical issues of stating.
The embodiment of the present invention provides a kind of method that warning lamp is opened in tunnel driving, comprises the following steps:Obtain vehicle
The image information in front;The first tunnel contour is extracted from described image information;When first tunnel contour and first make a reservation for
During outline, warning lamp is opened.
The embodiment of the present invention provides the device that warning lamp is opened in a kind of tunnel driving, including:Acquisition module, for obtaining
The image information of vehicle front;Extraction module, for extracting the first tunnel contour from described image information;Opening module is used
In when first tunnel contour is matched with the first predetermined profile, warning lamp is opened.
Tunnel provided in an embodiment of the present invention driving opens the method and device of warning lamp by the identification to vehicle image,
When the first tunnel contour identified is matched with predetermined tunnel contour, i.e., when vehicle enters tunnel, warning lamp is automatically opened, is carried
Front vehicle of waking up improves safety coefficient note that the generation of reduction security incident.
Description of the drawings
Fig. 1 is the flow chart that the method for warning lamp is opened in the tunnel driving of the embodiment of the present invention one.
Fig. 2 is the flow chart for the S130 that the method for warning lamp is opened in the tunnel driving of the embodiment of the present invention two.
Fig. 3 is the flow chart for the S120 that the method for warning lamp is opened in the tunnel driving of the embodiment of the present invention three.
Fig. 4 is the flow chart for the S330 that the method for warning lamp is opened in the tunnel driving of the embodiment of the present invention four.
Fig. 5 is the flow chart for the S120 that the method for warning lamp is opened in the tunnel driving of the embodiment of the present invention five.
Fig. 6 is the flow chart for the S130 that the method for warning lamp is opened in the tunnel driving of the embodiment of the present invention six.
Fig. 7 is the structure diagram that the device of warning lamp is opened in the tunnel driving of the embodiment of the present invention seven.
Fig. 8 is the hard of the electronic equipment for the method for performing tunnel driving unlatching warning lamp that the embodiment of the present invention 14 provides
Part structure diagram.
Specific embodiment
Below in conjunction with attached drawing and specific embodiment, technical scheme is described in detail.
Embodiment one
Fig. 1 shows that the flow chart of the method for warning lamp is opened in the tunnel driving of the embodiment of the present invention, comprises the following steps:
S110 obtains the image information of vehicle front;
In embodiments of the present invention, the collecting devices such as camera, automobile data recorder can be used and obtain vehicle front in real time
Image information.Collecting device can be arranged on the inside of vehicle, on rearview mirror, may also be arranged on the outside of vehicle, such as front
On wind glass.
S120 extracts the first tunnel contour from image information;
According to the difference of different zones light levels in image information, the first tunnel contour is obtained, for example, tunnel exit,
The brightness of tunnel intraoral illumination lamp is strong compared with brightness elsewhere, can extract the profile of bright areas, also can extract dark region
The profile in domain.For example, a wherein frame image information is carried out gray proces, become gray image.Then by gray image
Reverse phase processing is carried out, obtains reverse phase image.The color blend mode of reverse phase image is converted into color and gradually subtracts light, obtains subtracting light
Image.Then image of the brightness subtracted in light image less than predetermined luminance (such as 20 pixels) is removed again, obtains final image,
Extract the profile of final image.
S130 when first tunnel contour is matched with the first predetermined profile, opens warning lamp.
First predetermined profile can be arch, circle etc..When first tunnel contour is matched with the first predetermined profile, it can be used
Area, shape of profile etc. are matched.For example, the area of the area of profile and the first predetermined profile ratio is more than 80%, just recognize
For the outline of the two;The registration of shape is more than 70%, it is believed that the outline of the two.It is carried out at the same time area and shape
Match somebody with somebody, matched accuracy will be improved.Warning lamp can be clearance lamps, hazard warning lamp etc..
The method that warning lamp is opened in tunnel driving provided in an embodiment of the present invention works as identification by the identification to vehicle image
When the first tunnel contour gone out is matched with predetermined tunnel contour, i.e., when vehicle enters tunnel, warning lamp is automatically opened, reminds rear
Vehicle improves safety coefficient note that the generation of reduction security incident.
Embodiment two
On the basis of the embodiment of the present invention one, following improvement is done, as shown in Fig. 2, optionally, S130 includes:
S210 when first tunnel contour is matched with first predetermined profile, obtains the current position of vehicle and sits
Mark;
For example, the position of current vehicle can be positioned by global positioning system (GPS), obtain the current position of vehicle and sit
Mark.
S220 when the position coordinates is located in the coordinate domain in the tunnel, opens warning lamp.
For example, the current position coordinates of vehicle is (23.03,113.75), the tunnel coordinate domain of vehicle is:(23.00,
114.00), (23.10,114.00), (23.00,113.00), (23.10,113.00), 23.00 <, 23.03 < 23.10,
113.00 <, 113.75 < 114.0, then vehicle be located at tunnel internal, open warning lamp.
When first tunnel contour is matched with the first predetermined profile, if without the tunnel geographic position data or GPS
It can not position, be subject to the judgement for obtaining image mode.When obtaining the matching result of image mode with positioning result difference,
It is subject to the judgement for obtaining image mode.
Tunnel provided in an embodiment of the present invention driving opens the method for warning lamp by obtaining the position coordinates of current vehicle,
More accurately vehicle can be positioned, more accurately control the unlatching of warning lamp, to remind front vehicle note that reducing
The generation of security incident improves safety coefficient.
Embodiment three
On the basis of the embodiment of the present invention one or two, as shown in figure 3, optionally, S120 is realized as follows, tool
Body:
S310 carries out gray proces to image information, obtains the first gray level image;
For example, extracting a frame from the video that camera is shot, gray proces are carried out, obtain the first gray level image.
S320 in first gray level image, identifies the bright areas farthest apart from the current vehicle position;
It is bigger with the distance of the vehicle closer to the middle part of the first gray level image in the first gray level image.It is preferred that
Ground selects the bright areas at the positive middle part of gray level image, for example, using tunnel exit as bright areas, tunnel exit wheel profile
Shape is relatively more unified, is generally arch, convenient for extracting and comparing.
S330 extracts the profile of the bright areas, using bright areas profile as first tunnel contour.
For example, the contours extract of tunnel exit is come out, the shape of tunnel exit profile is arch, using arch as first
Tunnel contour.
The method that warning lamp is opened in tunnel driving provided in an embodiment of the present invention is used as bright areas, energy by tunnel exit
The enough efficiency for improving extraction tunnel contour, and tunnel exit change in shape is small, can reduce comparison difficulty, improves to specific efficiency,
So as to open warning lamp much sooner.
Example IV
On the basis of the embodiment of the present invention three, optionally, S330 can be realized in the following way, as shown in figure 4, tool
Body:
S410 detects any bright spot and the luminance difference of its all consecutive points in the bright areas;
For example, A points in bright areas, the luminance difference of all the points around A points and A points is detected.Also can choose eight around A points
Point on a direction, the luminance difference of detection A points and the consecutive points on this eight directions.
S420, if the luminance difference is respectively less than predetermined difference value, the bright spot is internal point;
If A points and luminance difference of all the points is both less than predetermined difference value around it, A points are internal point.It is for example, all
Luminance difference is 20,50,20 < 50 of predetermined difference value, then it is assumed that the A points are internal point, inside bright areas.If
Any consecutive points of surrounding and the luminance difference of A points are more than predetermined difference value, then it is assumed that the A points are boundary point.
All internal points are filled with background colour, the profile of the bright areas are extracted, by bright areas wheel by S430
Exterior feature is used as first tunnel contour.
All internal points are filled with background colour (such as black, grey), marginal point forms a profile, by the profile
It extracts, is exactly the profile of bright areas, using bright areas profile as first tunnel contour, with the first predetermined profile
It is compared.
The method that warning lamp is opened in tunnel provided in an embodiment of the present invention driving is by the bright spot detected in bright areas
No is internal point, then internal point is filled with background colour, can improve the extraction efficiency of tunnel contour.
Embodiment five
On the basis of the embodiment of the present invention one or two, as shown in figure 5, optionally, S120 is realized as follows, specifically
Ground:
S510 carries out gray proces to image information, obtains the second gray level image;
For example, extracting a frame from the video that automobile data recorder is shot, gray proces are carried out, obtain the second gray-scale map
Picture.
S520 in second gray level image, identifies the bright areas nearest apart from the current vehicle position;
The shorter position with the vehicle distances is the border of the second gray level image.Closer to the side of the second gray level image
Boundary illustrates nearer apart from vehicle.Due to tunnel internal, headlamp is both provided with.Apart from nearest bright of the current vehicle position
Bright area is the headlamp nearest apart from vehicle in front of current vehicle position.It is bright where headlamp in the second gray level image
Bright area is located at the top of the second gray level image.
S530 is identified apart from the minimum stain of the closest brightness of the bright areas;
For example, the headlamp nearest apart from vehicle is B, the brightness around B is detected, identifies the minimum stain of brightness, example
Such as stain C.
S540, the point on the basis of the stain, delineation and the dark area of the stain luminance difference within a predetermined range;
For example, the brightness value of stain C is 35, draw a circle to approve out dark area of the luminance difference of stain C within 15, i.e., it is dark
The scope of the brightness value of stain in region is 20-50.
S550 extracts the profile of the dark area, using dark area profile as the first tunnel contour.
For example, white will be filled with inside dark area, the profile of dark area is highlighted, inside is black for white
It is present with white contours line between dark areas and surrounding dark area, white contours line drawing is come out, is dark area wheel
It is wide.
The method of warning lamp is opened in tunnel provided in an embodiment of the present invention driving will be nearest apart from vehicle in gray level image
Headlamp is drawn a circle to approve dark area near headlamp, so as to extract dark area profile, can be obtained earlier as bright areas
Tunnel contour, so as to open warning lamp much sooner.
Embodiment six
On the basis of the embodiment of the present invention one, following improvement is done, as shown in Fig. 2, optionally, S130 includes:
S610 when first tunnel contour is matched with first predetermined profile, obtains the image after the predetermined time
Second tunnel contour of information;
For example, carrying out gray proces to the image information obtained after 2 seconds, the second tunnel contour is obtained.
S620 when second tunnel contour is matched with second predetermined profile, opens warning lamp.
For example, the second tunnel contour is semicircle, the matching of the second predetermined profile is also semicircle, and the matching rate of the two shape is
99%, more than 80%, then open warning lamp.
Tunnel provided in an embodiment of the present invention driving opens the method for warning lamp by obtaining the tunnel contour of different time
It is matched, warning lamp is opened when successful match, can will not cause bright light by the equidistant shorter tunnel in bridge opening
Variation need not open warning lamp when very big, so as to save cost.
Embodiment seven
Fig. 7 shows that the structure diagram of the device of warning lamp, bag are opened in tunnel driving provided in an embodiment of the present invention
It includes:
Acquisition module 710, for obtaining the image information of vehicle front;
Extraction module 720, for extracting the first tunnel contour from image information;
Opening module 730, for when first tunnel contour is matched with the first predetermined profile, opening warning lamp.
The device that warning lamp is opened in tunnel driving provided in an embodiment of the present invention works as identification by the identification to vehicle image
When the first tunnel contour gone out is matched with predetermined tunnel contour, warning lamp is automatically opened, reminds front vehicle note that reducing safety
The generation of accident improves safety coefficient.
Embodiment eight
Optionally, opening module is further used for:
When first tunnel contour is matched with first predetermined profile, the current position coordinates of vehicle is obtained;
When the position coordinates is located in the coordinate domain in the tunnel, warning lamp is opened.
Tunnel provided in an embodiment of the present invention driving opens the device of warning lamp by obtaining the position coordinates of current vehicle,
More accurately vehicle can be positioned, more accurately control the unlatching of warning lamp, to remind front vehicle note that reducing
The generation of security incident improves safety coefficient.
Embodiment nine
Optionally, extraction module further includes:
Processing unit for carrying out gray proces to image information, obtains the first gray level image;
Recognition unit, in first gray level image, identifying apart from farthest bright of the current vehicle position
Bright area;
Extraction unit, for extracting the profile of the bright areas, using bright areas profile as first tunnel wheel
It is wide.
The device that warning lamp is opened in tunnel driving provided in an embodiment of the present invention is used as bright areas, energy by tunnel exit
The enough efficiency for improving extraction tunnel contour, and tunnel exit change in shape is small, can reduce comparison difficulty, improves to specific efficiency,
So as to open warning lamp much sooner.
Embodiment ten
Optionally, extraction unit is further used for:
Detect any bright spot and the luminance difference of its all consecutive points in the bright areas;
If the luminance difference is respectively less than predetermined difference value, the bright spot is internal point;
All internal points are filled with background colour, the profile of the bright areas is extracted, bright areas profile is made
For first tunnel contour.
The device that warning lamp is opened in tunnel provided in an embodiment of the present invention driving is by the bright spot detected in bright areas
No is internal point, then internal point is filled with background colour, can improve the extraction efficiency of tunnel contour.
Embodiment 11
Optionally, extraction module is further used for:
Gray proces are carried out to image information, obtain the second gray level image;
In second gray level image, the bright areas nearest apart from the current vehicle position is identified;
It identifies apart from the minimum stain of the closest brightness of the bright areas;
The point on the basis of the stain, delineation and the dark area of the stain luminance difference within a predetermined range;
The profile of the dark area is extracted, using dark area profile as the first tunnel contour.
The device of warning lamp is opened in tunnel provided in an embodiment of the present invention driving will be nearest apart from vehicle in gray level image
Headlamp is drawn a circle to approve dark area near headlamp, so as to extract dark area profile, can be obtained earlier as bright areas
Tunnel contour, so as to open warning lamp much sooner.
Embodiment 12
Optionally, opening module is further used for:
When first tunnel contour is matched with first predetermined profile, the image information after the predetermined time is obtained
Second tunnel contour;
When second tunnel contour is matched with second predetermined profile, warning lamp is opened.
Tunnel provided in an embodiment of the present invention driving opens the device of warning lamp by obtaining the tunnel contour of different time
It is matched, warning lamp is opened when successful match, can will not cause bright light by the equidistant shorter tunnel in bridge opening
Variation need not open warning lamp when very big, so as to save cost.
Embodiment 13
An embodiment of the present invention provides a kind of computer storage media, the computer storage media is stored with computer can
It executes instruction, the side of warning lamp is opened in the tunnel driving which can perform in above-mentioned any means embodiment
Method.
Embodiment 14
Fig. 8 is the hardware knot of the electronic equipment for the method that warning lamp is opened in execution tunnel provided in an embodiment of the present invention driving
Structure schematic diagram, as shown in figure 8, the equipment includes:
Shown in one or more processors 10 and memory 20, in Fig. 8 by taking a processor 10 as an example.
Performing the equipment for the method that warning lamp is opened in tunnel driving can also include:Input unit 30 and output device 40.
Processor 10, memory 20, input unit 30 can be connected with output device 40 by bus or other modes,
In Fig. 8 exemplified by being connected by bus.
Memory 20 is used as a kind of non-volatile computer readable storage medium storing program for executing, available for storage non-volatile software journey
Sequence, non-volatile computer executable program and module, as the side of warning lamp is opened in the tunnel driving in the embodiment of the present invention
Corresponding program instruction/the module of method (for example, attached acquisition module shown in Fig. 7 710, extraction module 720 and opening module 730).
Processor 410 is stored in non-volatile software program, instruction and module in memory 20 by operation, so as to perform service
The method that warning lamp is opened in the driving of above method embodiment tunnel is realized in the various function application of device and data processing.
Memory 20 can include storing program area and storage data field, wherein, storing program area can storage program area,
At least one required application program of function;Storage data field can store to be driven a vehicle according to tunnel and open the device of warning lamp and make
With data created etc..In addition, memory 20 can include high-speed random access memory, non-volatile deposit can also be included
Reservoir, for example, at least a disk memory, flush memory device or other non-volatile solid state memory parts.In some implementations
In example, memory 20 is optional including compared with the remotely located memory of processor 10, these remote memories can pass through net
Network is connected to the device that warning lamp is opened in tunnel driving.The example of above-mentioned network include but not limited to internet, intranet,
LAN, mobile radio communication and combinations thereof.
Input unit 30 can receive input number or character information and generate with tunnel driving open warning lamp dress
The related key signals input of the user setting and function control put.Output device 40 may include the display devices such as display screen.
One or more of modules are stored in the memory 20, when by one or more of processors 10
During execution, the method that warning lamp is opened in the tunnel driving in above-mentioned any means embodiment is performed.
The said goods can perform the method that the embodiment of the present invention is provided, and possesses the corresponding function module of execution method and has
Beneficial effect.The not technical detail of detailed description in the present embodiment, reference can be made to the method that the embodiment of the present invention is provided.
The electronic equipment of the embodiment of the present invention exists in a variety of forms, includes but not limited to:
(1) mobile communication equipment:The characteristics of this kind equipment is that possess mobile communication function, and to provide speech, data
It communicates as main target.This Terminal Type includes:Smart mobile phone (such as iPhone), multimedia handset, functional mobile phone and low
Hold mobile phone etc..
(2) super mobile personal computer equipment:This kind equipment belongs to the scope of personal computer, there is calculating and processing work(
Can, generally also possess mobile Internet access characteristic.This Terminal Type includes:PDA, MID and UMPC equipment etc., such as iPad.
(3) portable entertainment device:This kind equipment can show and play multimedia content.The kind equipment includes:Audio,
Video player (such as iPod), handheld device, e-book and intelligent toy and portable car-mounted navigation equipment.
(4) server:The equipment for providing the service of calculating, the composition of server are total including processor, hard disk, memory, system
Line etc., server is similar with general computer architecture, but due to needing to provide highly reliable service, in processing energy
Power, stability, reliability, security, scalability, manageability etc. are more demanding.
(5) other have the function of the electronic device of data interaction.
Based on such understanding, part that technical scheme substantially in other words contributes to the prior art or
The part of person's technical solution can be embodied in the form of software product, which is stored in a storage
In medium, used including some instructions so that a mobile terminal (can be personal computer, server or the network equipment
Deng) perform all or part of the steps of the method according to each embodiment of the present invention.And foregoing storage medium includes:USB flash disk, movement
Hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access
Memory), the various media that can store program code such as magnetic disc or CD.
The apparatus embodiments described above are merely exemplary, wherein the unit illustrated as separating component can
To be or may not be physically separate, the component shown as unit may or may not be physics list
Member, you can be located at a place or can also be distributed in multiple network element.It can be selected according to the actual needs
In some or all of module realize the purpose of the embodiment of the present invention.Those of ordinary skill in the art are not paying wound
In the case of the work for the property made, you can to understand and implement.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment can
It is realized by the mode of software plus required general hardware platform, naturally it is also possible to pass through hardware realization.Based on such reason
Solution, above-mentioned technical proposal substantially in other words can be embodied the part that the prior art contributes in the form of software product
Come, which can store in a computer-readable storage medium, such as ROM/RAM, magnetic disc, CD, including
Some instructions are used so that computer equipment (can be personal computer, server or the network equipment etc.) perform it is each
Method described in some parts of a embodiment or embodiment.
Finally it should be noted that:Above example is only to illustrate the technical solution of the embodiment of the present invention rather than it is limited
System;Although the embodiment of the present invention is described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should
Understand:It can still modify to the technical solution recorded in foregoing embodiments or to which part technical characteristic
Carry out equivalent substitution;And these modifications or replacement, the essence of appropriate technical solution is not made to depart from various embodiments of the present invention skill
The spirit and scope of art scheme.