Method and device for displaying image
By providing a method and device for displaying images in an autonomous driving system, it is possible to output image data in a supported format in the image selection interface and count the number of pixels in the region of interest, solving the problem that the image data on the on-board camera cannot effectively evaluate the imaging quality, and achieving efficient and accurate image testing.
Patent Information
- Application Number
- CN202311121277.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-31
- Publication Date
- 2025-02-28
AI Technical Summary
In the existing autonomous driving system, the image data obtained by the on-board camera is compressed, with a lot of loss of information, and it is impossible to effectively evaluate the camera imaging quality. At the same time, the YUV format images cannot be viewed directly in a regular image viewer, and a dedicated decoding tool is required.
A method and device for displaying an image are provided, by detecting operation instructions, displaying a pixel statistics interface, and outputting the second image data in a supported format in the image selection interface, thereby realizing the output of the number of pixels in any region of interest.
It realizes selecting the area of interest in any area in the image and automatically counting the number of pixels in the selected area, improving the efficiency and accuracy of the image testing of on-board cameras, and solving the problem that YUV format images cannot be viewed directly.
Smart Images

Figure CN119544953A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing, and in particular to a method and device for displaying images. Background Art
[0002] Autonomous driving technology is an important direction of development in the current automotive industry, and on-board cameras are one of the essential sensors for autonomous driving. On-board cameras can obtain environmental data and build perception capabilities for cars, so it is very important to test the imaging effect of on-board cameras.
[0003] At present, the image data obtained by the autonomous driving system from the on-board camera is compressed data, which has a lot of information loss and cannot be used to evaluate the quality of camera imaging. Therefore, offline testing based on autonomous driving scenarios has become the main testing method. For different resolutions, field of view angles, and shooting distances, the perception and recognition module of the autonomous driving system requires that pedestrians, vehicles, obstacles, traffic signs, etc. in the images taken by the on-board camera must meet the corresponding pixel number requirements to achieve a high recognition accuracy rate. Therefore, during the test process, counting the number of pixels occupied by various targets in the image has become an important part of the on-board camera test. Summary of the invention
[0004] The present application provides a method and device for displaying an image, which achieves the purpose of outputting the number of pixels of any region of interest in an image that supports output on an image selection interface.
[0005] The technical solution is as follows:
[0006] In a first aspect, a method for displaying an image is provided, the method comprising: displaying a pixel statistics interface. When a first operation instruction acting on the pixel statistics interface is detected, an image selection interface is displayed, the image selection interface includes information of one or more second image data, and the second image data is obtained by format conversion of the first image data. The data format of the second image data is an image format supported for output on the image selection interface, and the data format of the first image data is an image format not supported for output on the image selection interface. When a second operation instruction acting on at least one of the one or more second image data is detected, at least one second image data is displayed. When a third operation instruction acting on any second image data is detected, the number of pixels in a target area selected by the third operation instruction in any second image data is output.
[0007] The present application displays a pixel statistics interface, and in the case of detecting a first operation instruction acting on the pixel statistics interface, responds to the first operation instruction to control the display of an image selection interface on a computer screen. The image selection interface includes information of one or more second image data, and the second image data is obtained by format conversion of the first image data. The data format of the first image data is an image format that is not supported for output in the image selection interface, and the data format of the second image data is an image format that is supported for output in the image selection interface. Therefore, in the case of detecting a second operation instruction for information of any second image data in one or more second image data, any second image data can be displayed. Then, through a third operation instruction for any second image data, the number of pixels in the target area selected by the third operation instruction in any second image data can be output, so that the function of selecting an area of interest in any area of the image and automatically counting the number of pixels in the selected area is realized through the third operation instruction, making it more convenient to count the number of pixels.
[0008] In one embodiment of the present application, before displaying the pixel statistics interface, the method further includes: displaying an initial interface, where the initial interface displays a plurality of controls, each control being used to trigger a different functional interface.
[0009] In one embodiment of the present application, the multiple controls include at least: a first control for triggering the display of a pixel statistics interface and a second control for triggering the display of a format conversion interface. After displaying the initial interface, the method further includes: detecting a fourth operation instruction for the first control, then displaying the pixel statistics interface, and / or detecting a fifth operation instruction for the second control, then displaying the format conversion interface.
[0010] In one embodiment of the present application, the format conversion interface includes a third control and a fourth control, and the method further includes: when a sixth operation instruction acting on the third control is detected, one or more first image data are read from the file location where the one or more first image data are stored. When a seventh operation instruction acting on the fourth control is detected, the data format of each first image data is converted to obtain the second image data corresponding to each first image data. The data format of the first image data is a YUV format, and the data format of the second image data is a format supported for output in the image selection interface.
[0011] In one embodiment of the present application, the format conversion interface further includes: a fifth control. The method further includes: upon detecting an eighth operation instruction for the fifth control, resetting the format conversion interface, or pausing the process of converting the first image data into the second image data.
[0012] In one embodiment of the present application, during the process of converting the first image into the second image, the method further includes: displaying prompt information on the format conversion interface, the prompt information reflecting the progress of converting the first image data into the second image data.
[0013] In one embodiment of the present application, the data format of each first image data is converted to obtain the second image data corresponding to each first image data, including: for each first image data, extracting the YUV value of each pixel in each first image data. According to the YUV value of each pixel in each first image data, determining the RGB value of each pixel in each first image data. According to the RGB value of each pixel in each first image data, determining the second image data corresponding to each first image data.
[0014] In one embodiment of the present application, in the method, the number of pixels in the target area of the second image data includes: the number of pixels in the horizontal direction, the number of pixels in the vertical direction, and the total number of pixels in the target area.
[0015] In a second aspect, a device for displaying an image is provided, the device comprising: a first display unit for displaying a pixel statistics interface. A second display unit for detecting a first operation instruction acting on the pixel statistics interface, and displaying an image selection interface, wherein the image selection interface includes one or more second image data, and the second image data is obtained by format conversion of the first image data. The data format of the second image data is an image format that supports output on the image selection interface, and the data format of the first image data is an image format that does not support output on the image selection interface. A detection unit for detecting a second operation instruction acting on any second image data among one or more second image data, and then displaying any second image data. An output unit for detecting a third operation instruction acting on any second image data, and outputting the number of pixels in a target area selected by the third operation instruction in any second image data.
[0016] In a third aspect, an electronic device is provided, comprising: a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the above-mentioned method for displaying an image.
[0017] In a fourth aspect, a computer program product is provided, which implements the above-mentioned method of displaying images when executed by a processor.
[0018] In a fifth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned method of displaying an image is implemented.
[0019] It can be understood that the beneficial effects of the second, third, fourth and fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in 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 only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 is a schematic diagram of an initial interface of an image testing tool provided in an embodiment of the present application;
[0022] Figure 2 This is a schematic diagram of a format conversion interface provided by an embodiment of the present application;
[0023] Figure 3 is a schematic diagram of a folder storing first image data provided by an embodiment of the present application;
[0024] Figure 4 This is a schematic diagram of a format conversion interface with a progress bar provided in an embodiment of the present application;
[0025] Figure 5 is a schematic diagram of a folder storing first image data and second image data provided by an embodiment of the present application;
[0026] Figure 6 is a flow chart of a method for displaying an image provided by an embodiment of the present application;
[0027] Figure 7 This is a schematic diagram of a pixel statistics interface provided in an embodiment of the present application;
[0028] Figure 8 This is a schematic diagram of a pixel statistics interface for displaying an image provided by an embodiment of the present application;
[0029] Fig. 9 This is a schematic diagram of a pixel statistics interface for outputting the number of pixels provided in an embodiment of the present application;
[0030] Fig.10 is a schematic diagram of the structure of an image display device provided in an embodiment of the present application;
[0031] Fig.11 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0032] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0033] It should be understood that the "multiple" mentioned in this application refers to two or more. In the description of this application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article 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 mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in order to facilitate the clear description of the technical solution of this application, the words "first" and "second" are used to distinguish between the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first" and "second" do not limit the quantity and execution order, and the words "first" and "second" do not limit them to be different.
[0034] Before explaining the embodiments of the present application in detail, the application scenarios of the embodiments of the present application are first described.
[0035] The on-board camera is one of the essential sensors for autonomous driving, and has become the main support for autonomous driving systems to obtain environmental data and build perception capabilities. The images taken by on-board cameras are mainly in YUV format, which cannot be viewed using conventional image viewers and requires special decoding tools. The decoded on-board camera images also require pedestrians, vehicles, obstacles, traffic signs, etc. in the image to meet the corresponding pixel number requirements in order to achieve a high recognition accuracy. Therefore, counting the number of pixels occupied by various targets in the image is an important part of the on-board camera image test.
[0036] The image data obtained by the autonomous driving system from the on-board camera for model training are all compressed data, which has a lot of information loss and cannot be used to evaluate the quality of a camera image. The data format directly output by the on-board camera is mainly in YUV format, which cannot be viewed using a conventional image viewer and requires a dedicated decoding tool. Offline testing of on-board cameras based on autonomous driving scenarios will obtain a large amount of image data. The testing process needs to rely on decoding tools with batch processing capabilities, otherwise the processing efficiency is too low to meet the testing requirements of on-board cameras. For different resolutions, field of view angles, and shooting distances, the perception and recognition module requires that pedestrians, vehicles, obstacles, traffic signs, etc. in the images captured by the on-board camera must meet the corresponding pixel number requirements to achieve a high recognition accuracy. Counting the number of pixels occupied by various targets in the image has become an important part of the on-board camera test. The naked eye observation and counting by testers is not only inefficient but also very error-prone.
[0037] To this end, the present application provides a method and device for displaying images for testing the imaging effect of vehicle-mounted cameras in different usage scenarios. On the one hand, it has the ability to batch process YUV image format conversion, and on the other hand, it realizes the function of selecting any area in the image and automatically counting the number of pixels in the selected area.
[0038] A method for displaying an image provided in an embodiment of the present application is explained in detail below.
[0039] In the embodiment of the present application, the specific structure of the execution subject of the method for displaying an image is not particularly limited in the embodiment of the present application, as long as the method for displaying an image according to the embodiment of the present application can be communicated by running a program that records the code of the method for displaying an image according to the embodiment of the present application. For example, the execution subject of the method for displaying an image provided in the embodiment of the present application may be a functional module in an electronic device that can call and execute a program, or a device applied to an electronic device, such as a chip. The following embodiment is described by taking the execution subject of the method for displaying an image as an electronic device with a display function as an example.
[0040] The electronic device in the embodiment of the present application may be a computer, a laptop computer, a tablet computer, a mobile phone, etc.
[0041] In the embodiment of the present application, one or more first image data collected by the vehicle-mounted camera are stored in the electronic device, and the data format of the one or more first image data is not recognized by the electronic device. In other words, when the electronic device displays the image selection interface, the data format of the first image data is an image format that is not supported for output on the image selection interface. For example, the data format of the image directly output by the vehicle-mounted camera is mostly in YUV format, which cannot be directly viewed on the image selection interface and requires a dedicated decoding tool.
[0042] For example, the electronic device is a computer, and the computer runs an image detection tool software. When the computer detects the operation instruction input by the user to run the image detection tool software, the computer starts running the image detection tool software and displays the image detection tool software on the screen. Figure 1 The initial interface 10 of the image detection tool software shown in FIG. Figure 1 As shown, the initial interface 10 includes a “pixel statistics” control 101 (corresponding to the first control), and a “format conversion” control 102 (corresponding to the second control).
[0043] Optionally, the initial interface 10 may further include an interface title 103, a minimize button 104, a maximize button 105, and a close button 106. As an example, Figure 1As shown, the interface title is located on the left side of the title bar of the initial interface 10, the name of the interface title 103 is "Image Test Tool", and the minimize button 104, the maximize button 105 and the close button 106 are located on the right side of the title bar. Among them, the image detection tool software detects the operation instruction for the minimize button 104, and in response to the operation instruction, controls the initial interface 10 of the image detection tool software to hide in the taskbar of the computer. The image detection tool software detects the operation instruction for the maximize button 105, and in response to the operation instruction, controls the initial interface 10 of the image detection tool software to be enlarged and displayed to the entire computer screen. The image detection tool software detects the operation instruction for the close button 106, and in response to the operation instruction, controls the computer to close the image detection tool software.
[0044] In a possible implementation of the present application, in order to facilitate the user to understand the functions of each control displayed on the initial interface 10, when the user operates the mouse to hover over the "pixel statistics" control 101 (first control) and the "format conversion" control 102 (second control), the computer can also display function prompt information 107, which is used to prompt the function corresponding to the control. Figure 1 As shown, the prompt information of the "Pixel Statistics" control 101 is a display prompt box 1072 "Click here to perform pixel statistics". The prompt information of the "Format Conversion" control 102 is a display prompt box 1071 "Click here to perform image format conversion".
[0045] In one embodiment of the present application, when the image detection tool software detects a trigger instruction for the "format conversion" control 102, in response to the trigger instruction, the computer screen is controlled to display the following Figure 2 The format conversion interface 20 shown in FIG. Format conversion interface 20 includes a "file selection" control 201 (third control) and a "confirmation" control 202 (fourth control).
[0046] When the image detection tool software detects an operation instruction (sixth operation instruction) for the "file selection" control 201, in response to the operation instruction, the computer is controlled to read one or more first image data from the file location where the one or more first image data are stored.
[0047] As an example, Figure 2 and Figure 3 As shown, when the image detection tool software detects an operation instruction for the "file selection" control 201, it controls the interface of the file storage location displayed on the computer screen in response to the operation instruction, such as Figure 3A folder storing one or more first image data, the first image data is image data in YUV format, and does not support direct display of images. The image detection tool software detects a selection instruction for at least one first image data, and controls reading at least one first image data from a file storage location in response to the selection instruction. Afterwards, the format conversion interface 20 is controlled to be displayed on the computer screen. Of course, after the computer reads at least one first image data, the computer can also output a prompt message that the file reading has been completed, and then control the display of the format conversion interface 20 on the computer screen based on the user's operation.
[0048] The user uses the mouse to click on the "Confirm" control 202, and the image detection tool software detects the operation instruction acting on the "Confirm" control 202, and in response to the operation instruction, controls the computer to start format conversion of at least one first image data, so as to convert the format of at least one first image data into a data format that can directly display the image on the computer through the image detection tool software.
[0049] In a possible implementation of the present application, the image detection tool software detects a selection instruction for the "file selection" control 201, and in response to the selection instruction, controls the computer to select a storage location (such as a folder), in which ten first image data are stored, and the user can select the first image data for format conversion, that is, the user can select a specific one or more first image data, and after the image detection tool software detects the selection instruction for the first image data, it controls the computer to perform format conversion on the selected one or more first image data in response to the selection instruction. For example, the image detection tool software detects the selection instruction for images 1 to 3, and controls the computer to perform image format conversion on images 1 to 3 in response to the selection instruction; if the image detection tool software detects the selection instruction for all ten first image data, it controls the computer to read all ten first image data from the folder storing the ten first image data in response to the selection instruction. Then, the user clicks the "confirm" control 202 of the format conversion interface with the mouse, and the image detection tool software detects the operation instruction acting on the "confirm" control 202, and controls the computer to perform format conversion on the ten first image data at the same time in response to the operation instruction.
[0050] In a possible implementation of the present application, the user selects one of the ten first image data, for example, the user selects image 1, and the image detection tool software detects the selection instruction for image 1, and controls the computer to read the first image data selected by the user in response to the selection instruction. Then, the user clicks the "Confirm" control 202 of the format conversion interface with the mouse, and the image detection tool software detects the operation instruction for the "Confirm" control 202, and controls the computer to start format conversion for the image 1 selected by the user in response to the operation instruction.
[0051] Optionally, the format conversion interface also includes a "reset" control 203 (fifth control). After completing a format conversion, when the image detection tool software detects an operation instruction that triggers the "reset" control 203, in response to the operation instruction, the computer is controlled to clear the first image data previously selected; or during the format conversion process, when an operation instruction that triggers the "reset" control 203 is detected, the computer is controlled to pause the format conversion process in response to the operation instruction.
[0052] Optionally, during the format conversion process, when the image detection tool software detects an operation instruction that triggers the "reset" control 203, the image detection tool software controls the computer to pause the format conversion process in response to the operation instruction. The user can use the mouse to click the "confirm" control 202 again. When the image detection tool software detects an operation instruction that triggers the "confirm" control 202 again, the image detection tool software controls the computer to continue the format conversion process in response to the operation instruction.
[0053] Alternatively, the format conversion interface may also include a "Continue" control. After pausing the format conversion process, the user may use the mouse to click the "Continue" control. When the image detection tool software detects an operation instruction that triggers the "Continue" control, it responds to the operation instruction to control the computer to continue the format conversion process.
[0054] Optionally, in the process of converting the first image data format into the second image data, a prompt message 204 is displayed on the format conversion interface 20, such as Figure 2 The prompt information 204 is used to reflect the progress of converting the first image data format into the second image data.
[0055] As an example, after the computer completes a format conversion through the image detection tool software, the user uses the mouse to click the "Reset" control 203, and the image detection tool software detects the trigger instruction for the "Reset" control 203. In response to the trigger instruction, the computer is controlled to clear the first image data previously selected, that is, the image detection tool software is reset for the next format conversion.
[0056] As another example, when the user needs to stop the current format conversion during the format conversion process, he can also use the mouse to click the "Reset" control 203. The image detection tool software detects the trigger instruction for the "Reset" control 203, and responds to the trigger instruction to control the computer to pause the current format conversion process.
[0057] As an example, Figure 4 As shown, the prompt information of the format conversion interface 20 is a progress bar 401, which can display the format conversion progress of the first image data in real time. When converting a first image data, the progress bar 401 displays the format conversion progress of the converted first image data (for example, the format conversion progress is 50%).
[0058] As another example, when converting multiple first image data, the progress bar 401 displays the ratio of the number of first image data that have completed format conversion to the total number of first image data that have been converted. For example, if there are 10 first image data to be converted and 5 of them have completed format conversion, the ratio is 50%, and the progress bar 401 displays the format conversion progress as 50%.
[0059] In one embodiment of the present application, the first image data is converted into the second image data, including: for each first image data, the computer extracts the YUV value of each pixel in each first image data through image detection tool software. The computer determines the RGB value of each pixel in each first image data based on the YUV value of each pixel in each first image data through the image detection tool software. The computer determines the second image data corresponding to each first image data based on the RGB value of each pixel in each first image data through the image detection tool software.
[0060] In a possible implementation of the present application, the format of the second image data is BMP format. The images collected by the vehicle-mounted camera are stored in YUV format. The image detection tool software in the embodiment of the present application detects relevant instructions and responds to relevant instructions to control the computer to batch convert YUV format data into BMP format data. BMP format data can be displayed on the computer screen in the form of an image in the image detection tool software. Among them, the second image data can also be data in other formats, and the YUV format data can be converted according to different display requirements, which is not limited here.
[0061] After the computer completes the format conversion of one or more first image data through the image detection tool software, the second image data corresponding to the one or more first image data are stored in a fixed position.
[0062] In a possible implementation of the present application, the second image data after format conversion is stored in the same location as the first image data, such as the same folder; or it can be stored in a different location, for example, the format-converted image is stored in other folders in the computer storage space by default.
[0063] The second image data is displayed in the selection interface in the form of an icon or a thumbnail.
[0064] In the embodiment of the present application, one or more first image data may be stored in the storage space of the computer. Of course, the one or more first image data may also be stored in an external storage device connected to the computer, or in a cloud disk.
[0065] As an example, Figure 5 As shown, in the folder storing a plurality of first image data in the above embodiment, second image data corresponding to each first image data is stored.
[0066] In one embodiment of the present application, when the image detection tool software detects that the "pixel statistics" control 101 is triggered, the method for displaying the image is as follows: Figure 6 As shown, including:
[0067] Step 601: Display a pixel statistics interface on the computer screen.
[0068] The computer stores one or more first image data collected by the vehicle-mounted camera. The one or more first image data can be stored in the computer's memory or in an external memory connected to the computer. Of course, the one or more first image data can be stored in the vehicle-mounted camera, but after the computer establishes a communication connection with the vehicle-mounted camera (such as a Bluetooth connection), the one or more first image data on the vehicle-mounted camera can be viewed by the computer to perform related operations, such as format conversion, or counting the number of pixels in the target area.
[0069] As an example, taking the image detection tool software installed on the computer as an example, the computer detects the operation instruction input by the user to run the image detection tool software, then the computer starts to run the image detection tool software and displays the following on the screen: Figure 1 In the initial interface 10 of the image detection tool software shown in FIG. 1 , the user clicks the "pixel statistics" control 101 with the mouse in the initial interface 10, and the image detection tool software detects the selection instruction for the "pixel statistics" control 101, and controls the computer to display the following on the screen in response to the selection instruction: Figure 7 Figure (a) or Figure 7 The pixel statistics interface shown in Figure (b).
[0070] Step 602: The image detection tool software detects a first operation instruction acting on the pixel statistics interface, and controls the display of an image selection interface on the computer screen in response to the first operation instruction. The image selection interface includes one or more second image data, and the second image data is obtained by format conversion of the first image data. The data format of the second image data is an image format that supports output on the image selection interface, and the data format of the first image data is an image format that does not support output on the image selection interface.
[0071] As an example, Figure 7As shown in FIG. 1 (a), there is an "open" control 701 in the pixel statistics interface. The user clicks the "open" control 701 with a mouse. When the image detection tool software detects an operation instruction (a first operation instruction) for the "open" control 701, it responds to the first operation instruction to control the display of an image selection interface on the computer screen. The image selection interface is a folder storing the second image data in the above embodiment, such as Figure 5 shown.
[0072] As another example, Figure 7 As shown in Figure (b), the pixel statistics interface has an image display area 704 with an "open" control function. The user clicks the area with the mouse, and the image detection tool software detects the operation instruction and controls the display of the image selection interface on the computer screen in response to the operation instruction; alternatively, the user can also directly drag the second image data into the image display area 704.
[0073] Step 603: the image detection tool software detects a second operation instruction for any second image data among the one or more second image data, and controls the display of any second image data on the computer screen in response to the second operation instruction.
[0074] As an example, the user selects a second image data in the image selection interface (a folder storing the second image data), and the image detection tool software detects the selection instruction (the second operation instruction), and in response to the selection instruction, controls the image display area 801 of the pixel statistics interface to display the selected second image data, such as Figure 8 shown.
[0075] Optionally, the pixel statistics interface may further include a "zoom in" control 702 and a "zoom out" control 703, such as Figure 7 shown.
[0076] As an example, the image detection tool software detects that the "zoom in" control 702 or the "zoom out" control 703 is triggered, and in response to the trigger instruction, controls the pixel statistics interface to display the second image data zoomed in or out with a step factor of 0.1. As another example, the user can zoom in or out the second image data using the mouse. Specifically, the user hovers the mouse pointer over the second image data and slides the scroll wheel. The image detection tool software detects the operation instruction of the mouse hybrid scroll wheel, and in response to the operation instruction of the mouse hybrid scroll wheel, controls the pixel statistics interface to display the zoom in or out of the second image data.
[0077] Step 604: the image detection tool software detects a third operation instruction acting on any second image data, and in response to the third operation instruction, controls the number of pixels in the target area selected by the third operation instruction in any second image data to be displayed on the pixel statistics interface.
[0078] It is understandable that after the image detection tool software detects the third operation instruction acting on any second image data, it controls the computer to count the number of pixels of the selected target area in the second image data in response to the third operation instruction.
[0079] The shape of the target area can be a regular shape, such as a rectangle, circle, triangle or other specific shapes; or it can be an irregular shape, such as the outline of an irregular object in the second image data, including a person, a vehicle, an obstacle, etc.
[0080] As an example, the user uses the mouse to control the displayed second image data to select the area of interest on the second image data with a regular pattern. The image detection tool software detects the operation instruction of the selection (the third operation instruction), and in response to the operation instruction, controls the display of the number of pixels in the area of interest above the second image data. The display format is: (X, Y, Num), where X is the number of pixels in the horizontal direction, Y is the number of pixels in the vertical direction, and Num is the total number of pixels in the area of interest, that is, the product of X and Y. Fig. 9 Shown is a display 902 showing the number of pixels within a region of interest 901 in a second image data.
[0081] As another example, when the area of interest of the user is an image of a person in the second image data, the regular pattern cannot satisfy the shape of the person, so the user uses the mouse control to draw the outline of the person on the displayed second image data. After the image detection tool software detects the operation instruction (the third operation instruction) to select the outline, it controls the number of pixels in the outline displayed above the second image data in response to the operation instruction.
[0082] In a possible implementation, the third operation instruction may also be an instruction for selecting a target area. After the image detection tool software detects the second operation instruction acting on any second image data among one or more second image data and displays any second image data, the computer automatically selects one or more target areas on the second image data. The computer detects the third operation instruction acting on any second image data, and the computer outputs the number of pixels in the target area selected by the third operation instruction in any second image data in response to the third operation instruction.
[0083] As an example, a displayed second image data includes a person, a traffic light, and an obstacle. The computer will automatically recognize the above contents and determine the areas where the above contents are located as target area 1, target area 2, and target area 3. When the user needs to select the traffic light as the target area, the target area 2 is selected by the mouse, and the computer detects the instruction to select the target area 2 (the third operation instruction). In response to the instruction, the computer displays the number of pixels in the target area 2 above the second image data.
[0084] The user may also select multiple target areas, such as simultaneously selecting target area 1 where a person is located and target area 2 where a traffic light is located, which is not limited here.
[0085] In a possible implementation of the present application, the output pixel number may be the number of pixels displayed on a display interface, or the number of pixels may be sent to other devices for storage or display.
[0086] Fig.10 A device for displaying an image is provided, comprising: a first display unit for displaying a pixel statistics interface; a second display unit for detecting a first operation instruction acting on the pixel statistics interface, and displaying an image selection interface, wherein the image selection interface includes one or more second image data, and the second image data is obtained by format conversion of the first image data; a detection unit for detecting a second operation instruction acting on at least one second image data among the one or more second image data, and then displaying the at least one second image data; and an output unit for detecting a third operation instruction acting on any second image data, and outputting the number of pixels in a target area selected by the third operation instruction in any second image data.
[0087] Fig.11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig.11 As shown, the electronic device 110 includes: a processor 1101, a memory 1102, and a computer program 1103 stored in the memory 1102 and executable on the processor 1101. When the processor 1101 executes the computer program 1103, the steps in the method for displaying an image in the above embodiment are implemented.
[0088] The electronic device 110 may be a general-purpose computer device or a dedicated computer device. In a specific implementation, the electronic device 110 may be a desktop computer, a portable computer, a network server, a PDA, a mobile phone, a tablet computer, a wireless terminal device, a communication device or an embedded device. The embodiment of the present application does not limit the type of the electronic device 110. Those skilled in the art will understand that Fig.11This is merely an example of the electronic device 110 and does not constitute a limitation on the electronic device 110 . The electronic device 110 may include more or fewer components than shown in the figure, or a combination of certain components, or different components, such as input and output devices, network access devices, etc.
[0089] The processor 1101 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.
[0090] In some embodiments, the memory 1102 may be an internal storage unit of the electronic device 110, such as a hard disk or memory of the electronic device 110. In other embodiments, the memory 1102 may also be an external storage device of the electronic device 110, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 110. Further, the memory 1102 may also include both an internal storage unit of the electronic device 110 and an external storage device. The memory 1102 is used to store an operating system, an application program, a boot loader, data, and other programs. The memory 1102 may also be used to temporarily store data that has been output or is to be output.
[0091] The present application also provides a computer program product, which, when executed by the processor 1101, implements the method for displaying an image in any method embodiment of the present application.
[0092] For example, the computer program product may be stored in the memory 1102 , such as a computer program 1103 , which is finally converted into an executable target file that can be executed by the processor 1101 after preprocessing, compilation, assembly, and linking.
[0093] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a computer, a method for displaying an image in any method embodiment of the present application is implemented. The computer program can be a high-level language program or an executable target program.
[0094] For example, the computer-readable storage medium is, for example, a memory 1102. The memory 1102 may be a volatile memory or a non-volatile memory, or the memory 1102 may include both a volatile memory and a non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0095] It should be understood that all or part of the steps to implement the above embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The computer instructions can be stored in the above-mentioned computer readable storage medium.
[0096] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0097] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0098] In the embodiments provided in the present application, it should be understood that the disclosed devices / computer equipment and methods can be implemented in other ways. For example, the device / computer equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0099] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0100] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for displaying an image, characterized in that: The method comprises: Display pixel statistics interface; When a first operation instruction acting on the pixel statistics interface is detected, an image selection interface is displayed, wherein the image selection interface includes information of one or more second image data, wherein the second image data is obtained by format conversion of the first image data. The data format of the second image data is an image format that can be output on the image selection interface, and the data format of the first image data is an image format that cannot be output on the image selection interface; detecting a second operation instruction acting on at least one of the one or more second image data, and displaying at least one of the second image data; When a third operation instruction acting on any of the second image data is detected, the number of pixels in the target area selected by the third operation instruction in any of the second image data is output.
2. The method for displaying an image according to claim 1, characterized in that: Before displaying the pixel statistics interface, the method further includes: An initial interface is displayed, wherein the initial interface displays a plurality of controls, each of which is used to trigger a different functional interface.
3. The method for displaying an image according to claim 2, characterized in that: The plurality of controls at least include: a first control for triggering display of the pixel statistics interface and a second control for triggering display of a format conversion interface. After displaying the initial interface, the method further includes: detecting a fourth operation instruction for the first control, then displaying the pixel statistics interface; and / or, When a fifth operation instruction for the second control is detected, the format conversion interface is displayed.
4. The method for displaying an image according to claim 3, characterized in that: The format conversion interface includes a third control and a fourth control, and the method further includes: When a sixth operation instruction acting on the third control is detected, one or more first image data are read from a file location storing the first image data; When a seventh operation instruction acting on the fourth control is detected, the data format of each piece of the first image data is converted to obtain the second image data corresponding to each piece of the first image data, The data format of the first image data is a YUV format, and the data format of the second image data is a format that supports output on the image selection interface.
5. The method for displaying an image according to claim 3 or 4, characterized in that: The format conversion interface also includes: a fifth control, The method further comprises: When an eighth operation instruction for the fifth control is detected, resetting the format conversion interface is executed, or the process of converting the first image data into the second image data is suspended.
6. The method according to claim 1 or 4, characterized in that: In the process of converting the first image into the second image, the method further includes: displaying prompt information on the format conversion interface, wherein the prompt information reflects the progress of converting the first image data into the second image data.
7. The method for displaying an image according to claim 4, characterized in that: The converting the data format of each piece of the first image data to obtain the second image data corresponding to each piece of the first image data includes: For each of the first image data, extract the YUV value of each pixel point in each of the first image data; Determine the RGB value of each pixel point in each first image data according to the YUV value of each pixel point in each first image data; The second image data corresponding to each piece of the first image data is determined according to the RGB value of each pixel in each piece of the first image data.
8. A device for displaying an image, characterized in that: The device comprises: A first display unit, used for displaying a pixel statistics interface; The second display unit is used to detect the first operation instruction acting on the pixel statistics interface and display an image selection interface, wherein the image selection interface includes one or more second image data, and the second image data is obtained by format conversion of the first image data. The data format of the second image data is an image format that can be output on the image selection interface, and the data format of the first image data is an image format that cannot be output on the image selection interface; a detection unit, configured to detect a second operation instruction acting on any second image data among the one or more second image data, and then display the any second image data; The output unit is used to detect a third operation instruction acting on any of the second image data, and output the number of pixels in the target area selected by the third operation instruction in any of the second image data.
9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory is used to store a computer program; The processor is used to execute the method for displaying an image according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The readable storage medium stores instructions, and when the instructions are executed, the method for displaying an image according to any one of claims 1 to 7 is executed.