WO2020140610A1 - Image processing method and device, and computer-readable storage medium - Google Patents

Image processing method and device, and computer-readable storage medium Download PDF

Info

Publication number
WO2020140610A1
WO2020140610A1 PCT/CN2019/116989 CN2019116989W WO2020140610A1 WO 2020140610 A1 WO2020140610 A1 WO 2020140610A1 CN 2019116989 W CN2019116989 W CN 2019116989W WO 2020140610 A1 WO2020140610 A1 WO 2020140610A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
vehicle
vin code
license plate
type
Prior art date
Application number
PCT/CN2019/116989
Other languages
French (fr)
Chinese (zh)
Inventor
林春伟
马进
王健宗
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020140610A1 publication Critical patent/WO2020140610A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/24Aligning, centring, orientation detection or correction of the image

Definitions

  • the present application relates to the field of image processing technology, and in particular, to an image processing method, device, and computer-readable storage medium.
  • vehicle license plate or vehicle identification number Vehicle Identification Number, vin
  • vehicle identification Number Vehicle Identification Number
  • Embodiments of the present application provide an image processing method, device, and computer-readable storage medium, which help to improve the recognition efficiency of a vin code or license plate of a vehicle image.
  • an embodiment of the present application provides an image processing method, including:
  • the vehicle image is a vin code image or a license plate image
  • the vin code image is an image including a vin code area of the vehicle
  • the license plate image is an image including a vehicle license plate area
  • the type of the vehicle image is a vin code image type or a license plate image type
  • the type of the vehicle image is a vin code image type
  • the license plate image is processed according to a preset license plate image processing rule to obtain the license plate of the vehicle.
  • an embodiment of the present application provides an image processing device including an unit for performing the method of the first aspect described above.
  • an embodiment of the present application provides another image processing device, including a processor and a memory, where the processor and the memory are connected to each other, wherein the memory is used to store a computer program that supports the image processing device to execute the above method
  • the computer program includes program instructions, and the processor is configured to call the program instructions to perform the method of the first aspect.
  • the image processing device may further include a user interface and/or a communication interface.
  • an embodiment of the present application provides a computer non-volatile readable storage medium, where the computer non-volatile readable storage medium stores a computer program, the computer program includes program instructions, and the program instructions When executed by a processor, the processor is caused to perform the method of the first aspect described above.
  • the embodiment of the present application can obtain the vehicle image and identify the type of the vehicle image according to a preset recognition rule, that is, determine whether the vehicle image is a vin code image or a license plate image, and then select the corresponding image according to the recognized type Processing rules to process the vehicle image to obtain the vin code or license plate included in the vehicle image, which improves the flexibility of image processing, helps to improve the recognition efficiency of the vin code or license plate of the vehicle image, and improves Image processing effect.
  • a preset recognition rule that is, determine whether the vehicle image is a vin code image or a license plate image
  • FIG. 1 is a schematic flowchart of an image processing method provided by an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of another image processing method provided by an embodiment of the present application.
  • FIG. 3 is a schematic structural diagram of an image processing device provided by an embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of another image processing device provided by an embodiment of the present application.
  • the technical solution of the present application may be applied to an image processing device, which may include various terminals, servers, or other devices, for processing an image, such as extracting a vin code area in an image, identifying a vin code in an image and many more.
  • the terminal involved in this application may be a mobile phone, computer, tablet, personal computer, smart watch, etc. This application is not limited.
  • This application can identify whether the acquired vehicle image is a vin code image or a license plate image, and then can select the corresponding image processing rule to perform image processing on the vehicle image according to the recognized result to obtain the vin code or the vin code included in the vehicle image
  • the license plate which increases the flexibility of image processing, helps to improve the recognition efficiency of the vin code or license plate of the vehicle image and the effect of image processing.
  • FIG. 1 is a schematic flowchart of an image processing method according to an embodiment of the present application. Specifically, the method of this embodiment may be specifically applied to the above-mentioned image processing device. As shown in FIG. 1, the image processing method may include the following steps:
  • the vehicle image may refer to an image including a vehicle
  • the vehicle image may specifically be a vin code image or a license plate image
  • the vin code image may be an image including a vin code area of the vehicle
  • the license plate image may be a license plate including a vehicle The image of the area.
  • vin Vehicle Identification Number
  • the vin code is a set of seventeen numbers that is used to identify a unique number of vehicles. In other words, each vehicle has a unique vin code.
  • the vin code can identify the vehicle manufacturer, engine, chassis serial number, and other performance data.
  • the vehicle image may be acquired in real time by a preset shooting device, or may be collected by the shooting device and stored in a preset queue or database to be processed by the image, and obtained from the queue or database, It can also be received vehicle images sent from other devices, and so on.
  • the shooting device may be a camera, a video camera, a camera, or other devices or devices that can be used for shooting, and the shooting device may be provided in the image processing device, or may be connected to the image processing device.
  • the type of the vehicle image is a vin code image type or a license plate image type.
  • one or more recognition rules may be preset.
  • the recognition rule may refer to a rule for inputting the vehicle image into a preset image detection model to recognize the type of the vehicle image, that is, a recognition rule based on the image detection model.
  • the recognition rule may also refer to a rule that uses the type corresponding to the vehicle image with the highest similarity among the vehicle image samples stored in the database as the type of the vehicle image, that is, the recognition rule based on similarity comparison ; That is to say, after acquiring the vehicle image, the image processing device can determine the type of the vehicle image with the highest similarity among the vehicle image samples stored in the database and the vehicle image with the highest similarity.
  • the recognition rule may also refer to a rule for determining the type of the vehicle image according to the source label of the vehicle image, that is, a recognition rule based on the source label; that is, the image processing device may determine the type according to the source of the acquired vehicle image
  • the rules of the vehicle image if the vehicle image is carried on the source label, assuming that the source label indicates that the vehicle image is from the vin code image database, the type of the vehicle image may be determined as the vin code image type, assuming that the source label indicates the When the vehicle image comes from the license plate image database, it can be determined that the type of the vehicle image is the license plate image type; for example, the different shooting devices used to collect the vin code image and the license plate image respectively, if the source label indicates that the vehicle image is from the collected vin Code image capturing device (if the source label is the identification of the vin code image capturing device), it can be
  • the recognition rules used by different image processing devices may be different, and/or, the same image processing device may also switch the recognition rules according to preset switching rules to recognize image types, so as to improve the flexibility and reliability of type determination .
  • the switching rule may include a switching rule that switches the identification rule at a preset time interval; or may include a switching rule that switches the identification rule according to the label of the vehicle image (such as an important level label, a source label, etc.); or may switch according to a user input Instruction to switch the recognition rules (switching in sequence, or the switching instruction can carry the information of the recognition rule to be switched to); or it can be included in the number of errors of the recognized vin code or license plate reaching the preset number of times (or in When the recognition error frequency of the preset time period is greater than the preset frequency threshold, etc.), the switching rule for switching the recognition rule, etc., can be specifically set to obtain the correspondence between the switching rule and the recognition rule.
  • the image processing device can switch the recognition rule at a preset time interval, such as every 24 hours; for another example, the image processing device can switch the recognition rule according to the source tag of the vehicle, such as the importance level label indicates that the vehicle image level is important
  • a preset time interval such as every 24 hours
  • the image processing device can switch the recognition rule according to the source tag of the vehicle, such as the importance level label indicates that the vehicle image level is important
  • an identification rule based on the image detection model may be used, and if the importance level tag indicates that the vehicle image is of a general level, the identification rule based on the source tag may be used, and so on, which are not enumerated here.
  • the type of the vehicle image is a vin code image type
  • the type of the vehicle image is a vin code image type
  • the vin code image can be processed according to a preset vin code image processing rule to obtain the The vin code included in the vin code image is the vin code of the vehicle.
  • the image processing device processes the vin code image according to a preset vin code image processing rule to obtain the vin code of the vehicle, which may refer to: performing edge detection on the vin code image to obtain the edge detection The first edge image; perform morphological close operation on the first edge image to obtain the first closed operation image; perform morphological opening operation on the first closed operation image to obtain the first open operation image; determine the first Open the minimum circumscribed rectangle of the vin code area in the image, and determine the area determined by the minimum circumscribed rectangle as the vin code area included in the vin code image; identify the vin code area to identify that the vin code image includes Vin code, that is, the vin code that identifies the vehicle.
  • a preset vin code image processing rule to obtain the vin code of the vehicle, which may refer to: performing edge detection on the vin code image to obtain the edge detection The first edge image; perform morphological close operation on the first edge image to obtain the first closed operation image; perform morphological opening operation on the first closed operation image to obtain the first open operation image; determine the first Open the minimum circumscribed rectangle of the
  • the image processing device may also perform tophat transformation on the vin code image to obtain a tophat transformed vin code image, so that when performing edge detection, the tophat The transformed vin code image is subjected to edge detection to obtain the first edge image after edge detection, and the subsequent process can be performed.
  • the tophat transform can be used to detect bright details in dark places and extract areas with higher gray levels in the image.
  • the license plate image is processed according to the preset license plate image processing rules to obtain the license plate of the vehicle.
  • the vehicle image can be determined as the license plate image, and then the license plate image can be processed according to the preset license plate image processing rules to obtain the license plate image included
  • the license plate is the license plate of the vehicle.
  • the image processing device processes the license plate image according to preset license plate image processing rules to obtain the license plate included in the license plate image, which may refer to: performing edge detection on the license plate image to obtain the first Two-edge image; perform a morphological close operation on the second edge image to obtain a second closed operation image; perform a morphological open operation on the second closed operation image to obtain a second open operation image; determine the second open image Calculate the minimum circumscribed rectangle of the license plate area in the image, and determine the area determined by the minimum circumscribed rectangle as the license plate area included in the license plate image; identify the license plate area to identify the license plate included in the license plate image, that is, the vehicle License plate.
  • the image processing device can identify the type of the vehicle image by acquiring the vehicle image and according to a preset recognition rule, that is, determine whether the vehicle image is a vin code image or a license plate image, and then be able to determine the type according to the recognized type Differentiate and select corresponding image processing rules to process the vehicle image to obtain the vin code or license plate included in the vehicle image, which enhances the flexibility of image processing and helps to improve the vin code or license plate of the vehicle image Recognize efficiency and improve image processing effects.
  • a preset recognition rule that is, determine whether the vehicle image is a vin code image or a license plate image
  • FIG. 2 is a schematic flowchart of another image processing method according to an embodiment of the present application. Specifically, as shown in FIG. 2, the image processing method may include the following steps:
  • the vehicle image may be a vin code image or a license plate image
  • the vin code image may be an image including a vin code area of the vehicle
  • the license plate image may be an image including a vehicle license plate area.
  • the output result is used to indicate the type of the vehicle image.
  • the type of the vehicle image is a vin code image type or a license plate image type.
  • the vin code image type may be used to indicate that the vehicle image is a vin code image
  • the license plate image type may be used to indicate that the vehicle image is a license plate image.
  • the image detection model may be trained based on a plurality of pre-selected image samples and the type of each image sample.
  • the plurality of image samples may include a first number of vin code image samples and a second number of license plate image samples, and the absolute value of the difference between the first number and the second number does not exceed a preset number threshold . That is to say, the image processing device can select a first number of vin code image samples and a second number of license plate image samples, that is, select a balanced number of different types of image samples for model training, so as to improve the model training effect.
  • the image processing device may detect whether the acquired vehicle image is specifically a license plate image or a vin code image, and determine different image processing according to different area images Rules, and identify according to the corresponding image processing rules, including the license plate number recognition of the license plate area (license plate image processing rules) or the vin code recognition of the vin code area (vin code image processing rules) and so on.
  • an image detection model may be established based on each license plate image in historical data and each vin code image in historical data, and subsequently acquired vehicle images may be recognized as The license plate area is still the vin code area.
  • the output result may include the type of the vehicle image, or may include an identifier indicating the type of the vehicle image, for example, "0" represents the vin code image type, "1" represents the license plate image type, etc. Wait, this application is not limited.
  • the vehicle image is collected by the shooting device, when shooting the vehicle image, the vehicle environment information of the vehicle may also be obtained, and then the target shooting parameters for shooting the vehicle may be determined according to the vehicle environment information, and use the The shooting device collects the vehicle image according to the target shooting parameter, so as to obtain the vehicle image.
  • the vehicle may refer to any vehicle within the shooting range of the shooting device, or may be a vehicle of a specific vehicle type within the shooting range, or may be a vehicle of a specific location area within the shooting range, or may be Vehicles that send out indication signals (such as turning on double flash or turning on wipers, etc.) within the shooting range, etc., can be set in advance to obtain the selection rules of the vehicle, thereby enhancing the flexibility of vehicle selection.
  • the vehicle environmental information may include the vehicle model of the vehicle, the ambient light intensity of the vehicle, the distance between the vehicle and the shooting device (or the distance between the vehicle and the image processing device),
  • the type of the vehicle image for example, the type recognized by the previous image detection model is used as the type of the subsequently collected vehicle image, or the type preset by the user is used as the type of the collected vehicle image, etc.
  • Type identification directly triggers any one or more of the corresponding image processing flow) and system time and other information items.
  • the vehicle environment information may be input by the user; or it may be automatically recognized by the image processing device, for example, by previewing the collected image of the vehicle to determine its vehicle model or by identifying the vehicle's logo to determine its vehicle model, through the pre
  • the distance sensor is used to determine the distance
  • the ambient light intensity is determined by the preset light sensor
  • the system time is determined by the preset time module, etc.; or other equipment (such as the vehicle) can identify the vehicle environmental information
  • the image processing device may receive the vehicle environment information of the vehicle sent from other devices, etc., which are not listed here.
  • the image processing device may quickly determine the correspondence between the vehicle environment information based on the correspondence between preset vehicle environment information and shooting parameters
  • the shooting parameters are used as the target shooting parameters to improve the determination efficiency of the shooting parameters; or, the image processing device may also be based on the vehicle environment information such as the vehicle model, based on the captured vin code image of the vehicle and the vehicle model stored in the database.
  • the shooting parameter corresponding to the vin code image sample with the highest vin code image similarity of the vehicle in the database is used as the target shooting parameter of the vehicle.
  • the shooting parameters of vehicles with the same vehicle environmental information are used as the target shooting parameters, and so on, which are not listed here one by one.
  • the shooting parameters involved in the present application, such as target shooting parameters may include a shooting angle (to control the shooting device to shoot at the shooting angle), a focal length, an aperture, an ISO and/or EV value, etc., which is not limited in this application.
  • the vehicle environment information of the vehicle may include the vehicle model.
  • the image processing device determines the target shooting parameter, it may find the shooting parameter corresponding to the same vehicle model as the vehicle model from the database according to the preset correspondence between the vehicle model and the shooting parameter, and search for the The shooting parameters are determined as target shooting parameters for shooting the vehicle.
  • a variety of vehicle models and shooting parameters corresponding to each vehicle model can be pre-stored in the database.
  • the shooting parameters corresponding to each vehicle model may be that the selected shooting effect of the vehicle model is better, for example, the shooting quality is greater than the preset quality threshold and/or the vin code area (or license plate area) accounts for the image ratio greater than the preset ratio threshold, etc.
  • the shooting parameters of the vehicle image samples are examples of the vehicle image samples.
  • the vehicle environment information of the vehicle includes the vehicle model of the vehicle and the ambient light intensity where the vehicle is located.
  • the target ambient light intensity interval in which the ambient light intensity of the vehicle is located in the multiple ambient light intensity intervals may be determined according to preset multiple ambient light intensity intervals;
  • the correspondence between the preset vehicle model, the ambient light intensity interval and the shooting parameters, the shooting parameters corresponding to the vehicle model and the target ambient light intensity interval are found from the database, and the searched out
  • the shooting parameters are determined as target shooting parameters for shooting the vehicle.
  • the database may pre-store multiple vehicle models, the multiple ambient light intensity intervals, and shooting parameters corresponding to each vehicle model and each ambient light intensity interval.
  • the vehicle environment information of the vehicle includes the vehicle model of the vehicle and the distance between the vehicle and the shooting device.
  • the image processing device determines the target shooting parameter, it may be based on preset multiple distance intervals to determine the target distance interval in which the distance between the vehicle and the shooting device is in the multiple distance intervals; according to the preset vehicle Correspondence between the vehicle model, the distance interval and the shooting parameters, the shooting parameters corresponding to the vehicle model and the target distance interval are found from the database, and the found shooting parameters are determined to be used for shooting The target shooting parameters of the vehicle.
  • the database may pre-store a variety of vehicle models, the plurality of distance sections, and shooting parameters corresponding to each vehicle model and each distance section.
  • the vehicle environment information of the vehicle includes the vehicle model and system time of the vehicle.
  • the target time period to which the system time belongs in the multiple time periods may be determined according to preset multiple time periods; according to the preset vehicle model, time period and shooting parameters According to the correspondence between the three, the shooting parameters corresponding to the vehicle model and the target time period are found from the database, and the found shooting parameters are determined as the target shooting parameters for shooting the vehicle.
  • a plurality of vehicle models, the plurality of time periods, and shooting parameters corresponding to each vehicle model and each time period may be pre-stored in the database.
  • the vehicle environment information of the vehicle includes a system time
  • the image processing device may determine the target shooting parameter according to the preset time period and the corresponding relationship between the shooting parameters to determine the The shooting parameters corresponding to the system time are used as the target shooting parameters; or, the vehicle environment information of the vehicle includes the ambient light intensity of the vehicle.
  • the image processing device may determine the target shooting parameters according to the preset ambient light intensity interval and The corresponding relationship of the shooting parameters determines the shooting parameters corresponding to the ambient light intensity as the target shooting parameters; the vehicle environment information of the vehicle includes the distance between the vehicle and the shooting device, and when the image processing device determines the target shooting parameters , The shooting parameters corresponding to the distance can be determined as the target shooting parameters according to the corresponding relationship between the preset distance interval and the shooting parameters; or, the vehicle environment information can also include the vehicle model of the vehicle and the ambient light of the vehicle Intensity, distance between the vehicle and the shooting device and system time, or include the ambient light intensity of the vehicle and the distance between the vehicle and the shooting device, or include the ambient light intensity and system of the vehicle Time, etc. are not listed here.
  • the shooting device may be loaded at a fixed position, and the shooting device may be rotated, that is, the shooting angle of the shooting device may be adjusted. Therefore, the vin code image in the historical data collected by the shooting device can be analyzed to obtain vin code image data of different car models, and the better shooting effect can be selected from them (such as covering all the vin code area with less interference) ) Vin code image, to obtain the shooting parameters of the vin code image, so that the shooting device can quickly call the shooting parameters according to the vehicle model after identifying the vehicle model, including the shooting angle of the shooting device (controlling the shooting device with the shooting angle Shooting), focal length, aperture, ISO, EV value, etc.
  • the vin code image in the historical data collected by the shooting device can be analyzed to obtain vin code image data of different car models, and the better shooting effect can be selected from them (such as covering all the vin code area with less interference) ) Vin code image, to obtain the shooting parameters of the vin code image, so that the shooting device can quickly call the shooting parameters according to the vehicle model after identifying the vehicle model
  • the license plate image in the historical data that can be collected is analyzed to obtain license plate image data of different models, and the license plate image with better shooting effect is selected therefrom, and the shooting parameters of the license plate image are obtained so that the shooting device can recognize the vehicle After the vehicle model, you can quickly call the shooting parameters to shoot the license plate image according to the vehicle model.
  • a shooting instruction for an area image it is determined that the shooting instruction corresponds to a license plate image shooting instruction or a vin code image shooting instruction to trigger a call to corresponding shooting parameters to shoot, and the acquired shooting can be determined according to the shooting instruction Whether the image is a license plate image or a vin code image, and then determines the corresponding image processing rules.
  • the time and/or ambient light intensity can also be combined to obtain the shooting time and shooting parameters of the vin code image (or license plate image) with better shooting effect, and then by obtaining the current vehicle model and current time (and/or environment Light intensity) to quickly call more matching shooting parameters to improve shooting reliability.
  • Different times or different ambient light intensities will affect the shooting effect, for example, the image effects obtained by shooting with the same shooting parameters during the day and night are completely different.
  • the correspondence between different time periods and vehicle models (which can also be combined with the recognized vehicle image type, that is, image area type), and the shooting parameters of the shooting device can be set in advance; or, the ambient light intensity can be set in advance
  • the vehicle model also the identified vehicle image type
  • the shooting parameters of the shooting device or pre-set to obtain different time periods, ambient light intensity and vehicle model (also can be combined with the identified vehicle Image type), the correspondence between the shooting parameters of the shooting device, and so on.
  • vin code image data of different time periods can be obtained, and according to each The vin code image data of the same vehicle type within a period of time selects the vin code image with better shooting effect, and obtains the shooting parameters of the vin code image, thereby determining the difference between the different time periods and vehicle models, and the shooting parameters of the shooting device Correspondence relationship; so that the camera can quickly call the corresponding shooting parameters according to the identified time zone and vehicle model after shooting the current time zone and vehicle model.
  • the vin code image data in different ambient light intensities can be obtained by analyzing the vin code images in the historical data collected by the photographing device (each vin code image correlates and records the ambient light intensity at the time of capturing the image) , And according to the Vin code image data of the same car model in each ambient light intensity section, select a vin code image with better shooting effect, obtain the shooting parameters of the vin code image, so as to determine different ambient light intensity sections and vehicle models, and Correspondence between the shooting parameters of the shooting device; so that the shooting device can quickly call the corresponding shooting according to the identified ambient light intensity section and vehicle model after identifying the ambient light intensity section where the current ambient light intensity is located and the vehicle model Parameters for shooting. Combined with the vehicle model time and other information, the shooting parameters are quickly called to improve the shooting quality, which in turn improves the processing effect of the subsequent vin code area or license plate area.
  • steps 205-207 may be performed.
  • the vin code image can be processed to extract the vin code area.
  • tophat transform, edge detection, morphological closed operation, morphological open operation, and a set of simple and fast algorithms for calculating the smallest circumscribed rectangle can be used to determine the vin code area, and then identify the vin code.
  • steps 208-210 may be performed.
  • the license plate image After determining that the acquired vehicle image is a license plate image, the license plate image can be processed to extract the license plate area.
  • a set of simple and fast algorithms for edge detection, morphological close operation, morphological open operation, and calculation of the minimum circumscribed rectangle can be used to determine the license plate area, and then recognize the license plate.
  • tophat By tophat transforming the captured vin code image, the interference received by the vin code image area can be reduced. Since tophat is better for detecting bright details in dark places in image segmentation, especially for objects with uniform width or size, tophat transformation can be performed on the captured vin code image to further distinguish the vin code area. Optionally, there are some reflection disturbances of the vehicle body in the vin code image.
  • the vin code image obtained by the original shooting that is, the original image
  • the tophat transform is performed on the grayscale image to obtain the tophat transform result.
  • the original vin code image is filtered by tophat, it has a simple and uniform background and foreground, so as to better distinguish the vin code area.
  • the image processing device may also detect whether the brightness of the vin code image is within a preset brightness interval range; If the brightness of the vin code image is not within the range of the brightness interval, the step of top hat transforming the vin code image may be triggered to obtain a tophat transformed vin code image. Further optionally, if the brightness of the vin code image is within the range of the brightness range, that is, when the shooting conditions are good, the tophat transformation may not be performed, and the edge detection of the vin code image may be directly performed, thereby helping to reduce equipment overhead .
  • a preset edge detection algorithm may be used, for example, a Canny operator may be used for edge detection.
  • the characteristic of the Canny algorithm is to try to assemble candidate pixels of independent edges into an outline.
  • the specific algorithm steps of Canny operator to find edge points are as follows:
  • the edges in the image can point in various directions, and the Canny algorithm can use operators (such as Roberts, Prewitt, Sobel, etc.) ) To detect the horizontal, vertical, and diagonal edges in the image, and obtain the first derivative values in the horizontal and vertical directions, thereby determining the gradient amplitude and direction of the pixel, where the gradient direction is calculated and the gradient operator is selected be consistent;
  • the gradient intensity of the current pixel can be Compare the two pixels along the positive and negative gradient direction. If the gradient intensity of the current pixel is the largest compared to the other two pixels, the pixel point will remain as an edge point, otherwise the pixel point will be suppressed, thus the local maximum All gradient values other than 0 are suppressed to 0, to achieve a "thin" edge;
  • Double-Threshold algorithm is used to detect and connect edges; specifically, after 3), there are still some edge pixels caused by noise and color changes, which can be set by setting high and low thresholds, if the edge pixels The gradient value of is higher than the high threshold, it can be marked as a strong edge pixel; if the gradient value of the edge pixel is less than the high threshold and greater than the low threshold, it can be marked as a weak edge pixel; if the gradient value of the edge pixel is less than low The threshold is suppressed. Therefore, it is possible to extract useful structural information from different visual objects through edge detection, and reduce the amount of data to be processed.
  • the structural element used may be a row vector structural element with a size of 1*N to connect discontinuous edges in the horizontal direction.
  • the structural element used in the morphological closed operation may be a 1*N row vector structural element, N may be the number of columns, and may be used to indicate the width of the structural element, and N is greater than 0.
  • the N may be obtained according to the resolution setting of the vin code image; and/or, the N may be obtained according to the size (size) of the vin code region in the vin code image, the size including the length Or width; and/or, the N may be set according to the ratio of the character pitch in the vin code area to the size of the vin code image; and/or, the N may be set according to the width of the vin code image .
  • the N can be set according to the resolution of the image and/or the size of the vin code area in the image.
  • N and the image can be set in advance. Correspondence between the resolution (and/or the size of the vin code area in the image).
  • the N can be obtained based on the statistical relationship between the character pitch size of the vin code area and the vin code image size in the captured image.
  • the larger the ratio between the character pitch size and the vin code image size the larger the value of N.
  • the correspondence relationship between N and the ratio of the character pitch size to the image size is preset.
  • the N can be obtained according to the image width setting, for example, the value of the N can be 5% of the image width.
  • the morphology open operation processing is performed, firstly eroded and then expanded to remove small-size noise in the image.
  • the structural elements used in the open operation of morphology can be consistent with the structural elements used in the closed operation described above.
  • the morphological opening operation result is obtained to achieve the effects of eliminating small objects, separating objects at slender points, and smoothing the boundaries of larger objects without significantly changing their area.
  • an image of the vin code area can be stored, and/or a character (signage) or barcode included in the vin code area can be further recognized.
  • the manner of identifying the vin code area includes OCR character recognition or other recognition methods, which is not limited in this solution.
  • the calibration The check digit is "X", and the weighting coefficient can be found in the "World Automobile Identification Code (VIN) Information Manual" P21 ⁇ 23.
  • VIN World Automobile Identification Code
  • the coefficients are: location: 1 2 3 4 4 5 6 6 7 8 10 10 11 12 13 14 14 15 16 17 weighting coefficient 8 7 6 5 4 4 32 10*9 8 7 6 5 4 4 3 2), which can then be calculated by this calculation
  • the parity bit and the ninth bit are compared to determine whether the two are the same, and determine whether the recognized vin code has an error, that is, when the two are different, it indicates that the vin code has an error
  • the vin code can be stored, or the vehicle business such as auto insurance can be processed based on the vin code, thereby improving the intelligence and efficiency of business processing.
  • the structural elements used in the morphological closed operation can be M*N vector structural elements, M can be the number of rows, which can be used to indicate the length (height) of the structural elements; N can be the number of columns, which can be used to indicate the structure elements Width, M and N are greater than 0.
  • the M and N may be obtained according to the resolution setting of the license plate image; and/or, the M and N may be obtained according to the size setting of the license plate area in the license plate image, the size including the length (height) And/or width; and/or, the M and N can be set according to the ratio of the character spacing in the license plate area to the size (such as height or width) of the license plate image; and/or, the M can be based on the The height of the license plate image is set, and N is obtained according to the width of the license plate image. For example, M is 5% of the height, and N is 5% of the width.
  • steps 208-210 can participate in the related description of steps 205-207, which will not be repeated here.
  • the vin code area or license plate area extraction method of the present application improves the detection efficiency when extracting the vin code area or license plate area in the image, can well overcome the interference of the vehicle body reflecting the scene, the accuracy is high, and can It is suitable for applications in embedded systems with limited performance and has a wide range of applications.
  • the image processing device can identify the type of the vehicle image by acquiring the vehicle image and inputting the vehicle image into a preset image detection model, that is, determining whether the vehicle image is a vin code image or a license plate image, and According to the identified type, the corresponding image processing rules can be selected to process the vehicle image, including the selection of tophat transformation, edge detection, morphological closing operation, morphological opening operation, calculating the minimum circumscribed rectangle, etc., to obtain the vehicle
  • the vin code or license plate included in the image enhances the flexibility of image processing, helps to improve the recognition efficiency of the vin code or license plate of the vehicle image, and improve the image processing effect.
  • FIG. 3 is a schematic structural diagram of an image processing device according to an embodiment of the present application.
  • the image processing apparatus of the embodiment of the present application includes a unit for performing the above image processing method.
  • the image processing apparatus 300 of this embodiment may include: an acquisition unit 301 and a processing unit 302. among them,
  • the obtaining unit 301 is configured to obtain a vehicle image, the vehicle image is a vin code image or a license plate image, the vin code image is an image including a vin code area of the vehicle, and the license plate image is an image including a vehicle license plate area;
  • the processing unit 302 is configured to recognize the vehicle image according to a preset recognition rule to identify the type of the vehicle image, and the type of the vehicle image is a vin code image type or a license plate image type;
  • the processing unit 302 is further configured to process the vin code image according to a preset vin code image processing rule when the type of the vehicle image is a vin code image type to obtain the vin code of the vehicle;
  • the processing unit 302 is further configured to process the license plate image according to a preset license plate image processing rule when the type of the vehicle image is the license plate image type to obtain the license plate of the vehicle.
  • the processing unit 302 may be specifically configured to input the vehicle image into a preset image detection model to obtain an output result of the image detection model, and the output result is used to indicate the type of the vehicle image;
  • the image detection model is trained based on a plurality of pre-selected image samples and the type of each image sample, the plurality of image samples includes a first number of vin code image samples and a second number of license plate image samples And the absolute value of the difference between the first quantity and the second quantity does not exceed a preset number threshold.
  • the processing unit 302 may be specifically configured to perform a top-hat tophat transformation on the vin code image to obtain a tophat transformed vin code image; perform edge detection on the tophat transformed vin code image to obtain A first edge image after edge detection; performing a morphological close operation on the first edge image to obtain a first closed operation image; performing a morphological opening operation on the first closed operation image to obtain a first opening operation Image; determine the minimum circumscribed rectangle of the vin code area in the first open operation image, and determine the area determined by the minimum circumscribed rectangle as the vin code area included in the vin code image; identify the vin code area To identify the vin code of the vehicle.
  • the structural element used for the morphological closed operation on the first edge image is a 1*N row vector structural element, where N is the number of columns, and N is greater than 0;
  • the N is obtained according to the size setting of the vin code area in the vin code image, and the size includes a length or a width; and/or,
  • the N is set according to the ratio of the character pitch in the vin code area to the size of the vin code image; and/or,
  • the N is obtained according to the width setting of the vin code image.
  • the structural element used for the morphological closed operation on the second edge image is a vector structural element of M*N, where M is the number of rows, N is the number of columns, and M and N is greater than 0;
  • the M and N are obtained according to the resolution setting of the license plate image.
  • the M and N are set according to the size of the license plate area in the license plate image, and the size includes length and/or width; and/or,
  • the M is obtained according to the length of the license plate image
  • the N is obtained according to the width of the license plate image.
  • the image processing device may implement part or all of the steps in the image processing method in the embodiments shown in FIG. 1 to FIG. 2 through the above units. It should be understood that the embodiments of the present application are device embodiments corresponding to the method embodiments, and the description of the method embodiments is also applicable to the embodiments of the present application.
  • FIG. 4 is a schematic structural diagram of another image processing device according to an embodiment of the present application.
  • the image processing device is used to perform the method described above.
  • the image processing device 400 in this embodiment may include: one or more processors 401 and a memory 402.
  • the image processing apparatus may further include or be connected to a photographing device.
  • the image processing device may further include one or more user interfaces 403, and/or one or more communication interfaces 404.
  • the processor 401, the user interface 403, the communication interface 404, and the memory 402 may be connected through the bus 405, or may be connected in other ways.
  • the bus mode is used as an example in FIG.
  • the memory 402 is used to store a computer program, and the computer program includes program instructions, and the processor 401 is used to execute the program instructions stored in the memory 402.
  • the processor 401 can be used to call the program instructions to perform the following steps: obtain a vehicle image, the vehicle image is a vin code image or a license plate image, and the vin code image is an image including a vin code area of the vehicle, the license plate
  • the image is an image including the license plate area of the vehicle; the vehicle image is recognized according to a preset recognition rule to identify the type of the vehicle image, and the type of the vehicle image is a vin code image type or a license plate image type; If the type of the vehicle image is a vin code image type, process the vin code image according to a preset vin code image processing rule to obtain the vin code of the vehicle; if the type of the vehicle image is a license plate image Type, processing the license plate image according to a preset license plate image processing rule to obtain the license plate of the vehicle.
  • the process 401 when the process 401 executes the recognition of the vehicle image according to a preset recognition rule to identify the type of the vehicle image, it may specifically perform the following steps: input the vehicle image into a preset An image detection model to obtain an output result of the image detection model, the output result is used to indicate the type of the vehicle image;
  • the image detection model is trained based on a plurality of pre-selected image samples and the type of each image sample, the plurality of image samples includes a first number of vin code image samples and a second number of license plate image samples And the absolute value of the difference between the first quantity and the second quantity does not exceed a preset number threshold.
  • the processor 401 when the processor 401 executes the processing of the vin code image according to a preset vin code image processing rule to obtain the vin code included in the vin code image, it may specifically perform the following steps: Performing top hat transformation on the vin code image to obtain a tophat transformed vin code image; performing edge detection on the tophat transformed vin code image to obtain a first edge image after edge detection; on the first Perform an morphological closing operation on the edge image to obtain a first closed computing image; perform a morphological opening operation on the first closed computing image to obtain a first opening computing image; determine the vin code area in the first opening computing image The minimum circumscribed rectangle of, and determine the area determined by the minimum circumscribed rectangle as the vin code area included in the vin code image; identify the vin code area to identify the vin code of the vehicle.
  • the structural element used in the morphological closed operation is an M*N vector structural element, where M is the number of rows, N is the number of columns, and M and N are greater than 0; wherein, the M And N are obtained according to the resolution setting of the license plate image; and/or, the M and N are obtained according to the size setting of the license plate area in the license plate image, and the size includes length and/or width; and /Or, the M and N are set according to the ratio of the character pitch in the license plate area to the size of the license plate image; and/or, the M are set according to the length of the license plate image, N It is obtained according to the width of the license plate image.
  • the processor 401 may also perform the following steps: detect whether the brightness of the vin code image is at Within the preset brightness interval; if the brightness of the vin code image is not within the brightness interval, trigger the top hat transformation of the vin code image to obtain the tophat transformed vin code image step.
  • the processor 401 may be a central processing unit (Central Processing Unit, CPU), and the processor may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSPs), application specific integrated circuits (Application Specific Integrated) Circuit (ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the user interface 403 may include an input device and an output device.
  • the input device may include a touch panel, a microphone, and the like
  • the output device may include a display (LCD, etc.), a speaker, and the like.
  • the communication interface 404 may include a receiver and a transmitter for communicating with other devices.
  • the processor 401 and the like described in the embodiments of the present application can execute the implementation described in the method embodiments shown in FIG. 1 to FIG. 2 above, and can also execute each of the methods described in FIG. 3 of the embodiment of the present application. The implementation of the unit is not repeated here.
  • An embodiment of the present application also provides a computer-readable storage medium that stores a computer program, and when the computer program is executed by a processor, the computer program can be implemented as described in the embodiments corresponding to FIG. 1 to FIG. 2 Some or all of the steps in the image processing method may also realize the functions of the image processing device of the embodiment shown in FIG. 3 or FIG. 4 of the present application, and details are not described here.
  • An embodiment of the present application further provides a computer program product containing instructions, which when run on a computer, causes the computer to perform some or all of the steps in the above method.
  • the computer-readable storage medium may be an internal storage unit of the image processing device described in any of the foregoing embodiments, such as a hard disk or a memory of the image processing device.
  • the computer-readable storage medium may also be an external storage device of the image processing device, such as a plug-in hard disk equipped on the image processing device, a smart memory card (Smart, Media, Card, SMC), and secure digital (Secure Digital) , SD) card, flash card (Flash Card), etc.
  • the term "and/or” is merely an association relationship that describes an associated object, indicating that there may be three relationships, for example, A and/or B, which may mean: A exists alone, and A and B exist simultaneously There are three cases of B alone.
  • the character “/” in this article generally indicates that the related objects before and after it are in an “or” relationship.
  • the size of the sequence numbers of the above processes does not mean that the execution order is sequential, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Traffic Control Systems (AREA)

Abstract

An image processing method and device, and a computer-readable storage medium, which are applied in the technical field of image processing. The method comprises: acquiring a vehicle image; identifying the vehicle image according to a pre-set identification rule, so as to identify the type of the vehicle image; if it is determined that the type of the vehicle image is a vin code image type, processing the vin code image according to a pre-set vin code image processing rule, so as to obtain a vin code of a vehicle; and if it is determined that the type of the vehicle image is a license plate image type, processing the license plate image according to a pre-set license plate image processing rule, so as to obtain a license plate of the vehicle. Using the method facilitates an improvement in identification efficiency of a vin code or a license plate in a vehicle image.

Description

一种图像处理方法、设备及计算机可读存储介质Image processing method, device and computer readable storage medium
本申请要求于2019年01月04日提交中国专利局、申请号为201910015377.7、申请名称为“一种图像处理方法、设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requires the priority of the Chinese patent application filed on January 04, 2019, with the application number 201910015377.7, the application name is "an image processing method, equipment and computer-readable storage medium". The reference is incorporated in this application.
技术领域Technical field
本申请涉及图像处理技术领域,尤其涉及一种图像处理方法、设备及计算机可读存储介质。The present application relates to the field of image processing technology, and in particular, to an image processing method, device, and computer-readable storage medium.
背景技术Background technique
目前经常会遇到获取车辆车牌或车辆识别号码(Vehicle Identification Number,vin)信息的场景,比如办理车辆业务时。在某些业务场景下,比如保险业务员为车辆办理车险业务的过程中,常常需要拍摄车辆vin码或车牌的图片进行存档,而录入这些vin码或车牌信息往往还是由人工进行的,效率较低。因此,如何自动识别这些区域以进一步识别出vin码或车牌,从而提升图像识别效率成为关键。At present, we often encounter scenarios of obtaining vehicle license plate or vehicle identification number (Vehicle Identification Number, vin) information, such as when handling vehicle business. In some business scenarios, such as the insurance salesman handling the car insurance business for the vehicle, it is often necessary to take a picture of the vehicle vin code or license plate for archiving, and entering the vin code or license plate information is often performed manually, which is more efficient low. Therefore, how to automatically recognize these areas to further recognize the vin code or license plate, thereby improving the efficiency of image recognition becomes the key.
发明内容Summary of the invention
本申请实施例提供了一种图像处理方法、设备及计算机可读存储介质,有助于提升对车辆图像的vin码或车牌的识别效率。Embodiments of the present application provide an image processing method, device, and computer-readable storage medium, which help to improve the recognition efficiency of a vin code or license plate of a vehicle image.
第一方面,本申请实施例提供了一种图像处理方法,包括:In a first aspect, an embodiment of the present application provides an image processing method, including:
获取车辆图像,所述车辆图像为vin码图像或车牌图像,所述vin码图像为包括车辆的vin码区域的图像,所述车牌图像为包括车辆的车牌区域的图像;Acquiring a vehicle image, the vehicle image is a vin code image or a license plate image, the vin code image is an image including a vin code area of the vehicle, and the license plate image is an image including a vehicle license plate area;
按照预设的识别规则对所述车辆图像进行识别,以识别出所述车辆图像的类型,所述车辆图像的类型为vin码图像类型或车牌图像类型;Identify the vehicle image according to a preset recognition rule to identify the type of the vehicle image, the type of the vehicle image is a vin code image type or a license plate image type;
如果确定所述车辆图像的类型为vin码图像类型,按照预设的vin码图像处理规则对所述vin码图像进行处理,以得到所述车辆的vin码;If it is determined that the type of the vehicle image is a vin code image type, process the vin code image according to a preset vin code image processing rule to obtain the vin code of the vehicle;
如果确定所述车辆图像的类型为车牌图像类型,按照预设的车牌图像处理规则对所述车牌图像进行处理,以得到所述车辆的车牌。If it is determined that the type of the vehicle image is the type of the license plate image, the license plate image is processed according to a preset license plate image processing rule to obtain the license plate of the vehicle.
第二方面,本申请实施例提供了一种图像处理设备,该图像处理设备包括用于执行上述第一方面的方法的单元。In a second aspect, an embodiment of the present application provides an image processing device including an unit for performing the method of the first aspect described above.
第三方面,本申请实施例提供了另一种图像处理设备,包括处理器和存储器,所述处理器和存储器相互连接,其中,所述存储器用于存储支持图像处理设备执行上述方法的计算机程序,所述计算机程序包括程序指令,所述处理器被配置用于调用所述程序指令,执行上述第一方面的方法。可选的,该图像处理设备还可包括用户接口和/或通信接口。In a third aspect, an embodiment of the present application provides another image processing device, including a processor and a memory, where the processor and the memory are connected to each other, wherein the memory is used to store a computer program that supports the image processing device to execute the above method The computer program includes program instructions, and the processor is configured to call the program instructions to perform the method of the first aspect. Optionally, the image processing device may further include a user interface and/or a communication interface.
第四方面,本申请实施例提供了一种计算机非易失性可读存储介质,所述计算机非易失性可读存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行上述第一方面的方法。According to a fourth aspect, an embodiment of the present application provides a computer non-volatile readable storage medium, where the computer non-volatile readable storage medium stores a computer program, the computer program includes program instructions, and the program instructions When executed by a processor, the processor is caused to perform the method of the first aspect described above.
本申请实施例能够通过获取车辆图像,并按照预设的识别规则识别出该车辆图像的类 型,即确定该车辆图像是vin码图像还是车牌图像,进而能够根据识别出的类型区别选择对应的图像处理规则来对该车辆图像进行处理,以得到该车辆图像包括的vin码或车牌,这就提升了图像处理的灵活性,有助于提升对车辆图像的vin码或车牌的识别效率,以及提升图像处理效果。The embodiment of the present application can obtain the vehicle image and identify the type of the vehicle image according to a preset recognition rule, that is, determine whether the vehicle image is a vin code image or a license plate image, and then select the corresponding image according to the recognized type Processing rules to process the vehicle image to obtain the vin code or license plate included in the vehicle image, which improves the flexibility of image processing, helps to improve the recognition efficiency of the vin code or license plate of the vehicle image, and improves Image processing effect.
附图说明BRIEF DESCRIPTION
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图进行说明。In order to more clearly explain the technical solutions of the embodiments of the present application, the drawings required in the description of the embodiments will be described below.
图1是本申请实施例提供的一种图像处理方法的流程示意图;1 is a schematic flowchart of an image processing method provided by an embodiment of the present application;
图2是本申请实施例提供的另一种图像处理方法的流程示意图;2 is a schematic flowchart of another image processing method provided by an embodiment of the present application;
图3是本申请实施例提供的一种图像处理设备的结构示意图;3 is a schematic structural diagram of an image processing device provided by an embodiment of the present application;
图4是本申请实施例提供的另一种图像处理设备的结构示意图。4 is a schematic structural diagram of another image processing device provided by an embodiment of the present application.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
本申请的技术方案可应用于图像处理设备中,该图像处理设备可包括各种终端、服务器或其他设备,用于对图像进行处理,比如提取图像中的vin码区域、识别图像中的vin码等等。本申请涉及的终端可以是手机、电脑、平板、个人计算机、智能手表等,本申请不做限定。The technical solution of the present application may be applied to an image processing device, which may include various terminals, servers, or other devices, for processing an image, such as extracting a vin code area in an image, identifying a vin code in an image and many more. The terminal involved in this application may be a mobile phone, computer, tablet, personal computer, smart watch, etc. This application is not limited.
本申请能够通过识别获取的车辆图像是vin码图像还是车牌图像,进而能够根据识别出的结果区别选择对应的图像处理规则来对该车辆图像进行图像处理,以得到该车辆图像包括的vin码或车牌,这就提升了图像处理的灵活性,有助于提升对车辆图像的vin码或车牌的识别效率以及图像处理效果。以下分别详细说明。This application can identify whether the acquired vehicle image is a vin code image or a license plate image, and then can select the corresponding image processing rule to perform image processing on the vehicle image according to the recognized result to obtain the vin code or the vin code included in the vehicle image The license plate, which increases the flexibility of image processing, helps to improve the recognition efficiency of the vin code or license plate of the vehicle image and the effect of image processing. Each is explained in detail below.
请参见图1,图1是本申请实施例提供的一种图像处理方法的流程示意图。具体的,本实施例的方法可具体应用于上述的图像处理设备中。如图1所示,该图像处理方法可以包括以下步骤:Please refer to FIG. 1, which is a schematic flowchart of an image processing method according to an embodiment of the present application. Specifically, the method of this embodiment may be specifically applied to the above-mentioned image processing device. As shown in FIG. 1, the image processing method may include the following steps:
101、获取车辆图像。101. Acquire vehicle images.
其中,该车辆图像可以是指包括车辆的图像,该车辆图像可具体为vin码图像或车牌图像,该vin码图像可以为包括车辆的vin码区域的图像,该车牌图像可以为包括车辆的车牌区域的图像。vin(Vehicle Identification Number)可以叫做车辆识别号码,还可以叫做车架号等等。vin码是一组由十七个数组成的,用于标识车辆的一组独一无二的号码,也就是说,每一车辆都有唯一的vin码。通过vin码可以识别车辆的生产商、引擎、底盘序号及其他性能等资料。Wherein, the vehicle image may refer to an image including a vehicle, the vehicle image may specifically be a vin code image or a license plate image, the vin code image may be an image including a vin code area of the vehicle, and the license plate image may be a license plate including a vehicle The image of the area. vin (Vehicle Identification Number) can be called the vehicle identification number, it can also be called the frame number and so on. The vin code is a set of seventeen numbers that is used to identify a unique number of vehicles. In other words, each vehicle has a unique vin code. The vin code can identify the vehicle manufacturer, engine, chassis serial number, and other performance data.
可选的,该车辆图像可以是预置的拍摄装置实时采集得到的,也可以是拍摄装置采集后存储至预设的待图像处理的队列或数据库中,从该队列或数据库中获取得到的,还可以是接收的来自其他设备发送的车辆图像,等等。对于该车辆图像的获取方式,本申请不做限定。其中,该拍摄装置可以是相机、摄像机、摄像头或其他可用于拍摄的装置或设备,该拍摄装置可设置于该图像处理设备中,或者可以与该图像处理设备连接。Optionally, the vehicle image may be acquired in real time by a preset shooting device, or may be collected by the shooting device and stored in a preset queue or database to be processed by the image, and obtained from the queue or database, It can also be received vehicle images sent from other devices, and so on. This application does not limit the acquisition method of the vehicle image. Wherein, the shooting device may be a camera, a video camera, a camera, or other devices or devices that can be used for shooting, and the shooting device may be provided in the image processing device, or may be connected to the image processing device.
102、按照预设的识别规则对该车辆图像进行识别,以识别出该车辆图像的类型,该车辆图像的类型为vin码图像类型或车牌图像类型。102. Identify the vehicle image according to a preset recognition rule to identify the type of the vehicle image. The type of the vehicle image is a vin code image type or a license plate image type.
其中,该车辆图像的类型为vin码图像类型可用于指示该车辆图像为vin码图像,该车辆图像的类型为车牌图像类型可用于指示该车辆图像为车牌图像。The type of the vehicle image is a vin code image type, which can be used to indicate that the vehicle image is a vin code image, and the type of the vehicle image is a license plate image type, which can be used to indicate that the vehicle image is a license plate image.
具体的,可预先设置一种或多种识别规则。例如,该识别规则可以是指将该车辆图像输入预置的图像检测模型以识别出该车辆图像的类型的规则,即基于图像检测模型的识别规则。又如,该识别规则还可以是指将数据库中存储的各车辆图像样本中与该车辆图像相似度最高的车辆图像对应的类型作为该车辆图像的类型的规则,即基于相似度对比的识别规则;也就是说,图像处理设备在获取到车辆图像之后,可通过确定数据库中存储的各车辆图像样本中与该车辆图像相似度最高的车辆图像,并将该相似度最高的车辆图像对应的类型确定为该获取的车辆图像的类型,其中,该数据库可存储有各车辆图像样本以及每个车辆图像样本对应的类型(标签)。又如,该识别规则还可以是指根据车辆图像的来源标签确定该车辆图像的类型的规则,即基于来源标签的识别规则;也就是说,图像处理设备可根据获取的车辆图像的来源确定该车辆图像的规则,如该车辆图像携带于来源标签,假设该来源标签指示该车辆图像来自于vin码图像数据库时,可确定该该车辆图像的类型为vin码图像类型,假设该来源标签指示该车辆图像来自于车牌图像数据库时,可确定该该车辆图像的类型为车牌图像类型;又如采集vin码图像和车牌图像分别采用的不同的拍摄装置,如果该来源标签指示该车辆图像来自采集vin码图像的拍摄装置(如该来源标签为该vin码图像的拍摄装置的标识),可确定该该车辆图像的类型为vin码图像类型,如果该来源标签指示该车辆图像来自采集车牌图像的拍摄装置(如该来源标签为该车牌图像的拍摄装置的标识),可确定该该车辆图像的类型为车牌图像类型,等等,此处不一一列举。Specifically, one or more recognition rules may be preset. For example, the recognition rule may refer to a rule for inputting the vehicle image into a preset image detection model to recognize the type of the vehicle image, that is, a recognition rule based on the image detection model. As another example, the recognition rule may also refer to a rule that uses the type corresponding to the vehicle image with the highest similarity among the vehicle image samples stored in the database as the type of the vehicle image, that is, the recognition rule based on similarity comparison ; That is to say, after acquiring the vehicle image, the image processing device can determine the type of the vehicle image with the highest similarity among the vehicle image samples stored in the database and the vehicle image with the highest similarity. Determined as the type of the acquired vehicle image, wherein the database may store each vehicle image sample and the corresponding type (tag) of each vehicle image sample. For another example, the recognition rule may also refer to a rule for determining the type of the vehicle image according to the source label of the vehicle image, that is, a recognition rule based on the source label; that is, the image processing device may determine the type according to the source of the acquired vehicle image The rules of the vehicle image, if the vehicle image is carried on the source label, assuming that the source label indicates that the vehicle image is from the vin code image database, the type of the vehicle image may be determined as the vin code image type, assuming that the source label indicates the When the vehicle image comes from the license plate image database, it can be determined that the type of the vehicle image is the license plate image type; for example, the different shooting devices used to collect the vin code image and the license plate image respectively, if the source label indicates that the vehicle image is from the collected vin Code image capturing device (if the source label is the identification of the vin code image capturing device), it can be determined that the type of the vehicle image is a vin code image type, if the source label indicates that the vehicle image is from the capture of a license plate image The device (if the source label is the identification of the shooting device of the license plate image), it can be determined that the type of the vehicle image is the license plate image type, etc., which are not enumerated here.
可选的,不同图像处理设备使用的识别规则可以不同,和/或,同一图像处理设备还可按照预设的切换规则切换识别规则进行图像类型的识别,以提升类型确定的灵活性和可靠性。该切换规则可以包括按照预设时间间隔切换识别规则的切换规则;或者可以包括按照车辆图像的标签(如重要等级标签、来源标签等等)切换识别规则的切换规则;或者可以按照用户输入的切换指令来切换识别规则(按顺序切换,或者该切换指令可携带需要切换到的识别规则的信息)的切换规则;或者可以包括在识别出的vin码或车牌的错误次数达到预设次数(或者在预设时间段的识别出错频率大于预设频率阈值等)时切换识别规则的切换规则,等等,具体可以先设置得到切换规则和识别规则的对应关系。从而有助于提升类型识别的灵活性和可靠性。例如,图像处理设备可按照预设的时间间隔如每24小时切换识别规则;又如,该图像处理设备可按照车辆的来源标签切换识别规则,如该重要等级标签指示该车辆图像的等级为重要时,可采用基于图像检测模型的识别规则,又如该重要等级标签指示该车辆图像的等级为一般时,可采用基于来源标签的识别规则,等等,此处不一一列举。Optionally, the recognition rules used by different image processing devices may be different, and/or, the same image processing device may also switch the recognition rules according to preset switching rules to recognize image types, so as to improve the flexibility and reliability of type determination . The switching rule may include a switching rule that switches the identification rule at a preset time interval; or may include a switching rule that switches the identification rule according to the label of the vehicle image (such as an important level label, a source label, etc.); or may switch according to a user input Instruction to switch the recognition rules (switching in sequence, or the switching instruction can carry the information of the recognition rule to be switched to); or it can be included in the number of errors of the recognized vin code or license plate reaching the preset number of times (or in When the recognition error frequency of the preset time period is greater than the preset frequency threshold, etc.), the switching rule for switching the recognition rule, etc., can be specifically set to obtain the correspondence between the switching rule and the recognition rule. This helps to increase the flexibility and reliability of type identification. For example, the image processing device can switch the recognition rule at a preset time interval, such as every 24 hours; for another example, the image processing device can switch the recognition rule according to the source tag of the vehicle, such as the importance level label indicates that the vehicle image level is important At this time, an identification rule based on the image detection model may be used, and if the importance level tag indicates that the vehicle image is of a general level, the identification rule based on the source tag may be used, and so on, which are not enumerated here.
103、如果确定该车辆图像的类型为vin码图像类型,按照预设的vin码图像处理规则对该vin码图像进行处理,以得到该车辆的vin码。103. If it is determined that the type of the vehicle image is a vin code image type, process the vin code image according to a preset vin code image processing rule to obtain the vin code of the vehicle.
也就是说,当该车辆图像的类型为vin码图像类型时,即可确定该车辆图像为vin码图像,进而可按照预设的vin码图像处理规则对该vin码图像进行处理,以得到该vin码图 像包括的vin码,即该车辆的vin码。That is to say, when the type of the vehicle image is a vin code image type, it can be determined that the vehicle image is a vin code image, and then the vin code image can be processed according to a preset vin code image processing rule to obtain the The vin code included in the vin code image is the vin code of the vehicle.
可选的,图像处理设备按照预设的vin码图像处理规则对该vin码图像进行处理,以得到该车辆的vin码,可以是指:对该vin码图像进行边缘检测,以得到边缘检测后的第一边缘图像;对该第一边缘图像进行形态学闭运算,以得到第一闭运算图像;对该第一闭运算图像进行形态学开运算,以得到第一开运算图像;确定该第一开运算图像中vin码区域的最小外接矩形,并将该最小外接矩形确定的区域确定为该vin码图像包括的vin码区域;对该vin码区域进行识别,以识别出该vin码图像包括的vin码,即识别出该车辆的vin码。进一步可选的,在进行边缘检测之前,图像处理设备还可对该vin码图像进行顶帽(tophat)变换,以得到tophat变换后的vin码图像,从而在进行边缘检测时,可对该tophat变换后的vin码图像进行边缘检测,以得到边缘检测后的该第一边缘图像,并可执行后续流程。其中,该tophat变换可用于检测暗处明亮的细节,提取图像中灰度较高的区域。Optionally, the image processing device processes the vin code image according to a preset vin code image processing rule to obtain the vin code of the vehicle, which may refer to: performing edge detection on the vin code image to obtain the edge detection The first edge image; perform morphological close operation on the first edge image to obtain the first closed operation image; perform morphological opening operation on the first closed operation image to obtain the first open operation image; determine the first Open the minimum circumscribed rectangle of the vin code area in the image, and determine the area determined by the minimum circumscribed rectangle as the vin code area included in the vin code image; identify the vin code area to identify that the vin code image includes Vin code, that is, the vin code that identifies the vehicle. Further optionally, before performing edge detection, the image processing device may also perform tophat transformation on the vin code image to obtain a tophat transformed vin code image, so that when performing edge detection, the tophat The transformed vin code image is subjected to edge detection to obtain the first edge image after edge detection, and the subsequent process can be performed. Among them, the tophat transform can be used to detect bright details in dark places and extract areas with higher gray levels in the image.
104、如果确定该车辆图像的类型为车牌图像类型,确按照预设的车牌图像处理规则对该车牌图像进行处理,以得到该车辆的车牌。104. If it is determined that the type of the vehicle image is the type of the license plate image, then the license plate image is processed according to the preset license plate image processing rules to obtain the license plate of the vehicle.
也就是说,当该车辆图像的类型为车牌图像类型时,即可确定该车辆图像为车牌图像,进而可按照预设的车牌图像处理规则对该车牌图像进行处理,以得到该车牌图像包括的车牌,即车辆的车牌。That is, when the type of the vehicle image is the type of the license plate image, the vehicle image can be determined as the license plate image, and then the license plate image can be processed according to the preset license plate image processing rules to obtain the license plate image included The license plate is the license plate of the vehicle.
可选的,图像处理设备按照预设的车牌图像处理规则对该车牌图像进行处理,以得到该车牌图像包括的车牌,可以是指:对该车牌图像进行边缘检测,以得到边缘检测后的第二边缘图像;对该第二边缘图像进行形态学闭运算,以得到第二闭运算图像;对该第二闭运算图像进行形态学开运算,以得到第二开运算图像;确定该第二开运算图像中车牌区域的最小外接矩形,并将该最小外接矩形确定的区域确定为该车牌图像包括的车牌区域;对该车牌区域进行识别,以识别出该车牌图像包括的车牌,即该车辆的车牌。Optionally, the image processing device processes the license plate image according to preset license plate image processing rules to obtain the license plate included in the license plate image, which may refer to: performing edge detection on the license plate image to obtain the first Two-edge image; perform a morphological close operation on the second edge image to obtain a second closed operation image; perform a morphological open operation on the second closed operation image to obtain a second open operation image; determine the second open image Calculate the minimum circumscribed rectangle of the license plate area in the image, and determine the area determined by the minimum circumscribed rectangle as the license plate area included in the license plate image; identify the license plate area to identify the license plate included in the license plate image, that is, the vehicle License plate.
在本实施例中,图像处理设备能够通过获取车辆图像,并按照预设的识别规则识别出该车辆图像的类型,即确定该车辆图像是vin码图像还是车牌图像,进而能够根据识别出的类型区别选择对应的图像处理规则来对该车辆图像进行处理,以得到该车辆图像包括的vin码或车牌,这就提升了图像处理的灵活性,有助于提升对车辆图像的vin码或车牌的识别效率,以及提升图像处理效果。In this embodiment, the image processing device can identify the type of the vehicle image by acquiring the vehicle image and according to a preset recognition rule, that is, determine whether the vehicle image is a vin code image or a license plate image, and then be able to determine the type according to the recognized type Differentiate and select corresponding image processing rules to process the vehicle image to obtain the vin code or license plate included in the vehicle image, which enhances the flexibility of image processing and helps to improve the vin code or license plate of the vehicle image Recognize efficiency and improve image processing effects.
请参见图2,图2是本申请实施例提供的另一种图像处理方法的流程示意图。具体的,如图2所示,该图像处理方法可以包括以下步骤:Please refer to FIG. 2, which is a schematic flowchart of another image processing method according to an embodiment of the present application. Specifically, as shown in FIG. 2, the image processing method may include the following steps:
201、获取车辆图像。201. Acquire a vehicle image.
其中,该车辆图像可以为vin码图像或车牌图像,该vin码图像可以为包括车辆的vin码区域的图像,该车牌图像可以为包括车辆的车牌区域的图像。获取该车辆图像的方式可以为多种,此处不赘述。The vehicle image may be a vin code image or a license plate image, the vin code image may be an image including a vin code area of the vehicle, and the license plate image may be an image including a vehicle license plate area. There are many ways to obtain the vehicle image, which will not be repeated here.
202、将该车辆图像输入预置的图像检测模型,以得到该图像检测模型的输出结果,该输出结果用于指示该车辆图像的类型。202. Input the vehicle image into a preset image detection model to obtain an output result of the image detection model. The output result is used to indicate the type of the vehicle image.
其中,该车辆图像的类型为vin码图像类型或车牌图像类型,该vin码图像类型可用于指示该车辆图像为vin码图像,该车牌图像类型可用于指示该车辆图像为车牌图像。The type of the vehicle image is a vin code image type or a license plate image type. The vin code image type may be used to indicate that the vehicle image is a vin code image, and the license plate image type may be used to indicate that the vehicle image is a license plate image.
该图像检测模型可以是根据预先选取的多个图像样本以及每个图像样本的类型训练 得到的。可选的,该多个图像样本可包括第一数量的vin码图像样本以及第二数量的车牌图像样本,且该第一数量和该第二数量的差值的绝对值不超过预设数目阈值。也就是说,图像处理设备可通过选取第一数量的vin码图像样本以及第二数量的车牌图像样本,即选取数量均衡的不同类型的图像样本来进行模型训练,从而可以提升模型训练效果。在一些实施例中,可能会遇到区别采集车辆车牌或vin码的情况,图像处理设备可通过检测获取到的车辆图像具体为车牌图像还是vin码图像,根据不同的区域图像确定不同的图像处理规则,并根据对应的图像处理规则进行识别,包括对车牌区域的车牌号识别(车牌图像处理规则)或对vin码区域的vin码识别(vin码图像处理规则)等等。一种可能的实施方式中,如上述所述,可根据历史数据中各车牌图像和历史数据中各vin码图像建立图像检测模型,后续获取的车辆图像即可通过输入该图像检测模型识别其为车牌区域还是vin码区域。The image detection model may be trained based on a plurality of pre-selected image samples and the type of each image sample. Optionally, the plurality of image samples may include a first number of vin code image samples and a second number of license plate image samples, and the absolute value of the difference between the first number and the second number does not exceed a preset number threshold . That is to say, the image processing device can select a first number of vin code image samples and a second number of license plate image samples, that is, select a balanced number of different types of image samples for model training, so as to improve the model training effect. In some embodiments, it may be encountered that the vehicle license plate or vin code is collected differently, and the image processing device may detect whether the acquired vehicle image is specifically a license plate image or a vin code image, and determine different image processing according to different area images Rules, and identify according to the corresponding image processing rules, including the license plate number recognition of the license plate area (license plate image processing rules) or the vin code recognition of the vin code area (vin code image processing rules) and so on. In a possible implementation manner, as described above, an image detection model may be established based on each license plate image in historical data and each vin code image in historical data, and subsequently acquired vehicle images may be recognized as The license plate area is still the vin code area.
可选的,该输出结果可包括该车辆图像的类型,或者可包括用于指示该车辆图像的类型的标识,如“0”代表为vin码图像类型,“1”代表为车牌图像类型,等等,本申请不做限定。Optionally, the output result may include the type of the vehicle image, or may include an identifier indicating the type of the vehicle image, for example, "0" represents the vin code image type, "1" represents the license plate image type, etc. Wait, this application is not limited.
进一步可选的,如果该车辆图像是拍摄装置采集的,在拍摄车辆图像时,还可获取该车辆的车辆环境信息,进而根据该车辆环境信息确定用于拍摄该车辆的目标拍摄参数,使用该拍摄装置并按照该目标拍摄参数采集车辆图像,以实现获取得到车辆图像。可选的,该车辆可以是指该拍摄装置的拍摄范围内的任一车辆,或者可以为该拍摄范围内特定车型的车辆,或者可以为该拍摄范围内特定位置区域的车辆,或者可以为该拍摄范围内发出指示信号(如开启双闪或开启雨刷等等)的车辆,等等,具体可预先设置得到该车辆的选取规则,从而提升了车辆选取的灵活性。进一步可选的,该车辆环境信息可包括该车辆的车型、该车辆所处的环境光强度、该车辆与该拍摄装置之间的距离(或该车辆与该图像处理设备之间的距离)、该车辆图像的类型(比如将之前图像检测模型识别出的类型作为后续采集的车辆图像的类型,或者将用户预先设置的类型作为采集的车辆图像的类型等等,后续采集的车辆图像可不再进行类型的识别而直接触发对应的图像处理流程)和***时间等信息项中的任一项或多项。进一步可选的,该车辆环境信息可以是用户输入的;或者可以是由图像处理设备自动识别的,比如通过预览该车辆的采集图像确定其车型或者通过识别该车辆的标识确定其车型,通过预置的距离传感器确定出该距离,通过预置的光线传感器确定出该环境光强度,通过预置的时间模块确定***时间等等;或者可以是其他设备(如该车辆)识别出该车辆环境信息后发送给该图像处理设备的,图像处理设备可接收来自其他设备发送的该车辆的车辆环境信息,等等,此处不一一列举。Further optionally, if the vehicle image is collected by the shooting device, when shooting the vehicle image, the vehicle environment information of the vehicle may also be obtained, and then the target shooting parameters for shooting the vehicle may be determined according to the vehicle environment information, and use the The shooting device collects the vehicle image according to the target shooting parameter, so as to obtain the vehicle image. Optionally, the vehicle may refer to any vehicle within the shooting range of the shooting device, or may be a vehicle of a specific vehicle type within the shooting range, or may be a vehicle of a specific location area within the shooting range, or may be Vehicles that send out indication signals (such as turning on double flash or turning on wipers, etc.) within the shooting range, etc., can be set in advance to obtain the selection rules of the vehicle, thereby enhancing the flexibility of vehicle selection. Further optionally, the vehicle environmental information may include the vehicle model of the vehicle, the ambient light intensity of the vehicle, the distance between the vehicle and the shooting device (or the distance between the vehicle and the image processing device), The type of the vehicle image (for example, the type recognized by the previous image detection model is used as the type of the subsequently collected vehicle image, or the type preset by the user is used as the type of the collected vehicle image, etc. Type identification directly triggers any one or more of the corresponding image processing flow) and system time and other information items. Further optionally, the vehicle environment information may be input by the user; or it may be automatically recognized by the image processing device, for example, by previewing the collected image of the vehicle to determine its vehicle model or by identifying the vehicle's logo to determine its vehicle model, through the pre The distance sensor is used to determine the distance, the ambient light intensity is determined by the preset light sensor, the system time is determined by the preset time module, etc.; or other equipment (such as the vehicle) can identify the vehicle environmental information After being sent to the image processing device, the image processing device may receive the vehicle environment information of the vehicle sent from other devices, etc., which are not listed here.
可选的,在确定用于拍摄该车辆的目标拍摄参数时,图像处理设备可以是通过预置的各车辆环境信息与拍摄参数的对应关系,基于该对应关系快速确定出该车辆环境信息对应的拍摄参数作为该目标拍摄参数,以提升拍摄参数的确定效率;或者,图像处理设备还可以是根据该车辆环境信息如车型,基于拍摄的该车辆的vin码图像与数据库中存储的该车型下的各vin码图像样本的相似度,将数据库中该车型下与该车辆的vin码图像相似度最高的vin码图像样本对应的拍摄参数作为该车辆的该目标拍摄参数,该数据库中可存储有多个vin码图像样本、多种车型以及与每个vin码图像样本和每种车型对应的(较佳)拍摄参 数;或者,图像处理设备还可以是根据该车辆环境信息将上一次手动调节的与该车辆环境信息相同的车辆的拍摄参数作为该目标拍摄参数,等等,此处不一一列举。进一步可选的,本申请涉及的拍摄参数如目标拍摄参数可包括拍摄角度(控制拍摄装置以该拍摄角度拍摄)、焦距、光圈、ISO和/或EV值等等,本申请不做限定。Optionally, when determining the target shooting parameters for shooting the vehicle, the image processing device may quickly determine the correspondence between the vehicle environment information based on the correspondence between preset vehicle environment information and shooting parameters The shooting parameters are used as the target shooting parameters to improve the determination efficiency of the shooting parameters; or, the image processing device may also be based on the vehicle environment information such as the vehicle model, based on the captured vin code image of the vehicle and the vehicle model stored in the database. For the similarity of each vin code image sample, the shooting parameter corresponding to the vin code image sample with the highest vin code image similarity of the vehicle in the database is used as the target shooting parameter of the vehicle. Vin code image samples, multiple vehicle models, and (preferred) shooting parameters corresponding to each vin code image sample and each vehicle model; or, the image processing device can also be manually adjusted last time according to the vehicle environment information. The shooting parameters of vehicles with the same vehicle environmental information are used as the target shooting parameters, and so on, which are not listed here one by one. Further optionally, the shooting parameters involved in the present application, such as target shooting parameters, may include a shooting angle (to control the shooting device to shoot at the shooting angle), a focal length, an aperture, an ISO and/or EV value, etc., which is not limited in this application.
可选的,在一种可能的实施方式中,该车辆的车辆环境信息可包括该车辆的车型。图像处理设备在确定该目标拍摄参数,可以是根据预设的车辆车型和拍摄参数的对应关系,从数据库中查找出与该车辆的车型相同的车辆车型所对应的拍摄参数,并将查找出的该拍摄参数确定为用于拍摄该车辆的目标拍摄参数。其中,该数据库中可预先存储有多种车辆车型以及每种车辆车型对应的拍摄参数。该每种车型对应的拍摄参数可以是选择出的该车型下拍摄效果较好比如拍摄质量大于预设的质量阈值和/或vin码区域(或车牌区域)占图像比例大于预设的比例阈值等等的车辆图像样本的拍摄参数。Optionally, in a possible implementation manner, the vehicle environment information of the vehicle may include the vehicle model. When the image processing device determines the target shooting parameter, it may find the shooting parameter corresponding to the same vehicle model as the vehicle model from the database according to the preset correspondence between the vehicle model and the shooting parameter, and search for the The shooting parameters are determined as target shooting parameters for shooting the vehicle. Among them, a variety of vehicle models and shooting parameters corresponding to each vehicle model can be pre-stored in the database. The shooting parameters corresponding to each vehicle model may be that the selected shooting effect of the vehicle model is better, for example, the shooting quality is greater than the preset quality threshold and/or the vin code area (or license plate area) accounts for the image ratio greater than the preset ratio threshold, etc. The shooting parameters of the vehicle image samples.
可选的,在一种可能的实施方式中,该车辆的车辆环境信息包括该车辆的车型和该车辆所处的环境光强度。图像处理设备在确定该目标拍摄参数,可以是根据预设的多个环境光强度区间,确定该车辆所处的环境光强度在该多个环境光强度区间中所在的目标环境光强度区间;根据预设的车辆车型、环境光强度区间和拍摄参数三者之间的对应关系,从数据库中查找出与该车辆的车型和该目标环境光强度区间所对应的拍摄参数,并将查找出的该拍摄参数确定为用于拍摄该车辆的目标拍摄参数。其中,该数据库中可预先存储有多种车辆车型、该多个环境光强度区间以及与每种车辆车型和每个环境光强度区间对应的拍摄参数。Optionally, in a possible implementation manner, the vehicle environment information of the vehicle includes the vehicle model of the vehicle and the ambient light intensity where the vehicle is located. When the image processing device determines the target shooting parameter, the target ambient light intensity interval in which the ambient light intensity of the vehicle is located in the multiple ambient light intensity intervals may be determined according to preset multiple ambient light intensity intervals; The correspondence between the preset vehicle model, the ambient light intensity interval and the shooting parameters, the shooting parameters corresponding to the vehicle model and the target ambient light intensity interval are found from the database, and the searched out The shooting parameters are determined as target shooting parameters for shooting the vehicle. Among them, the database may pre-store multiple vehicle models, the multiple ambient light intensity intervals, and shooting parameters corresponding to each vehicle model and each ambient light intensity interval.
可选的,在一种可能的实施方式中,该车辆的车辆环境信息包括该车辆的车型和该车辆与该拍摄装置之间的距离。图像处理设备在确定该目标拍摄参数,可以是根据预设的多个距离区间,确定该车辆与该拍摄装置之间的距离在该多个距离区间中所在的目标距离区间;根据预设的车辆车型、距离区间和拍摄参数三者之间的对应关系,从数据库中查找出与该车辆的车型和该目标距离区间所对应的拍摄参数,并将查找出的该拍摄参数确定为用于拍摄该车辆的目标拍摄参数。其中,该数据库中可预先存储有多种车辆车型、该多个距离区间以及与每种车辆车型和每个距离区间对应的拍摄参数。Optionally, in a possible implementation manner, the vehicle environment information of the vehicle includes the vehicle model of the vehicle and the distance between the vehicle and the shooting device. When the image processing device determines the target shooting parameter, it may be based on preset multiple distance intervals to determine the target distance interval in which the distance between the vehicle and the shooting device is in the multiple distance intervals; according to the preset vehicle Correspondence between the vehicle model, the distance interval and the shooting parameters, the shooting parameters corresponding to the vehicle model and the target distance interval are found from the database, and the found shooting parameters are determined to be used for shooting The target shooting parameters of the vehicle. Among them, the database may pre-store a variety of vehicle models, the plurality of distance sections, and shooting parameters corresponding to each vehicle model and each distance section.
可选的,在一种可能的实施方式中,该车辆的车辆环境信息包括该车辆的车型和***时间。图像处理设备在确定该目标拍摄参数,可以是根据预设的多个时间段,确定该***时间在该多个时间段中所属的目标时间段;根据预设的车辆车型、时间段和拍摄参数三者之间的对应关系,从数据库中查找出与该车辆的车型和该目标时间段所对应的拍摄参数,并将查找出的该拍摄参数确定为用于拍摄该车辆的目标拍摄参数。其中,该数据库中可预先存储有多种车辆车型、该多个时间段以及与每种车辆车型和每个时间段对应的拍摄参数。Optionally, in a possible implementation manner, the vehicle environment information of the vehicle includes the vehicle model and system time of the vehicle. When the image processing device determines the target shooting parameter, the target time period to which the system time belongs in the multiple time periods may be determined according to preset multiple time periods; according to the preset vehicle model, time period and shooting parameters According to the correspondence between the three, the shooting parameters corresponding to the vehicle model and the target time period are found from the database, and the found shooting parameters are determined as the target shooting parameters for shooting the vehicle. Among them, a plurality of vehicle models, the plurality of time periods, and shooting parameters corresponding to each vehicle model and each time period may be pre-stored in the database.
可选的,在一种可能的实施方式中,该车辆的车辆环境信息包括***时间,图像处理设备在确定该目标拍摄参数,可根据预设的时间段和拍摄参数的对应关系,确定出该***时间对应的拍摄参数作为该目标拍摄参数;或者,该车辆的车辆环境信息包括该车辆所处的环境光强度,图像处理设备在确定该目标拍摄参数,可根据预设的环境光强度区间和拍摄参数的对应关系,确定出该环境光强度对应的拍摄参数作为该目标拍摄参数;该车辆的车辆环境信息包括该车辆与该拍摄装置之间的距离,图像处理设备在确定该目标拍摄参数 时,可根据预设的距离区间和拍摄参数的对应关系,确定出该距离对应的拍摄参数作为该目标拍摄参数;或者,该车辆环境信息还可包括该车辆的车型、该车辆所处的环境光强度、该车辆与该拍摄装置之间的距离和***时间,或者包括该车辆所处的环境光强度和该车辆与该拍摄装置之间的距离,或者包括该车辆所处的环境光强度和***时间,等等,此处不一一列举。Optionally, in a possible implementation manner, the vehicle environment information of the vehicle includes a system time, and the image processing device may determine the target shooting parameter according to the preset time period and the corresponding relationship between the shooting parameters to determine the The shooting parameters corresponding to the system time are used as the target shooting parameters; or, the vehicle environment information of the vehicle includes the ambient light intensity of the vehicle. The image processing device may determine the target shooting parameters according to the preset ambient light intensity interval and The corresponding relationship of the shooting parameters determines the shooting parameters corresponding to the ambient light intensity as the target shooting parameters; the vehicle environment information of the vehicle includes the distance between the vehicle and the shooting device, and when the image processing device determines the target shooting parameters , The shooting parameters corresponding to the distance can be determined as the target shooting parameters according to the corresponding relationship between the preset distance interval and the shooting parameters; or, the vehicle environment information can also include the vehicle model of the vehicle and the ambient light of the vehicle Intensity, distance between the vehicle and the shooting device and system time, or include the ambient light intensity of the vehicle and the distance between the vehicle and the shooting device, or include the ambient light intensity and system of the vehicle Time, etc. are not listed here.
例如,该拍摄装置可以是装载于一固定位置处,且该拍摄装置可旋转,即该拍摄装置的拍摄角度可调节。由此可通过对该拍摄装置采集的历史数据中的vin码图像进行分析,得到不同车型的vin码图像数据,并从中选择出拍摄效果较好的(比如涵盖全部vin码区域,且干扰较少的)vin码图像,获取该vin码图像的拍摄参数,以便于拍摄装置在识别到车辆的车型之后,能够根据车辆的车型快速调用拍摄参数,包括拍摄装置拍摄角度(控制拍摄装置以该拍摄角度拍摄)、焦距、光圈、ISO、EV值等等。或者,可采集的历史数据中的车牌图像进行分析,得到不同车型的车牌图像数据,并从中选择出拍摄效果较好的车牌图像,获取该车牌图像的拍摄参数,以便于拍摄装置在识别到车辆的车型之后,能够根据车辆的车型快速调用拍摄参数拍摄车牌图像。具体可以在接收到针对区域图像的拍摄指令时,确定该拍摄指令对应为车牌图像拍摄指令或vin码图像拍摄指令来触发调用对应的拍摄参数来拍摄,并可根据该拍摄指令确定获取到的拍摄图像为车牌图像还是vin码图像,进而确定出对应的图像处理规则。For example, the shooting device may be loaded at a fixed position, and the shooting device may be rotated, that is, the shooting angle of the shooting device may be adjusted. Therefore, the vin code image in the historical data collected by the shooting device can be analyzed to obtain vin code image data of different car models, and the better shooting effect can be selected from them (such as covering all the vin code area with less interference) ) Vin code image, to obtain the shooting parameters of the vin code image, so that the shooting device can quickly call the shooting parameters according to the vehicle model after identifying the vehicle model, including the shooting angle of the shooting device (controlling the shooting device with the shooting angle Shooting), focal length, aperture, ISO, EV value, etc. Or, the license plate image in the historical data that can be collected is analyzed to obtain license plate image data of different models, and the license plate image with better shooting effect is selected therefrom, and the shooting parameters of the license plate image are obtained so that the shooting device can recognize the vehicle After the vehicle model, you can quickly call the shooting parameters to shoot the license plate image according to the vehicle model. Specifically, when a shooting instruction for an area image is received, it is determined that the shooting instruction corresponds to a license plate image shooting instruction or a vin code image shooting instruction to trigger a call to corresponding shooting parameters to shoot, and the acquired shooting can be determined according to the shooting instruction Whether the image is a license plate image or a vin code image, and then determines the corresponding image processing rules.
又如,还可结合时间和/或环境光强度,获取拍摄效果较好的vin码图像(或车牌图像)的拍摄时间和拍摄参数,进而通过获取当前车辆的车型和当前时间(和/或环境光强度)来快速调用更加匹配的拍摄参数,以提升拍摄可靠性。因不同时间或者不同环境光强度均会对拍摄效果产生影响,比如白天和晚上采用相同的拍摄参数拍摄得到的图像效果完全不同。由此,可预先设置得到不同时间段和车辆车型(还可结合识别出的车辆图像类型,即图像区域类型),与拍摄装置的拍摄参数之间的对应关系;或者,预先设置得到环境光强度和车辆车型(还可结合识别出的车辆图像类型),与拍摄装置的拍摄参数之间的对应关系,或者,预先设置得到不同时间段、环境光强度和车辆车型(还可结合识别出的车辆图像类型),与拍摄装置的拍摄参数之间的对应关系,等等。例如,可通过对该拍摄装置采集的历史数据中的vin码图像进行分析(每个vin码图像关联记录了其拍摄图像时的拍摄时间),得到不同时间段的vin码图像数据,并根据每个时间段内相同车型的vin码图像数据选择出拍摄效果较好的vin码图像,获取该vin码图像的拍摄参数,从而确定出不同时间段和车辆车型,与拍摄装置的拍摄参数之间的对应关系;以便于拍摄装置在识别到当前时间处于的时间段以及车辆的车型之后,能够根据识别出的时间段和车型快速调用对应的拍摄参数进行拍摄。又如,可通过对该拍摄装置采集的历史数据中的vin码图像进行分析(每个vin码图像关联记录了其拍摄图像时的环境光强度),得到不同环境光强度下的vin码图像数据,并根据每个环境光强度区间下相同车型的Vin码图像数据选择出拍摄效果较好的vin码图像,获取该vin码图像的拍摄参数,从而确定出不同环境光强度区间和车辆车型,与拍摄装置的拍摄参数之间的对应关系;以便于拍摄装置在识别到当前环境光强度处于的环境光强度区间以及车辆的车型之后,能够根据识别出的环境光强度区间和车型快速调用对应的拍摄参数进行拍摄。结合车型时间等信息,快速调用拍摄参数,提升了拍摄质量,进而提 升了后续vin码区域或车牌区域的处理效果。For another example, the time and/or ambient light intensity can also be combined to obtain the shooting time and shooting parameters of the vin code image (or license plate image) with better shooting effect, and then by obtaining the current vehicle model and current time (and/or environment Light intensity) to quickly call more matching shooting parameters to improve shooting reliability. Different times or different ambient light intensities will affect the shooting effect, for example, the image effects obtained by shooting with the same shooting parameters during the day and night are completely different. In this way, the correspondence between different time periods and vehicle models (which can also be combined with the recognized vehicle image type, that is, image area type), and the shooting parameters of the shooting device can be set in advance; or, the ambient light intensity can be set in advance Correspondence between the vehicle model (also the identified vehicle image type) and the shooting parameters of the shooting device, or pre-set to obtain different time periods, ambient light intensity and vehicle model (also can be combined with the identified vehicle Image type), the correspondence between the shooting parameters of the shooting device, and so on. For example, by analyzing the vin code images in the historical data collected by the shooting device (each vin code image records the shooting time when the image was captured), vin code image data of different time periods can be obtained, and according to each The vin code image data of the same vehicle type within a period of time selects the vin code image with better shooting effect, and obtains the shooting parameters of the vin code image, thereby determining the difference between the different time periods and vehicle models, and the shooting parameters of the shooting device Correspondence relationship; so that the camera can quickly call the corresponding shooting parameters according to the identified time zone and vehicle model after shooting the current time zone and vehicle model. For another example, the vin code image data in different ambient light intensities can be obtained by analyzing the vin code images in the historical data collected by the photographing device (each vin code image correlates and records the ambient light intensity at the time of capturing the image) , And according to the Vin code image data of the same car model in each ambient light intensity section, select a vin code image with better shooting effect, obtain the shooting parameters of the vin code image, so as to determine different ambient light intensity sections and vehicle models, and Correspondence between the shooting parameters of the shooting device; so that the shooting device can quickly call the corresponding shooting according to the identified ambient light intensity section and vehicle model after identifying the ambient light intensity section where the current ambient light intensity is located and the vehicle model Parameters for shooting. Combined with the vehicle model time and other information, the shooting parameters are quickly called to improve the shooting quality, which in turn improves the processing effect of the subsequent vin code area or license plate area.
203、如果该车辆图像的类型为vin码图像类型,确定该车辆图像为vin码图像,则可执行步骤205-207。203. If the type of the vehicle image is a vin code image type, and it is determined that the vehicle image is a vin code image, then steps 205-207 may be performed.
在确定得到获取的车辆图像为vin码图像之后,即可对该vin码图像进行处理,以提取出该vin码区域。对该vin码图像进行处理时,可采用tophat变换,边缘检测,形态学闭运算,形态学开运算,计算最小外接矩形的一套简单快速的算法来确定vin码区域,进而识别出vin码。After determining that the acquired vehicle image is a vin code image, the vin code image can be processed to extract the vin code area. When processing the vin code image, tophat transform, edge detection, morphological closed operation, morphological open operation, and a set of simple and fast algorithms for calculating the smallest circumscribed rectangle can be used to determine the vin code area, and then identify the vin code.
204、如果该车辆图像的类型为车牌图像类型,确定该车辆图像为车牌图像,则可执行步骤208-210。204. If the type of the vehicle image is a license plate image type, and it is determined that the vehicle image is a license plate image, then steps 208-210 may be performed.
在确定得到获取的车辆图像为车牌图像之后,即可对该车牌图像进行处理,以提取出该车牌区域。对该车牌图像进行处理时,可采用边缘检测,形态学闭运算,形态学开运算,计算最小外接矩形的一套简单快速的算法来确定车牌区域,进而识别出车牌。After determining that the acquired vehicle image is a license plate image, the license plate image can be processed to extract the license plate area. When processing the license plate image, a set of simple and fast algorithms for edge detection, morphological close operation, morphological open operation, and calculation of the minimum circumscribed rectangle can be used to determine the license plate area, and then recognize the license plate.
205、对该vin码图像进行tophat变换,以得到tophat变换后的vin码图像,并对该tophat变换后的vin码图像进行边缘检测,以得到边缘检测后的第一边缘图像。205. Perform tophat transformation on the vin code image to obtain a tophat transformed vin code image, and perform edge detection on the tophat transformed vin code image to obtain a first edge image after edge detection.
通过对拍摄的vin码图像进行tophat变换,能够减少该vin码图像区域受到的干扰。由于tophat在图像分割中对检测暗处明亮的细节效果较好,特别是有均匀宽度或大小的目标,由此,可通过对拍摄的vin码图像进行tophat变换以进一步区分出vin码区域。可选的,在vin码图像中存在一些车辆车体反射干扰,为了减少这些干扰,可以将原拍摄得到的vin码图像即原始图像转换为灰度图像,得到转换后的灰度图像之后,再对灰度图像进行tophat变换,得到的tophat变换结果。原vin码图像经过tophat滤波后,就具有简单、均匀的背景和前景,以便于更好地区分出vin码区域。By tophat transforming the captured vin code image, the interference received by the vin code image area can be reduced. Since tophat is better for detecting bright details in dark places in image segmentation, especially for objects with uniform width or size, tophat transformation can be performed on the captured vin code image to further distinguish the vin code area. Optionally, there are some reflection disturbances of the vehicle body in the vin code image. In order to reduce these interferences, the vin code image obtained by the original shooting, that is, the original image, can be converted into a grayscale image. After the converted grayscale image is obtained, then The tophat transform is performed on the grayscale image to obtain the tophat transform result. After the original vin code image is filtered by tophat, it has a simple and uniform background and foreground, so as to better distinguish the vin code area.
例如,灰度级图像f的tophat变换定义为f减去其开运算的结果,即That(f)=f-(f°b),其中,b为均值滤波模板,°为开运算。For example, the tophat transformation of the grayscale image f is defined as the result of f minus its opening operation, that is, That(f)=f-(f°b), where b is the mean filter template and ° is the opening operation.
可选的,在该对该vin码图像进行顶帽tophat变换,以得到tophat变换后的vin码图像之前,图像处理设备还可检测该vin码图像的亮度是否处于预设的亮度区间范围内;如果该vin码图像的亮度不处于该亮度区间范围内,则可触发该对该vin码图像进行顶帽tophat变换,以得到tophat变换后的vin码图像的步骤。进一步可选的,如果该vin码图像的亮度处于该亮度区间范围内,即拍摄条件较好时,则可不进行tophat变换,而直接对该vin码图像进行边缘检测,从而有助于减少设备开销。Optionally, before the top hat transform is performed on the vin code image to obtain the tophat transformed vin code image, the image processing device may also detect whether the brightness of the vin code image is within a preset brightness interval range; If the brightness of the vin code image is not within the range of the brightness interval, the step of top hat transforming the vin code image may be triggered to obtain a tophat transformed vin code image. Further optionally, if the brightness of the vin code image is within the range of the brightness range, that is, when the shooting conditions are good, the tophat transformation may not be performed, and the edge detection of the vin code image may be directly performed, thereby helping to reduce equipment overhead .
进一步的,在进行边缘检测时,可采用预设的边缘检测算法如可采用Canny算子进行边缘检测。该Canny算法的特点是试图将独立边的候选像素拼装成轮廓。Canny算子求边缘点具体算法步骤如下:Further, when performing edge detection, a preset edge detection algorithm may be used, for example, a Canny operator may be used for edge detection. The characteristic of the Canny algorithm is to try to assemble candidate pixels of independent edges into an outline. The specific algorithm steps of Canny operator to find edge points are as follows:
1)用高斯滤波器与图像(如该vin码图像)进行卷积,以平滑图像,滤除噪声;1) Use a Gaussian filter to convolve the image (such as the vin code image) to smooth the image and filter out noise;
2)用一阶偏导有限差分计算图像中每个像素点的梯度幅值(梯度强度)和方向;图像中的边缘可以指向各个方向,Canny算法可以使用算子(如Roberts,Prewitt,Sobel等)来检测图像中的水平、垂直和对角边缘,获取水平和垂直方向的一阶导数值,由此确定出像素点的梯度幅值和方向,其中,梯度方向的计算和梯度算子的选取保持一致;2) Use the first-order partial derivative finite difference to calculate the gradient amplitude (gradient strength) and direction of each pixel in the image; the edges in the image can point in various directions, and the Canny algorithm can use operators (such as Roberts, Prewitt, Sobel, etc.) ) To detect the horizontal, vertical, and diagonal edges in the image, and obtain the first derivative values in the horizontal and vertical directions, thereby determining the gradient amplitude and direction of the pixel, where the gradient direction is calculated and the gradient operator is selected be consistent;
3)对梯度幅值进行非极大值抑制,以消除边缘检测带来的杂散响应;具体的,对梯 度图像中每个像素进行非极大值抑制时,可以将当前像素的梯度强度与沿正负梯度方向上的两个像素进行比较,如果当前像素的梯度强度与另外两个像素相比最大,则该像素点保留为边缘点,否则该像素点将被抑制,从而将局部最大值之外的所有梯度值抑制为0,实现“瘦”边;3) Perform non-maximum suppression on the gradient amplitude to eliminate the spurious response caused by edge detection; specifically, when performing non-maximum suppression on each pixel in the gradient image, the gradient intensity of the current pixel can be Compare the two pixels along the positive and negative gradient direction. If the gradient intensity of the current pixel is the largest compared to the other two pixels, the pixel point will remain as an edge point, otherwise the pixel point will be suppressed, thus the local maximum All gradient values other than 0 are suppressed to 0, to achieve a "thin" edge;
4)用双阈值(Double-Threshold)算法检测和连接边缘;具体的,进行3)之后,此时还是存在由于噪声和颜色变化引起的一些边缘像素,由此可以通过设置高低阈值,如果边缘像素的梯度值高于高阈值,则可将其标记为强边缘像素;如果边缘像素的梯度值小于高阈值并且大于低阈值,则可将其标记为弱边缘像素;如果边缘像素的梯度值小于低阈值,则被抑制。从而能够通过边缘检测能够实现从不同视觉对象中提取有用的结构信息,并减少了要处理的数据量。4) Double-Threshold algorithm is used to detect and connect edges; specifically, after 3), there are still some edge pixels caused by noise and color changes, which can be set by setting high and low thresholds, if the edge pixels The gradient value of is higher than the high threshold, it can be marked as a strong edge pixel; if the gradient value of the edge pixel is less than the high threshold and greater than the low threshold, it can be marked as a weak edge pixel; if the gradient value of the edge pixel is less than low The threshold is suppressed. Therefore, it is possible to extract useful structural information from different visual objects through edge detection, and reduce the amount of data to be processed.
206、对该第一边缘图像进行形态学闭运算,以得到第一闭运算图像,对该第一闭运算图像进行形态学开运算,以得到第一开运算图像;确定该第一开运算图像中vin码区域的最小外接矩形,并将该最小外接矩形确定的区域确定为该vin码图像包括的vin码区域。206. Perform a morphological closing operation on the first edge image to obtain a first closed computing image, and perform a morphological opening operation on the first closed computing image to obtain a first opening computing image; determine the first opening computing image The minimum circumscribed rectangle of the middle vin code area, and the area determined by the minimum circumscribed rectangle is determined as the vin code area included in the vin code image.
在对vin码图像进行边缘检测得到边缘检测结果图像即边缘图像之后,还可对该边缘图形进行形态学闭运算,先膨胀后腐蚀。从而得到形态学闭运算结果,以排除小型黑洞(黑色区域)。在进行形态学闭运算时,使用的结构元素可以为一个尺寸为1*N的行向量结构元素,以将水平方向上不连续的边缘连接起来。After edge detection is performed on the vin code image to obtain an edge detection result image, that is, an edge image, a morphological closing operation can also be performed on the edge graphic, which is expanded first and then corroded. Thus, the morphological closed calculation result is obtained to exclude small black holes (black areas). When performing morphological closed operations, the structural element used may be a row vector structural element with a size of 1*N to connect discontinuous edges in the horizontal direction.
其中,该形态学闭运算使用的结构元素可以是1*N的行向量结构元素,N可以为列数,可用于指示结构元素的宽度,N大于0。可选的,该N可以是根据该vin码图像的分辨率设置得到的;和/或,该N可以是根据该vin码图像中vin码区域的尺寸(大小)设置得到的,该尺寸包括长度或宽度;和/或,该N可以是根据该vin码区域中字符间距与该vin码图像的尺寸的比值设置得到的;和/或,该N可以是根据该vin码图像的宽度设置得到的。例如,该N可根据图像的分辨率和/或图像中vin码区域的大小设置得到,分辨率越大和/或vin码区域越大,N的取值越大,具体可预先设置N与图像的分辨率(和/或图像中vin码区域的大小)的对应关系。又如,该N可根据拍摄图像中vin码区域的字符间距大小与vin码图像大小的统计关系得到,比如字符间距大小与vin码图像大小的比值越大,N的取值越大,具体可预先设置N与字符间距大小与图像大小的比值的对应关系。又如,该N可以根据图像宽度设置得到,比如该N的值可以取图像宽度的5%。从而得到形态学闭运算结果,以排除小型黑洞(黑色区域)。也就是说,进行闭运算的结构元素N可以是根据图像的分辨率和/或图像中vin码区域的大小、图像中vin码区域的字符间距大小与图像大小的比值、图像宽度等参数设置得到,灵活性较高,提升了图像处理效果。The structural element used in the morphological closed operation may be a 1*N row vector structural element, N may be the number of columns, and may be used to indicate the width of the structural element, and N is greater than 0. Optionally, the N may be obtained according to the resolution setting of the vin code image; and/or, the N may be obtained according to the size (size) of the vin code region in the vin code image, the size including the length Or width; and/or, the N may be set according to the ratio of the character pitch in the vin code area to the size of the vin code image; and/or, the N may be set according to the width of the vin code image . For example, the N can be set according to the resolution of the image and/or the size of the vin code area in the image. The larger the resolution and/or the larger the vin code area, the larger the value of N. Specifically, N and the image can be set in advance. Correspondence between the resolution (and/or the size of the vin code area in the image). For another example, the N can be obtained based on the statistical relationship between the character pitch size of the vin code area and the vin code image size in the captured image. For example, the larger the ratio between the character pitch size and the vin code image size, the larger the value of N. Specifically, The correspondence relationship between N and the ratio of the character pitch size to the image size is preset. For another example, the N can be obtained according to the image width setting, for example, the value of the N can be 5% of the image width. Thus, the morphological closed calculation result is obtained to exclude small black holes (black areas). That is to say, the structural element N for the closed operation can be obtained according to the parameters such as the resolution of the image and/or the size of the vin code area in the image, the ratio of the character pitch of the vin code area in the image to the image size, and the image width. , Higher flexibility and improved image processing effect.
进一步的,在进行形态学闭运算后,再进行形态学开运算处理,先腐蚀后膨胀,以将图像中的小尺寸噪声去除。形态学开运算使用的结构元素可与上述的闭运算使用的结构元素保持一致。从而得到形态学开运算结果,以实现消除小物体、在纤细点处分离物体、平滑较大物体的边界的同时并不明显改变其面积等效果。Further, after the morphology close operation is performed, the morphology open operation processing is performed, firstly eroded and then expanded to remove small-size noise in the image. The structural elements used in the open operation of morphology can be consistent with the structural elements used in the closed operation described above. Thus, the morphological opening operation result is obtained to achieve the effects of eliminating small objects, separating objects at slender points, and smoothing the boundaries of larger objects without significantly changing their area.
进一步的,在进行开运算之后,在结果图像即开运算图像中,显示为白色的部分为前景,黑色部分为背景,从而可通过对该结果图像即开运算图像进行扫描,即可计算得到前景部分的最小外接矩形,则该最小外接矩形所确定(包围)的区域即为vin码标牌所在区 域也即vin码区域。Further, after the opening operation is performed, the portion displayed as white in the result image opening operation image is the foreground, and the black portion is the background, so that the foreground can be calculated by scanning the result image opening operation image Part of the minimum circumscribed rectangle, the area determined (enclosed) by the minimum circumscribed rectangle is the area where the vin code sign is located, that is, the vin code area.
207、对该vin码区域进行识别,以识别出该vin码图像包括的vin码。207. Identify the vin code area to identify the vin code included in the vin code image.
在提取出该vin码区域之后,即可存储该vin码区域的图像,和/或进一步识别出该vin码区域包括的字符(标牌)或条码等等。可选的,对该vin码区域进行识别的方式包括OCR字符识别或其他识别方式,本方案不做限定。After the vin code area is extracted, an image of the vin code area can be stored, and/or a character (signage) or barcode included in the vin code area can be further recognized. Optionally, the manner of identifying the vin code area includes OCR character recognition or other recognition methods, which is not limited in this solution.
可选的,为了确保识别出的vin码的可靠性,在识别出该vin码之后,还可对该vin进行校验,以确定其是否正确/合法,比如可以对该识别出的vin码的第9位进行校验。因vin码的第9位始终为校验位,通过对vin码中的其他位进行一系列计算后即可获得正确的校验位(其中,vin码的第9位为为1-9任意一位数字或“X”。计算方法可以为将vin中其余每一位字母或数字的对应数值乘以该位的加权系数,然后除以11,余数即为校验位,若余数为10,校验位为“X”,该加权系数可参见《世界汽车识别代号(VIN)资料手册》P21~23。例如,首先将其它16位中的字母按下列关系转换成数字:A=1B=2C=3D=4E=5F=6G=7H=8J=1K=2L=3M=4N=5P=7R=9S=2T=3U=4V=5W=6X=7Y=8Z=9,每个位置及其对应的加权系数为:位置:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17,加权系数:8 7 6 5 4 32 10*9 8 7 6 5 4 3 2),进而可通过将该计算出的校验位和该第9位进行比较,判断两者是否相同,确定识别出的vin码是否存在错误,也即,两者不同时,表明该vin码存在错误。或者,可以检测识别出的vin码中是否存在非法字符,具体可以通过预置合法字符白名单进行匹配比对,如果存在非法字符,比如该白名单以外的字符,如I、O、Q等等,可以确定该识别出的vin码存在错误。或者,可以通过检测识别出的vin码的位数,因为正常vin码是固定的17位,如果长于或短于17位,则可以确定该识别出的vin码存在错误。如果确定识别出的vin码存在错误,还可以触发重新识别(如果错误次数达到预设次数阈值如3次,还可重新进行vin码区域的提取并重新识别),或者发出告警信息以提示进行人工识别或检测等等。Optionally, in order to ensure the reliability of the identified vin code, after the vin code is identified, the vin can also be checked to determine whether it is correct/legal, such as the identification of the vin code The 9th digit is checked. Because the 9th bit of the vin code is always a check digit, the correct check digit can be obtained by performing a series of calculations on other bits in the vin code (wherein the 9th bit of the vin code is any one of 1-9 Digit or “X”. The calculation method is to multiply the corresponding value of each remaining letter or digit in vin by the weighting coefficient of the digit, and then divide by 11, the remainder is the check digit. If the remainder is 10, the calibration The check digit is "X", and the weighting coefficient can be found in the "World Automobile Identification Code (VIN) Information Manual" P21 ~ 23. For example, first convert the letters in the other 16 digits into numbers according to the following relationship: A=1B=2C= 3D = 4E = 5F = 6G = 7H = 8J = 1K = 2L = 3M = 4N = 5P = 7R = 9S = 2T = 3U = 4V = 5W = 6X = 7Y = 8Z = 9, each position and its corresponding weight The coefficients are: location: 1 2 3 4 4 5 6 6 7 8 10 10 11 12 13 14 14 15 16 17 weighting coefficient 8 7 6 5 4 4 32 10*9 8 7 6 5 4 4 3 2), which can then be calculated by this calculation The parity bit and the ninth bit are compared to determine whether the two are the same, and determine whether the recognized vin code has an error, that is, when the two are different, it indicates that the vin code has an error. Or, it can detect whether there are illegal characters in the recognized vin code. Specifically, it can be matched and matched by presetting a white list of legal characters. If there are illegal characters, such as characters outside the white list, such as I, O, Q, etc. , It can be determined that the recognized vin code has an error. Alternatively, the number of digits of the recognized vin code can be detected because the normal vin code is a fixed 17 bits. If it is longer or shorter than 17 bits, it can be determined that the recognized vin code has an error. If it is determined that there is an error in the recognized vin code, it can also trigger re-identification (if the number of errors reaches the preset number of thresholds such as 3 times, the vin code area can be extracted and re-identified again), or an alarm message is issued to prompt manual Identification or detection, etc.
在获取到正确的vin码之后,即可存储该vin码,或者可基于该vin码办理车辆业务如车险投保等等,从而提升业务办理的智能化和效率。After the correct vin code is obtained, the vin code can be stored, or the vehicle business such as auto insurance can be processed based on the vin code, thereby improving the intelligence and efficiency of business processing.
208、对该车牌图像进行边缘检测,以得到边缘检测后的第二边缘图像。208. Perform edge detection on the license plate image to obtain a second edge image after edge detection.
209、对该第二边缘图像进行形态学闭运算,以得到第二闭运算图像,对该第二闭运算图像进行形态学开运算,以得到第二开运算图像,确定该第二开运算图像中车牌区域的最小外接矩形,并将该最小外接矩形确定的区域确定为该车牌图像包括的车牌区域。209. Perform a morphological close operation on the second edge image to obtain a second closed operation image, perform a morphological open operation on the second closed operation image to obtain a second open operation image, and determine the second open operation image The minimum circumscribed rectangle of the medium license plate area, and the area determined by the minimum circumscribed rectangle is determined as the license plate area included in the license plate image.
其中,该形态学闭运算使用的结构元素可以是M*N的向量结构元素,M可以为行数,可用于指示结构元素的长度(高度);N可以为列数,可用于指示结构元素的宽度,M和N均大于0。可选的,该M和N可是根据该车牌图像的分辨率设置得到的;和/或,该M和N可以是根据该车牌图像中车牌区域的尺寸设置得到的,该尺寸包括长度(高度)和/或宽度;和/或,该M和N可以是根据该车牌区域中字符间距与该车牌图像的尺寸(如高度或宽度)的比值设置得到的;和/或,该M可以是根据该车牌图像的高度设置得到的,N是根据该车牌图像的宽度设置得到的,如该M为该高度的5%,该N为该宽度的5%。Among them, the structural elements used in the morphological closed operation can be M*N vector structural elements, M can be the number of rows, which can be used to indicate the length (height) of the structural elements; N can be the number of columns, which can be used to indicate the structure elements Width, M and N are greater than 0. Optionally, the M and N may be obtained according to the resolution setting of the license plate image; and/or, the M and N may be obtained according to the size setting of the license plate area in the license plate image, the size including the length (height) And/or width; and/or, the M and N can be set according to the ratio of the character spacing in the license plate area to the size (such as height or width) of the license plate image; and/or, the M can be based on the The height of the license plate image is set, and N is obtained according to the width of the license plate image. For example, M is 5% of the height, and N is 5% of the width.
210、对该车牌区域进行识别,以识别出该车牌图像包括的车牌。210. Identify the license plate area to identify the license plate included in the license plate image.
在提取出该车牌区域之后,即可存储该车牌区域的图像,和/或进一步识别出该车牌区 域包括的字符(车牌)等等。可选的,对该vin码区域进行识别的方式包括OCR字符识别或其他识别方式,本方案不做限定。After the license plate area is extracted, the image of the license plate area can be stored, and/or the characters (license plates) included in the license plate area can be further recognized. Optionally, the manner of identifying the vin code area includes OCR character recognition or other recognition methods, which is not limited in this solution.
可选的,该步骤208-210的描述可参加步骤205-207的相关描述,此处不赘述。Optionally, the description of steps 208-210 can participate in the related description of steps 205-207, which will not be repeated here.
本申请的vin码区域或车牌区域提取方式,在对图像中的vin码区域或车牌进行提取时,提升了检测效率,可以很好地克服车体反射景物的干扰,准确性较高,且能够适用于在性能有限的嵌入式***中应用,应用范围广。The vin code area or license plate area extraction method of the present application improves the detection efficiency when extracting the vin code area or license plate area in the image, can well overcome the interference of the vehicle body reflecting the scene, the accuracy is high, and can It is suitable for applications in embedded systems with limited performance and has a wide range of applications.
在本实施例中,图像处理设备能够通过获取车辆图像,并将该车辆图像输入预置的图像检测模型以识别出该车辆图像的类型,即确定该车辆图像是vin码图像还是车牌图像,进而能够根据识别出的类型区别选择对应的图像处理规则来对该车辆图像进行处理,包括选择进行tophat变换,边缘检测,形态学闭运算,形态学开运算,计算最小外接矩形等,以得到该车辆图像包括的vin码或车牌,这就提升了图像处理的灵活性,有助于提升对车辆图像的vin码或车牌的识别效率,以及提升图像处理效果。In this embodiment, the image processing device can identify the type of the vehicle image by acquiring the vehicle image and inputting the vehicle image into a preset image detection model, that is, determining whether the vehicle image is a vin code image or a license plate image, and According to the identified type, the corresponding image processing rules can be selected to process the vehicle image, including the selection of tophat transformation, edge detection, morphological closing operation, morphological opening operation, calculating the minimum circumscribed rectangle, etc., to obtain the vehicle The vin code or license plate included in the image enhances the flexibility of image processing, helps to improve the recognition efficiency of the vin code or license plate of the vehicle image, and improve the image processing effect.
上述方法实施例都是对本申请的图像处理方法的举例说明,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。The above method embodiments are all examples of the image processing method of the present application, and the description of each embodiment has its own emphasis. For a part that is not detailed in an embodiment, you can refer to the related descriptions of other embodiments.
请参见图3,图3是本申请实施例提供的一种图像处理设备的结构示意图。本申请实施例的图像处理设备包括用于执行上述图像处理方法的单元。具体的,本实施例的图像处理设备300可包括:获取单元301和处理单元302。其中,Please refer to FIG. 3, which is a schematic structural diagram of an image processing device according to an embodiment of the present application. The image processing apparatus of the embodiment of the present application includes a unit for performing the above image processing method. Specifically, the image processing apparatus 300 of this embodiment may include: an acquisition unit 301 and a processing unit 302. among them,
获取单元301,用于获取车辆图像,所述车辆图像为vin码图像或车牌图像,所述vin码图像为包括车辆的vin码区域的图像,所述车牌图像为包括车辆的车牌区域的图像;The obtaining unit 301 is configured to obtain a vehicle image, the vehicle image is a vin code image or a license plate image, the vin code image is an image including a vin code area of the vehicle, and the license plate image is an image including a vehicle license plate area;
处理单元302,用于按照预设的识别规则对所述车辆图像进行识别,以识别出所述车辆图像的类型,所述车辆图像的类型为vin码图像类型或车牌图像类型;The processing unit 302 is configured to recognize the vehicle image according to a preset recognition rule to identify the type of the vehicle image, and the type of the vehicle image is a vin code image type or a license plate image type;
处理单元302,还用于当所述车辆图像的类型为vin码图像类型时,按照预设的vin码图像处理规则对所述vin码图像进行处理,以得到所述车辆的vin码;The processing unit 302 is further configured to process the vin code image according to a preset vin code image processing rule when the type of the vehicle image is a vin code image type to obtain the vin code of the vehicle;
处理单元302,还用于当所述车辆图像的类型为车牌图像类型时,按照预设的车牌图像处理规则对所述车牌图像进行处理,以得到所述车辆的车牌。The processing unit 302 is further configured to process the license plate image according to a preset license plate image processing rule when the type of the vehicle image is the license plate image type to obtain the license plate of the vehicle.
可选的,处理单元302,可具体用于将所述车辆图像输入预置的图像检测模型,以得到所述图像检测模型的输出结果,所述输出结果用于指示所述车辆图像的类型;Optionally, the processing unit 302 may be specifically configured to input the vehicle image into a preset image detection model to obtain an output result of the image detection model, and the output result is used to indicate the type of the vehicle image;
其中,所述图像检测模型是根据预先选取的多个图像样本以及每个图像样本的类型训练得到的,所述多个图像样本包括第一数量的vin码图像样本以及第二数量的车牌图像样本,且所述第一数量和所述第二数量的差值的绝对值不超过预设数目阈值。The image detection model is trained based on a plurality of pre-selected image samples and the type of each image sample, the plurality of image samples includes a first number of vin code image samples and a second number of license plate image samples And the absolute value of the difference between the first quantity and the second quantity does not exceed a preset number threshold.
可选的,处理单元302,可具体用于对所述vin码图像进行顶帽tophat变换,以得到tophat变换后的vin码图像;对所述tophat变换后的vin码图像进行边缘检测,以得到边缘检测后的第一边缘图像;对所述第一边缘图像进行形态学闭运算,以得到第一闭运算图像;对所述第一闭运算图像进行形态学开运算,以得到第一开运算图像;确定所述第一开运算图像中vin码区域的最小外接矩形,并将所述最小外接矩形确定的区域确定为所述vin码图像包括的vin码区域;对所述vin码区域进行识别,以识别出所述车辆的vin码。Optionally, the processing unit 302 may be specifically configured to perform a top-hat tophat transformation on the vin code image to obtain a tophat transformed vin code image; perform edge detection on the tophat transformed vin code image to obtain A first edge image after edge detection; performing a morphological close operation on the first edge image to obtain a first closed operation image; performing a morphological opening operation on the first closed operation image to obtain a first opening operation Image; determine the minimum circumscribed rectangle of the vin code area in the first open operation image, and determine the area determined by the minimum circumscribed rectangle as the vin code area included in the vin code image; identify the vin code area To identify the vin code of the vehicle.
可选的,对所述第一边缘图像进行的所述形态学闭运算使用的结构元素是1*N的行向量结构元素,所述N为列数,所述N大于0;Optionally, the structural element used for the morphological closed operation on the first edge image is a 1*N row vector structural element, where N is the number of columns, and N is greater than 0;
其中,所述N是根据所述vin码图像的分辨率设置得到的;和/或,Wherein, the N is obtained according to the resolution setting of the vin code image; and/or,
所述N是根据所述vin码图像中vin码区域的尺寸设置得到的,所述尺寸包括长度或宽度;和/或,The N is obtained according to the size setting of the vin code area in the vin code image, and the size includes a length or a width; and/or,
所述N是根据所述vin码区域中字符间距与所述vin码图像的尺寸的比值设置得到的;和/或,The N is set according to the ratio of the character pitch in the vin code area to the size of the vin code image; and/or,
所述N是根据所述vin码图像的宽度设置得到的。The N is obtained according to the width setting of the vin code image.
可选的,处理单元302,可具体用于对所述车牌图像进行边缘检测,以得到边缘检测后的第二边缘图像;对所述第二边缘图像进行形态学闭运算,以得到第二闭运算图像;对所述第二闭运算图像进行形态学开运算,以得到第二开运算图像;确定所述第二开运算图像中车牌区域的最小外接矩形,并将所述最小外接矩形确定的区域确定为所述车牌图像包括的车牌区域;对所述车牌区域进行识别,以识别出所述车牌图像包括的车牌。Optionally, the processing unit 302 may be specifically configured to perform edge detection on the license plate image to obtain a second edge image after edge detection; perform a morphological close operation on the second edge image to obtain a second closed Operation image; performing a morphological opening operation on the second closed operation image to obtain a second opening operation image; determining a minimum circumscribed rectangle of the license plate area in the second open operation image, and determining the minimum circumscribed rectangle The area is determined as the license plate area included in the license plate image; the license plate area is identified to identify the license plate included in the license plate image.
可选的,对所述第二边缘图像进行的所述形态学闭运算使用的结构元素是M*N的向量结构元素,所述M为行数,所述N为列数,所述M和N大于0;Optionally, the structural element used for the morphological closed operation on the second edge image is a vector structural element of M*N, where M is the number of rows, N is the number of columns, and M and N is greater than 0;
其中,所述M和N是根据所述车牌图像的分辨率设置得到的;和/或,Wherein, the M and N are obtained according to the resolution setting of the license plate image; and/or,
所述M和N是根据所述车牌图像中车牌区域的尺寸设置得到的,所述尺寸包括长度和/或宽度;和/或,The M and N are set according to the size of the license plate area in the license plate image, and the size includes length and/or width; and/or,
所述M和N是根据所述车牌区域中字符间距与所述车牌图像的尺寸的比值设置得到的;和/或,The M and N are set according to the ratio of the character pitch in the license plate area to the size of the license plate image; and/or,
所述M是根据所述车牌图像的长度设置得到的,N是根据所述车牌图像的宽度设置得到的。The M is obtained according to the length of the license plate image, and the N is obtained according to the width of the license plate image.
可选的,处理单元302,还可用于在所述对所述vin码图像进行顶帽tophat变换,以得到tophat变换后的vin码图像之前,检测所述vin码图像的亮度是否处于预设的亮度区间范围内;如果所述vin码图像的亮度不处于所述亮度区间范围内,触发所述对所述vin码图像进行顶帽tophat变换,以得到tophat变换后的vin码图像。Optionally, the processing unit 302 may be further configured to detect whether the brightness of the vin code image is at a preset level before performing top hat transformation on the vin code image to obtain the tophat transformed vin code image Within the brightness interval; if the brightness of the vin code image is not within the brightness interval, trigger the top hat transformation of the vin code image to obtain a tophat transformed vin code image.
具体的,该图像处理设备可通过上述单元实现上述图1至图2所示实施例中的图像处理方法中的部分或全部步骤。应理解,本申请实施例是对应方法实施例的装置实施例,对方法实施例的描述,也适用于本申请实施例。Specifically, the image processing device may implement part or all of the steps in the image processing method in the embodiments shown in FIG. 1 to FIG. 2 through the above units. It should be understood that the embodiments of the present application are device embodiments corresponding to the method embodiments, and the description of the method embodiments is also applicable to the embodiments of the present application.
请参见图4,图4是本申请实施例提供的另一种图像处理设备的结构示意图。该图像处理设备用于执行上述的方法。如图4所示,本实施例中的图像处理设备400可以包括:一个或多个处理器401和存储器402。该图像处理设备还可包括拍摄装置或者与拍摄装置连接。可选的,该图像处理设备还可包括一个或多个用户接口403,和/或,一个或多个通信接口404。上述处理器401、用户接口403、通信接口404和存储器402可通过总线405连接,或者可以通过其他方式连接,图4中以总线方式进行示例说明。其中,存储器402用于存储计算机程序,所述计算机程序包括程序指令,处理器401用于执行存储器402存储的程序指令。Please refer to FIG. 4, which is a schematic structural diagram of another image processing device according to an embodiment of the present application. The image processing device is used to perform the method described above. As shown in FIG. 4, the image processing device 400 in this embodiment may include: one or more processors 401 and a memory 402. The image processing apparatus may further include or be connected to a photographing device. Optionally, the image processing device may further include one or more user interfaces 403, and/or one or more communication interfaces 404. The processor 401, the user interface 403, the communication interface 404, and the memory 402 may be connected through the bus 405, or may be connected in other ways. The bus mode is used as an example in FIG. The memory 402 is used to store a computer program, and the computer program includes program instructions, and the processor 401 is used to execute the program instructions stored in the memory 402.
其中,处理器401可用于调用所述程序指令执行以下步骤:获取车辆图像,所述车辆图像为vin码图像或车牌图像,所述vin码图像为包括车辆的vin码区域的图像,所述车牌图像为包括车辆的车牌区域的图像;按照预设的识别规则对所述车辆图像进行识别,以识 别出所述车辆图像的类型,所述车辆图像的类型为vin码图像类型或车牌图像类型;如果所述车辆图像的类型为vin码图像类型,按照预设的vin码图像处理规则对所述vin码图像进行处理,以得到所述车辆的vin码;如果所述车辆图像的类型为车牌图像类型,按照预设的车牌图像处理规则对所述车牌图像进行处理,以得到所述车辆的车牌。The processor 401 can be used to call the program instructions to perform the following steps: obtain a vehicle image, the vehicle image is a vin code image or a license plate image, and the vin code image is an image including a vin code area of the vehicle, the license plate The image is an image including the license plate area of the vehicle; the vehicle image is recognized according to a preset recognition rule to identify the type of the vehicle image, and the type of the vehicle image is a vin code image type or a license plate image type; If the type of the vehicle image is a vin code image type, process the vin code image according to a preset vin code image processing rule to obtain the vin code of the vehicle; if the type of the vehicle image is a license plate image Type, processing the license plate image according to a preset license plate image processing rule to obtain the license plate of the vehicle.
可选的,处理401在执行所述按照预设的识别规则对所述车辆图像进行识别,以识别出所述车辆图像的类型时,可具体执行如下步骤:将所述车辆图像输入预置的图像检测模型,以得到所述图像检测模型的输出结果,所述输出结果用于指示所述车辆图像的类型;Optionally, when the process 401 executes the recognition of the vehicle image according to a preset recognition rule to identify the type of the vehicle image, it may specifically perform the following steps: input the vehicle image into a preset An image detection model to obtain an output result of the image detection model, the output result is used to indicate the type of the vehicle image;
其中,所述图像检测模型是根据预先选取的多个图像样本以及每个图像样本的类型训练得到的,所述多个图像样本包括第一数量的vin码图像样本以及第二数量的车牌图像样本,且所述第一数量和所述第二数量的差值的绝对值不超过预设数目阈值。The image detection model is trained based on a plurality of pre-selected image samples and the type of each image sample, the plurality of image samples includes a first number of vin code image samples and a second number of license plate image samples And the absolute value of the difference between the first quantity and the second quantity does not exceed a preset number threshold.
可选的,处理器401在执行所述按照预设的vin码图像处理规则对所述vin码图像进行处理,以得到所述vin码图像包括的vin码时,可具体执行如下步骤:对所述vin码图像进行顶帽tophat变换,以得到tophat变换后的vin码图像;对所述tophat变换后的vin码图像进行边缘检测,以得到边缘检测后的第一边缘图像;对所述第一边缘图像进行形态学闭运算,以得到第一闭运算图像;对所述第一闭运算图像进行形态学开运算,以得到第一开运算图像;确定所述第一开运算图像中vin码区域的最小外接矩形,并将所述最小外接矩形确定的区域确定为所述vin码图像包括的vin码区域;对所述vin码区域进行识别,以识别出所述车辆的vin码。Optionally, when the processor 401 executes the processing of the vin code image according to a preset vin code image processing rule to obtain the vin code included in the vin code image, it may specifically perform the following steps: Performing top hat transformation on the vin code image to obtain a tophat transformed vin code image; performing edge detection on the tophat transformed vin code image to obtain a first edge image after edge detection; on the first Perform an morphological closing operation on the edge image to obtain a first closed computing image; perform a morphological opening operation on the first closed computing image to obtain a first opening computing image; determine the vin code area in the first opening computing image The minimum circumscribed rectangle of, and determine the area determined by the minimum circumscribed rectangle as the vin code area included in the vin code image; identify the vin code area to identify the vin code of the vehicle.
可选的,所述形态学闭运算使用的结构元素是1*N的行向量结构元素,所述N为列数,所述N大于0;其中,所述N是根据所述vin码图像的分辨率设置得到的;和/或,所述N是根据所述vin码图像中vin码区域的尺寸设置得到的,所述尺寸包括长度或宽度;和/或,所述N是根据所述vin码区域中字符间距与所述vin码图像的尺寸的比值设置得到的;和/或,所述N是根据所述vin码图像的宽度设置得到的。Optionally, the structural element used in the morphological closed operation is a 1*N row vector structural element, where N is the number of columns, and N is greater than 0; wherein, N is based on the vin code image Resolution setting; and/or, the N is obtained according to the size setting of the vin code area in the vin code image, the size includes length or width; and/or, the N is based on the vin The ratio between the character pitch in the code area and the size of the vin code image is set; and/or, the N is obtained according to the width setting of the vin code image.
可选的,处理器401在执行所述按照预设的车牌图像处理规则对所述车牌图像进行处理,以得到所述车牌图像包括的车牌时,可具体执行如下步骤:对所述车牌图像进行边缘检测,以得到边缘检测后的第二边缘图像;对所述第二边缘图像进行形态学闭运算,以得到第二闭运算图像;对所述第二闭运算图像进行形态学开运算,以得到第二开运算图像;确定所述第二开运算图像中车牌区域的最小外接矩形,并将所述最小外接矩形确定的区域确定为所述车牌图像包括的车牌区域;对所述车牌区域进行识别,以识别出所述车辆的车牌。Optionally, when the processor 401 executes the processing of the license plate image according to a preset license plate image processing rule to obtain the license plate included in the license plate image, it may specifically perform the following steps: perform on the license plate image Edge detection to obtain a second edge image after edge detection; perform a morphological close operation on the second edge image to obtain a second closed operation image; perform a morphological opening operation on the second closed operation image to Obtain the second opening calculation image; determine the minimum circumscribed rectangle of the license plate area in the second opening calculation image, and determine the area determined by the minimum circumscribed rectangle as the license plate area included in the license plate image; perform on the license plate area Identify to identify the license plate of the vehicle.
可选的,所述形态学闭运算使用的结构元素是M*N的向量结构元素,所述M为行数,所述N为列数,所述M和N大于0;其中,所述M和N是根据所述车牌图像的分辨率设置得到的;和/或,所述M和N是根据所述车牌图像中车牌区域的尺寸设置得到的,所述尺寸包括长度和/或宽度;和/或,所述M和N是根据所述车牌区域中字符间距与所述车牌图像的尺寸的比值设置得到的;和/或,所述M是根据所述车牌图像的长度设置得到的,N是根据所述车牌图像的宽度设置得到的。Optionally, the structural element used in the morphological closed operation is an M*N vector structural element, where M is the number of rows, N is the number of columns, and M and N are greater than 0; wherein, the M And N are obtained according to the resolution setting of the license plate image; and/or, the M and N are obtained according to the size setting of the license plate area in the license plate image, and the size includes length and/or width; and /Or, the M and N are set according to the ratio of the character pitch in the license plate area to the size of the license plate image; and/or, the M are set according to the length of the license plate image, N It is obtained according to the width of the license plate image.
可选的,处理器401在执行所述对所述vin码图像进行顶帽tophat变换,以得到tophat变换后的vin码图像之前,还可执行以下步骤:检测所述vin码图像的亮度是否处于预设的 亮度区间范围内;如果所述vin码图像的亮度不处于所述亮度区间范围内,触发所述对所述vin码图像进行顶帽tophat变换,以得到tophat变换后的vin码图像的步骤。Optionally, before performing the top-hat tophat transformation on the vin code image to obtain the tophat transformed vin code image, the processor 401 may also perform the following steps: detect whether the brightness of the vin code image is at Within the preset brightness interval; if the brightness of the vin code image is not within the brightness interval, trigger the top hat transformation of the vin code image to obtain the tophat transformed vin code image step.
其中,所述处理器401可以是中央处理单元(Central Processing Unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。Wherein, the processor 401 may be a central processing unit (Central Processing Unit, CPU), and the processor may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSPs), application specific integrated circuits (Application Specific Integrated) Circuit (ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
用户接口403可包括输入设备和输出设备,输入设备可以包括触控板、麦克风等,输出设备可以包括显示器(LCD等)、扬声器等。The user interface 403 may include an input device and an output device. The input device may include a touch panel, a microphone, and the like, and the output device may include a display (LCD, etc.), a speaker, and the like.
通信接口404可包括接收器和发射器,用于与其他设备进行通信。The communication interface 404 may include a receiver and a transmitter for communicating with other devices.
存储器402可以包括只读存储器和随机存取存储器,并向处理器401提供指令和数据。存储器402的一部分还可以包括非易失性随机存取存储器。例如,存储器402还可以存储上述的函数指针和函数的对应关系等等。The memory 402 may include a read-only memory and a random access memory, and provide instructions and data to the processor 401. A portion of the memory 402 may also include non-volatile random access memory. For example, the memory 402 may also store the correspondence between the function pointers and functions described above, and so on.
具体实现中,本申请实施例中所描述的处理器401等可执行上述图1至图2所示的方法实施例中所描述的实现方式,也可执行本申请实施例图3所描述的各单元的实现方式,此处不赘述。In a specific implementation, the processor 401 and the like described in the embodiments of the present application can execute the implementation described in the method embodiments shown in FIG. 1 to FIG. 2 above, and can also execute each of the methods described in FIG. 3 of the embodiment of the present application. The implementation of the unit is not repeated here.
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时可实现图1至图2所对应实施例中描述的图像处理方法中的部分或全部步骤,也可实现本申请图3或图4所示实施例的图像处理设备的功能,此处不赘述。An embodiment of the present application also provides a computer-readable storage medium that stores a computer program, and when the computer program is executed by a processor, the computer program can be implemented as described in the embodiments corresponding to FIG. 1 to FIG. 2 Some or all of the steps in the image processing method may also realize the functions of the image processing device of the embodiment shown in FIG. 3 or FIG. 4 of the present application, and details are not described here.
本申请实施例还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述方法中的部分或全部步骤。An embodiment of the present application further provides a computer program product containing instructions, which when run on a computer, causes the computer to perform some or all of the steps in the above method.
所述计算机可读存储介质可以是前述任一实施例所述的图像处理设备的内部存储单元,例如图像处理设备的硬盘或内存。所述计算机可读存储介质也可以是所述图像处理设备的外部存储设备,例如所述图像处理设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。The computer-readable storage medium may be an internal storage unit of the image processing device described in any of the foregoing embodiments, such as a hard disk or a memory of the image processing device. The computer-readable storage medium may also be an external storage device of the image processing device, such as a plug-in hard disk equipped on the image processing device, a smart memory card (Smart, Media, Card, SMC), and secure digital (Secure Digital) , SD) card, flash card (Flash Card), etc.
在本申请中,术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。In this application, the term "and/or" is merely an association relationship that describes an associated object, indicating that there may be three relationships, for example, A and/or B, which may mean: A exists alone, and A and B exist simultaneously There are three cases of B alone. In addition, the character “/” in this article generally indicates that the related objects before and after it are in an “or” relationship. The size of the sequence numbers of the above processes does not mean that the execution order is sequential, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
以上所述,仅为本申请的部分实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。The above is only part of the implementation of this application, but the scope of protection of this application is not limited to this, any person skilled in the art can easily think of various equivalents within the technical scope disclosed in this application Modifications or replacements, these modifications or replacements should be covered within the scope of protection of this application.

Claims (20)

  1. 一种图像处理方法,其特征在于,包括:An image processing method, which includes:
    获取车辆图像,所述车辆图像为vin码图像或车牌图像,所述vin码图像为包括车辆的vin码区域的图像,所述车牌图像为包括车辆的车牌区域的图像;Acquiring a vehicle image, the vehicle image is a vin code image or a license plate image, the vin code image is an image including a vin code area of the vehicle, and the license plate image is an image including a vehicle license plate area;
    按照预设的识别规则对所述车辆图像进行识别,以识别出所述车辆图像的类型,所述车辆图像的类型为vin码图像类型或车牌图像类型;Identify the vehicle image according to a preset recognition rule to identify the type of the vehicle image, the type of the vehicle image is a vin code image type or a license plate image type;
    如果确定所述车辆图像的类型为vin码图像类型,按照预设的vin码图像处理规则对所述vin码图像进行处理,以得到所述车辆的vin码;If it is determined that the type of the vehicle image is a vin code image type, process the vin code image according to a preset vin code image processing rule to obtain the vin code of the vehicle;
    如果确定所述车辆图像的类型为车牌图像类型,按照预设的车牌图像处理规则对所述车牌图像进行处理,以得到所述车辆的车牌。If it is determined that the type of the vehicle image is the type of the license plate image, the license plate image is processed according to a preset license plate image processing rule to obtain the license plate of the vehicle.
  2. 根据权利要求1所述的方法,其特征在于,所述按照预设的识别规则对所述车辆图像进行识别,以识别出所述车辆图像的类型,包括:The method according to claim 1, wherein the identifying the vehicle image according to a preset recognition rule to identify the type of the vehicle image includes:
    将所述车辆图像输入预置的图像检测模型,以得到所述图像检测模型的输出结果,所述输出结果用于指示所述车辆图像的类型;Input the vehicle image into a preset image detection model to obtain an output result of the image detection model, the output result is used to indicate the type of the vehicle image;
    其中,所述图像检测模型是根据预先选取的多个图像样本以及每个图像样本的类型训练得到的,所述多个图像样本包括第一数量的vin码图像样本以及第二数量的车牌图像样本,且所述第一数量和所述第二数量的差值的绝对值不超过预设数目阈值。The image detection model is trained based on a plurality of pre-selected image samples and the type of each image sample, the plurality of image samples includes a first number of vin code image samples and a second number of license plate image samples And the absolute value of the difference between the first quantity and the second quantity does not exceed a preset number threshold.
  3. 根据权利要求1所述的方法,其特征在于,所述按照预设的识别规则对所述车辆图像进行识别,以识别出所述车辆图像的类型,包括:The method according to claim 1, wherein the identifying the vehicle image according to a preset recognition rule to identify the type of the vehicle image includes:
    按照预设的切换规则切换识别规则进行图像类型的识别,以识别出所述车辆图像的类型;其中,所述切换规则包括按照预设时间间隔切换识别规则的切换规则,或者包括按照车辆图像的标签切换识别规则的切换规则,或者包括按照用户输入的切换指令来切换识别规则的切换规则,或者包括在识别出的vin码或车牌的错误次数达到预设次数时切换识别规则的切换规则,或者包括在预设时间段的识别出的vin码或车牌的错频率大于预设频率阈值时切换识别规则的切换规则。According to a preset switching rule, a switching recognition rule is used to recognize the image type to identify the type of the vehicle image; wherein, the switching rule includes a switching rule that switches the recognition rule at a preset time interval, or includes a switching rule according to the vehicle image Switching rules for label switching recognition rules, or switching rules for switching recognition rules according to the switching instructions input by the user, or switching rules for switching recognition rules when the number of errors of the recognized vin code or license plate reaches a preset number of times, or It includes a switching rule for switching the identification rule when the identified vin code or the wrong frequency of the license plate is greater than the preset frequency threshold.
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述按照预设的vin码图像处理规则对所述vin码图像进行处理,以得到所述车辆的vin码,包括:The method according to any one of claims 1 to 3, wherein the processing of the vin code image according to a preset vin code image processing rule to obtain the vin code of the vehicle includes:
    对所述vin码图像进行顶帽变换,以得到顶帽变换后的vin码图像;Performing a top hat transformation on the vin code image to obtain a vin code image after the top hat conversion;
    对所述顶帽变换后的vin码图像进行边缘检测,以得到边缘检测后的第一边缘图像;Performing edge detection on the vin code image after the top hat transformation to obtain a first edge image after edge detection;
    对所述第一边缘图像进行形态学闭运算,以得到第一闭运算图像;Performing a morphological closed operation on the first edge image to obtain a first closed operation image;
    对所述第一闭运算图像进行形态学开运算,以得到第一开运算图像;Performing a morphological opening operation on the first closed operation image to obtain a first opening operation image;
    确定所述第一开运算图像中vin码区域的最小外接矩形,并将所述最小外接矩形确定的区域确定为所述vin码图像包括的vin码区域;Determining the minimum circumscribed rectangle of the vin code area in the first open operation image, and determining the area determined by the minimum circumscribed rectangle as the vin code area included in the vin code image;
    对所述vin码区域进行识别,以识别出所述车辆的vin码。The vin code area is identified to identify the vin code of the vehicle.
  5. 根据权利要求4所述的方法,其特征在于,所述形态学闭运算使用的结构元素是1*N的行向量结构元素,所述N为列数,所述N大于0;The method according to claim 4, wherein the structural element used in the morphological closed operation is a 1*N row vector structural element, the N is the number of columns, and the N is greater than 0;
    其中,所述N是根据所述vin码图像的分辨率设置得到的;和/或,Wherein, the N is obtained according to the resolution setting of the vin code image; and/or,
    所述N是根据所述vin码图像中vin码区域的尺寸设置得到的,所述尺寸包括长度或 宽度;和/或,The N is obtained according to the size setting of the vin code area in the vin code image, and the size includes a length or a width; and/or,
    所述N是根据所述vin码区域中字符间距与所述vin码图像的尺寸的比值设置得到的;和/或,The N is set according to the ratio of the character pitch in the vin code area to the size of the vin code image; and/or,
    所述N是根据所述vin码图像的宽度设置得到的。The N is obtained according to the width setting of the vin code image.
  6. 根据权利要求1-3任一项所述的方法,其特征在于,所述按照预设的车牌图像处理规则对所述车牌图像进行处理,以得到所述车辆的车牌,包括:The method according to any one of claims 1-3, wherein the processing of the license plate image according to a preset license plate image processing rule to obtain the license plate of the vehicle includes:
    对所述车牌图像进行边缘检测,以得到边缘检测后的第二边缘图像;Performing edge detection on the license plate image to obtain a second edge image after edge detection;
    对所述第二边缘图像进行形态学闭运算,以得到第二闭运算图像;Performing a morphological closed operation on the second edge image to obtain a second closed operation image;
    对所述第二闭运算图像进行形态学开运算,以得到第二开运算图像;Performing a morphological opening operation on the second closed operation image to obtain a second open operation image;
    确定所述第二开运算图像中车牌区域的最小外接矩形,并将所述最小外接矩形确定的区域确定为所述车牌图像包括的车牌区域;Determining a minimum circumscribed rectangle of the license plate area in the second opening calculation image, and determining the area determined by the minimum circumscribed rectangle as the license plate area included in the license plate image;
    对所述车牌区域进行识别,以识别出所述车辆的车牌。Recognize the license plate area to identify the license plate of the vehicle.
  7. 根据权利要求6所述的方法,其特征在于,所述形态学闭运算使用的结构元素是M*N的向量结构元素,所述M为行数,所述N为列数,所述M和N大于0;The method according to claim 6, wherein the structural elements used in the morphological closed operation are M*N vector structural elements, where M is the number of rows, N is the number of columns, and M and N is greater than 0;
    其中,所述M和N是根据所述车牌图像的分辨率设置得到的;或者,Wherein, the M and N are obtained according to the resolution setting of the license plate image; or,
    所述M和N是根据所述车牌图像中车牌区域的尺寸设置得到的,所述尺寸包括长度和/或宽度;或者,The M and N are obtained according to the size of the license plate area in the license plate image, and the size includes the length and/or width; or,
    所述M和N是根据所述车牌区域中字符间距与所述车牌图像的尺寸的比值设置得到的;或者,The M and N are set according to the ratio of the character pitch in the license plate area to the size of the license plate image; or,
    所述M是根据所述车牌图像的长度设置得到的,N是根据所述车牌图像的宽度设置得到的。The M is obtained according to the length of the license plate image, and the N is obtained according to the width of the license plate image.
  8. 一种图像处理设备,其特征在于,包括:获取单元和处理单元;An image processing device, characterized by comprising: an acquisition unit and a processing unit;
    所述获取单元,用于获取车辆图像,所述车辆图像为vin码图像或车牌图像,所述vin码图像为包括车辆的vin码区域的图像,所述车牌图像为包括车辆的车牌区域的图像;The acquiring unit is configured to acquire a vehicle image, the vehicle image is a vin code image or a license plate image, the vin code image is an image including a vin code area of the vehicle, and the license plate image is an image including a vehicle license plate area ;
    所述处理单元,用于按照预设的识别规则对所述车辆图像进行识别,以识别出所述车辆图像的类型,所述车辆图像的类型为vin码图像类型或车牌图像类型;The processing unit is configured to recognize the vehicle image according to a preset recognition rule to identify the type of the vehicle image, and the type of the vehicle image is a vin code image type or a license plate image type;
    处理单元,还用于当所述车辆图像的类型为vin码图像类型时,按照预设的vin码图像处理规则对所述vin码图像进行处理,以得到所述车辆的vin码;The processing unit is further configured to process the vin code image according to a preset vin code image processing rule when the type of the vehicle image is a vin code image type to obtain the vin code of the vehicle;
    处理单元,还用于当所述车辆图像的类型为车牌图像类型时,按照预设的车牌图像处理规则对所述车牌图像进行处理,以得到所述车辆的车牌。The processing unit is further configured to process the license plate image according to a preset license plate image processing rule when the type of the vehicle image is the license plate image type to obtain the license plate of the vehicle.
  9. 根据权利要求8所述的设备,其特征在于,The device according to claim 8, characterized in that
    所述处理单元,具体用于将所述车辆图像输入预置的图像检测模型,以得到所述图像检测模型的输出结果,所述输出结果用于指示所述车辆图像的类型;The processing unit is specifically configured to input the vehicle image into a preset image detection model to obtain an output result of the image detection model, and the output result is used to indicate the type of the vehicle image;
    其中,所述图像检测模型是根据预先选取的多个图像样本以及每个图像样本的类型训练得到的,所述多个图像样本包括第一数量的vin码图像样本以及第二数量的车牌图像样本,且所述第一数量和所述第二数量的差值的绝对值不超过预设数目阈值。The image detection model is trained based on a plurality of pre-selected image samples and the type of each image sample, the plurality of image samples includes a first number of vin code image samples and a second number of license plate image samples And the absolute value of the difference between the first quantity and the second quantity does not exceed a preset number threshold.
  10. 根据权利要求8所述的设备,其特征在于,The device according to claim 8, characterized in that
    所述处理单元,具体用于按照预设的切换规则切换识别规则进行图像类型的识别,以 识别出所述车辆图像的类型;其中,所述切换规则包括按照预设时间间隔切换识别规则的切换规则,或者包括按照车辆图像的标签切换识别规则的切换规则,或者包括按照用户输入的切换指令来切换识别规则的切换规则,或者包括在识别出的vin码或车牌的错误次数达到预设次数时切换识别规则的切换规则,或者包括在预设时间段的识别出的vin码或车牌的错频率大于预设频率阈值时切换识别规则的切换规则。The processing unit is specifically configured to recognize the image type according to a preset switching rule switching recognition rule to identify the type of the vehicle image; wherein, the switching rule includes switching the recognition rule according to a preset time interval The rule includes either the switching rule for switching the recognition rule according to the label of the vehicle image, or the switching rule for switching the recognition rule according to the switching instruction input by the user, or when the number of errors of the recognized vin code or license plate reaches a preset number of times The switching rule for switching the recognition rule, or the switching rule for switching the recognition rule when the error frequency of the identified vin code or license plate during the preset time period is greater than the preset frequency threshold.
  11. 根据权利要求8-10任一项所述的设备,其特征在于,The device according to any one of claims 8-10, characterized in that
    所述处理单元,具体用于对所述vin码图像进行顶帽变换,以得到顶帽变换后的vin码图像;对所述顶帽变换后的vin码图像进行边缘检测,以得到边缘检测后的第一边缘图像;对所述第一边缘图像进行形态学闭运算,以得到第一闭运算图像;对所述第一闭运算图像进行形态学开运算,以得到第一开运算图像;确定所述第一开运算图像中vin码区域的最小外接矩形,并将所述最小外接矩形确定的区域确定为所述vin码图像包括的vin码区域;对所述vin码区域进行识别,以识别出所述车辆的vin码。The processing unit is specifically configured to perform a top hat transformation on the vin code image to obtain a top hat transformed vin code image; perform an edge detection on the top hat transformed vin code image to obtain an edge detection The first edge image; perform a morphological close operation on the first edge image to obtain a first closed operation image; perform a morphological opening operation on the first closed operation image to obtain a first open operation image; determine The smallest circumscribed rectangle of the vin code area in the first open operation image, and determining the area determined by the smallest circumscribed rectangle as the vin code area included in the vin code image; identifying the vin code area to identify The vin code of the vehicle.
  12. 根据权利要求11所述的设备,其特征在于,所述形态学闭运算使用的结构元素是1*N的行向量结构元素,所述N为列数,所述N大于0;The device according to claim 11, wherein the structural element used in the morphological closed operation is a 1*N row vector structural element, the N is the number of columns, and the N is greater than 0;
    其中,所述N是根据所述vin码图像的分辨率设置得到的;和/或,Wherein, the N is obtained according to the resolution setting of the vin code image; and/or,
    所述N是根据所述vin码图像中vin码区域的尺寸设置得到的,所述尺寸包括长度或宽度;和/或,The N is obtained according to the size setting of the vin code area in the vin code image, and the size includes a length or a width; and/or,
    所述N是根据所述vin码区域中字符间距与所述vin码图像的尺寸的比值设置得到的;和/或,The N is set according to the ratio of the character pitch in the vin code area to the size of the vin code image; and/or,
    所述N是根据所述vin码图像的宽度设置得到的。The N is obtained according to the width setting of the vin code image.
  13. 根据权利要求8-10任一项所述的设备,其特征在于,The device according to any one of claims 8-10, characterized in that
    所述处理单元,具体用于对所述车牌图像进行边缘检测,以得到边缘检测后的第二边缘图像;对所述第二边缘图像进行形态学闭运算,以得到第二闭运算图像;对所述第二闭运算图像进行形态学开运算,以得到第二开运算图像;确定所述第二开运算图像中车牌区域的最小外接矩形,并将所述最小外接矩形确定的区域确定为所述车牌图像包括的车牌区域;对所述车牌区域进行识别,以识别出所述车辆的车牌。The processing unit is specifically configured to perform edge detection on the license plate image to obtain a second edge image after edge detection; perform a morphological closed operation on the second edge image to obtain a second closed operation image; Performing a morphological opening operation on the second closed operation image to obtain a second opening operation image; determining a minimum circumscribed rectangle of the license plate area in the second open operation image, and determining the area determined by the minimum circumscribed rectangle as A license plate area included in the license plate image; identifying the license plate area to identify the license plate of the vehicle.
  14. 根据权利要求13所述的设备,其特征在于,所述形态学闭运算使用的结构元素是M*N的向量结构元素,所述M为行数,所述N为列数,所述M和N大于0;The device according to claim 13, wherein the structural elements used in the morphological closed operation are M*N vector structural elements, where M is the number of rows, N is the number of columns, and M and N is greater than 0;
    其中,所述M和N是根据所述车牌图像的分辨率设置得到的;或者,Wherein, the M and N are obtained according to the resolution setting of the license plate image; or,
    所述M和N是根据所述车牌图像中车牌区域的尺寸设置得到的,所述尺寸包括长度和/或宽度;或者,The M and N are obtained according to the size of the license plate area in the license plate image, and the size includes the length and/or width; or,
    所述M和N是根据所述车牌区域中字符间距与所述车牌图像的尺寸的比值设置得到的;或者,The M and N are set according to the ratio of the character pitch in the license plate area to the size of the license plate image; or,
    所述M是根据所述车牌图像的长度设置得到的,N是根据所述车牌图像的宽度设置得到的。The M is obtained according to the length of the license plate image, and the N is obtained according to the width of the license plate image.
  15. 一种图像处理设备,其特征在于,包括处理器和存储器,所述处理器和存储器相互连接,其中,所述存储器用于存储计算机程序,所述计算机程序包括程序指令,所述处理器被配置用于调用所述程序指令,执行以下步骤:An image processing apparatus, characterized by comprising a processor and a memory, the processor and the memory are connected to each other, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured For calling the program instructions, perform the following steps:
    获取车辆图像,所述车辆图像为vin码图像或车牌图像,所述vin码图像为包括车辆的vin码区域的图像,所述车牌图像为包括车辆的车牌区域的图像;Acquiring a vehicle image, the vehicle image is a vin code image or a license plate image, the vin code image is an image including a vin code area of the vehicle, and the license plate image is an image including a vehicle license plate area;
    按照预设的识别规则对所述车辆图像进行识别,以识别出所述车辆图像的类型,所述车辆图像的类型为vin码图像类型或车牌图像类型;Identify the vehicle image according to a preset recognition rule to identify the type of the vehicle image, the type of the vehicle image is a vin code image type or a license plate image type;
    如果确定所述车辆图像的类型为vin码图像类型,按照预设的vin码图像处理规则对所述vin码图像进行处理,以得到所述车辆的vin码;If it is determined that the type of the vehicle image is a vin code image type, process the vin code image according to a preset vin code image processing rule to obtain the vin code of the vehicle;
    如果确定所述车辆图像的类型为车牌图像类型,按照预设的车牌图像处理规则对所述车牌图像进行处理,以得到所述车辆的车牌。If it is determined that the type of the vehicle image is the type of the license plate image, the license plate image is processed according to a preset license plate image processing rule to obtain the license plate of the vehicle.
  16. 根据权利要求15所述的设备,其特征在于,所述处理器在执行所述按照预设的识别规则对所述车辆图像进行识别,以识别出所述车辆图像的类型时,具体执行以下步骤:The device according to claim 15, wherein the processor specifically performs the following steps when performing the recognition of the vehicle image according to a preset recognition rule to identify the type of the vehicle image :
    将所述车辆图像输入预置的图像检测模型,以得到所述图像检测模型的输出结果,所述输出结果用于指示所述车辆图像的类型;Input the vehicle image into a preset image detection model to obtain an output result of the image detection model, the output result is used to indicate the type of the vehicle image;
    其中,所述图像检测模型是根据预先选取的多个图像样本以及每个图像样本的类型训练得到的,所述多个图像样本包括第一数量的vin码图像样本以及第二数量的车牌图像样本,且所述第一数量和所述第二数量的差值的绝对值不超过预设数目阈值。The image detection model is trained based on a plurality of pre-selected image samples and the type of each image sample, the plurality of image samples includes a first number of vin code image samples and a second number of license plate image samples And the absolute value of the difference between the first quantity and the second quantity does not exceed a preset number threshold.
  17. 根据权利要求15所述的设备,其特征在于,所述处理器在执行所述按照预设的识别规则对所述车辆图像进行识别,以识别出所述车辆图像的类型时,具体执行以下步骤:The device according to claim 15, wherein the processor specifically performs the following steps when performing the recognition of the vehicle image according to a preset recognition rule to identify the type of the vehicle image :
    按照预设的切换规则切换识别规则进行图像类型的识别,以识别出所述车辆图像的类型;其中,所述切换规则包括按照预设时间间隔切换识别规则的切换规则,或者包括按照车辆图像的标签切换识别规则的切换规则,或者包括按照用户输入的切换指令来切换识别规则的切换规则,或者包括在识别出的vin码或车牌的错误次数达到预设次数时切换识别规则的切换规则,或者包括在预设时间段的识别出的vin码或车牌的错频率大于预设频率阈值时切换识别规则的切换规则。According to a preset switching rule, a switching recognition rule is used to recognize the image type to identify the type of the vehicle image; wherein, the switching rule includes a switching rule that switches the recognition rule at a preset time interval, or includes a switching rule according to the vehicle image Switching rules for label switching recognition rules, or switching rules for switching recognition rules according to the switching instructions input by the user, or switching rules for switching recognition rules when the number of errors of the recognized vin code or license plate reaches a preset number of times, or It includes a switching rule for switching the identification rule when the identified vin code or the wrong frequency of the license plate is greater than the preset frequency threshold.
  18. 根据权利要求15-17任一项所述的设备,其特征在于,所述处理器在执行所述按照预设的vin码图像处理规则对所述vin码图像进行处理,以得到所述车辆的vin码时,具体执行以下步骤:The device according to any one of claims 15-17, wherein the processor executes the processing of the vin code image according to a preset vin code image processing rule to obtain the vehicle's For the vin code, specifically perform the following steps:
    对所述vin码图像进行顶帽变换,以得到顶帽变换后的vin码图像;Performing a top hat transformation on the vin code image to obtain a vin code image after the top hat conversion;
    对所述顶帽变换后的vin码图像进行边缘检测,以得到边缘检测后的第一边缘图像;Performing edge detection on the vin code image after the top hat transformation to obtain a first edge image after edge detection;
    对所述第一边缘图像进行形态学闭运算,以得到第一闭运算图像;Performing a morphological closed operation on the first edge image to obtain a first closed operation image;
    对所述第一闭运算图像进行形态学开运算,以得到第一开运算图像;Performing a morphological opening operation on the first closed operation image to obtain a first opening operation image;
    确定所述第一开运算图像中vin码区域的最小外接矩形,并将所述最小外接矩形确定的区域确定为所述vin码图像包括的vin码区域;Determining the minimum circumscribed rectangle of the vin code area in the first open operation image, and determining the area determined by the minimum circumscribed rectangle as the vin code area included in the vin code image;
    对所述vin码区域进行识别,以识别出所述车辆的vin码。The vin code area is identified to identify the vin code of the vehicle.
  19. 根据权利要求15-17任一项所述的设备,其特征在于,所述处理器在执行所述按照预设的车牌图像处理规则对所述车牌图像进行处理,以得到所述车辆的车牌时,具体执行以下步骤:The device according to any one of claims 15-17, wherein the processor performs the processing of the license plate image according to a preset license plate image processing rule to obtain the license plate of the vehicle , Specifically perform the following steps:
    对所述车牌图像进行边缘检测,以得到边缘检测后的第二边缘图像;Performing edge detection on the license plate image to obtain a second edge image after edge detection;
    对所述第二边缘图像进行形态学闭运算,以得到第二闭运算图像;Performing a morphological closed operation on the second edge image to obtain a second closed operation image;
    对所述第二闭运算图像进行形态学开运算,以得到第二开运算图像;Performing a morphological opening operation on the second closed operation image to obtain a second open operation image;
    确定所述第二开运算图像中车牌区域的最小外接矩形,并将所述最小外接矩形确定的区域确定为所述车牌图像包括的车牌区域;Determining a minimum circumscribed rectangle of the license plate area in the second opening calculation image, and determining the area determined by the minimum circumscribed rectangle as the license plate area included in the license plate image;
    对所述车牌区域进行识别,以识别出所述车辆的车牌。Recognize the license plate area to identify the license plate of the vehicle.
  20. 一种计算机非易失性可读存储介质,其特征在于,所述计算机非易失性可读存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行如权利要求1-7任一项所述的方法。A computer non-volatile readable storage medium, characterized in that the computer non-volatile readable storage medium stores a computer program, the computer program includes program instructions, when the program instructions are executed by a processor Causing the processor to perform the method of any one of claims 1-7.
PCT/CN2019/116989 2019-01-04 2019-11-11 Image processing method and device, and computer-readable storage medium WO2020140610A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910015377.7 2019-01-04
CN201910015377.7A CN109740547A (en) 2019-01-04 2019-01-04 A kind of image processing method, equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
WO2020140610A1 true WO2020140610A1 (en) 2020-07-09

Family

ID=66363878

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/116989 WO2020140610A1 (en) 2019-01-04 2019-11-11 Image processing method and device, and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN109740547A (en)
WO (1) WO2020140610A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112633115A (en) * 2020-12-17 2021-04-09 杭州海康机器人技术有限公司 Method and device for detecting vehicle bottom carried object and storage medium
CN112862726A (en) * 2021-03-12 2021-05-28 湖南国科微电子股份有限公司 Image processing method, image processing apparatus, and computer-readable storage medium

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109740547A (en) * 2019-01-04 2019-05-10 平安科技(深圳)有限公司 A kind of image processing method, equipment and computer readable storage medium
CN110430078B (en) * 2019-08-05 2022-04-08 云南电网有限责任公司电力科学研究院 Method and system for recognizing type, configuring and functionally enabling electric power automation terminal
CN110619330A (en) * 2019-09-18 2019-12-27 上海眼控科技股份有限公司 Recognition model training method and device, computer equipment and recognition method
CN110796709A (en) * 2019-10-29 2020-02-14 上海眼控科技股份有限公司 Method and device for acquiring size of frame number, computer equipment and storage medium
CN111259887B (en) * 2020-01-08 2021-08-06 网思科技股份有限公司 Intelligent quality inspection method, system and device for dumb resource equipment
CN111598137A (en) * 2020-04-24 2020-08-28 北京金山云网络技术有限公司 Method and device for providing reasoning service and electronic equipment
CN112818746A (en) * 2020-12-30 2021-05-18 北京立禾物联科技有限公司 Method, device and system for identifying certification
CN112464940A (en) * 2021-02-03 2021-03-09 浙江驿公里智能科技有限公司 Deep learning-based vehicle front windshield vin code identification method and system
CN114550490B (en) * 2022-02-22 2023-12-22 北京信路威科技股份有限公司 Parking space statistics method, system, computer equipment and storage medium of parking lot
CN115311663A (en) * 2022-08-09 2022-11-08 青岛海信信息科技股份有限公司 OCR recognition method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104050450A (en) * 2014-06-16 2014-09-17 西安通瑞新材料开发有限公司 Vehicle license plate recognition method based on video
CN107423732A (en) * 2017-07-26 2017-12-01 大连交通大学 Vehicle VIN recognition methods based on Android platform
CN108446618A (en) * 2018-03-09 2018-08-24 平安科技(深圳)有限公司 Car damage identification method, device, electronic equipment and storage medium
US20180300578A1 (en) * 2014-06-27 2018-10-18 Blinker, Inc. Method and apparatus for identifying vehicle information from an image
CN109740547A (en) * 2019-01-04 2019-05-10 平安科技(深圳)有限公司 A kind of image processing method, equipment and computer readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107067002A (en) * 2017-03-09 2017-08-18 华东师范大学 Road licence plate recognition method in a kind of dynamic video

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104050450A (en) * 2014-06-16 2014-09-17 西安通瑞新材料开发有限公司 Vehicle license plate recognition method based on video
US20180300578A1 (en) * 2014-06-27 2018-10-18 Blinker, Inc. Method and apparatus for identifying vehicle information from an image
CN107423732A (en) * 2017-07-26 2017-12-01 大连交通大学 Vehicle VIN recognition methods based on Android platform
CN108446618A (en) * 2018-03-09 2018-08-24 平安科技(深圳)有限公司 Car damage identification method, device, electronic equipment and storage medium
CN109740547A (en) * 2019-01-04 2019-05-10 平安科技(深圳)有限公司 A kind of image processing method, equipment and computer readable storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112633115A (en) * 2020-12-17 2021-04-09 杭州海康机器人技术有限公司 Method and device for detecting vehicle bottom carried object and storage medium
CN112633115B (en) * 2020-12-17 2024-04-05 杭州海康机器人股份有限公司 Method and device for detecting vehicle bottom carrying object and storage medium
CN112862726A (en) * 2021-03-12 2021-05-28 湖南国科微电子股份有限公司 Image processing method, image processing apparatus, and computer-readable storage medium
CN112862726B (en) * 2021-03-12 2023-11-10 湖南国科微电子股份有限公司 Image processing method, device and computer readable storage medium

Also Published As

Publication number Publication date
CN109740547A (en) 2019-05-10

Similar Documents

Publication Publication Date Title
WO2020140610A1 (en) Image processing method and device, and computer-readable storage medium
WO2020140611A1 (en) Vin code identification method based on image processing, device and medium
CN110598558B (en) Crowd density estimation method, device, electronic equipment and medium
US8608073B2 (en) System and method for robust real-time 1D barcode detection
US10943141B2 (en) Object detection device and object detection method
US7460689B1 (en) System and method of detecting, recognizing, and tracking moving targets
WO2019020103A1 (en) Target recognition method and apparatus, storage medium and electronic device
CN109308711B (en) Target detection method and device and image processing equipment
CN111325769B (en) Target object detection method and device
US20070281734A1 (en) Method, system and apparatus for handset screen analysis
CN108734684B (en) Image background subtraction for dynamic illumination scene
CN108647587B (en) People counting method, device, terminal and storage medium
US20180047271A1 (en) Fire detection method, fire detection apparatus and electronic equipment
CN110602488A (en) Day and night type camera device switching abnormity detection method and device and camera device
US20140056519A1 (en) Method, apparatus and system for segmenting an image in an image sequence
WO2009105812A1 (en) Spatio-activity based mode matching field of the invention
WO2014193220A2 (en) System and method for multiple license plates identification
CN111444555B (en) Temperature measurement information display method and device and terminal equipment
CN108460388B (en) Method and device for detecting positioning mark and computer readable storage medium
EP3376438A1 (en) A system and method for detecting change using ontology based saliency
CN111814776A (en) Image processing method, device, server and storage medium
CN108805838B (en) Image processing method, mobile terminal and computer readable storage medium
CN114758268A (en) Gesture recognition method and device and intelligent equipment
CN111178118A (en) Image acquisition processing method and device and computer readable storage medium
AU2018202801A1 (en) Method, apparatus and system for producing a foreground map

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19907386

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS (EPO FORM 1205A DATED 25.08.2021)

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 22.04.2022)

122 Ep: pct application non-entry in european phase

Ref document number: 19907386

Country of ref document: EP

Kind code of ref document: A1