Method and device for generating traffic sound image volume
By calculating the element locations on the traffic acoustic and image volume page and drawing the connecting lines, the problem of insufficient accuracy and standardization of traffic acoustic and image volumes in the prior art is solved, and a true and comprehensive reflection of the situation at the traffic accident site is achieved.
Patent Information
- Application Number
- CN202510089647.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-05-30
AI Technical Summary
The prior art cannot ensure the accuracy and standardization of traffic audio and video coils, and it is difficult to truly and comprehensively reflect the on-site situation of a traffic accident.
By determining the page pixel size of the traffic audio and video volume, calculate the location of the drawing area, pictures and text in the page, and draw the connection line between the pictures based on the mouse event to ensure the accuracy and standardization of the traffic audio and video volume.
The accuracy and standardization of traffic audio and video coils are achieved, so that they can truly and comprehensively reflect the on-site situation of traffic accidents.
Smart Images

Figure CN120068830A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of computer technology, and particularly relates to a method and device for generating traffic audio-visual volumes. Background Art
[0002] As a core document for traffic management departments when dealing with traffic accidents, traffic audio-visual volumes carry multiple important functions such as clarifying accident responsibilities, recording on-site situations, and assisting accident analysis. Therefore, the production and preservation of audio-visual volumes are subject to strict norms and requirements. However, the existing methods for generating traffic audio-visual volumes in the prior art cannot ensure the accuracy and standardization of traffic audio-visual volumes.
[0003] Application Content
[0004] The purpose of the embodiments of this application is to provide a method and device for generating traffic audio-visual volumes to solve the defect that the prior art cannot ensure the accuracy and standardization of traffic audio-visual volumes.
[0005] To solve the above technical problems, this application is implemented as follows:
[0006] In the first aspect, a method for generating a traffic audio-visual volume is provided. The traffic audio-visual volume includes multiple vouchers, and each voucher includes two drawing areas. The method includes the following steps:
[0007] Determine the page pixel size of the traffic audio-visual volume according to the resolution and display ratio of the local display, and the paper size of the traffic audio-visual volume;
[0008] Calculate the positions of the drawing areas, pictures, and texts on the page according to the page height, picture height, page width, picture width, width of the drawing area, width of the encapsulation area, horizontal distance between the encapsulation area and the picture, and horizontal distance between adjacent pictures, and position the drawing areas, images, and texts on the page according to the positions;
[0009] Draw connection lines between different pictures based on the monitored mouse events. The connection lines include at least one of horizontal connection lines, vertical connection lines, and broken-line connection lines.
[0010] In the second aspect, a device for generating a traffic audio-visual volume is provided. The traffic audio-visual volume includes multiple vouchers, and each voucher includes two drawing areas. The device includes:
[0011] A determination module, configured to determine the page pixel size of the traffic audio-visual volume according to the resolution and display ratio of the local display, and the paper size of the traffic audio-visual volume;
[0012] A positioning module, configured to calculate the positions of the drawing area, the picture, and the text in the page according to the page height, the picture height, the page width, the picture width, the width of the drawing area, the width of the encapsulation area, the horizontal distance between the encapsulation area and the picture, and the horizontal distance between adjacent pictures, and position the drawing area, as well as the images and text on the page, according to the positions;
[0013] A drawing module, configured to draw connection lines between different pictures based on the monitored mouse events, where the connection lines include at least one of a horizontal connection line, a vertical connection line, and a polyline connection line.
[0014] According to the embodiments of the present application, by positioning the drawing area, the images and text on the page according to the positions of the drawing area, the pictures, and the text in the page, and drawing connection lines between different pictures, the accuracy and standardization of the traffic audio-visual volume can be ensured, enabling it to truly and comprehensively reflect the on-site situation of traffic accidents. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 is a flowchart of a method for generating a traffic audio-visual volume provided by an embodiment of the present application;
[0016] Figure 2 is a schematic diagram of the front page and the folded page of the traffic audio-visual volume provided by an embodiment of the present application;
[0017] Figure 3 is a schematic diagram of the duplicate form area provided by an embodiment of the present application;
[0018] Figure 4 is a schematic diagram of the drawing area provided by an embodiment of the present application;
[0019] Figure 5 is a schematic diagram of the image and text area provided by an embodiment of the present application;
[0020] Figure 6 is a schematic diagram of the parameters of the drawing area provided by an embodiment of the present application;
[0021] Figure 7 is a schematic diagram of the horizontal coordinate parameters of the image provided by an embodiment of the present application;
[0022] Figure 8 is a schematic diagram of the vertical coordinate parameters of the image provided by an embodiment of the present application;
[0023] Figure 9 is a flowchart of the image connection provided by an embodiment of the present application;
[0024] Figure 10 is a schematic diagram of the image boundary line provided by an embodiment of the present application;
[0025] Figure 11It is a schematic diagram of the boundary line example provided by the embodiments of the present application;
[0026] Figure 12 It is a schematic diagram of the horizontal connection line provided by the embodiments of the present application;
[0027] Figure 13 It is a schematic diagram of the vertical connection line provided by the embodiments of the present application;
[0028] Figure 14 It is a schematic diagram of the broken line connection line provided by the embodiments of the present application;
[0029] Figure 15 It is a schematic structural diagram of a device for generating a traffic audio-visual volume provided by the embodiments of the present application. Detailed implementation manners
[0030] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0031] According to relevant regulations, the paper quality and size of the traffic audio-visual volume need to comply with relevant national standards, and there are also clear requirements for photo specifications, layout, and written descriptions. These rules ensure the accuracy, standardization, and timeliness of the traffic audio-visual volume, enabling it to truly and comprehensively reflect the scene of the traffic accident.
[0032] The embodiments of the present application strictly follow relevant specifications and adopt advanced image processing, intelligent layout and other technologies to realize the online generation of traffic audio-visual volumes.
[0033] Next, in conjunction with the accompanying drawings, a method for generating a traffic audio-visual volume provided by the embodiments of the present application will be described in detail through specific embodiments and their application scenarios.
[0034] As Figure 1 shown, it is a flowchart of a method for generating a traffic audio-visual volume provided by the embodiments of the present application. The traffic audio-visual volume includes multiple forms, and each form includes two drawing areas. The method includes the following steps:
[0035] Step 101, determine the page pixel size of the traffic audio-visual volume according to the resolution and display ratio of the local display and the paper size of the traffic audio-visual volume.
[0036] Specifically, the dots per inch (DPI) can be calculated according to the resolution of the local display and the screen diagonal length; based on the DPI and the paper size of the traffic audio-visual volume, the physical size of the page can be calculated, and the physical size can be converted into pixel size.
[0037] Among them, the duplicate form is the basic constituent unit of the traffic audio-visual volume. Each page of the traffic audio-visual volume is regarded as an independent duplicate form, and each independent duplicate form contains different audio-visual data and relevant information; each duplicate form is divided into two upper and lower drawing areas, and the drawing areas are used to display thumbnails of the audio-visual data.
[0038] In this embodiment, the pictures can also be assigned to the corresponding duplicate form areas according to the number of pictures uploaded by the user and the preset duplicate form template to ensure that the order of the pictures in the traffic audio-visual volume is correct; multiple duplicate forms containing all the images are generated according to the area and position where the images uploaded by the user are located.
[0039] Step 102, calculate the positions of the drawing areas, pictures, and texts on the page according to the page height, picture height, page width, picture width, width of the drawing area, width of the encapsulation area, horizontal distance between the encapsulation area and the picture, and horizontal distance between adjacent pictures, and position the drawing areas, and the images and texts on the page according to the positions.
[0040] Specifically, for each drawing area of the traffic audio-visual volume, the following formula can be used to calculate the upper left corner coordinates of the drawing area:
[0041] Upper left corner coordinates = X * W 画图 + W 封装 + M 封装与图片 + X * M 图
[0042] Among them, W 画图 is the width of the drawing area, W 封装 is the width of the encapsulation area, M 封装与图片 is the horizontal distance between the encapsulation area and the picture, M 图 is the horizontal distance between adjacent pictures, and X is the picture order, starting from 0 with the first picture in the upper left corner of the front page as the first;
[0043] According to the picture width, page width, and width of the encapsulation area, the following formula is used to calculate the abscissa of the picture on the page:
[0044]
[0045] Among them, X is the abscissa of the picture on the page, W 封装 is the width of the encapsulation area, W 图 is the picture width, W 页is the page width;
[0046] According to the picture height and the page height, use the following formula to calculate the vertical coordinate of the picture on the page:
[0047]
[0048] where Y is the vertical coordinate of the picture on the page, and H 页 is the page height, and H 图 is the picture height.
[0049] Step 103: Based on the monitored mouse event, draw connection lines between different pictures. The connection lines include at least one of a horizontal connection line, a vertical connection line, and a polyline connection line.
[0050] Specifically, in the case of capturing the mouse event of the user's click, record the initial position of the mouse click and determine whether there is a picture at the initial position; in the case where there is a starting picture at the initial position, continue to capture the event of the mouse moving and determine whether there is a picture at the target position of the mouse; in the case where there is a target picture at the target position, determine the positional relationship between the starting picture and the target picture; if the positional relationship between the starting picture and the target picture is a horizontal relationship, draw a horizontal connection line between the starting picture and the target picture; if the positional relationship between the starting picture and the target picture is a vertical relationship, draw a vertical connection line between the starting picture and the target picture; if the positional relationship between the starting picture and the target picture is a non-horizontal and non-vertical relationship, draw a polyline connection line between the starting picture and the target picture.
[0051] In the embodiment of the present application, according to the drawing area, the positions of the pictures and the text on the page, locate the drawing area, as well as the images and text on the page, and draw connection lines between different pictures, which can ensure the accuracy and standardization of the traffic audio-visual volume, so that it can truly and comprehensively reflect the scene of the traffic accident.
[0052] In the embodiment of the present application, the online generation of the traffic audio-visual volume is realized through the following steps:
[0053] 1. Paper selection and size setting
[0054] In the embodiment of the present application, the paper of the traffic audio-visual volume is selected to have the same format size as the format size of the national organ official document paper, and strictly follows the paper size of the national organ official document paper and the rules for defining the positions and routing of pictures.
[0055] Among them, one sheet uses A4 paper size, with the specification: A4 type, 210mm×297mm. When multiple photos of a paragraph level cannot be pasted on the front page, continuous folding can be done at the binding margin. The length of the folded page should be the same as that of the front page, that is, the one-sheet part uses A4 paper size, while the two-sheet and three-sheet parts use folded pages. As Figure 2 shown, it can automatically adjust the position and size of elements such as pictures and texts on the paper according to the size of the form, so as to ensure readability and aesthetics.
[0056] 2. Region Division Description
[0057] In order to efficiently manage and display a large amount of audio-visual data, the traffic audio-visual volume is carefully divided into multiple functional regions, including the form region, the drawing region, and the image and text region.
[0058] 2.1 Form Region
[0059] The form region is the basic constituent unit of the entire audio-visual volume. Each sheet of paper is regarded as an independent form. The design of this region aims to provide flexibility and scalability, allowing users to adjust the number of forms according to actual needs. Whether dealing with a small amount of audio-visual data or a large-scale data set, the embodiments of this application can adapt to different needs by adjusting the number of forms.
[0060] Users can freely increase or decrease the number of forms according to the quantity and type of audio-visual data. Each form is independent and can contain different audio-visual data and related information, such as Figure 3 shown.
[0061] 2.2 Drawing Region
[0062] The drawing region is an important part of the form and is used to display the thumbnail of the audio-visual data. Each form is divided into two upper and lower drawing regions, as Figure 4 shown. Such a design makes the image display clearer and more orderly, and users can easily browse and identify the required audio-visual data in these regions.
[0063] The two upper and lower drawing regions provide more choices and flexibility for image display. The images are presented in the form of thumbnails, which helps to save space and quickly locate the required content.
[0064] 2.3 Image and Text Region
[0065] Inside the drawing region, images and texts are skillfully combined to form the image and text region, as Figure 5As shown. The image is horizontally centered in the drawing area to ensure its visual focus position on the page. The text is located 10px below the image, providing descriptions or relevant information about the image. The text provides necessary supplementary information for the image, helping users better understand the image content.
[0066] 3. Image Upload and Generation of N - part Forms
[0067] Users can select and upload traffic - related image files. During the user upload process, to avoid the situation of blank forms or non - consecutive pictures, a picture judgment function can be built - in.
[0068] If the user skips a certain serial number or position during the upload process, the embodiment of this application will automatically allocate the pictures to the corresponding form areas according to the number of pictures uploaded by the user and the preset form template, ensuring that the order of the pictures in the final generated audio - visual volume is correct.
[0069] The embodiment of this application will calculate and generate an N - part form (i.e., the image sequence in the audio - visual volume) containing all the images according to the area and position where the images uploaded by the user are located. For example, if the user uploads pictures in two form areas, it is a two - part form; if the user uploads images in N form areas, it is an N - part form.
[0070] 4. Pixel Conversion
[0071] Regarding the problem of different sizes of accident photos, the embodiment of this application has strong picture adaptation capabilities. Regardless of the original size of the photos, all uploaded photos will be uniformly adapted to the standard five - inch photo size, ensuring consistent clarity and visual effects when the pictures are displayed and printed. The pixel conversion function is a key component.
[0072] 4.1 Obtain the Local Monitor
[0073] Obtain the resolution and ratio information of the currently used local monitor. This is the basis for pixel conversion because different monitors have different resolutions and display ratios, and these differences will affect the display effect of the audio - visual volume on the monitor. Obtaining the ratio and resolution of the local monitor can better adapt to different users' display environments. By operating the API to obtain the resolution of the current monitor (such as 1920×1080), this information will be used in subsequent pixel conversion calculations.
[0074] 4.2 Calculation of DPI Ratio Explanation and Examples
[0075] DPI (Dots Per Inch) is a unit for measuring image resolution. It determines the number of pixels per inch in an image. The purpose of setting DPI is to control the clarity of the image. The higher the DPI value, the higher the clarity of the image.
[0076] Combine the current display resolution and the screen diagonal length to calculate the corresponding DPI value, ensuring that the generated audio-visual volume maintains the same size and clarity when displayed and printed on different devices. The following is an example of the DPI calculation method:
[0077] ① First, determine the physical size of the screen. Assume a 24-inch monitor with a screen resolution of 1920×1080.
[0078] ② Calculate the number of pixels on the diagonal:
[0079] Number of diagonal pixels = (1920 2 + 1080 2 ) ≈ 2202.91 pixels
[0080] ③ Calculate the DPI:
[0081]
[0082] Assume the physical diagonal is 24 inches and the DPI is:
[0083]
[0084] 4.3 Set the overall page pixel description and examples
[0085] First, calculate the physical size of the page (in centimeters) based on the calculated DPI and paper size, and convert this physical size to pixel size. This pixel size will be used as the reference size for the audio-visual volume during generation and display. The following is an example of the page pixel calculation method. Assume that the DPI is 96 and the paper size is 60 cm, and convert it to specific pixels:
[0086] ① Convert centimeters to inches:
[0087]
[0088] ② Convert inches to pixels:
[0089] Pixels = inches × DPI
[0090] That is, pixels = 23.62 × 96 ≈ 2267.52 pixels
[0091] 5. Position coordinate calculation
[0092] When arranging pictures and text on a page, it is necessary to consider the page layout, picture size, position of the binding margin, and text typesetting. Ensure that the pictures and text do not exceed the binding margin and the edges of the page. Calculate the positions of the pictures and text on the page, where the calculation of position coordinates plays a crucial role in ensuring that elements such as images and text can be accurately positioned and displayed. The following is a detailed analysis of the coordinate calculation of the drawing area, picture coordinates, and text position calculation.
[0093] 5.1 Coordinate Calculation of the Drawing Area
[0094] The drawing area is an important part of the continuous form, which is achieved by determining the starting and ending points of each area. Each continuous form is divided into two upper and lower drawing areas.
[0095] For each drawing area, it is necessary to calculate its upper-left corner coordinates, which will be used for the positioning of the drawing area and subsequent image and text positioning. This calculation involves multiple parameters, such as Figure 6 shown below. The following is the detailed calculation process:
[0096] ① Define parameters:
[0097] W 画图 : Width of the drawing area
[0098] W 封装 : Width of the encapsulation area, that is, the width of the left encapsulation area of the front page
[0099] M 封装与图片 : Distance from the encapsulation area to the picture
[0100] M 图 : Spacing between pictures
[0101] X: Picture order, starting from the first picture in the upper left of the front page, starting from 0
[0102] ② Calculation formula:
[0103] Upper-left corner coordinates = X * W 画图 + W 封装 + M 封装与图片 + X * M 图
[0104] 5.2 Picture Coordinate Calculation
[0105] Given the picture width, drawing area width, and the starting X coordinate of the drawing area on the page, this function can accurately calculate the coordinates of the picture on the page to ensure that the picture is accurately displayed within its corresponding drawing area, as Figure 7 shown below. The following is the detailed calculation process:
[0106] Define parameters for the abscissa:
[0107] W 封装 : Encapsulation area width
[0108] W 图 : Width of the picture
[0109] W 页 : Width of the page
[0110] Abscissa calculation formula:
[0111] Note: If the area where the picture is located is a right page, the width of W encapsulation needs to be subtracted; otherwise, it does not need to be subtracted.
[0112]
[0113] Ordinate definition parameters:
[0114] H 页 : Page height
[0115] H 图 : Height of the picture
[0116] Ordinate calculation formula:
[0117]
[0118] 5.3 Text position calculation
[0119] The text is placed in the area below the picture, and the horizontal position of the text is centered with the picture. When determining the position of the text, it is necessary to ensure that the text does not overlap with the picture and does not exceed the edge of the page. After obtaining the position of the picture, the text position is the bottom of the picture plus a 10-pixel offset.
[0120] 6. Image connection settings
[0121] Image connection settings allow users to upload pictures on the page and express the association relationships between these pictures through connections. This is usually used in flowcharts, relationship diagrams, or any applications that need to show the connections between elements, such as Figure 9 shown.
[0122] 6.1 Boundary line determination
[0123] Boundary line determination means that when drawing a connection, the four sides of the picture (taking the picture frame) are used as the starting or ending points of the connection. In the audio-visual volume, each picture is regarded as an independent visual element, and its four sides are set as the boundary lines of the connection. When the mouse is pressed and moved, by listening to the mouse events in real time to accurately capture the user's connection intention, a unilateral boundary line will appear on the picture, as Figure 10 shown, to indicate the possible positions of the connection, so as to reasonably plan the line layout.
[0124] ① Capture mouse events:
[0125] Set the event listening time to capture the mouse events when the user clicks on the picture, record the coordinate position of the mouse click, and determine whether there is a picture at the current click coordinate. If there is, continue with the following operations; otherwise, do not perform any line-drawing operations.
[0126] After the user clicks on the picture, continue to capture the mouse movement events. Compare the new position after the mouse moves with the initial position at the time of clicking. Based on the comparison between the new position and the initial position after the mouse moves, determine whether the mouse moves up, down, left, or right. According to the moving direction and distance, draw the corresponding boundary lines on the picture. For example, if the mouse moves down a lot, draw the lower boundary line.
[0127] ② Determine the position of the boundary line:
[0128] Obtain the picture coordinate information of the mouse click position, add a certain offset (for example, 2px) as the starting position of the boundary line, and draw a boundary line with the same width (or height) as the picture.
[0129] ③ Example:
[0130] Suppose the user clicks on a certain position of the picture, which is the starting point, and the coordinate of this position is (X, Y). Then the mouse moves to the end position on the right side of the starting point of the picture and is released, generating a right boundary line. As Figure 11 shown, the starting point of the right boundary line is X + W 图 + 2px, and the height of the right boundary line is equal to the height of the picture.
[0131] 6.2 Determination of polyline
[0132] 6.2.1 Capture mouse events
[0133] When the mouse down event occurs, determine whether the mouse is within the picture area. If it is, record this position as the starting point of the line-drawing and mark the current picture as the starting picture.
[0134] 6.2.2 Judge the position of the target picture relative to the starting picture
[0135] During the mouse movement, continuously determine whether the current mouse position points to another picture. Once it is determined that the mouse points to the target picture, it is necessary to judge the positional relationship between the target picture and the starting picture. According to the judged positional relationship, prepare to draw a straight line or a polyline with inflection points. If it is a vertical or horizontal relationship, draw a straight line directly; otherwise, calculate the inflection point position while drawing the line.
[0136] 6.2.3 Connect the lines
[0137] Drawing a horizontal connection line: The horizontal connection line starts from the left or right boundary line of the starting picture and reaches the current mouse position on the target picture. The position of this line is adjusted as the mouse moves, but it always remains horizontal, that is, the X value of the starting point coordinate of the line is fixed, and the Y value is adjusted as the mouse moves. As shown in Figure 12 shown.
[0138] ① Coordinates of the starting point of the connection line:
[0139]
[0140] ② Length of the connection line:
[0141] Length of the connection line = X coordinate of the end point - X coordinate of the starting point
[0142] Drawing a vertical connection line: It starts from the upper or lower boundary line of the starting picture and extends to the end point at the current mouse position on the target picture. The connection line is dynamically adjusted as the mouse moves on the target picture, but it always remains vertical, that is, the Y value of the starting point coordinate of the line is fixed, and the X value is adjusted as the mouse moves. As shown in Figure 13 shown.
[0143] ① Coordinates of the starting point of the connection line:
[0144]
[0145] ② Length of the connection line:
[0146] Length of the connection line = Y coordinate of the end point - Y coordinate of the starting point
[0147] Drawing a broken-line connection line: It starts from the boundary line of the starting picture, passes through two inflection points, and finally reaches the current mouse position on the target picture. The starting horizontal broken line is located in the middle of the boundary line of the starting picture, the vertical broken line coincides with the bill separator, and the target horizontal broken line is dynamically adjusted as the mouse moves horizontally on the target picture. As shown in Figure 14 shown.
[0148] The following is the detailed calculation process:
[0149] ① Coordinates of the starting point of the connection line:
[0150]
[0151] ② Length of the starting horizontal broken line:
[0152] Length of the starting horizontal broken line = Coordinate of the bill separator - Coordinates of the starting point of the connection line
[0153] ③ Length of the vertical broken line:
[0154] Length of the vertical broken line = Coordinates of the end point - Coordinates of the starting point of the connection line
[0155] ④ Target horizontal broken line length:
[0156] Target horizontal broken line length = End point coordinates - Vertical broken line coordinates
[0157] 6.3 Intersection determination
[0158] If there is a line segment intersection during image connection, it will first determine whether there is a line segment in the connected image orientation. If there is a line segment, the current connection line drawing will be cancelled to avoid line overlap and confusion.
[0159] 6.4 Top - setting setting
[0160] When line segments are connected, if the picture name or picture description below the image is encountered, these names and descriptions will be top - set through attributes to ensure that they will not be covered by the line segments.
[0161] Before drawing a line segment, check whether the line segment will cover any picture name or description. If it will cover, adjust the positions of these names and descriptions to top - display.
[0162] As Figure 15 shown, it is a schematic structural diagram of a device for generating a traffic audio - visual volume provided by an embodiment of the present application. The traffic audio - visual volume includes multiple vouchers, each voucher includes two drawing areas, and the device includes:
[0163] A determination module 151, configured to determine the page pixel size of the traffic audio - visual volume according to the resolution and display ratio of the local display, and the paper size of the traffic audio - visual volume.
[0164] Specifically, the determination module 151 is specifically configured to calculate the corresponding dots per inch DPI according to the resolution and screen diagonal length of the local display; calculate the physical size of the page according to the DPI and the paper size of the traffic audio - visual volume, and convert the physical size into a pixel size.
[0165] Wherein, the voucher is the basic constituent unit of the traffic audio - visual volume. Each page of the traffic audio - visual volume is regarded as an independent voucher, and each independent voucher contains different audio - visual data and related information; each voucher is divided into upper and lower two drawing areas, and the drawing areas are used to display thumbnails of audio - visual data.
[0166] A positioning module 152, configured to calculate the positions of the drawing areas, pictures, and texts on the page according to the page height, picture height, page width, picture width, width of the drawing area, width of the encapsulation area, horizontal distance between the encapsulation area and the picture, and horizontal distance between adjacent pictures, and position the drawing areas, images, and texts on the page according to the positions.
[0167] Specifically, the positioning module 152 is specifically configured to calculate the upper left coordinates of each drawing area of the traffic audio-visual volume using the following formula for each drawing area:
[0168] Upper left coordinates = X * W 画图 + W 封装 + M 封装与图片 + X * M 图
[0169] Where W 画图 is the width of the drawing area, W 封装 is the width of the encapsulation area, M 封装与图片 is the horizontal distance between the encapsulation area and the picture, M 图 is the horizontal distance between adjacent pictures, X is the picture order, starting from 0 with the first picture in the upper left of the positive page as the first;
[0170] According to the picture width, page width, and the width of the encapsulation area, use the following formula to calculate the abscissa of the picture on the page:
[0171]
[0172] Where X is the abscissa of the picture on the page, W 封装 is the width of the encapsulation area, W 图 is the picture width, W 页 is the page width;
[0173] According to the picture height and page height, use the following formula to calculate the ordinate of the picture on the page:
[0174]
[0175] Where Y is the ordinate of the picture on the page, H 页 is the page height, H 图 is the picture height.
[0176] The drawing module 153 is used to draw connection lines between different pictures based on the monitored mouse events, and the connection lines include at least one of horizontal connection lines, vertical connection lines, and broken line connection lines.
[0177] Specifically, the drawing module 153 is specifically configured to record the initial position of a mouse click and determine whether there is an image at the initial position when a mouse event clicked by the user is captured; when there is a starting image at the initial position, continue to capture the event of mouse movement and determine whether there is an image at the target position of the mouse; when there is a target image at the target position, determine the positional relationship between the starting image and the target image; if the positional relationship between the starting image and the target image is a horizontal relationship, draw a horizontal connection line between the starting image and the target image; if the positional relationship between the starting image and the target image is a vertical relationship, draw a vertical connection line between the starting image and the target image; if the positional relationship between the starting image and the target image is a non-horizontal and non-vertical relationship, draw a polyline connection line between the starting image and the target image.
[0178] Furthermore, the above device further includes:
[0179] An allocation module, configured to allocate images to corresponding waybill areas according to the number of images uploaded by the user and a preset waybill template, ensuring that the order of the images in the traffic audio-visual volume is correct; generate multiple waybills including all the images according to the area and position where the images uploaded by the user are located.
[0180] According to the drawing area, the positions of the images and texts on the page, the embodiments of the present application locate the drawing area, as well as the images and texts on the page, and draw connection lines between different images, which can ensure the accuracy and standardization of the traffic audio-visual volume, enabling it to truly and comprehensively reflect the on-site situation of traffic accidents.
[0181] The embodiments of the present application also provide a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements each process of the method embodiments for generating the traffic audio-visual volume and can achieve the same technical effects. To avoid repetition, it will not be elaborated here. Among them, the computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc, etc.
[0182] It should be noted that in this text, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the presence of additional identical elements in the process, method, article or device comprising that element.
[0183] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present application.
[0184] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them fall within the protection scope of the present application.
Claims
1. A method for generating a traffic audio and video roll, characterized in that: The traffic audio-visual roll includes a plurality of sheets, each sheet includes two drawing areas, and the method includes the following steps: Determining the page pixel size of the traffic audio-visual roll according to the resolution and display ratio of the local display and the paper size of the traffic audio-visual roll; Calculate the positions of the drawing area, the picture and the text on the page according to the page height, the picture height, the page width, the picture width, the width of the drawing area, the width of the encapsulation area, the horizontal distance between the encapsulation area and the picture, and the horizontal distance between adjacent pictures, and locate the drawing area, the image and the text on the page according to the positions; Based on the monitored mouse events, connecting lines are drawn between different pictures, where the connecting lines include at least one of horizontal connecting lines, vertical connecting lines and broken line connecting lines.
2. The method according to claim 1, characterized in that Determining the page pixel size of the traffic audio-visual volume according to the resolution and display ratio of the local display and the paper size of the traffic audio-visual volume specifically includes: Calculate the corresponding dots per inch (DPI) based on the local display resolution and screen diagonal length; According to the DPI and the paper size of the traffic audio and video roll, the physical size of the page is calculated and converted into pixel size.
3. The method according to claim 1, characterized in that The calculating the positions of the drawing area, the picture and the text in the page according to the page height, the picture height, the page width, the picture width, the width of the drawing area, the width of the encapsulation area, the horizontal distance between the encapsulation area and the picture, and the horizontal distance between adjacent pictures specifically includes: For each drawing area of the traffic audio-visual roll, the upper left corner coordinate of the drawing area is calculated using the following formula: Upper left corner coordinate = X*W 画图 +W 封装 +M 封装与图片 +X*M 图 Among them, W 画图 is the width of the drawing area, W 封装 is the width of the package area, M 封装与图片 is the horizontal distance between the package area and the image, M 图 is the horizontal distance between adjacent pictures, X is the picture order, starting from the first picture on the upper left of the main page, starting from 0; Based on the image width, page width, and encapsulation area width, use the following formula to calculate the horizontal coordinate of the image on the page: Among them, X is the horizontal coordinate of the picture on the page, W 封装 is the width of the package area, W 图 is the image width, W 页 is the page width; Based on the image height and page height, use the following formula to calculate the vertical coordinate of the image on the page: Among them, Y is the vertical coordinate of the picture on the page, H 页 is the page height, H 图 The height of the image.
4. The method according to claim 1, characterized in that Drawing connecting lines between different pictures based on the monitored mouse events specifically includes: When capturing a mouse event of a user clicking, record the initial position of the mouse click and determine whether there is a picture at the initial position; When there is a starting picture at the initial position, continue to capture mouse movement events to determine whether there is a picture at the target position of the mouse; When there is a target picture at the target position, determining the positional relationship between the starting picture and the target picture; If the positional relationship between the starting image and the target image is a horizontal relationship, a horizontal connecting line is drawn between the starting image and the target image; if the positional relationship between the starting image and the target image is a vertical relationship, a vertical connecting line is drawn between the starting image and the target image; if the positional relationship between the starting image and the target image is a non-horizontal and non-vertical relationship, a broken line connecting line is drawn between the starting image and the target image.
5. The method according to claim 1, characterized in that The form is the basic component of the traffic audio-visual volume. Each page of the traffic audio-visual volume is regarded as an independent form, and each independent form contains different audio-visual data and related information. Each sheet is divided into two upper and lower drawing areas, and the drawing areas are used to display thumbnails of audio and video data; The method further comprises: According to the number of pictures uploaded by the user and the preset form template, the pictures are allocated to the corresponding form areas to ensure that the order of the pictures in the traffic audio-visual roll is correct; Generate multiple joint forms containing all images based on the area and location of the images uploaded by the user.
6. A device for generating traffic audio and video rolls, characterized in that: The traffic audio-visual roll includes a plurality of sheets, each of which includes two drawing areas, and the device includes: A determination module, used for determining the page pixel size of the traffic audio-visual roll according to the resolution and display ratio of the local display and the paper size of the traffic audio-visual roll; A positioning module, used for calculating the positions of the drawing area, the picture and the text on the page according to the page height, the picture height, the page width, the picture width, the width of the drawing area, the width of the encapsulation area, the horizontal distance between the encapsulation area and the picture, and the horizontal distance between adjacent pictures, and positioning the drawing area, the image and the text on the page according to the positions; The drawing module is used to draw connection lines between different pictures based on the monitored mouse events, and the connection lines include at least one of horizontal connection lines, vertical connection lines and broken line connection lines.
7. The device according to claim 6, characterized in that The determination module is specifically used to calculate the corresponding dots per inch DPI according to the resolution of the local display and the screen diagonal length; calculate the physical size of the page according to the DPI and the paper size of the traffic audio and video roll, and convert the physical size into pixel size.
8. The device according to claim 6, characterized in that The positioning module is specifically used to calculate the upper left corner coordinates of each drawing area of the traffic audio-visual volume using the following formula: Upper left corner coordinate = X*W 画图 +W 封装 +M 封装与图片 +X*M 图 Among them, W 画图 is the width of the drawing area, W 封装 is the width of the package area, M 封装与图片 is the horizontal distance between the package area and the image, M 图 is the horizontal distance between adjacent pictures, X is the picture order, starting from the first picture on the upper left of the main page, starting from 0; Based on the image width, page width, and encapsulation area width, use the following formula to calculate the horizontal coordinate of the image on the page: Among them, X is the horizontal coordinate of the picture on the page, W 封装 is the width of the package area, W 图 is the image width, W 页 is the page width; Based on the image height and page height, use the following formula to calculate the vertical coordinate of the image on the page: Among them, Y is the vertical coordinate of the picture on the page, H 页 is the page height, H 图 The height of the image.
9. The device according to claim 6, characterized in that The drawing module is specifically used to, when capturing a mouse event of a user clicking, record the initial position of the mouse click and determine whether there is a picture at the initial position; when there is a starting picture at the initial position, continue to capture the mouse moving event and determine whether there is a picture at the target position of the mouse; When there is a target picture at the target position, determining the positional relationship between the starting picture and the target picture; If the positional relationship between the starting picture and the target picture is a horizontal relationship, a horizontal connecting line is drawn between the starting picture and the target picture; If the positional relationship between the starting image and the target image is a vertical relationship, a vertical connecting line is drawn between the starting image and the target image; If the positional relationship between the starting image and the target image is a non-horizontal and non-vertical relationship, a broken line connecting line is drawn between the starting image and the target image.
10. The device according to claim 6, characterized in that The form is the basic component of the traffic audio-visual volume. Each page of the traffic audio-visual volume is regarded as an independent form, and each independent form contains different audio-visual data and related information. Each sheet is divided into two upper and lower drawing areas, and the drawing areas are used to display thumbnails of audio and video data; The device further comprises: The allocation module is used to allocate the pictures to the corresponding joint form area according to the number of pictures uploaded by the user and the preset joint form template, ensuring that the order of the pictures in the traffic audio and video volume is correct; and generate multiple joint forms containing all the images according to the area and location of the images uploaded by the user.