A target image acquisition method

By automatically determining the theoretically optimal or suboptimal shooting point in the car, the problem of poor shooting effect in the existing technology is solved, and a better image acquisition effect is achieved.

CN116233585BActive Publication Date: 2025-10-14FORYOU GENERAL ELECTRONICS
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211666640.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-23
Publication Date
2025-10-14
Estimated Expiration
2042-12-23

AI Technical Summary

Technical Problem

Existing car photography technology fails to effectively consider the relationship between the vehicle position and the shooting angle, resulting in poor photo quality and affecting user experience.

Method used

By acquiring the initial image, the theoretical optimal shooting point is determined and whether it meets the shooting conditions. If not, the next best shooting point is sought until the vehicle reaches the shooting point for shooting, ensuring the best image effect.

Benefits of technology

It realizes automatic acquisition of better images according to the shooting scene, improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116233585B_ABST
    Figure CN116233585B_ABST
Patent Text Reader

Abstract

The application provides a target image acquisition method, which comprises the following steps: step 1, acquiring a first image; step 2, determining a shooting subject in the first image; step 3, determining a theoretical optimal shooting point of the shooting subject; step 4, judging whether the theoretical optimal shooting point meets shooting conditions; if yes, taking the theoretical optimal shooting point as a final shooting point and entering step 6, otherwise, entering the next step; step 5, judging whether there is a sub-optimal shooting point; if yes, taking the sub-optimal shooting point as the final shooting point and entering step 6, otherwise, taking the first image as a final image; step 6, judging whether a vehicle has reached the final shooting point; if yes, entering the next step, otherwise, repeating the present step; and step 7, acquiring a second image and taking it as the final image. The application can automatically obtain an image with better effect according to a shooting scene.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, in particular to a target image acquisition method. BACKGROUND

[0002] With the rapid development of China's automobile industry and the improvement of people's living standards, the number of cars owned by households is increasing rapidly, and cars have gradually become one of the indispensable means of transportation in people's lives.

[0003] In the process of driving, when the driver sees the scenery, traffic accidents or other scenes that he wants to shoot, the current main way is to shoot by manually operating the camera or the vehicle-mounted camera, which is easy to distract the driver and affect the driving safety; Some automatic shooting technologies of vehicle-mounted cameras have also appeared, but the current automatic shooting technologies do not consider the relationship between the current vehicle position and the shooting angle, resulting in that the photos taken are often not the best, and the user experience is poor. SUMMARY

[0004] The present application provides a target image acquisition method, which aims to solve the defects in the prior art and realize the automatic acquisition of images with better effects according to the shooting scene.

[0005] To achieve the above-mentioned purpose, the technical scheme adopted by the present application is:

[0006] The present application provides a target image acquisition method, which includes:

[0007] Step 1, acquiring a first image;

[0008] Step 2, determining a shooting subject in the first image;

[0009] Step 3, determining a theoretical best shooting point of the shooting subject;

[0010] Step 4, judging whether the theoretical best shooting point meets the shooting condition, if yes, taking the theoretical best shooting point as the final shooting point and entering step 6, otherwise, entering the next step;

[0011] Step 5, judging whether there is a sub-optimal shooting point, if yes, taking the sub-optimal shooting point as the final shooting point and entering step 6, otherwise, taking the first image as the final image;

[0012] Step 6, judging whether the vehicle has reached the final shooting point, if yes, entering the next step, otherwise, repeating the present step;

[0013] Step 7, acquiring a second image and taking it as the final image.

[0014] Specifically, the step 3 comprises: acquiring the position and size of the shooting subject in the image, calculating the angle of the leftmost side, the center point and the rightmost side of the shooting subject, and calculating the theoretical optimal shooting point.

[0015] Specifically, the step 4 comprises:

[0016] Step 401, judging whether the theoretical optimal shooting point is located on the current driving route, if yes, entering the next step, otherwise judging that the theoretical optimal shooting point does not meet the shooting condition;

[0017] Step 402, judging whether the blocked part of the shooting subject exceeds the preset threshold when the vehicle is located at the theoretical optimal shooting point, if yes, judging that the theoretical optimal shooting point does not meet the shooting condition, otherwise judging that the theoretical optimal shooting point meets the shooting condition.

[0018] Further, the step 1 or / and step 7 comprises:

[0019] Step A, judging whether the definition of the acquired picture meets the standard, if yes, saving the acquired picture, otherwise entering the next step;

[0020] Step B, detecting whether the flash is turned on, if yes, entering the next step, otherwise turning on the flash and acquiring the image, and returning to step A;

[0021] Step C, controlling the vehicle to reduce the speed by a preset step and then acquiring the image, and returning to step A.

[0022] Specifically, the step A comprises:

[0023] Step A1, performing convolution operation on the preset direction template and the target picture to obtain a first gradient image, and acquiring the maximum gradient value and the average gradient value of each pixel point in the first gradient image;

[0024] Step A2, acquiring a preset first gradient threshold and a second gradient threshold, traversing all pixel points in the first gradient image, and processing the first gradient image according to a preset rule to generate a second gradient image, the first gradient threshold being greater than the second gradient threshold;

[0025] Step A3, calculating the second gradient image by using the Otsu threshold method to obtain an optimal threshold, and classifying the pixel points with gradient values greater than the optimal threshold in the second gradient image as first-class pixel points, and classifying the remaining pixel points as second-class pixel points;

[0026] Step A4, calculating the definition of the first-class pixel points according to a first preset formula, and calculating the definition of the second-class pixel points according to a second preset formula;

[0027] Step A5, calculating the overall sharpness of the entire image according to a third preset formula.

[0028] Further, after the step A3, further comprising:

[0029] Step A31, obtaining eight adjacent pixel points of each pixel point in the first type of pixel points, judging whether at least 2 pixel points in the eight adjacent pixel points belong to the first type of pixel points, if yes, retaining the pixel point, otherwise deleting the pixel point from the first type of pixel points and classifying it into the second type of pixel points.

[0030] Specifically, the preset direction template is:

[0031]

[0032] Specifically, the preset rule comprises:

[0033] If the gradient value of the current pixel point is higher than the first gradient threshold value, the gradient value thereof is modified to the maximum gradient value;

[0034] If the gradient value of the current pixel point is less than the second gradient threshold value, the gradient value thereof is modified to the average gradient value;

[0035] If the gradient value of the current pixel point is between the first gradient threshold value and the second gradient threshold value, the gradient value thereof is kept unchanged.

[0036] Specifically, the first preset formula is:

[0037]

[0038] The second preset formula is:

[0039]

[0040] Wherein, MxN is the image resolution, I(x, y) represents the pixel gray value at the image pixel (x, y), Δg is the gray change amplitude, Δd is the distance increment between pixels, and a represents the serial number of the eight adjacent pixels of the current pixel.

[0041] Specifically, the third preset formula is:

[0042] C=k1*C1+k2*C2

[0043] Wherein, k1 and k2 represent the weights of the flat area sharpness and the edge area sharpness, which are obtained by experimental effect calibration.

[0044] The beneficial effect of the present application is that the present application acquires an initial image, then determines a theoretical optimal shooting point according to the initial image, if the theoretical optimal shooting point meets the shooting condition, then shooting is performed when the vehicle reaches the theoretical optimal shooting point, otherwise it is judged whether there is a sub-optimal shooting point, if there is, then shooting is performed when the vehicle reaches the sub-optimal shooting point, thereby realizing that a better effect image can be obtained according to the shooting scene. BRIEF DESCRIPTION OF DRAWINGS

[0045] Figure 1 is a flowchart of the target image acquisition method of the present application. DETAILED DESCRIPTION

[0046] The embodiments of the present application will be described in detail below with reference to the accompanying drawings, which are used only for reference and illustration, and do not constitute a limitation on the scope of patent protection of the present application.

[0047] In the flow described in the specification, claims or drawings of the present application, the serial numbers of the steps (such as steps 10, 20, etc.) are included, which are only used to distinguish the steps, and the serial numbers themselves do not represent any execution order. It should be noted that the "first", "second" and the like in this paper are only used to distinguish the description objects and the like, and do not represent the order of precedence.

[0048] Example 1

[0049] As Figure 1 shown, the present embodiment provides a target image acquisition method, comprising:

[0050] Step 1, acquiring a first image.

[0051] In the present embodiment, the step 1 comprises: when the preview image acquired by the vehicle-mounted image acquisition device matches the target image type, automatically acquiring the first image.

[0052] The target image type (such as a landscape picture, an animal picture or a traffic accident picture, etc.) in this step can be set by the user himself, and then the preview image is judged to match the target image type through deep learning.

[0053] In another embodiment of the present application, the step 1 comprises: acquiring the first image by accepting a shooting instruction.

[0054] When the user sees the scene he wants to shoot, he can shoot a picture through voice command or gesture command or other human-computer interaction methods.

[0055] Step 2, determining a shooting subject in the first image.

[0056] In a specific implementation, the scene type in the first image can be identified first, such as a background far away, a person near, a car, a traffic scene, etc., and then the scene type is played out or listed in a preset manner (such as a serial number) for the user to select one as the shooting subject.

[0057] Step 3, determining a theoretically optimal shooting point of the shooting subject.

[0058] In the embodiment, the step 3 includes obtaining the position and size of the shooting subject in the image, calculating the angle of the vehicle-mounted image acquisition device with the leftmost side, the center point and the rightmost side of the shooting subject, and calculating the theoretically optimal shooting point.

[0059] The optimal shooting point includes a shooting angle and a distance.

[0060] Step 4, judging whether the theoretically optimal shooting point meets the shooting condition, if yes, taking the theoretically optimal shooting point as the final shooting point and entering step 6, otherwise, entering the next step.

[0061] In the embodiment, the step 4 includes:

[0062] Step 401, judging whether the theoretically optimal shooting point is located on the current driving route, if yes, entering the next step, otherwise, judging that the theoretically optimal shooting point does not meet the shooting condition.

[0063] Step 402, judging whether the occluded part of the shooting subject exceeds a preset threshold when the vehicle is located at the theoretically optimal shooting point, if yes, judging that the theoretically optimal shooting point does not meet the shooting condition, otherwise, judging that the theoretically optimal shooting point meets the shooting condition.

[0064] In a specific implementation, the altitude H1 of the optimal shooting point and the altitude H2 of the shooting subject and the height H3 of the vehicle-mounted image acquisition device to the ground are obtained through a high-precision navigation map, and whether the shooting subject is occluded and the occlusion degree can be judged through the similarity principle.

[0065] Step 5, judging whether there is a sub-optimal shooting point, if yes, taking the sub-optimal shooting point as the final shooting point and entering step 6, otherwise, taking the first image as the final image.

[0066] In the embodiment, the sub-optimal shooting point refers to a shooting point that is better than the current shooting point and meets the shooting condition except the theoretically optimal shooting point.

[0067] Step 6, judging whether the vehicle has reached the final shooting point, if yes, entering the next step, otherwise, repeatedly executing the step.

[0068] Step 7, obtaining a second image and taking it as the final image.

[0069] Example 2

[0070] The difference from Example 1 is that after step 1 and / or step 7, the following steps are included:

[0071] Step A: Determine whether the clarity of the acquired image meets the standard. If yes, save the acquired image; otherwise, proceed to the next step.

[0072] Step B: Detect whether the flash is on, if yes, proceed to the next step, otherwise turn on the flash to acquire an image and return to step A;

[0073] Step C: Control the vehicle to reduce its speed by a preset step, acquire an image, and return to step A.

[0074] In this embodiment, step A includes:

[0075] Step A1: Perform a convolution operation on the preset direction template and the target image to obtain a first gradient image, and obtain the maximum gradient value Tmax and the average gradient value Tavg of each pixel point in the first gradient image.

[0076] In this embodiment, the preset direction template is:

[0077]

[0078] Step A2: Obtain a preset first gradient threshold T1 and a second gradient threshold T2, traverse all pixels in the first gradient image, and process the first gradient image according to a preset rule to generate a second gradient image, wherein the first gradient threshold T1 is greater than the second gradient threshold T2.

[0079] In this embodiment, the preset rules include:

[0080] If the gradient value of the current pixel point is higher than the first gradient threshold T1, then its gradient value is modified to the maximum gradient value Tmax;

[0081] If the gradient value of the current pixel point is less than the second gradient threshold T2, then modify its gradient value to the average gradient value Tavg;

[0082] If the gradient value of the current pixel is between the first gradient threshold T1 and the second gradient threshold T2, the gradient value is kept unchanged.

[0083] The first gradient threshold T1 and the second gradient threshold T2 are obtained through experimental effect calibration.

[0084] Step A3: Calculate the second gradient image using the Otsu threshold method to obtain an optimal threshold Tbst, and classify the pixels in the second gradient image whose gradient values ​​are greater than the optimal threshold Tbst as first-category pixels, and classify the remaining pixels as second-category pixels.

[0085] Step A4: Calculate the clarity C1 of the first type of pixel points according to a first preset formula, and calculate the clarity C2 of the second type of pixel points according to a second preset formula.

[0086] In this embodiment, the first preset formula is:

[0087]

[0088] The second preset formula is:

[0089]

[0090] Where M×N is the image resolution, I(x,y) represents the grayscale value of the image pixel at (x,y), Δg is the grayscale change amplitude, Δd is the distance increment between pixels, and a represents the sequence number of the eight adjacent pixels of the current pixel.

[0091] Step A5: Calculate the overall clarity C of the entire image according to a third preset formula.

[0092] In this embodiment, the third preset formula is:

[0093] C=k1*C1+k2*C2

[0094] Among them, k1 and k2 represent the weights of the clarity in the flat area and the clarity in the edge area, which are obtained through experimental effect calibration.

[0095] In another embodiment of the present invention, after step A3, the method further includes:

[0096] Step A31: Obtain the eight adjacent pixels of each pixel in the first category, and determine whether at least two of the eight adjacent pixels belong to the first category. If so, retain the pixel; otherwise, delete the pixel from the first category and classify it as the second category.

[0097] This step makes full use of the continuity of true edges and removes false edges formed by noise by identifying the types of the eight adjacent pixels of each pixel.

[0098] The above disclosure is only a preferred embodiment of the present invention and cannot be used to limit the scope of protection of the present invention. Therefore, equivalent changes made according to the scope of the patent application of the present invention are still within the scope covered by the present invention.

Claims

1. A target image acquisition method, characterized in that: include: Step 1: Acquire a first image; Step 2: determining the subject in the first image; Step 3: determining the theoretical optimal shooting point of the subject, including: obtaining the position and size of the subject in the image, calculating the angles between the current vehicle-mounted image acquisition device and the leftmost point, center point, and rightmost point of the subject, and calculating the theoretical optimal shooting point; Step 4: Determine whether the theoretical optimal shooting point meets the shooting conditions. If yes, use the theoretical optimal shooting point as the final shooting point and proceed to step 6. Otherwise, proceed to the next step, including: Step 401: determine whether the theoretical optimal shooting point is located on the current driving route. If so, proceed to the next step. Otherwise, determine that the theoretical optimal shooting point does not meet the shooting conditions. Step 402: When the vehicle is located at the theoretical optimal shooting point, whether the portion of the subject being blocked exceeds a preset threshold value; if so, it is determined that the theoretical optimal shooting point does not meet the shooting conditions; otherwise, it is determined that the theoretical optimal shooting point meets the shooting conditions; Step 5: Determine whether there is a suboptimal shooting point. If yes, take the suboptimal shooting point as the final shooting point and proceed to step 6. Otherwise, take the first image as the final image. Step 6: Determine whether the vehicle has reached the final shooting point. If yes, proceed to the next step; otherwise, repeat this step. Step 7: Obtain the second image and use it as the final image; After step 1 and / or step 7, the method includes: Step A: Determine whether the clarity of the acquired image meets the standard. If yes, save the acquired image; otherwise, proceed to the next step. Step B: Detect whether the flash is on, if yes, proceed to the next step, otherwise turn on the flash to acquire an image and return to step A; Step C: Control the vehicle to reduce its speed by a preset step, acquire an image, and return to step A.

2. The target image acquisition method according to claim 1, characterized in that: The step A comprises: Step A1: performing a convolution operation on a preset direction template and a target image to obtain a first gradient image, and obtaining the maximum gradient value and the average gradient value of each pixel point in the first gradient image; Step A2: obtaining a preset first gradient threshold and a second gradient threshold, traversing all pixels in the first gradient image, and processing the first gradient image according to a preset rule to generate a second gradient image, wherein the first gradient threshold is greater than the second gradient threshold; Step A3: Calculate the second gradient image using the Otsu threshold method to obtain an optimal threshold, and classify pixels in the second gradient image whose gradient values ​​are greater than the optimal threshold as first-category pixels, and classify the remaining pixels as second-category pixels; Step A4: calculating the clarity of the first type of pixel points according to a first preset formula, and calculating the clarity of the second type of pixel points according to a second preset formula; Step A5: Calculate the overall clarity of the entire image according to a third preset formula.

3. The target image acquisition method according to claim 2, characterized in that: After step A3, the method further includes: Step A31: Obtain the eight adjacent pixels of each pixel in the first category, and determine whether at least two of the eight adjacent pixels belong to the first category. If so, retain the pixel; otherwise, delete the pixel from the first category and classify it as the second category.

4. The target image acquisition method according to claim 2, characterized in that: The preset direction template is: 。 5. The target image acquisition method according to claim 4, characterized in that: The preset rules include: If the gradient value of the current pixel point is higher than the first gradient threshold, modifying its gradient value to the maximum gradient value; If the gradient value of the current pixel point is less than the second gradient threshold, modifying its gradient value to the average gradient value; If the gradient value of the current pixel is between the first gradient threshold and the second gradient threshold, the gradient value is kept unchanged.

6. The target image acquisition method according to claim 5, characterized in that: The first preset formula is: The second preset formula is: Where M×N is the image resolution, I(x,y) represents the grayscale value of the image pixel at (x,y), Δg is the grayscale change amplitude, Δd is the distance increment between pixels, and a represents the sequence number of the eight adjacent pixels of the current pixel.

7. The target image acquisition method according to claim 6, characterized in that: The third preset formula is: C=k1*C1+k2*C2 Among them, k1 and k2 represent the weights of the clarity in the flat area and the clarity in the edge area, which are obtained through experimental effect calibration.

Citation Information

Patent Citations

  • Vehicle intelligent photographing method, equipment, device and storage medium

    CN114205531A