A VIN code recognition method, device and medium based on image processing
By obtaining vehicle environment information, determining shooting parameters, performing edge detection and morphological operations, and extracting the vin code area, the problem of low vin code recognition efficiency in the existing technology is solved, and efficient and accurate vin code recognition is achieved.
Patent Information
- Application Number
- CN201910013905.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-01-04
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2039-01-04
AI Technical Summary
In the existing technology, the vehicle vin code recognition efficiency is low, requiring manual photography and input of vin code information, and it is difficult to accurately extract the vin code area during automatic recognition, which affects the image recognition efficiency.
By obtaining vehicle environment information, determining shooting parameters, collecting VIN code images, and performing edge detection, morphological closing and opening operations, extracting the VIN code area, and finally identifying the VIN code, improving recognition efficiency.
It improves the shooting effect and reliability of VIN code images, significantly improves the recognition efficiency of VIN codes in vehicle images, overcomes the interference of reflected scenery on the vehicle body, and is suitable for embedded systems with limited performance.
Smart Images

Figure CN109784322B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a VIN code recognition method, device and medium based on image processing. Background Art
[0002] At present, we often encounter scenarios where we need to obtain the Vehicle Identification Number (VIN) information, such as when handling vehicle business. In the process of insurance salesmen handling auto insurance business, they often need to manually take pictures of the vehicle VIN code for archiving and manually enter the VIN code information, which is inefficient. In order to improve efficiency, image recognition can be used to automatically identify the VIN code in the picture taken by the salesman, and the first step of recognition is to extract the area where the VIN code sign is located in the image. Therefore, how to identify the VIN code area to further identify the VIN code and thus improve image recognition efficiency becomes the key. Summary of the invention
[0003] The embodiments of the present application provide a VIN code recognition method, device and medium based on image processing, which helps to improve the recognition efficiency of the VIN code of the vehicle image.
[0004] In a first aspect, an embodiment of the present application provides a VIN code recognition method based on image processing, comprising:
[0005] Acquire vehicle environment information of a target vehicle within a shooting range of a shooting device, wherein the vehicle environment information includes any one or more of the model of the target vehicle, the ambient light intensity of the target vehicle, the distance between the target vehicle and the shooting device, and the system time;
[0006] Determine a target shooting parameter for shooting the target vehicle according to the vehicle environment information, use the shooting device and collect a VIN code image of the target vehicle according to the target shooting parameter, the VIN code image includes a VIN code area of the target vehicle;
[0007] Performing edge detection on the VIN code image to obtain an edge image after edge detection;
[0008] Performing a morphological closing operation on the edge image to obtain a closed operation image;
[0009] Performing a morphological opening operation on the closed operation image to obtain an open operation image;
[0010] Determine the minimum bounding rectangle of the VIN code area in the open operation image, and determine the area determined by the minimum bounding rectangle as the VIN code area of the target vehicle;
[0011] The VIN code area of the target vehicle is identified to identify the VIN code of the target vehicle.
[0012] Optionally, determining target shooting parameters for shooting the target vehicle according to the vehicle environment information includes:
[0013] According to the preset correspondence between the vehicle environment information and the shooting parameters, the shooting parameters corresponding to the vehicle environment information of the target vehicle are determined, and the determined shooting parameters are determined as target shooting parameters for shooting the target vehicle.
[0014] Optionally, the vehicle environment information of the target vehicle includes the model of the target vehicle;
[0015] The step of determining the shooting parameters corresponding to the vehicle environment information of the target vehicle according to the preset correspondence between the vehicle environment information and the shooting parameters, and determining the determined shooting parameters as target shooting parameters for shooting the target vehicle, comprises:
[0016] According to the preset correspondence between the vehicle model and the shooting parameter, the shooting parameters corresponding to the vehicle model that is the same as the model of the target vehicle are searched from the database, and the searched shooting parameters are determined as the target shooting parameters for shooting the target vehicle;
[0017] The database stores a variety of vehicle models and shooting parameters corresponding to each vehicle model.
[0018] Optionally, the vehicle environment information of the target vehicle includes the model of the target vehicle and the ambient light intensity of the target vehicle;
[0019] The step of determining the shooting parameters corresponding to the vehicle environment information of the target vehicle according to the preset correspondence between the vehicle environment information and the shooting parameters, and determining the determined shooting parameters as target shooting parameters for shooting the target vehicle, comprises:
[0020] According to a plurality of preset ambient light intensity intervals, determining a target ambient light intensity interval in which the ambient light intensity of the target vehicle is located among the plurality of ambient light intensity intervals;
[0021] According to the preset correspondence between the vehicle model, the ambient light intensity interval and the shooting parameters, the shooting parameters corresponding to the model of the target vehicle and the target ambient light intensity interval are searched from the database, and the searched shooting parameters are determined as the target shooting parameters for shooting the target vehicle;
[0022] The database stores a plurality of vehicle models, the plurality of ambient light intensity intervals, and shooting parameters corresponding to each vehicle model and each ambient light intensity interval.
[0023] Optionally, the vehicle environment information of the target vehicle includes the model of the target vehicle and the distance between the target vehicle and the shooting device;
[0024] The step of determining the shooting parameters corresponding to the vehicle environment information of the target vehicle according to the preset correspondence between the vehicle environment information and the shooting parameters, and determining the determined shooting parameters as target shooting parameters for shooting the target vehicle, comprises:
[0025] According to a plurality of preset distance intervals, determining a target distance interval in which the distance between the target vehicle and the photographing device is located among the plurality of distance intervals;
[0026] According to the preset correspondence between the vehicle model, the distance interval and the shooting parameters, the shooting parameters corresponding to the model of the target vehicle and the target distance interval are searched from the database, and the searched shooting parameters are determined as the target shooting parameters for shooting the target vehicle;
[0027] The database stores a plurality of vehicle models, the plurality of distance intervals, and shooting parameters corresponding to each vehicle model and each distance interval.
[0028] Optionally, the vehicle environment information of the target vehicle includes the model and system time of the target vehicle;
[0029] The step of determining the shooting parameters corresponding to the vehicle environment information of the target vehicle according to the preset correspondence between the vehicle environment information and the shooting parameters, and determining the determined shooting parameters as target shooting parameters for shooting the target vehicle, comprises:
[0030] According to a plurality of preset time periods, determining a target time period to which the system time belongs among the plurality of time periods;
[0031] According to the correspondence between the preset vehicle model, time period and shooting parameters, the shooting parameters corresponding to the model of the target vehicle and the target time period are searched from the database, and the searched shooting parameters are determined as the target shooting parameters for shooting the target vehicle;
[0032] The database stores a plurality of vehicle models, the plurality of time periods, and shooting parameters corresponding to each vehicle model and each time period.
[0033] Optionally, before performing edge detection on the VIN code image, the method further includes:
[0034] Detecting whether the brightness of the VIN code image is within a preset brightness range;
[0035] If the brightness of the VIN code image is not within the brightness interval, performing a top-hat transformation on the VIN code image to obtain a VIN code image after the top-hat transformation;
[0036] The performing edge detection on the VIN code image to obtain an edge image after edge detection includes:
[0037] Edge detection is performed on the VIN code image after the top-hat transformation to obtain an edge image after edge detection.
[0038] In a second aspect, an embodiment of the present application provides an image processing device, which includes a unit for executing the method of the first aspect.
[0039] In a third aspect, an embodiment of the present application provides another image processing device, including 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 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 execute the method of the first aspect. Optionally, the image processing device may also include a user interface and / or a communication interface.
[0040] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the method of the first aspect above.
[0041] The embodiment of the present application can obtain vehicle environment information of the vehicle, determine shooting parameters according to the vehicle environment information, and collect the VIN code image of the vehicle according to the shooting parameters, and then can obtain the edge image by performing edge detection on the VIN code image, perform morphological closing and opening operations on the edge image, and then extract the VIN code area of the vehicle according to the minimum circumscribed rectangle in the image, so as to obtain the VIN code of the vehicle by identifying the VIN code area, thereby improving the shooting effect of the VIN code image, improving the reliability of the acquired VIN code image, and helping to improve the recognition efficiency of the VIN code of the vehicle image. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0043] Figure 1 It is a flowchart of a VIN code recognition method based on image processing provided in an embodiment of the present application;
[0044] Figure 2 It is a flowchart of another VIN code recognition method based on image processing provided in an embodiment of the present application;
[0045] Figure 3 is a structural schematic diagram of an image processing device provided in an embodiment of the present application;
[0046] Figure 4 It is a structural schematic diagram of another image processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] The following will describe the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0048] The technical solution of the present application can be applied to an image processing device, which may include various terminals, servers or other devices for processing images, such as extracting the VIN code area in an image, identifying the VIN code in an image, etc. The terminal involved in the present application may be a mobile phone, a computer, a tablet, a personal computer, a smart watch, etc., and the present application does not limit it.
[0049] The present application can obtain vehicle environment information of the vehicle, such as the vehicle model, the ambient light intensity of the vehicle, the distance between the vehicle and the shooting device and / or the system time, etc., to determine the shooting parameters according to the vehicle environment information, and collect the VIN code image of the vehicle according to the shooting parameters, which improves the shooting effect of the VIN code image and the reliability of the acquired VIN code image; and then can obtain the edge image by performing edge detection on the VIN code image, perform morphological closing and opening operations on the edge image, and then extract the VIN code area of the vehicle according to the minimum circumscribed rectangle in the image, so as to obtain the VIN code of the vehicle by identifying the VIN code area, thereby helping to improve the recognition efficiency of the VIN code of the vehicle image.
[0050] The following are detailed explanations respectively.
[0051] See also Figure 1 , Figure 1 1 is a flow chart of a VIN code recognition method based on image processing provided by an embodiment of the present application. Specifically, the method of this embodiment can be specifically applied to the above-mentioned image processing device. Figure 1 As shown, the VIN code recognition method based on image processing may include the following steps:
[0052] 101. Obtain vehicle environment information of a target vehicle within a shooting range of a shooting device.
[0053] The shooting device may be a camera, a video camera, a camera head or other device or equipment that can be used for shooting. The shooting device may be arranged in the image processing device or may be connected to the image processing device. The shooting range may be a range in which the shooting device can capture images, or may be a range in which the quality of the captured images of the shooting device is greater than a preset quality threshold, or may be a preset distance range, etc., which is not limited in this application.
[0054] Optionally, the target vehicle may refer to any vehicle within the shooting range, or may be a vehicle of a specific model within the shooting range, or may be a vehicle in a specific location area within the shooting range, or may be a vehicle that sends an indication signal (such as turning on the double flash or the wipers, etc.) within the shooting range, etc. The specific selection rules for the target vehicle may be pre-set, thereby improving the flexibility of selecting the target vehicle.
[0055] Further optionally, the vehicle environment information may include any one or more of the information items such as the model of the target vehicle, the ambient light intensity of the target vehicle, the distance between the target vehicle and the shooting device (or the distance between the target vehicle and the image processing device), and the system time. Further optionally, the vehicle environment information may be input by the user; or it may be automatically recognized by the image processing device, such as determining its model by previewing the captured image of the target vehicle, determining the distance by a preset distance sensor, determining the ambient light intensity by a preset light sensor, determining the system time by a preset time module, etc.; or it may be sent to the image processing device after other devices (such as the target vehicle) recognize the vehicle environment information, and the image processing device may receive the vehicle environment information of the target vehicle sent from other devices, etc., which are not listed here one by one.
[0056] 102. Determine a target shooting parameter for shooting the target vehicle according to the vehicle environment information, use the shooting device and collect a VIN code image of the target vehicle according to the target shooting parameter, the VIN code image including the VIN code area of the target vehicle.
[0057] Among them, vin (Vehicle Identification Number) can be called vehicle identification number, frame number, etc. The vin code is a set of 17 numbers, which is a unique number used to identify the vehicle. In other words, each vehicle has a unique vin code. The vin code can be used to identify the vehicle's manufacturer, engine, chassis serial number and other performance information.
[0058] Optionally, when determining the target shooting parameters for photographing the target vehicle, the image processing device may be based on the preset correspondence between each vehicle environment information and the shooting parameters, and based on the correspondence, quickly determine the shooting parameters corresponding to the vehicle environment information as the target shooting parameters, so as to improve the efficiency of determining the shooting parameters; or, the image processing device may also be based on the vehicle environment information such as vehicle model, based on the similarity between the captured VIN code image of the target vehicle and each VIN code image sample under the vehicle model stored in the database, and use the shooting parameters corresponding to the VIN code image sample under the vehicle model in the database with the highest similarity to the VIN code image of the target vehicle as the target shooting parameters of the target vehicle, wherein the database may store multiple VIN code image samples, multiple vehicle models, and (preferable) shooting parameters corresponding to each VIN code image sample and each vehicle model; or, the image processing device may also be based on the vehicle environment information and use the shooting parameters of the vehicle with the same vehicle environment information as the target shooting parameters that were manually adjusted last time, and so on, which are not listed here one by one.
[0059] Furthermore, after determining the shooting parameters for shooting the VIN code of the target vehicle, i.e., the target shooting parameters, the shooting device can be used to capture (shoot) the VIN code image of the target vehicle with the target shooting parameters, i.e., shoot the VIN code area of the target vehicle to obtain a VIN code image including the VIN code area.
[0060] Optionally, the shooting parameters involved in this application, such as target shooting parameters, may include shooting angle (controlling the shooting device to shoot at this shooting angle), focal length, aperture, ISO and / or EV value, etc., which are not limited in this application.
[0061] 103. Perform edge detection on the VIN code image to obtain an edge image after edge detection.
[0062] After acquiring the vin code image including the vin code area, the vin code image can be processed to extract the vin code area. When processing the vin code image, edge detection can be performed on the vin code image, such as using the Canny operator for edge detection. The characteristic of the Canny algorithm is that it attempts to assemble candidate pixels of independent edges into contours. The specific algorithm steps for finding edge points using the Canny operator are as follows:
[0063] 1) Use a Gaussian filter to convolve with the image (such as the VIN code image) to smooth the image and filter out noise;
[0064] 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 to various directions. The Canny algorithm can use operators (such as Roberts, Prewitt, Sobel, etc.) to detect horizontal, vertical and diagonal edges in the image, obtain the first-order derivative values in the horizontal and vertical directions, and thus determine the gradient amplitude and direction of the pixel point. The calculation of the gradient direction and the selection of the gradient operator are consistent;
[0065] 3) Non-maximum suppression is performed on the gradient amplitude to eliminate the stray response caused by edge detection; specifically, when non-maximum suppression is performed on each pixel in the gradient image, the gradient strength of the current pixel can be compared with the two pixels along the positive and negative gradient directions. If the gradient strength of the current pixel is the largest compared with the other two pixels, the pixel point is retained as an edge point, otherwise the pixel point will be suppressed, thereby suppressing all gradient values outside the local maximum value to 0 to achieve a "thin" edge;
[0066] 4) Use the double-threshold algorithm to detect and connect edges; specifically, after 3), there are still some edge pixels caused by noise and color changes. Therefore, by setting high and low thresholds, if the gradient value of the edge pixel 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 the low threshold, it is suppressed. Thus, edge detection can be used to extract useful structural information from different visual objects and reduce the amount of data to be processed.
[0067] 104. Perform a morphological closing operation on the edge image to obtain a closed operation image.
[0068] After edge detection is performed on the vin code image to obtain the edge detection result image, i.e., the edge image, a morphological closing operation can be performed on the edge graph, first dilation and then erosion. Thus, a morphological closing operation result is obtained to exclude small black holes (black areas). When performing a morphological closing operation, the structure element used can be a row vector structure element with a size of 1*N to connect the discontinuous edges in the horizontal direction. Among them, N can be the number of columns, which can be used to indicate the width of the structure element, and N is greater than 0.
[0069] Optionally, the N may be set according to the resolution of the vin code image; and / or, the N may be set according to the size of the vin code area in the vin code image, which size may include length or width; and / or, the N may be set according to the ratio of the character spacing 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 may be set according to the resolution of the image and / or the size (dimension) 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, the corresponding relationship between N and the resolution of the image (and / or the size of the vin code area in the image) may be preset. For another example, the N may be obtained based on the statistical relationship between the character spacing size of the vin code area in the captured image and the size of the vin code image. For example, the larger the ratio of the character spacing size to the vin code image size, the larger the value of N. Specifically, the corresponding relationship between N and the ratio of the character spacing size to the image size may be preset. For another example, the N may be set according to the image width. For example, the value of N may be 5% of the image width. Thus, a morphological closing operation result is obtained to exclude small black holes (black areas). In other words, the structural element N for the closing operation can be set according to 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 spacing size of the vin code area in the image to the image size, and the image width, which has high flexibility and improves the image processing effect.
[0070] 105. Perform a morphological opening operation on the closed operation image to obtain an open operation image.
[0071] After the morphological closing operation, the morphological opening operation is performed, first eroding and then dilating, to remove small-size noise in the image. The structural element used in the morphological opening operation can be consistent with the structural element used in the above-mentioned closing operation. Thus, the morphological opening operation result is obtained to achieve the effects of eliminating small objects, separating objects at thin points, and smoothing the boundaries of larger objects without significantly changing their areas.
[0072] 106. Determine the minimum bounding rectangle of the VIN code area in the open operation image, and determine the area determined by the minimum bounding rectangle as the VIN code area of the target vehicle.
[0073] In the result image obtained in step 105, the white part is the foreground and the black part is the background. By scanning the result image, i.e. the open operation image, the minimum bounding rectangle of the foreground part can be calculated. The area determined (enclosed) by the minimum bounding rectangle is the area where the VIN code sign is located, i.e. the VIN code area.
[0074] That is to say, when extracting the VIN code area in the image, the present application can use edge detection, morphological closing operation, morphological opening operation, and a set of simple and fast algorithms to calculate the minimum enclosing rectangle to determine the VIN code area, and then identify the VIN code. It can be seen that the method proposed in the present application can better extract the VIN code area from the original image.
[0075] 107. Identify the VIN code area of the target vehicle to identify the VIN code of the target vehicle.
[0076] After the VIN code area is extracted, the image of the VIN code area can be stored, and / or the characters (signs) or barcodes included in the VIN code area can be further identified. Optionally, the VIN code area can be identified by OCR character recognition or other recognition methods, which are not limited in this solution.
[0077] Optionally, in order to ensure the reliability of the identified VIN code, after the VIN code is identified, the VIN code may be verified to determine whether it is correct / legal, for example, the 9th bit of the identified VIN code may be verified. Because the 9th bit of the VIN code is always the check bit, the correct check bit can be obtained by performing a series of calculations on the other bits in the VIN code (where the 9th bit of the VIN code is any number from 1 to 9 or "X". The calculation method can be to multiply the corresponding value of each remaining letter or number in the VIN by the weighting coefficient of the bit, and then divide it by 11. The remainder is the check bit. If the remainder is 10, the check bit is "X". The weighting coefficient can be found in the "World Vehicle Identification Code (VIN) Data Manual" P21~23. For example, first convert the letters in the other 16 bits into numbers according to the following relationship: A=1 B=2 C=3 D=4 E=5 F=6 G=7 H=8 J=1 K=2 L=3 M=4 N=5 P=7 R=9 S=2 T=3 U=4 V=5 W=6 X=7 Y=8 Z=9, and each position and its corresponding weighting coefficient are: Position: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17, weighting coefficient: 8 7 6 5 4 3 2 10*9 8 7 6 5 4 3 2), and then by comparing the calculated check digit with the 9th digit to determine whether the two are the same, it is determined whether the recognized vin code has an error, that is, when the two are different, it indicates that the vin code has an error. Alternatively, it is possible to detect whether there are illegal characters in the recognized vin code, and specifically, a matching comparison can be performed by presetting a legal character whitelist. If there are illegal characters, such as characters outside the whitelist, 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 fixed to 17 digits, if it is longer or shorter than 17 digits, it can be determined that the recognized vin code has an error. If it is determined that the recognized vin code has an error, re-recognition can also be triggered (if the number of errors reaches a preset number of thresholds, such as 3 times, the vin code area can be re-extracted and re-recognized), or an alarm message can be issued to prompt manual recognition or detection, etc.
[0078] After obtaining the correct VIN code, you can store the VIN code, or handle vehicle business such as car insurance based on the VIN code, thereby improving the intelligence and efficiency of business handling.
[0079] The VIN code area extraction method of the present application improves the detection efficiency when extracting the VIN code area in the image, can effectively overcome the interference of the reflected scenery of the vehicle body, has high accuracy, and can be applied in embedded systems with limited performance, with a wide range of applications.
[0080] In this embodiment, the image processing device can obtain vehicle environment information of the vehicle, determine shooting parameters according to the vehicle environment information, and collect the VIN code image of the vehicle according to the shooting parameters, and then can obtain the edge image by performing edge detection on the VIN code image, perform morphological closing and opening operations on the edge image, and then extract the VIN code area of the vehicle according to the minimum circumscribed rectangle in the image, so as to obtain the VIN code of the vehicle by identifying the VIN code area, thereby improving the shooting effect of the VIN code image, improving the reliability of the acquired VIN code image, and helping to improve the recognition efficiency of the VIN code of the vehicle image.
[0081] See also Figure 2 , Figure 2 FIG. 1 is a flow chart of another VIN code recognition method based on image processing provided in an embodiment of the present application. Specifically, Figure 2 As shown, the VIN code recognition method based on image processing may include the following steps:
[0082] 201. Obtain vehicle environment information of a target vehicle within a shooting range of a shooting device.
[0083] The vehicle environment information may include any one or more of the following information: the model of the target vehicle, the ambient light intensity of the target vehicle, the distance between the target vehicle and the camera, and the system time. Figure 1 The relevant description of step 101 in the illustrated embodiment is not repeated here.
[0084] 202. Determine a shooting parameter corresponding to the vehicle environment information of the target vehicle according to a preset correspondence relationship between the vehicle environment information and the shooting parameter, and determine the determined shooting parameter as a target shooting parameter for shooting the target vehicle.
[0085] Optionally, in a possible implementation, the vehicle environment information of the target vehicle may include the model of the target vehicle. When determining the target shooting parameters, the image processing device may search for shooting parameters corresponding to the vehicle model that is the same as the model of the target vehicle from a database based on a preset correspondence between the vehicle model and the shooting parameters, and determine the searched shooting parameters as the target shooting parameters for shooting the target vehicle. Among them, the database may pre-store a variety of vehicle models and shooting parameters corresponding to each vehicle model. The shooting parameters corresponding to each vehicle model may be shooting parameters of a selected vin code image sample with a better shooting effect under the selected vehicle model, such as a shooting quality greater than a preset quality threshold and / or a vin code area greater than a preset ratio threshold, etc.
[0086] Optionally, in a possible implementation, the vehicle environment information of the target vehicle may include the model of the target vehicle and the ambient light intensity of the target vehicle. When determining the target shooting parameters, the image processing device may determine the target ambient light intensity interval in which the ambient light intensity of the target vehicle is located among the multiple ambient light intensity intervals based on the preset multiple ambient light intensity intervals; according to the correspondence between the preset vehicle model, ambient light intensity interval and shooting parameters, the shooting parameters corresponding to the model of the target vehicle and the target ambient light intensity interval are searched from the database, and the searched shooting parameters are determined as the target shooting parameters for shooting the target vehicle. Among them, the database may pre-store multiple vehicle models, the multiple ambient light intensity intervals and the shooting parameters corresponding to each vehicle model and each ambient light intensity interval.
[0087] Optionally, in a possible implementation, the vehicle environment information of the target vehicle includes the model of the target vehicle and the distance between the target vehicle and the shooting device. When determining the target shooting parameters, the image processing device may determine the target distance interval in which the distance between the target vehicle and the shooting device is located in the multiple distance intervals according to the preset multiple distance intervals; according to the correspondence between the preset vehicle model, distance interval and shooting parameters, the shooting parameters corresponding to the model of the target vehicle and the target distance interval are searched from the database, and the searched shooting parameters are determined as the target shooting parameters for shooting the target vehicle. Among them, the database may pre-store multiple vehicle models, the multiple distance intervals and the shooting parameters corresponding to each vehicle model and each distance interval.
[0088] Optionally, in a possible implementation, the vehicle environment information of the target vehicle includes the model and system time of the target vehicle. When determining the target shooting parameters, the image processing device may determine the target time period to which the system time belongs in the multiple time periods according to the preset multiple time periods; according to the correspondence between the preset vehicle model, time period and shooting parameters, the shooting parameters corresponding to the model of the target vehicle and the target time period are searched from the database, and the searched shooting parameters are determined as the target shooting parameters for shooting the target vehicle. The database may pre-store multiple vehicle models, the multiple time periods and the shooting parameters corresponding to each vehicle model and each time period.
[0089] Optionally, in a possible implementation, the vehicle environment information of the target vehicle includes the system time, and the image processing device, when determining the target shooting parameters, may determine the shooting parameters corresponding to the system time as the target shooting parameters according to the correspondence between a preset time period and the shooting parameters; or, the vehicle environment information of the target vehicle includes the ambient light intensity of the target vehicle, and the image processing device, when determining the target shooting parameters, may determine the shooting parameters corresponding to the ambient light intensity as the target shooting parameters according to the correspondence between a preset ambient light intensity interval and the shooting parameters; the vehicle environment information of the target vehicle includes the distance between the target vehicle and the shooting device When determining the target shooting parameters, the image processing device may determine the shooting parameters corresponding to the distance as the target shooting parameters according to the correspondence between the preset distance interval and the shooting parameters; or, the vehicle environment information may also include the model of the target vehicle, the ambient light intensity of the target vehicle, the distance between the target vehicle and the shooting device, and the system time, or the ambient light intensity of the target vehicle and the distance between the target vehicle and the shooting device, or the ambient light intensity of the target vehicle and the system time, so as to determine the target shooting parameters based on the correspondence between the corresponding vehicle environment information and the shooting parameters, etc., which are not listed here one by one.
[0090] For example, when it is necessary to identify the information of a vehicle, such as the vin code, the camera device can be called to shoot the vin code area to obtain a photographed image including the vin code, referred to as the vin code image. Alternatively, in an optional embodiment, the camera device can be loaded at a fixed position, and the camera device can be rotated, that is, the shooting angle of the camera device can be adjusted. Thus, the vin code image data of different vehicle models can be obtained by analyzing the vin code images in the historical data collected by the camera device, and the vin code image with better shooting effect (for example, covering the entire vin code area and less interference) can be selected from them, and the shooting parameters of the vin code image are obtained, and the corresponding relationship between each vehicle model and the shooting parameters is preset, so that after the camera device identifies the vehicle model, it can quickly call the shooting parameters according to the vehicle model, including the shooting angle of the camera device (control the camera device to shoot at this shooting angle), focal length, aperture, ISO, EV value, etc.
[0091] For another example, the shooting time and shooting parameters of the VIN code images with better shooting effects in the historical data can be obtained by combining the time and / or the ambient light intensity, and then more matching shooting parameters can be quickly called by obtaining the current vehicle model and the current time (and / or ambient light intensity) 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 at night are completely different. Therefore, the corresponding relationship between different time periods and vehicle models and the shooting parameters of the shooting device can be preset; or the corresponding relationship between the ambient light intensity and the vehicle model and the shooting parameters of the shooting device can be preset, or the corresponding relationship between different time periods, ambient light intensities and vehicle models and the shooting parameters of the shooting device can be preset, and so on. For example, the VIN code images in the historical data collected by the shooting device can be analyzed (each VIN code image is associated with the shooting time when the image was taken) to obtain VIN code image data of different time periods, and the VIN code image with better shooting effect can be selected according to the VIN code image data of the same vehicle model in each time period, and the shooting parameters of the VIN code image can be obtained, so as to determine the correspondence between different time periods and vehicle models and the shooting parameters of the shooting device; so that after the shooting device recognizes the time period and vehicle model of the current time, it can quickly call the corresponding shooting parameters for shooting according to the recognized time period and vehicle model. For another example, the VIN code images in the historical data collected by the shooting device can be analyzed (each VIN code image is associated with and records the ambient light intensity when the image was shot) to obtain VIN code image data under different ambient light intensities, and the VIN code image with better shooting effect can be selected according to the VIN code image data of the same vehicle model under each ambient light intensity range, and the shooting parameters of the VIN code image can be obtained, so as to determine the correspondence between different ambient light intensity ranges and vehicle models, and the shooting parameters of the shooting device; so that after the shooting device identifies the ambient light intensity range in which the current ambient light intensity is located and the vehicle model, it can quickly call the corresponding shooting parameters for shooting according to the identified ambient light intensity range and vehicle model.
[0092] 203. Use the shooting device and collect the VIN code image of the target vehicle according to the target shooting parameter, wherein the VIN code image includes the VIN code area of the target vehicle.
[0093] 204. Perform a tophat transformation on the VIN code image to obtain a VIN code image after the tophat transformation.
[0094] Among them, the tophat transformation can be used to detect bright details in dark places and extract areas with higher grayscale in the image. By performing tophat transformation on the captured VIN code image, the interference to the VIN code image area can be reduced. Since tophat has a good effect on detecting bright details in dark places in image segmentation, especially targets with uniform width or size, the captured VIN code image can be subjected to tophat transformation to further distinguish the VIN code area. Optionally, there are some vehicle body reflection interferences in the VIN code image. In order to reduce these interferences, the original captured VIN code image, that is, the original image, can be converted into a grayscale image. After obtaining the converted grayscale image, the grayscale image is subjected to tophat transformation to obtain the tophat transformation 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.
[0095] For example, the tophat transform of a grayscale image f is defined as f minus the result of its opening operation, that is, That(f)=f-(fοb), where b is the mean filter template and ° is the opening operation.
[0096] Optionally, in some embodiments, if the shooting conditions are good, such as the brightness of the VIN code image is within a preset brightness range, tophat transformation may not be performed. This reduces equipment overhead. Therefore, it is possible to detect whether the brightness of the VIN code image is within a preset brightness range; if the brightness of the VIN code image is not within the brightness range, perform tophat transformation on the VIN code image to obtain a VIN code image after tophat transformation. Further, if the brightness of the VIN code image is within the brightness range, tophat transformation may not be performed, and edge detection may be performed directly on the VIN code image, which is not described in detail here.
[0097] 205. Perform edge detection on the VIN code image after tophat transformation to obtain an edge image after edge detection.
[0098] If tophat transformation is not required, edge detection can be performed directly on the acquired VIN code image, which will not be described here.
[0099] 206. Perform a morphological closing operation on the edge image to obtain a closed operation image.
[0100] 207. Perform a morphological opening operation on the closed operation image to obtain an open operation image.
[0101] 208. Determine the minimum bounding rectangle of the VIN code area in the open operation image, and determine the area determined by the minimum bounding rectangle as the VIN code area of the target vehicle.
[0102] That is to say, when extracting the VIN code area in the image, the present application can use a set of simple and fast algorithms including tophat transformation, edge detection, morphological closing operation, morphological opening operation, and calculation of the minimum enclosing rectangle to determine the VIN code area and identify the VIN code.
[0103] 209. Identify the VIN code area of the target vehicle to identify the VIN code of the target vehicle.
[0104] Optionally, for the description of steps 203, 205-209, please refer to Figure 1 The description of steps 102-107 in the illustrated embodiment is not repeated here.
[0105] In this embodiment, the image processing device can obtain the vehicle environment information of the vehicle, determine the shooting parameters of the vehicle according to the correspondence between the preset vehicle environment information and the shooting parameters, and collect the VIN code image of the vehicle according to the shooting parameters, and then can perform Tophat transformation on the VIN code image, perform edge detection after Tophat transformation to obtain an edge image, perform morphological closing and opening operations on the edge image, and then extract the VIN code area of the vehicle according to the minimum circumscribed rectangle in the image, so as to obtain the VIN code of the vehicle by identifying the VIN code area, thereby improving the shooting effect of the VIN code image, improving the reliability of the acquired VIN code image, and improving the recognition efficiency of the VIN code of the vehicle image.
[0106] The above method embodiments are all examples of the VIN code recognition method based on image processing of the present application. The description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0107] See also Figure 3 , Figure 3 300 is a schematic diagram of the structure of an image processing device provided in an embodiment of the present application. The image processing device in the embodiment of the present application includes a unit for executing the above-mentioned VIN code recognition method based on image processing. Specifically, the image processing device 300 in this embodiment may include: an acquisition unit 301 and a processing unit 302. Among them,
[0108] An acquisition unit 301 is used to acquire vehicle environment information of a target vehicle within a shooting range of a shooting device, wherein the vehicle environment information includes any one or more of the model of the target vehicle, the ambient light intensity of the target vehicle, the distance between the target vehicle and the shooting device, and the system time;
[0109] The processing unit 302 is used to determine target shooting parameters for shooting the target vehicle according to the vehicle environment information,
[0110] The acquisition unit 301 is further used to use the shooting device and collect the VIN code image of the target vehicle according to the target shooting parameters, wherein the VIN code image includes the VIN code area of the target vehicle;
[0111] The processing unit 302 is also used to perform edge detection on the VIN code image to obtain an edge image after edge detection; perform a morphological closing operation on the edge image to obtain a closed operation image; perform a morphological opening operation on the closed operation image to obtain an open operation image; determine the minimum bounding rectangle of the VIN code area in the open operation image, and determine the area determined by the minimum bounding rectangle as the VIN code area of the target vehicle; identify the VIN code area of the target vehicle to identify the VIN code of the target vehicle.
[0112] Optionally, the processing unit 302 can be specifically used to determine shooting parameters corresponding to the vehicle environment information of the target vehicle based on the preset correspondence between the vehicle environment information and the shooting parameters, and determine the determined shooting parameters as target shooting parameters for photographing the target vehicle.
[0113] Further optionally, the vehicle environment information of the target vehicle includes the model of the target vehicle;
[0114] The processing unit 302 may be specifically configured to search for shooting parameters corresponding to a vehicle model that is the same as the model of the target vehicle from a database according to a preset correspondence relationship between the vehicle model and the shooting parameters, and determine the searched shooting parameters as target shooting parameters for shooting the target vehicle;
[0115] The database stores a variety of vehicle models and shooting parameters corresponding to each vehicle model.
[0116] Further optionally, the vehicle environment information of the target vehicle includes the model of the target vehicle and the ambient light intensity of the target vehicle;
[0117] The processing unit 302 may be specifically configured to determine, according to a plurality of preset ambient light intensity intervals, a target ambient light intensity interval in which the ambient light intensity of the target vehicle is located among the plurality of ambient light intensity intervals; and to search for shooting parameters corresponding to the vehicle model of the target vehicle and the target ambient light intensity interval from a database according to a preset correspondence between the vehicle model, the ambient light intensity interval and the shooting parameters, and determine the searched shooting parameters as target shooting parameters for shooting the target vehicle;
[0118] The database stores a plurality of vehicle models, the plurality of ambient light intensity intervals, and shooting parameters corresponding to each vehicle model and each ambient light intensity interval.
[0119] Further optionally, the vehicle environment information of the target vehicle includes the model of the target vehicle and the distance between the target vehicle and the shooting device;
[0120] The processing unit 302 may be specifically configured to determine, according to a plurality of preset distance intervals, a target distance interval in which the distance between the target vehicle and the photographing device is located in the plurality of distance intervals; according to a preset correspondence between a vehicle model, a distance interval, and a photographing parameter, search out from a database the photographing parameters corresponding to the model of the target vehicle and the target distance interval, and determine the searched photographing parameters as target photographing parameters for photographing the target vehicle;
[0121] The database stores a plurality of vehicle models, the plurality of distance intervals, and shooting parameters corresponding to each vehicle model and each distance interval.
[0122] Further optionally, the vehicle environment information of the target vehicle includes the model and system time of the target vehicle;
[0123] The processing unit 302 may be specifically configured to determine, according to a plurality of preset time periods, a target time period to which the system time belongs in the plurality of time periods; according to a correspondence between a preset vehicle model, a time period, and a shooting parameter, find out from a database the shooting parameters corresponding to the model of the target vehicle and the target time period, and determine the found shooting parameters as target shooting parameters for shooting the target vehicle;
[0124] The database stores a plurality of vehicle models, the plurality of time periods, and shooting parameters corresponding to each vehicle model and each time period.
[0125] Optionally, the processing unit 302 may be further configured to detect whether the brightness of the VIN code image is within a preset brightness range before performing edge detection on the VIN code image; if the brightness of the VIN code image is not within the brightness range, perform a tophat transformation on the VIN code image to obtain a VIN code image after the tophat transformation;
[0126] The processing unit 302 may be specifically configured to perform edge detection on the VIN code image after tophat transformation to obtain an edge image after edge detection.
[0127] Specifically, the image processing device can realize the above-mentioned Figure 1 to Figure 2 Part or all of the steps in the VIN code recognition method based on image processing in the illustrated embodiment. It should be understood that the embodiment of the present application is an apparatus embodiment corresponding to the method embodiment, and the description of the method embodiment is also applicable to the embodiment of the present application.
[0128] See also Figure 4 , Figure 4 is a schematic diagram of the structure of another image processing device provided in an embodiment of the present application. The image processing device is used to execute the above method. Figure 4 As shown, the image processing device 400 in this embodiment may include: one or more processors 401 and a memory 402. The image processing device may also include a shooting device or be connected to the shooting device. Optionally, the image processing device may also include one or more user interfaces 403, and / or one or more communication interfaces 404. The processor 401, user interface 403, communication interface 404 and memory 402 may be connected via a bus 405, or may be connected in other ways. Figure 4 The bus mode is used as an example in the description. The memory 402 is used to store a computer program, the computer program includes program instructions, and the processor 401 is used to execute the program instructions stored in the memory 402.
[0129] Among them, the processor 401 can be used to call the program instructions to perform the following steps: obtain vehicle environment information of the target vehicle within the shooting range of the shooting device, the vehicle environment information includes any one or more of the model of the target vehicle, the ambient light intensity of the target vehicle, the distance between the target vehicle and the shooting device, and the system time; determine the target shooting parameters for shooting the target vehicle according to the vehicle environment information, use the shooting device and collect the VIN code image of the target vehicle according to the target shooting parameters, and the VIN code image includes the VIN code area of the target vehicle; perform edge detection on the VIN code image to obtain an edge image after edge detection; perform morphological closing operation on the edge image to obtain a closed operation image; perform morphological opening operation on the closed operation image to obtain an open operation image; determine the minimum circumscribed rectangle of the VIN code area in the open operation image, and determine the area determined by the minimum circumscribed rectangle as the VIN code area of the target vehicle; identify the VIN code area of the target vehicle to identify the VIN code of the target vehicle.
[0130] Optionally, when the processor 401 is executing the determination of the target shooting parameters for photographing the target vehicle based on the vehicle environment information, it may specifically perform the following steps: determine the shooting parameters corresponding to the vehicle environment information of the target vehicle based on a preset correspondence between the vehicle environment information and the shooting parameters, and determine the determined shooting parameters as the target shooting parameters for photographing the target vehicle.
[0131] Optionally, the vehicle environment information of the target vehicle includes the model of the target vehicle;
[0132] When the processor 401 performs the steps of determining the shooting parameters corresponding to the vehicle environment information of the target vehicle according to the preset correspondence between the vehicle environment information and the shooting parameters, and determining the determined shooting parameters as the target shooting parameters for shooting the target vehicle, the processor 401 may specifically perform the following steps: searching for shooting parameters corresponding to the vehicle model that is the same as the vehicle model of the target vehicle from a database according to the preset correspondence between the vehicle model and the shooting parameters, and determining the searched shooting parameters as the target shooting parameters for shooting the target vehicle;
[0133] The database stores a variety of vehicle models and shooting parameters corresponding to each vehicle model.
[0134] Optionally, the vehicle environment information of the target vehicle includes the model of the target vehicle and the ambient light intensity of the target vehicle;
[0135] When the processor 401 performs the steps of determining the shooting parameters corresponding to the vehicle environment information of the target vehicle according to the preset correspondence between the vehicle environment information and the shooting parameters, and determining the determined shooting parameters as the target shooting parameters for shooting the target vehicle, the following steps may be specifically performed: determining the target ambient light intensity interval in which the ambient light intensity of the target vehicle is located among the multiple ambient light intensity intervals according to the preset multiple ambient light intensity intervals; searching for the shooting parameters corresponding to the vehicle model and the target ambient light intensity interval from a database according to the preset correspondence between the vehicle model, the ambient light intensity interval and the shooting parameters, and determining the searched shooting parameters as the target shooting parameters for shooting the target vehicle;
[0136] The database stores a plurality of vehicle models, the plurality of ambient light intensity intervals, and shooting parameters corresponding to each vehicle model and each ambient light intensity interval.
[0137] Optionally, the vehicle environment information of the target vehicle includes the model of the target vehicle and the distance between the target vehicle and the shooting device;
[0138] When the processor 401 performs the steps of determining the shooting parameters corresponding to the vehicle environment information of the target vehicle according to the preset correspondence between the vehicle environment information and the shooting parameters, and determining the determined shooting parameters as the target shooting parameters for shooting the target vehicle, the following steps may be specifically performed: determining the target distance interval in which the distance between the target vehicle and the shooting device is located among the multiple distance intervals according to the preset multiple distance intervals; searching for the shooting parameters corresponding to the vehicle model and the target distance interval from a database according to the preset correspondence between the vehicle model, the distance interval and the shooting parameters, and determining the searched shooting parameters as the target shooting parameters for shooting the target vehicle;
[0139] The database stores a plurality of vehicle models, the plurality of distance intervals, and shooting parameters corresponding to each vehicle model and each distance interval.
[0140] Optionally, the vehicle environment information of the target vehicle includes the model and system time of the target vehicle;
[0141] When the processor 401 performs the steps of determining the shooting parameters corresponding to the vehicle environment information of the target vehicle according to the preset correspondence between the vehicle environment information and the shooting parameters, and determining the determined shooting parameters as the target shooting parameters for shooting the target vehicle, the processor 401 may specifically perform the following steps: determining the target time period to which the system time belongs among the multiple time periods according to the preset multiple time periods; searching for the shooting parameters corresponding to the vehicle model of the target vehicle and the target time period from a database according to the preset correspondence between the vehicle model, the time period and the shooting parameters, and determining the searched shooting parameters as the target shooting parameters for shooting the target vehicle;
[0142] The database stores a plurality of vehicle models, the plurality of time periods, and shooting parameters corresponding to each vehicle model and each time period.
[0143] Optionally, before performing the edge detection on the VIN code image, the processor 401 may further perform the following steps: detecting whether the brightness of the VIN code image is within a preset brightness range; if the brightness of the VIN code image is not within the brightness range, performing a tophat transformation on the VIN code image to obtain a VIN code image after the tophat transformation;
[0144] When edge detection is performed on the VIN code image to obtain an edge image after edge detection, the following steps may be specifically performed: edge detection is performed on the VIN code image after tophat transformation to obtain an edge image after edge detection.
[0145] The processor 401 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0146] The user interface 403 may include an input device and an output device. The input device may include a touch panel, a microphone, etc., and the output device may include a display (LCD, etc.), a speaker, etc.
[0147] The communication interface 404 may include a receiver and a transmitter for communicating with other devices.
[0148] 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 a non-volatile random access memory. For example, the memory 402 may also store the above-mentioned correspondence between the function pointer and the function, and the like.
[0149] In a specific implementation, the processor 401 described in the embodiment of the present application may execute the above Figure 1 to Figure 2 The implementation described in the method embodiment shown in the figure can also be implemented in the embodiment of the present application Figure 3 The implementation of each unit described is not described here in detail.
[0150] The present application also provides a computer-readable storage medium storing a computer program, which can be executed by a processor to implement Figure 1 to Figure 2 Part or all of the steps in the VIN code recognition method based on image processing described in the corresponding embodiment can also be used to implement the present application. Figure 3 or Figure 4 The functions of the image processing device of the illustrated embodiment are not described in detail here.
[0151] The embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute part or all of the steps in the above method.
[0152] 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 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, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the image processing device.
[0153] In this application, the term "and / or" is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0154] In various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. 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.
[0155] The above description is only a partial implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or substitutions within the technical scope disclosed in the present application, and these modifications or substitutions should be included in the protection scope of the present application.
Claims
1. A VIN code recognition method based on image processing, characterized in that: include: Acquire vehicle environment information of a target vehicle within a shooting range of the shooting device, wherein the vehicle environment information includes a vehicle model and a system time of the target vehicle; Determine a target shooting parameter for shooting the target vehicle according to the vehicle environment information, use the shooting device and collect a VIN code image of the target vehicle according to the target shooting parameter, the VIN code image includes a VIN code area of the target vehicle; different shooting parameters correspond to different vehicle models and system times; Perform edge detection on the VIN code image to obtain an edge image after edge detection; the edge detection includes: convolving the VIN code image with a Gaussian filter to smooth the image and filter out noise; calculating the gradient amplitude and direction of each pixel in the VIN code image after convolution by first-order partial derivative finite difference; performing non-maximum suppression on the gradient amplitude to eliminate the stray response caused by edge detection, wherein if the gradient intensity of the current pixel is the largest compared with the two pixels along the positive and negative gradient directions, the pixel is retained as an edge point, otherwise the pixel is suppressed to suppress all gradient values other than the local maximum value to 0; obtaining a high threshold and a low threshold, if the gradient amplitude of the edge pixel is higher than the high threshold, it is marked as a strong edge pixel, if the gradient amplitude of the edge pixel is less than the high threshold and greater than the low threshold, it is marked as a weak edge pixel, if the gradient amplitude of the edge pixel is less than the high threshold and greater than the low threshold, it is suppressed; Performing a morphological closing operation on the edge image to obtain a closed operation image; the structure element used in the morphological closing operation is a 1*N row vector structure element, wherein N is obtained according to the resolution of the vin code image, the size of the vin code area, the ratio of the character spacing in the vin code area to the size of the vin code image, and the width of the vin code image; Performing a morphological opening operation on the closed operation image to obtain an open operation image; Determine the minimum bounding rectangle of the VIN code area in the open operation image, and determine the area determined by the minimum bounding rectangle as the VIN code area of the target vehicle; Identifying the VIN code area of the target vehicle to identify the VIN code of the target vehicle; Verify the identified VIN code to determine whether the identified VIN code is legal, the verification includes comparing the check bit calculated based on the VIN code with the preset bit in the VIN code, detecting whether there are illegal characters in the VIN code, and detecting whether the number of digits of the identified VIN code does not meet the preset number of digits condition; If it is determined that the identified VIN code is illegal, the VIN code area is extracted again and re-identified. If it is determined that the identified VIN code is still illegal, an alarm message is issued to prompt.
2. The method according to claim 1, characterized in that The determining, according to the vehicle environment information, target shooting parameters for shooting the target vehicle comprises: According to the preset correspondence between the vehicle environment information and the shooting parameters, the shooting parameters corresponding to the vehicle environment information of the target vehicle are determined, and the determined shooting parameters are determined as target shooting parameters for shooting the target vehicle.
3. The method according to claim 2, characterized in that The vehicle environment information of the target vehicle also includes the ambient light intensity of the target vehicle; The step of determining the shooting parameters corresponding to the vehicle environment information of the target vehicle according to the preset correspondence between the vehicle environment information and the shooting parameters, and determining the determined shooting parameters as target shooting parameters for shooting the target vehicle, comprises: According to a plurality of preset ambient light intensity intervals, determining a target ambient light intensity interval in which the ambient light intensity of the target vehicle is located among the plurality of ambient light intensity intervals; According to the correspondence between the preset vehicle model, time period, ambient light intensity interval and shooting parameters, the shooting parameters corresponding to the model of the target vehicle, the target time period to which the system time belongs and the target ambient light intensity interval are searched from the database, and the searched shooting parameters are determined as the target shooting parameters for shooting the target vehicle; The database stores a plurality of vehicle models, a plurality of time periods, a plurality of ambient light intensity intervals, and shooting parameters corresponding to each vehicle model and each ambient light intensity interval.
4. The method according to claim 2, characterized in that: The vehicle environment information of the target vehicle also includes the distance between the target vehicle and the shooting device; The step of determining the shooting parameters corresponding to the vehicle environment information of the target vehicle according to the preset correspondence between the vehicle environment information and the shooting parameters, and determining the determined shooting parameters as target shooting parameters for shooting the target vehicle, comprises: According to a plurality of preset distance intervals, determining a target distance interval in which the distance between the target vehicle and the photographing device is located among the plurality of distance intervals; According to the preset correspondence between the vehicle model, time period, distance interval and shooting parameters, the shooting parameters corresponding to the model of the target vehicle, the target time period to which the system time belongs and the target distance interval are searched from the database, and the searched shooting parameters are determined as the target shooting parameters for shooting the target vehicle; The database stores a plurality of vehicle models, a plurality of time periods, a plurality of distance intervals, and shooting parameters corresponding to each vehicle model and each distance interval.
5. The method according to claim 2, characterized in that: The step of determining the shooting parameters corresponding to the vehicle environment information of the target vehicle according to the preset correspondence between the vehicle environment information and the shooting parameters, and determining the determined shooting parameters as target shooting parameters for shooting the target vehicle, comprises: According to a plurality of preset time periods, determining a target time period to which the system time belongs among the plurality of time periods; According to the correspondence between the preset vehicle model, time period and shooting parameters, the shooting parameters corresponding to the model of the target vehicle and the target time period are searched from the database, and the searched shooting parameters are determined as the target shooting parameters for shooting the target vehicle; The database stores a plurality of vehicle models, the plurality of time periods, and shooting parameters corresponding to each vehicle model and each time period.
6. The method according to any one of claims 1 to 5, characterized in that: Before performing edge detection on the VIN code image, the method further includes: Detecting whether the brightness of the VIN code image is within a preset brightness range; If the brightness of the VIN code image is not within the brightness interval, performing a top-hat transformation on the VIN code image to obtain a VIN code image after the top-hat transformation; The performing edge detection on the VIN code image to obtain an edge image after edge detection includes: Edge detection is performed on the VIN code image after the top-hat transformation to obtain an edge image after edge detection.
7. An image processing device, characterized in that: The method comprises means for executing the method according to any one of claims 1 to 6.
8. An image processing device, characterized in that: The method comprises a processor and a memory, wherein the processor and the memory are connected to each other, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Fast license plate locating method
CN101246551A
License plate locating method based on JPEG (Joint Photographic Experts Group) compressed image
CN102646195A
Shooting method and shooting device
CN106558121A
Cited By
Vehicle identification code verification method based on image processing and character verification
CN122637419A
VIN code recognition method and system based on YOLOv11 and PaddleOCR
CN122966932A
