WO2023005286A1 - Image processing - Google Patents

Image processing Download PDF

Info

Publication number
WO2023005286A1
WO2023005286A1 PCT/CN2022/088545 CN2022088545W WO2023005286A1 WO 2023005286 A1 WO2023005286 A1 WO 2023005286A1 CN 2022088545 W CN2022088545 W CN 2022088545W WO 2023005286 A1 WO2023005286 A1 WO 2023005286A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
target
information
processed
processing
Prior art date
Application number
PCT/CN2022/088545
Other languages
French (fr)
Chinese (zh)
Inventor
张卿麒
张彬
吴阳平
许亮
Original Assignee
上海商汤智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 上海商汤智能科技有限公司 filed Critical 上海商汤智能科技有限公司
Publication of WO2023005286A1 publication Critical patent/WO2023005286A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440218Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • G06T3/4007Interpolation-based scaling, e.g. bilinear interpolation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/186Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a colour or a chrominance component
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/40Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video transcoding, i.e. partial or full decoding of a coded input stream followed by re-encoding of the decoded output stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/643Communication protocols
    • H04N21/6437Real-time Transport Protocol [RTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image

Definitions

  • the present disclosure relates to the technical field of image processing.
  • Embodiments of the present disclosure at least provide an image processing method, device, computer equipment, and storage medium.
  • the embodiment of the present disclosure provides an image processing method applied to an ARM development board, including:
  • the processing duration is for the previous frame image Perform target format conversion, and perform marking processing corresponding to the duration during the target format conversion process; if the previous frame image is not marked, the processing duration is The duration corresponding to the target format conversion; performing the first format conversion on the image to be processed to obtain the first target image with the first target format; when the processing duration does not exceed the first preset duration, by performing marking processing on the image to be processed to obtain first object marking information, and marking the first object marking information on the first target image to obtain a second target image; converting the second target image to a third target image, and send the third target image to the target device.
  • the embodiment of the present disclosure also provides a detection method, including: acquiring an image to be processed taken in the vehicle cabin; and the processing duration corresponding to the previous frame of the image to be processed; In the case where the previous frame image is tagged, the processing duration is the duration corresponding to the target format conversion of the previous frame image and the tagging process during the target format conversion process; In the case of marking a frame of image, the processing duration is the duration corresponding to the target format conversion of the previous frame of image; the first format conversion is performed on the image to be processed to obtain the first target format conversion.
  • the first object marking information is obtained by marking the image to be processed, and marking the first object marking information in A second target image is obtained from the first target image; the second target image is converted into a third target image and displayed; and based on the displayed second target image, a safety warning is given to the driving of the vehicle.
  • an embodiment of the present disclosure further provides an image processing device, including: a first information acquisition module, configured to acquire an image to be processed, and a processing duration corresponding to a previous frame of the image to be processed; wherein, in In the case of performing tagging processing on the previous frame image, the processing duration is the duration corresponding to performing target format conversion on the previous frame image and performing tagging processing during the target format conversion process; In the case where the previous frame image is marked, the processing duration is the duration corresponding to the target format conversion of the previous frame image; the image conversion module is used to perform the first processing on the image to be processed format conversion, to obtain a first target image with a first target format; an image marking module, configured to obtain a first target image by marking the image to be processed when the processing time does not exceed a first preset time Object marking information, and marking the first object marking information on the first target image to obtain a second target image; a first image processing module, configured to convert the second target image into a third target image , and send the third target
  • the embodiment of the present disclosure further provides a detection device, including: a second information acquisition module, configured to acquire the image to be processed captured in the cabin and the processing corresponding to the previous frame image of the image to be processed Duration; wherein, in the case of performing tagging processing on the previous frame image, the processing duration is corresponding to performing target format conversion on the previous frame image and performing tagging processing during the target format conversion process Duration; in the case that the previous frame of image is not marked, the processing duration is the duration corresponding to the target format conversion of the previous frame of image; the third image processing module is used to convert the previous frame of image Convert the image to be processed into a first format to obtain a first target image in a first target format; if the processing time does not exceed a first preset time length, mark the image to be processed to obtain a second target image An object marking information, and marking the first object marking information on the first target image to obtain a second target image; converting the second target image into a third target image and displaying it; an early warning module ,
  • the embodiment of the present disclosure further provides a computer device, including: a processor, a memory, and a bus, the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processing
  • the processor communicates with the memory through a bus, and when the machine-readable instruction is executed by the processor, it executes the steps of the first aspect above, or any possible image processing method in the first aspect, and executes when executed The steps of the detection method of the second aspect above.
  • the embodiments of the present disclosure also provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is run by a processor, the above-mentioned first aspect, or any of the first aspects in the first aspect, can be executed.
  • FIG. 1 shows a flowchart of an image processing method provided by an embodiment of the present disclosure
  • FIG. 2 shows a schematic flow diagram of a specific implementation process of an image processing process provided by an embodiment of the present disclosure
  • FIG. 3 shows a schematic diagram of target pixels determined from a second target image provided by an embodiment of the present disclosure
  • FIG. 4 shows a schematic diagram of an image processing device provided by an embodiment of the present disclosure
  • Fig. 5 shows a schematic diagram of a detection device provided by an embodiment of the present disclosure
  • FIG. 6 shows a schematic structural diagram of a computer device provided by an embodiment of the present disclosure.
  • the existing tools are mainly based on soft real-time operating systems such as ubuntu or android, which have a wide open source foundation, and require the help of graphics processing units (GPUs). ) and other external devices, or rely heavily on the high-performance platform of the X86-64 instruction set, which greatly increases the cost of the tool.
  • image processing is implemented on the QNX (Quick Unix) platform of the ARM development board.
  • QNX Quality Unix
  • the present disclosure provides an image processing method, device, computer equipment and storage medium, using the function of ARM development board to process data in parallel, such as the single command multiple data parallel processing library Neon in the ARM development board and the CPU automatic With registers, the speed of image format conversion can be doubled, which meets the real-time performance of image processing; in addition, in general, the process of marking images is slow, which may lead to excessively long processing time, which in turn leads to display errors.
  • the video stream freezes, that is, the display of two consecutive frames of images freezes, which cannot meet the smoothness requirements of image display.
  • the mechanism for judging whether to mark an image to be processed based on the processing time, and the first object mark information stored in the memory can meet the real-time visualization requirements of image processing.
  • ARM processor Advanced RISC Machines, ARM
  • ARM Advanced RISC Machines
  • ARM development board that is, an embedded development board with ARM core chip as the CPU and additional peripheral functions, used to evaluate the functions of the core chip and develop products of various technology companies.
  • the central processing unit (CPU for short) is the computing and control core of the computer system, and is the final execution unit for information processing and program operation.
  • GPU Graphics Processing Unit
  • display core also known as display core, visual processor, and display chip
  • display chip is a graphics processing unit designed for use in personal computers, workstations, game consoles, and some mobile devices (such as tablets, smartphones, etc.) Microprocessor for image and graphics related operations.
  • RISC Reduced Instruction Set Computing
  • OpenCV is a cross-platform computer vision and machine learning software library released under the BSD license (open source), which can run on Linux, Windows, Android and Mac OS operating systems. It is lightweight and efficient. It consists of a series of C functions and a small number of C++ classes. It also provides interfaces for languages such as Python, Ruby, and MATLAB, and implements many general-purpose algorithms in image processing and computer vision.
  • FFmpeg is a set of open source computer programs that can be used to record, convert digital audio and video, and convert them into streams.
  • Neon is a 128-bit SIMD (Single Instruction, Multiple Data, Single Instruction, Multiple Data) extension structure for ARM processors.
  • SIMD Single Instruction, Multiple Data, Single Instruction, Multiple Data
  • YUV is a color encoding method that is often used in various video processing components. YUV allows for reduced chroma bandwidth by taking human perception into account when encoding photos or videos. Among them, Y represents brightness, and U and V represent chroma. Can include UYVU format and NV12 format.
  • Linear interpolation refers to the interpolation method in which the interpolation function is a polynomial, and its interpolation error on the interpolation node is zero.
  • BGR the default channel of OpenCV. Among them, B represents blue, G represents green, and R represents red.
  • QNX a commercial Unix-like real-time operating system that complies with the POSIX specification. It is a hard real-time operating system based on priority preemption.
  • the code rate is the number of data bits transmitted per unit time during data transmission, such as kbps, which is thousands of bits per second.
  • H264 is a digital video compression format
  • Real Time Streaming Protocol (Real Time Streaming Protocol, RTSP) is an application layer protocol in the TCP/IP protocol system, which is used to control the multimedia streaming protocol of audio or video, and allows multiple streaming requirements to be controlled at the same time.
  • RTSP Real Time Streaming Protocol
  • Ubuntu is a Linux operating system mainly for desktop applications.
  • Android is a free and open source operating system based on the Linux kernel.
  • Linux is a UNIX-like operating system that is free to use and spread freely.
  • X86-64 short for 64-bit extended, is a 64-bit extension of the X86 architecture.
  • the image processing method provided in the embodiment of the present disclosure is generally executed by an ARM processor in an ARM development board.
  • the ARM development board here can store computer-readable instructions compiled by the QNX system.
  • the image processing method may be implemented by calling a computer-readable instruction stored in a memory by an ARM processor.
  • FIG. 1 is a flowchart of an image processing method provided by an embodiment of the present disclosure, the method includes steps S101 to S104, wherein:
  • S101 Obtain the image to be processed and the processing time corresponding to the previous frame image of the image to be processed.
  • the image to be processed and the previous frame of image may include an image captured by a shooting device, such as an image in a vehicle cabin captured by a vehicle camera, and the image may include an object, such as a driver and/or a passenger.
  • the previous frame image may be a previous frame image of the current frame image (that is, the image to be processed).
  • the shooting device described here can be any camera driven by the QNX platform.
  • the QNX driver of the camera can be replaced, which is not specifically limited in this embodiment of the present disclosure.
  • the processing time in this step can be:
  • the processing duration is the duration corresponding to performing target format conversion on the previous frame image and performing tagging processing during the target format conversion process.
  • the processing duration is the duration corresponding to the target format conversion of the previous frame of image.
  • the labeling process may be a process of labeling an object in an image in the first target format, specifically including detecting an object in an image in the first target format and identifying an object in the image in the first target format The tagging process performed by one or more of type, identifying a state of the object in the image in the first target format, identifying an attribute of the object in the image in the first target format.
  • the image in the first target format can be an image in UYVY format
  • the human face in the image in UYVY format can be marked, specifically, a detection frame for a human face can be generated, and, in some embodiments, can be Tag processing occurs during target format conversion.
  • the target format conversion may include a first format conversion and a second format conversion, wherein, performing the first format conversion on the image may obtain an image having the first target format, and performing the second format conversion on the image may obtain an image having the An image in the second target format.
  • the image in the second target format may be transmitted to a display device for display.
  • the first target format may be BGR format
  • the second target format may be NV12 format.
  • the image with the first object format may be a BGR image
  • the image with the second object format may be an NV12 image.
  • the environmental image captured by the shooting device may be acquired in real time, that is, the environmental image may be used as the image to be processed.
  • the image captured by the shooting device does not necessarily include the object, therefore, the image that does not include the object can be filtered.
  • the image contains a preset object, such as a person. If the preset object is included, the environment image containing the preset object will be used as the image to be processed; if the preset object is not included, the environment image can be removed. Process the next frame of image.
  • the format of the image to be processed may include UYVY format or NV12 format among YUV formats.
  • the ARM processor independently develops an image acquisition process to acquire the image to be processed in UYVY format or NV12 format collected by the camera in real time, and then copies the image to be processed in two copies and stores them in memory A and memory B respectively.
  • S102 Perform first format conversion on the image to be processed to obtain a first target image in the first target format.
  • the image processing process in order to ensure the smoothness of the video stream displayed by the target device in real time, during the image processing process, it is necessary to ensure that the image format conversion process is processed first, that is, configure a higher priority for this process.
  • a preset high-priority image format conversion process may be used to perform first format conversion on the image to be processed to obtain a first target image in the first target format.
  • the first target format may be a BGR format
  • the first target image in the BGR format is a BGR image.
  • the image to be processed stored in the memory A is obtained by using the high-priority image format conversion process, and the image to be processed is converted into the first format, and the UYVY The format is converted to the BGR format, and a BGR image with the BGR format is obtained.
  • the first object tag information may include tag information of objects in the image to be processed, or tag information of objects in historical images whose shooting time difference from the image to be processed is less than a second preset duration.
  • the process of tagging images is slow, which may lead to a long processing time, which will cause the displayed video stream to freeze, that is, the display of two consecutive frames of images freezes, which cannot meet the smoothness requirements of image display.
  • the preset object recognition process can be set to low priority. Low priority has lower priority than high priority, and relatively fewer resources can be invoked.
  • the object recognition process may include a face recognition algorithm module, that is, the driver's face may be recognized.
  • the object in the image to be processed is marked, and after the first format conversion on the image to be processed is completed, the obtained For the first target image, when the marking information obtained by marking the object in the image to be processed is obtained, that is, when the marking information of the object in the image to be processed is stored in the memory, it can be obtained from The marking information of the object in the image to be processed is acquired in the memory, and used as the first object marking information, waiting to be marked for the object in the image to be processed.
  • the process of storing the label information of the object in the image to be processed into the memory specifically, acquiring the image to be processed in the memory B, transferring the image to be processed to the object recognition process, and using the object recognition algorithm in the object recognition process , such as a face recognition algorithm, recognizes the object in the image to be processed, obtains the first object tag information of the object, and stores the first object tag information in a memory, waiting to be called.
  • the object recognition algorithm in the object recognition process such as a face recognition algorithm
  • the marking information obtained by marking the object in the image to be processed is not obtained, the marking information of the object in the historical image whose shooting time difference with the image to be processed is less than a second preset duration may also be obtained from the memory , and use the tag information of the object in the historical image as the first object tag information.
  • the label information of the object in the previous frame image is used as the first object label information.
  • the object in the image to be processed is marked with the tag information of the object in the image to be processed, and if the object in the image to be processed cannot be obtained
  • marking information the marking information of the object in the historical image can be used to mark the object in the image to be processed. Since the difference between the shooting time of the image to be processed and the object in the historical image is less than the second preset duration, the tag information of the object in the historical image will not be different from the tag information of the object in the image to be processed. In the case of a large difference, the object in the image to be processed can be marked by using the marking information of the object in the historical image.
  • the tag information corresponding to the object in the image to be processed may not have been generated, that is, it has not been stored in the memory If there is tag information corresponding to the object, then the tag information already stored in the memory and corresponding to the object in the historical image whose shooting time difference of the image to be processed is less than the second preset time length can be called at this time.
  • the historical image whose shooting time difference with the image to be processed is less than the second preset duration may include three frames of images before the current frame of the image to be processed.
  • the second preset duration may also be set according to a specific application scenario, which is not limited in this embodiment of the present disclosure.
  • the first object label information may include but not limited to at least one of object detection frame information, object identifier, object state characteristic information, and object attribute characteristic information.
  • the detection frame information may include the coordinates of the center point of the detection frame, the size information of the detection frame, that is, the length and width, and the like.
  • the object's identity identifier may be an identity indicating the identity information of the object, such as a driver's identity or a passenger's identity.
  • the state characteristic information of the object may include the behavior of the object, such as playing with a mobile phone, holding the steering wheel, not wearing a seat belt, and so on.
  • the attribute feature information of the object may include age stage attributes, such as old people, adults, children, and so on.
  • the first preset duration may be set to 50 ms. It should be noted that, in different application scenarios, the first preset duration may also be set to other values according to empirical values, which are not limited in this embodiment of the present disclosure.
  • the second target image is the first target object recorded with the first object mark information.
  • S104 Convert the second target image into a third target image, and send the third target image to the target device.
  • the second target image is converted into a third target image that can be displayed on the target device. converting the second format to obtain a third target image in the second target format.
  • the second target format is an image format that can be displayed by the target device, specifically, the second target format may be NV12 format, and the third target image may be an image in NV12 format.
  • the third target image contains the first object label information.
  • the target device cannot display the first target image in the first target format, it is necessary to convert the second target image in the first target format into the second format to obtain a third target image in the second target format that can be displayed by the target device.
  • the second format conversion process utilizes the parallel data processing function of the ARM development board, which can increase the speed of converting the second target image into a displayable third target image.
  • the converted third target image can be stored in memory C.
  • the target device includes a display screen displaying a third target image.
  • Send the third target image to the target device specifically, obtain the third target image in the memory C through the preset video encoding process, and encode the third target image, for example, the video encoding process calls the QNX platform support
  • the video encoding interface and the video processing unit perform encoding processing on the third target image, and the video processing unit is configured with an image encoding strategy and a code rate.
  • the third target image is encoded into the H264 data video stream format, and then the encoded H264 data is published to the target device through an RTSP server for display.
  • the RTSP server is formed according to a specific network component library of QNX.
  • the processing of the previous frame of image may include the process of performing target format conversion on the previous frame of image, therefore, the processing duration may be the duration corresponding to the target format conversion of the previous frame of image.
  • the previous frame image is not marked, that is, the processing duration of the previous frame image is The duration corresponding to the target format conversion of the previous frame image, and does not include the duration of marking processing during the target format conversion process of the previous frame image.
  • the target format conversion is performed on the previous frame image.
  • the first format conversion can be performed on the previous frame image to obtain the first format image with the first target format; the second format conversion is performed on the first format image. format conversion to obtain a second format image with a second target format.
  • the first target format is the BGR format
  • the first format image is a BGR image
  • the second target format is the NV12 format
  • the second format image is an NV12 image
  • the previous frame image when it is determined that the image processing duration of the previous frame image of the previous frame image does not exceed the first preset duration, the previous frame image may be marked, that is, the previous frame image
  • the processing time is the time corresponding to the target format conversion of the previous frame image and the marking process during the target format conversion process. Based on this, the target format conversion is performed on the previous frame image, and marking processing is performed during the target format conversion process.
  • the first format conversion can be performed on the previous frame image to obtain the first target format image.
  • a format image after that, acquire the second object tag information in the memory, and mark the second object tag information on the first format image to obtain the first format tag image, wherein the second object tag information may include the previous frame
  • the second object marking information of the object includes at least one of the detection frame information of the object, the identity identifier of the object, the state characteristic information of the object, and the attribute characteristic information of the object.
  • the reason why the processing time exceeds the first preset time may include marking the object in the previous frame of image, which causes the marking process to take too long, which in turn causes the processing time to exceed the first preset time.
  • the first target image can be directly converted to the second format to obtain the fourth target image with the second target format ; Send the fourth target image to the target device.
  • the first target image can be directly converted to the second format, avoiding the problem that the processing duration exceeds the first preset duration after subsequent marking processing is performed for the first target image.
  • the situation guarantees the real-time performance of image processing and the fluency requirements of image display.
  • the fourth target image may be an image in NV12 format.
  • the detailed description of using the target device to display the fourth target image can refer to the above-mentioned process of sending the third target image to the target device, which will not be repeated here repeat.
  • one frame lacks the first object label information, which will not affect the display effect perceived by the user, and can still meet the real-time visualization requirements of image processing.
  • the processing duration does not exceed the first preset duration
  • the processing process of identifying the object in the image to be processed and generating the first object tag information is relatively slow
  • the process of processing images for object recognition sets a low priority, that is, the second preset priority, and sets a high priority for the image format conversion process, that is, the first preset priority, which can ensure that the image format is converted and sent to the target Real-time requirements for device display.
  • the image format conversion process during specific implementation, first, obtain the first preset priority; then, according to the first preset priority, allocate a second resource to the image processing process, and use the second resource to be processed through the image processing process
  • the image undergoes first format conversion and/or second format conversion.
  • the image processing process may also perform marking processing of the image to be processed under the condition that the first format conversion and the second format conversion are completed first.
  • the image processing refers to performing at least one of the first format conversion, the second format conversion, and marking processing on the image to be processed by using the second resource.
  • the marking process in the image processing it may also be determined based on the processing duration whether the marking process is performed on the image to be processed.
  • the second preset priority is obtained, the first resource is allocated to the object recognition processing process according to the second preset priority, and the first resource is used to perform object detection, object recognition, and object detection on the image to be processed. At least one of state recognition and object attribute recognition is tagged to determine first object tag information of the object in the image to be processed.
  • the resources refer to system resources or computing resources, such as system memory, CPU, and the like.
  • the first preset priority is higher than the second preset priority
  • the first preset priority is the above-mentioned high priority
  • the second preset priority may be the above-mentioned low priority.
  • the resource amount of the first resource is less than the resource amount of the second resource.
  • the processing in this embodiment can meet the real-time visualization requirement of image processing.
  • FIG. 2 is a schematic diagram of a specific implementation flow of the image processing process.
  • Reference numeral 21 represents the image to be processed acquired by the shooting device
  • reference numeral 22 represents the image format conversion process
  • reference numeral 23 represents the object recognition process
  • reference numeral 24 represents the first object tag information stored in the memory.
  • Mark 25 represents judging whether to allow marking of the first target image, wherein the permitted case may include the case that the processing time does not exceed the first preset time length, and the disallowed case may include the processing time exceeds the first preset time length.
  • Reference numeral 26 indicates that the first target image is allowed to be marked to obtain a second target image
  • reference numeral 27 indicates that the second target image including the mark is converted into a second format, and the converted image is stored in the memory C.
  • Reference numeral 28 indicates that when the first target image is not allowed to be marked, the second format conversion is directly performed on the first target image, and the converted image is stored in the memory C.
  • Reference numeral 29 denotes a memory C.
  • S1021 Acquire the first color coding information of the image to be processed; the first color coding information includes a plurality of first brightness information and multiple sets of first color information, and each pixel in the image to be processed corresponds to a first brightness information, at least One piece of first brightness information corresponds to a group of first color information.
  • the first color coding information may include coding information for encoding the image to be processed in the UYVY format, wherein the UYVY format is one of the horizontal sampling and vertical full sampling formats in the YUV format.
  • the UYVY format is one of the horizontal sampling and vertical full sampling formats in the YUV format.
  • it may also be encoding information for encoding the image to be processed in the NV12 format, where the NV12 format is one of the YUV formats for horizontal sampling and vertical 2:1 sampling.
  • it may also be encoding information for encoding the image to be processed in AYUV format, where the AYUV format is one of the full sampling formats in the YUV format.
  • the first color coding information includes multiple first brightness information, that is, multiple Ys; and multiple sets of first color information, that is, multiple sets of UV.
  • Each pixel of the image to be processed corresponds to a Y, and every two pieces of first brightness information correspond to a set of first color information.
  • the image size of the image to be processed is also acquired, including the width and height of the image to be processed.
  • S1022 Based on the first sort order of the first color coding information, extract a plurality of first brightness information in parallel to obtain a first information sequence, and, based on the first sort order of the first color coding information, extract multiple groups of first colors in parallel information to obtain the second information sequence.
  • the first sorting order of the first color-coded information may be the pack sorting order, that is, it is arranged according to the adding order.
  • the UYVY format is arranged according to the order of addition, and the first sorting order of the first color-coded information obtained is UYVYUYVY . . . .
  • Y, U, V are the elements of the pixel.
  • the address of each element in the first sorting order UYVYUYVY . . . may be determined based on the acquired image size of the image to be processed, and elements at corresponding positions may be extracted in parallel according to the address.
  • the arrangement manner of the first brightness information in the first color coding information conforms to a certain sorting feature, for example, it is located in an odd numbered position or an even numbered position.
  • the sorting positions of UYVYUYVY... are 0th, 1st, 2nd, 3rd, 4th, 5th, 6th, 7th,....
  • the first luminance information Y is located at odd-numbered bits
  • the first color information U and V are located at even-numbered bits.
  • the address of the first element of the image to be processed may be determined.
  • the parallel processing performance information of the ARM development board based on the first sorting order and parallel processing performance information of the first color-coded information, starting from the first element address, Neon can be used to sequentially extract the first in parallel.
  • the plurality of sets of first color information in the sequence are sorted to obtain a second information sequence.
  • each element occupies 8 bits, 8-bit symbols (including positive "+” and negative “-”, etc.) are attached to the element calculation during the image format conversion process. Therefore, each element needs to occupy 16 bits of memory.
  • the storage capacity of the register in the ARM may be 128 bits, and its parallel processing performance information may include a parallel extraction of 16 elements without a sign, or 8 elements with a sign.
  • the first sorting order is UYVYUYVY...
  • the corresponding addresses can be 0, 1, 2, 3, 4, 5, 6, 7,..., which can be determined
  • the sorting position of the first brightness information in the first color coding information is an odd number, that is, 1, 3, 5, 7, ...
  • the sorting position of the first color information in the first color coding information is an even number bits, that is, 0, 2, 4, 6, ...
  • the first information sequence and the second information sequence corresponding to a plurality of pixels in the image to be processed can be quickly obtained, thereby improving the image quality in the image to be processed.
  • the first quantity of the first brightness information corresponding to a group of first color information may indicate the quantity of the first brightness information sharing a group of first color information.
  • a set of first color information corresponds to two first brightness information, that is, two first brightness information share a set of first color information
  • a set of first color information corresponds to four first Brightness information, that is, four first brightness information share a set of first color information
  • a set of first color information corresponds to one first brightness information, that is, one first brightness information shares a set of first color information.
  • the first color information may include first color sub-information and second color sub-information.
  • the first color information is UV
  • the first color sub-information may be U
  • the second color sub-information may be V
  • the color coding sub-information corresponding to each pixel includes first brightness information Y
  • the first color sub-information may be U
  • the second color sub-information may be V.
  • a set of first color information UV corresponds to two first brightness information Y, that is, the first number is two.
  • the first information sequence is YYYY and the second information sequence is UVUV
  • the first first brightness information Y corresponding to the first information sequence corresponds to the first group of first color information UV
  • the first information sequence corresponds to the first The two first brightness information Ys
  • the third first brightness information Y corresponding to the first information sequence corresponds to the second group of first color information UV
  • the first information sequence corresponds to the first The four first brightness information Ys correspond to the second group of first color information UV.
  • the color coding sub-information corresponding to the first pixel in the image to be processed is the first first brightness information Y and the first group of first color information UV; it can be determined that the second pixel in the image to be processed
  • the color coding sub-information corresponding to the point is the second first brightness information Y and the first group of first color information UV; it can be determined that the color coding sub-information corresponding to the third pixel in the image to be processed is the third first Brightness information Y and the second group of first color information UV; it can be determined that the color coding sub-information corresponding to the fourth pixel in the image to be processed is the fourth first brightness information Y and the second group of first color information UV.
  • the color coding sub-information of each pixel in the image to be processed can be determined by recycling other multiple first brightness information and other multiple sets of first color information extracted in parallel by Neon.
  • S1024 Obtain a first target image in a first target format based on the color-coded sub-information corresponding to each pixel.
  • the first target format may include but not limited to BGR format.
  • the first target image in the first target format may be an image in BGR format.
  • the third color coding information in the first target format corresponding to each pixel in the image to be processed may be calculated by using a linear interpolation function.
  • the third color coding information may include element B, element G and element R.
  • ⁇ , ⁇ , and ⁇ may be set according to actual application scenarios and empirical values, and are not specifically limited in the embodiments of the present disclosure.
  • the element corresponding to each pixel can be stored in memory D according to the order of each pixel, starting from the address of the first element in the BGR image.
  • the above S1021-S1024 utilize the Neon extension structure in the ARM development board and the registers that come with the CPU to extract multiple first brightness information and multiple sets of first color information in parallel from the first color coding information stored in the register. Since the parallel extraction can double the speed of information acquisition, it can realize the double acceleration of image format conversion on the CPU, which can meet the needs of real-time image format conversion.
  • This embodiment does not depend on image processing devices such as GPU, and can reduce the hardware cost of image format conversion; in addition, this embodiment provides a general image format conversion method for ARM development boards for real-time image format conversion. In comparison, the power consumption and hardware cost of the ARM development board are lower.
  • the second format conversion is performed on the second target image to obtain a third target image in the second target format.
  • the second target format corresponds to the second color coding information;
  • the second color coding information includes the second brightness information and the second color information;
  • each pixel in the third target image corresponds to a second brightness information, at least one second The brightness information corresponds to a set of second color information.
  • the second target format may include but not limited to NV12 format, and the second color coding information includes second brightness information Y and second color information UV.
  • Each pixel of the image in the NV12 format corresponds to one piece of second brightness information, and four pieces of second brightness information correspond to a group of second color information.
  • the third color coding information corresponding to each pixel in the second target image is the first The third color coding information corresponding to each pixel in the target image.
  • the fixed coefficients in the linear interpolation function corresponding to the second luminance information Y in the pixel may be defined according to empirical values, which are not specifically limited in the embodiments of the present disclosure.
  • the parallel calculation can be to use Neon to extract in parallel the element B in the eight 8-bit third color-coded information stored in parallel, the element G in the eight 8-bit third color-coded information, and the eight 8-bit third color-coded information from the three registers.
  • the second luminance information corresponding to the group BGR (each pixel).
  • the Neon parallel calculation is called circularly until the format-converted second luminance information of each pixel corresponding to the second target image is obtained, and then the second luminance information corresponding to each pixel in the third target image is obtained.
  • the second quantity of the second brightness information corresponding to a group of second color information may represent the quantity of the second brightness information sharing a group of second color information.
  • the second number is 4.
  • the sorting feature information of the target pixel is determined; the target pixel includes pixels used to determine the second color information; based on the sorting feature information
  • the third color coding information corresponding to each pixel in the second target image is determined to determine the third color coding information corresponding to the target pixel; based on the third color coding information corresponding to the target pixel, parallel calculation is performed to obtain the third target image
  • the second color information corresponding to each pixel is determined based on the second quantity of the second luminance information corresponding to a set of second color information.
  • the second numbers are different, the number of determined target pixel points is different.
  • the second number is 4, that is, four second brightness information share a set of second color information
  • four pixels in the second target image determine one target pixel, that is, the target pixel
  • the number is a quarter of the number of pixels in the second target image.
  • FIG. 3 which is a schematic diagram of target pixels determined from the second target image.
  • 31 represents the second target image of 4 ⁇ 4
  • 32 represents the pixels in the second target image, and there are 16 pixels in total
  • 33 represents the target pixels, and there are 4 in total, that is, the pixels in the 16 second target images A quarter of the number of pixels.
  • the sorting feature information of the target pixel points is the position information of the pixels in the second target image in even rows and even columns, as shown in Figure 3, the 0th row, the 0th column, the 0th row Row 0, column 2, row 2, column 0, row 2, column 2.
  • represents the calculation of the fixed coefficient in the linear interpolation function corresponding to the second color information U in the pixel
  • represents the calculation of the fixed coefficient in the linear interpolation function corresponding to the second color information V in the pixel, which can be calculated according to Empirical value definitions are not specifically limited in the embodiments of the present disclosure.
  • the Neon parallel calculation is called circularly until the second color information after the format conversion of each pixel corresponding to the second target image is obtained, and then the second color information corresponding to each pixel in the third target image is obtained.
  • S304 Obtain a third target image with a second target format based on the second brightness information and second color information corresponding to each pixel in the third target image.
  • the second color coding information corresponding to each pixel based on the second brightness information and the second color information corresponding to each pixel of the third target image, determine the second color coding information corresponding to each pixel; based on the second color coding information, obtain the format of the third target image.
  • one pixel corresponds to one second brightness information, and according to the second amount of second brightness information corresponding to a group of second color information, it is determined that the second number of pixels share a group of second color information.
  • the second sub-format is the NV12 format
  • determine the second brightness information and second color information corresponding to each pixel of the 4 ⁇ 4 third target image that is, YYYYYYYYYYYYYYYYY and UVUVUVUV
  • each The second color coding information corresponding to the pixel can be YYYYYYYYYYYYYYYYUVUVUV
  • the third target image in NV12 format is YYYYYYYYYYYYYYYUVUVUVUV.
  • the third target image After calculating the second brightness information and second color information of each pixel, store the first second brightness information in the generated third target image into the preset first address of the second brightness information, and follow the storing the rest of the second brightness information sequentially; storing the first group of second color information in the generated third target image into the preset first address of the second color information, and storing the rest of the second color information in order,
  • the third target image is subsequently called from the memory based on the first address of the second brightness information and the first address of the second color information.
  • the above S301-S304 based on the third color coding information corresponding to a plurality of pixels stored in the registers in the ARM development board, can be calculated in parallel to obtain the second brightness information of the plurality of pixels, based on the information stored in the registers in the ARM development board
  • the third color coding information corresponding to multiple pixels can be calculated in parallel to obtain the second color information of the multiple pixels.
  • this embodiment can The calculation efficiency of the second brightness information and the second color information is doubled, thereby improving the efficiency of image format conversion.
  • the third number of registers is determined based on the second number of second brightness information corresponding to a set of second color information; the third number of registers is used to store the third color coding information, and based on the register The third color coding information is stored for parallel calculation to obtain the second color information corresponding to each pixel of the third target image.
  • BGR blue-numbered rows and even-numbered columns
  • BGRs odd-numbered rows and odd-numbered columns
  • Neon parallel computing can process up to 8 groups of BGRs at the same time. If only 4 groups of BGRs extracted in parallel are used, it will be wasteful.
  • the third color coding information stored in two registers (that is, the third number is 2) can be called at the same time, and 8 groups of BGR can be extracted at the same time, and the linear interpolation function can be used to simultaneously calculate the corresponding color of 16 pixels
  • the second color information improves the calculation efficiency of the second color information, thereby improving the image conversion efficiency of converting the BGR format image into the NV12 format image.
  • an embodiment of the present disclosure also provides a detection method, which is executed by a displayable device, such as the above-mentioned target device.
  • Its application scenario can be a vehicle driving scenario to supervise drivers and passengers.
  • the displayable device acquires the image to be processed captured in the cabin through the RTSP protocol, processes the image to be processed by the above image processing method, and displays the processed third target image. Based on the displayed image of the third target, a safety warning is given to the driving of the vehicle.
  • the third target image includes the first object label information, and determine the status feature information of the driver and/or passengers based on the displayed first object label information, and determine whether a safety warning is required, for example, when the driver’s status feature information indicates that the driver has If there are problems with playing with mobile phones and not wearing seat belts, a safety warning prompt message will be sent to the driver in time. For example, when the first object tag information indicates that the attribute feature information of the object is a child, and the child is not sitting in the safety seat, the safety warning prompt information is sent to the passenger in time. Specific examples are not listed here one by one.
  • ARM development board that can process data in parallel, such as the single-command multiple data parallel processing library Neon in the ARM development board and the registers that come with the CPU, can double the speed of image format conversion and meet the requirements of the image format.
  • Real-time processing in addition, under normal circumstances, the process of marking images is slow, which may lead to long processing time, which will cause the displayed video stream to freeze, that is, the display of two consecutive frames of images freezes, which cannot meet the requirements of the image. Fluency requirements for display.
  • the mechanism for judging whether to mark an image to be processed based on the processing time, and the first object mark information stored in the memory can meet the real-time visualization requirements of image processing.
  • the writing order of each step does not mean a strict execution order and constitutes any limitation on the implementation process.
  • the specific execution order of each step should be based on its function and possible
  • the inner logic is OK.
  • the embodiment of the present disclosure also provides an image processing device corresponding to the image processing method. Since the problem-solving principle of the image processing device in the embodiment of the present disclosure is similar to the above-mentioned image processing method in the embodiment of the present disclosure, the device For the implementation of the image processing device, reference may be made to the implementation of the image processing method, and repeated descriptions will not be repeated.
  • the device includes: a first information acquisition module 401, an image conversion module 402, an image marking module 403, and a first image processing module 404; in,
  • the first information acquisition module 401 is configured to acquire the image to be processed, and the processing duration corresponding to the previous frame image of the image to be processed; wherein, in the case of marking the previous frame image, the processing The duration is the duration corresponding to performing target format conversion on the previous frame image and marking processing during the target format conversion process; if the previous frame image is not marked, the processing duration The duration corresponding to the conversion of the target format for the previous frame image;
  • An image conversion module 402 configured to convert the image to be processed into a first format to obtain a first target image in a first target format
  • An image marking module 403 configured to obtain first object marking information by performing marking processing on the image to be processed when the processing time does not exceed a first preset time length, and mark the first object marking information Obtaining a second target image on the first target image;
  • the first image processing module 404 is configured to convert the second target image into a third target image, and send the third target image to the target device.
  • the first image processing module 404 is configured to perform second format conversion on the second target image to obtain a third target image in the second target format; wherein, the first The second target format is an image format that the target device can display.
  • the image marking module 403 is configured to use the marking information of the object in the image to be processed as the The first object tag information; if the tag information of the object in the image to be processed is not obtained, acquire the tag of the object in the historical image whose shooting time difference with the image to be processed is less than a second preset duration information, and use the tag information of the object in the historical image as the first object tag information.
  • the first image processing module 404 is further configured to: after determining the processing duration, if the processing duration exceeds the first preset duration, Converting a target image to a second format to obtain a fourth target image in the second target format; sending the fourth target image to the target device.
  • the device further includes an object recognition module 405 and a second image processing module 406;
  • the first information acquiring module 401 is further configured to acquire a first preset priority and a second preset priority after acquiring the image to be processed;
  • the object recognition module 405 is configured to allocate a first resource to the object recognition processing process according to the second preset priority, and use the first resource to target the image to be processed through the object recognition processing process identifying and determining first object tag information of the object in the image to be processed;
  • the second image processing module 406 is configured to allocate a second resource to an image processing process according to the first preset priority, and use the second resource to process the image to be processed through the image processing process At least one of the first format conversion and the second format conversion.
  • the image conversion module 402 is configured to obtain first color coding information of the image to be processed; the first color coding information includes a plurality of first brightness information and a plurality of sets of first color coding information.
  • a color information, each pixel in the image to be processed corresponds to a first brightness information, at least one first brightness information corresponds to a group of first color information; based on the first sort order of the first color coding information, parallel extracting a plurality of first luminance information to obtain a first information sequence, and, based on the first sort order of the first color coding information, extracting multiple sets of first color information in parallel to obtain a second information sequence; based on a set of first
  • the first quantity of the first brightness information corresponding to the color information, the second information sequence and the first information sequence determine the color coding sub-information corresponding to each pixel; based on the color coding sub-information corresponding to each pixel , to obtain a first target image with the first target format.
  • the second target format corresponds to second color coding information;
  • the second color coding information includes second brightness information and second color information;
  • each of the third target images A pixel corresponds to a piece of second brightness information, and at least one piece of second brightness information corresponds to a set of second color information;
  • the first image processing module 404 is configured to obtain the third color coding information corresponding to each pixel in the second target image; based on the third color coding information, perform parallel calculation to obtain the third target image
  • the first object marking information includes at least one of detection frame information of the object, an identifier of the object, state characteristic information of the object, and attribute characteristic information of the object.
  • the images to be processed include images captured in a vehicle cabin, and the objects include drivers and/or passengers.
  • the writing order of each step does not mean a strict execution order and constitutes any limitation on the implementation process.
  • the specific execution order of each step should be based on its function and possible
  • the inner logic is OK.
  • the embodiment of the disclosure also provides a detection device corresponding to the detection method. Since the principle of the detection device in the embodiment of the disclosure to solve the problem is similar to the above detection method of the embodiment of the disclosure, the implementation of the detection device can be Refer to the implementation of the detection method, and the repeated parts will not be repeated.
  • the detection device includes: a second information acquisition module 501, a third image processing module 502, and an early warning module 503; wherein,
  • the second information acquisition module 501 is used to acquire the image to be processed taken in the cabin and the processing duration corresponding to the previous frame image of the image to be processed; wherein, in the case of marking the previous frame image Next, the processing duration is the duration corresponding to performing target format conversion on the previous frame image and marking processing during the target format conversion process; if the previous frame image is not marked. , the processing duration is the duration corresponding to the target format conversion of the previous frame image;
  • the third image processing module 502 is configured to perform first format conversion on the image to be processed to obtain a first target image in the first target format; when the processing time does not exceed the first preset time length, by performing marking processing on the image to be processed to obtain first object marking information, and marking the first object marking information on the first target image to obtain a second target image; converting the second target image to The third target image, and display it;
  • the warning module 503 is configured to give a safety warning to the driving of the vehicle based on the displayed third target image.
  • the embodiment of the present application also provides a computer device.
  • FIG. 6 it is a schematic structural diagram of a computer device provided in the embodiment of the present application, including:
  • the processor 61 executes The following steps: S101: Acquire the image to be processed and the processing time corresponding to the previous frame image of the image to be processed; S102: Perform first format conversion on the image to be processed to obtain a first target image with the first target format; S103: If the processing duration does not exceed the first preset duration, the first object marking information is obtained by marking the image to be processed, and the first object marking information is marked on the first target image to obtain a second target image; S104 : Convert the second target image to the third target image and send the third target image to the target device.
  • memory 62 comprises memory 621 and external memory 622;
  • Memory 621 here is also called internal memory, is used for temporarily storing the operation data in processor 61, and the data exchanged with external memory 622 such as hard disk, processor 61 communicates with memory 621 through memory 621.
  • the external memory 622 performs data exchange.
  • the processor 61 communicates with the memory 62 through the bus 63, so that the processor 61 executes the execution instructions mentioned in the above method embodiments.
  • Embodiments of the present disclosure further provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is run by a processor, the steps of the image processing method described in the foregoing method embodiments are executed.
  • the storage medium may be a volatile or non-volatile computer-readable storage medium.
  • An embodiment of the present disclosure further provides a computer program product, including computer instructions, and when the computer instructions are executed by a processor, the steps of the above-mentioned image processing method are implemented.
  • the computer program product may be any product capable of implementing the above-mentioned image processing method, and part or all of the solutions contributed by the computer program product may be embodied in the form of software products (such as software development kits (Software Development Kit, SDK)),
  • the software product may be stored in a storage medium, and the computer instructions contained therein cause a relevant device or processor to execute some or all steps of the above-mentioned image processing method.
  • the disclosed devices and methods may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the modules is only a logical function division.
  • multiple modules or components can be combined.
  • some features can be ignored, or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces, and the indirect coupling or communication connection of devices or modules may be in electrical, mechanical or other forms.
  • 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 may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional module in each embodiment of the present disclosure may be integrated into one processing module, each module may exist separately physically, or two or more modules may be integrated into one module.
  • the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium executable by a processor.
  • the technical solution of the present disclosure is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present disclosure.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disc and other media that can store program codes. .

Abstract

Provided in the present disclosure are an image processing method and apparatus, and a computer device and a storage medium. The method comprises: acquiring an image to be processed, and a processing duration which corresponds to a previous frame of image of the image to be processed; performing first format conversion on the image to be processed, so as to obtain a first target image of a first target format; when the processing duration does not exceed a first preset duration, performing marking processing on the image to be processed, so as to obtain first object marking information, and marking the first object marking information on the first target image, so as to obtain a second target image; and converting the second target image into a third target image, and then sending the third target image to a target device.

Description

图像处理Image Processing
相关申请的交叉引用Cross References to Related Applications
本申请要求在2021年7月30日提交至中国专利局、申请号为CN2021108756619的中国专利申请的优先权,其全部内容通过引用结合在本公开中。This application claims priority to a Chinese patent application with application number CN2021108756619 filed with the China Patent Office on July 30, 2021, the entire contents of which are incorporated in this disclosure by reference.
技术领域technical field
本公开涉及图像处理技术领域。The present disclosure relates to the technical field of image processing.
背景技术Background technique
为了保证图像处理过程的实时可视化,现有工具主要是基于乌班图(ubuntu)或者安卓(android)这样有广泛的开源基础的软实时操作系统,且需要借助图形处理器(GPU)等外部设备进行辅助,或者严重依赖X86-64指令集的高性能平台,极大提高了工具的成本。In order to ensure the real-time visualization of the image processing process, existing tools are mainly based on soft real-time operating systems such as Ubuntu or Android, which have a wide open source foundation, and require external devices such as graphics processing units (GPUs) Auxiliary, or a high-performance platform that relies heavily on the X86-64 instruction set, greatly increases the cost of the tool.
发明内容Contents of the invention
本公开实施例至少提供一种图像处理方法、装置、计算机设备和存储介质。Embodiments of the present disclosure at least provide an image processing method, device, computer equipment, and storage medium.
第一方面,本公开实施例提供了一种图像处理方法,应用于ARM开发板,包括:In the first aspect, the embodiment of the present disclosure provides an image processing method applied to an ARM development board, including:
获取待处理图像,以及所述待处理图像的前一帧图像对应的处理时长;其中,在对所述前一帧图像进行标记处理的情况下,所述处理时长为对所述前一帧图像进行目标格式转换,并在所述目标格式转换过程中进行标记处理对应的时长;在未对所述前一帧图像进行标记处理的情况下,所述处理时长为对所述前一帧图像进行所述目标格式转换对应的时长;对所述待处理图像进行第一格式转换,得到具有第一目标格式的第一目标图像;在所述处理时长未超过第一预设时长的情况下,通过对所述待处理图像进行标记处理得到第一对象标记信息,并将所述第一对象标记信息标记在所述第一目标图像上,得到第二目标图像;将所述第二目标图像转换为第三目标图像,并将所述第三目标图像发送到目标设备。Acquiring the image to be processed, and the processing duration corresponding to the previous frame image of the image to be processed; wherein, in the case of marking the previous frame image, the processing duration is for the previous frame image Perform target format conversion, and perform marking processing corresponding to the duration during the target format conversion process; if the previous frame image is not marked, the processing duration is The duration corresponding to the target format conversion; performing the first format conversion on the image to be processed to obtain the first target image with the first target format; when the processing duration does not exceed the first preset duration, by performing marking processing on the image to be processed to obtain first object marking information, and marking the first object marking information on the first target image to obtain a second target image; converting the second target image to a third target image, and send the third target image to the target device.
第二方面,本公开实施例还提供一种检测方法,包括:获取在车舱内拍摄的待处理图像;以及所述待处理图像的前一帧图像对应的处理时长;其中,在对所述前一帧图像进行标记处理的情况下,所述处理时长为对所述前一帧图像进行目标格式转换,并在所述目标格式转换过程中进行标记处理对应的时长;在未对所述前一帧图像进行标记处理的情况下,所述处理时长为对所述前一帧图像进行所述目标格式转换对应的时长;对所述待处理图像进行第一格式转换,得到具有第一目标格式的第一目标图像;在所述处理时长未超过第一预设时长的情况下,通过对所述待处理图像进行标记处理得到第一对象标记信息,并将所述第一对象标记信息标记在所述第一目标图像上,得到第二目标图像;将所述第二目标图像转换为第三目标图像,并进行展示;基于展示的第二目标图像,对车辆的驾驶进行安全预警。In the second aspect, the embodiment of the present disclosure also provides a detection method, including: acquiring an image to be processed taken in the vehicle cabin; and the processing duration corresponding to the previous frame of the image to be processed; In the case where the previous frame image is tagged, the processing duration is the duration corresponding to the target format conversion of the previous frame image and the tagging process during the target format conversion process; In the case of marking a frame of image, the processing duration is the duration corresponding to the target format conversion of the previous frame of image; the first format conversion is performed on the image to be processed to obtain the first target format conversion. the first target image; in the case that the processing time does not exceed the first preset time length, the first object marking information is obtained by marking the image to be processed, and marking the first object marking information in A second target image is obtained from the first target image; the second target image is converted into a third target image and displayed; and based on the displayed second target image, a safety warning is given to the driving of the vehicle.
第三方面,本公开实施例还提供一种图像处理装置,包括:第一信息获取模块,用于获取待处理图像,以及所述待处理图像的前一帧图像对应的处理时长;其中,在对所述前一帧图像进行标记处理的情况下,所述处理时长为对所述前一帧图像进行目标格式转换,并在所述目标格式转换过程中进行标记处理对应的时长;在未对所述前一帧图像进行标记处理的情况下,所述处理时长为对所述前一帧图像进行所述目标格式转换对应 的时长;图像转换模块,用于对所述待处理图像进行第一格式转换,得到具有第一目标格式的第一目标图像;图像标记模块,用于在所述处理时长未超过第一预设时长的情况下,通过对所述待处理图像进行标记处理得到第一对象标记信息,并将所述第一对象标记信息标记在所述第一目标图像上,得到第二目标图像;第一图像处理模块,用于将所述第二目标图像转换为第三目标图像,并将所述第三目标图像发送到目标设备。In a third aspect, an embodiment of the present disclosure further provides an image processing device, including: a first information acquisition module, configured to acquire an image to be processed, and a processing duration corresponding to a previous frame of the image to be processed; wherein, in In the case of performing tagging processing on the previous frame image, the processing duration is the duration corresponding to performing target format conversion on the previous frame image and performing tagging processing during the target format conversion process; In the case where the previous frame image is marked, the processing duration is the duration corresponding to the target format conversion of the previous frame image; the image conversion module is used to perform the first processing on the image to be processed format conversion, to obtain a first target image with a first target format; an image marking module, configured to obtain a first target image by marking the image to be processed when the processing time does not exceed a first preset time Object marking information, and marking the first object marking information on the first target image to obtain a second target image; a first image processing module, configured to convert the second target image into a third target image , and send the third target image to the target device.
第四方面,本公开实施例还提供了一种检测装置,包括:第二信息获取模块,用于获取在车舱内拍摄的待处理图像以及所述待处理图像的前一帧图像对应的处理时长;其中,在对所述前一帧图像进行标记处理的情况下,所述处理时长为对所述前一帧图像进行目标格式转换,并在所述目标格式转换过程中进行标记处理对应的时长;在未对所述前一帧图像进行标记处理的情况下,所述处理时长为对所述前一帧图像进行所述目标格式转换对应的时长;第三图像处理模块,用于对所述待处理图像进行第一格式转换,得到具有第一目标格式的第一目标图像;在所述处理时长未超过第一预设时长的情况下,通过对所述待处理图像进行标记处理得到第一对象标记信息,并将所述第一对象标记信息标记在所述第一目标图像上,得到第二目标图像;将所述第二目标图像转换为第三目标图像,并进行展示;预警模块,用于基于展示的第三目标图像,对车辆的驾驶进行安全预警。In the fourth aspect, the embodiment of the present disclosure further provides a detection device, including: a second information acquisition module, configured to acquire the image to be processed captured in the cabin and the processing corresponding to the previous frame image of the image to be processed Duration; wherein, in the case of performing tagging processing on the previous frame image, the processing duration is corresponding to performing target format conversion on the previous frame image and performing tagging processing during the target format conversion process Duration; in the case that the previous frame of image is not marked, the processing duration is the duration corresponding to the target format conversion of the previous frame of image; the third image processing module is used to convert the previous frame of image Convert the image to be processed into a first format to obtain a first target image in a first target format; if the processing time does not exceed a first preset time length, mark the image to be processed to obtain a second target image An object marking information, and marking the first object marking information on the first target image to obtain a second target image; converting the second target image into a third target image and displaying it; an early warning module , which is used to give a safety warning to the driving of the vehicle based on the displayed third target image.
第五方面,本公开实施例还提供一种计算机设备,包括:处理器、存储器和总线,所述存储器存储有所述处理器可执行的机器可读指令,当计算机设备运行时,所述处理器与所述存储器之间通过总线通信,所述机器可读指令被所述处理器执行时执行上述第一方面,或第一方面中任一种可能的图像处理方法的步骤,以及执行时执行上述第二方面的检测方法的步骤。In the fifth aspect, the embodiment of the present disclosure further provides a computer device, including: a processor, a memory, and a bus, the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processing The processor communicates with the memory through a bus, and when the machine-readable instruction is executed by the processor, it executes the steps of the first aspect above, or any possible image processing method in the first aspect, and executes when executed The steps of the detection method of the second aspect above.
第六方面,本公开实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述第一方面,或第一方面中任一种可能的图像处理方法的步骤,以及执行时执行上述第二方面的检测方法的步骤。In the sixth aspect, the embodiments of the present disclosure also provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is run by a processor, the above-mentioned first aspect, or any of the first aspects in the first aspect, can be executed. The steps of a possible image processing method, and the steps of the detection method of the above second aspect during execution.
关于上述图像处理装置、计算机设备和存储介质的效果描述参见上述图像处理方法的说明,这里不再赘述。For the effect description of the above image processing apparatus, computer equipment and storage medium, please refer to the description of the above image processing method, which will not be repeated here.
为使本公开的上述目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附附图,作详细说明如下。In order to make the above-mentioned objects, features and advantages of the present disclosure more comprehensible, preferred embodiments will be described in detail below together with the accompanying drawings.
附图说明Description of drawings
为了更清楚地说明本公开实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,此处的附图被并入说明书中并构成本说明书中的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。应当理解,以下附图仅示出了本公开的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to illustrate the technical solutions of the embodiments of the present disclosure more clearly, the following will briefly introduce the accompanying drawings used in the embodiments. The accompanying drawings here are incorporated into the specification and constitute a part of the specification. The drawings show the embodiments consistent with the present disclosure, and are used together with the description to explain the technical solution of the present disclosure. It should be understood that the following drawings only show some embodiments of the present disclosure, and therefore should not be regarded as limiting the scope. For those skilled in the art, they can also make From these drawings other related drawings are obtained.
图1示出了本公开实施例所提供的一种图像处理方法的流程图;FIG. 1 shows a flowchart of an image processing method provided by an embodiment of the present disclosure;
图2示出了本公开实施例所提供的图像处理过程的具体实施流程示意图;FIG. 2 shows a schematic flow diagram of a specific implementation process of an image processing process provided by an embodiment of the present disclosure;
图3示出了本公开实施例所提供的从第二目标图像中确定出的目标像素点的示意图;FIG. 3 shows a schematic diagram of target pixels determined from a second target image provided by an embodiment of the present disclosure;
图4示出了本公开实施例所提供的一种图像处理装置的示意图;FIG. 4 shows a schematic diagram of an image processing device provided by an embodiment of the present disclosure;
图5示出了本公开实施例所提供的一种检测装置的示意图;Fig. 5 shows a schematic diagram of a detection device provided by an embodiment of the present disclosure;
图6示出了本公开实施例所提供的一种计算机设备的结构示意图。FIG. 6 shows a schematic structural diagram of a computer device provided by an embodiment of the present disclosure.
具体实施方式Detailed ways
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中 附图,对本公开实施例中的技术方案进行清楚、完整地描述,所描述的实施例仅仅是本公开一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本公开实施例的组件可以以各种不同的配置来布置和设计。因此,以下对在附图中提供的本公开的实施例的详细描述并非旨在限制要求保护的本公开的范围,而是仅仅表示本公开的选定实施例。基于本公开的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本公开保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present disclosure. The described embodiments are only the present invention. Some, but not all, embodiments are disclosed. The components of the disclosed embodiments generally described and illustrated in the figures herein may be arranged and designed in a variety of different configurations. Accordingly, the following detailed description of the embodiments of the present disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but merely represents selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative effort shall fall within the protection scope of the present disclosure.
另外,本公开实施例中的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不应该用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。In addition, the terms "first" and "second" in the description and claims in the embodiments of the present disclosure and the above drawings are used to distinguish similar objects, and should not be used to describe a specific order or sequence . It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments described herein can be practiced in sequences other than those illustrated or described herein.
在本文中提及的“多个或者若干个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。"Plural or several" mentioned herein means two or more. "And/or" describes the association relationship of associated objects, indicating that there may be three types of relationships, for example, A and/or B may indicate: A exists alone, A and B exist simultaneously, and B exists independently. The character "/" generally indicates that the contextual objects are an "or" relationship.
经研究发现,为了保证图像处理过程的实时可视化,现有工具主要是基于乌班图(ubuntu)或者安卓(android)这样有广泛的开源基础的软实时操作系统,且需要借助图形处理器(GPU)等外部设备进行辅助,或者严重依赖X86-64指令集的高性能平台,极大提高了工具的成本。为了降低开发工具的成本,在ARM开发板的QNX(Quick Unix)平台下实现图像处理,但是由于ARM开发板算力不足,图像处理效率低,耗时长,无法满足图像处理的实时可视化要求。After research, it is found that in order to ensure the real-time visualization of the image processing process, the existing tools are mainly based on soft real-time operating systems such as ubuntu or android, which have a wide open source foundation, and require the help of graphics processing units (GPUs). ) and other external devices, or rely heavily on the high-performance platform of the X86-64 instruction set, which greatly increases the cost of the tool. In order to reduce the cost of development tools, image processing is implemented on the QNX (Quick Unix) platform of the ARM development board. However, due to the insufficient computing power of the ARM development board, the image processing efficiency is low and time-consuming, which cannot meet the real-time visualization requirements of image processing.
基于上述研究,本公开提供了一种图像处理方法、装置、计算机设备和存储介质,利用ARM开发板能够并行处理数据的功能,例如ARM开发板中的单命令多数据并行处理库Neon以及CPU自带的寄存器,能够成倍提高图像格式转换的速度,满足了图像处理的实时性;另外,一般情况下,对图像进行标记处理的过程较慢,可能会导致处理时长过长,进而导致展示的视频流卡顿,即连续两帧图像展示卡顿,不能满足图像展示的流畅性要求。基于上述图像格式转换满足了图像处理的实时性的特点,要满足图像展示的流畅性要求,就需要保证处理时长不能超过第一预设时长,才能对待处理图像进行标记处理,进而该待处理图像与前一帧图像组成的视频流展示过程才不至于卡顿,才能满足第一对象标记信息的实时可视化要求。综上,利用ARM开发板能够并行处理数据的功能、基于处理时长判断是否为待处理图像进行标记处理的机制、以及存储在存储器中的第一对象标记信息,能够满足图像处理的实时可视化要求。Based on the above research, the present disclosure provides an image processing method, device, computer equipment and storage medium, using the function of ARM development board to process data in parallel, such as the single command multiple data parallel processing library Neon in the ARM development board and the CPU automatic With registers, the speed of image format conversion can be doubled, which meets the real-time performance of image processing; in addition, in general, the process of marking images is slow, which may lead to excessively long processing time, which in turn leads to display errors. The video stream freezes, that is, the display of two consecutive frames of images freezes, which cannot meet the smoothness requirements of image display. Based on the above-mentioned image format conversion that satisfies the real-time characteristics of image processing, in order to meet the fluency requirements of image display, it is necessary to ensure that the processing time cannot exceed the first preset time length before marking the image to be processed, and then the image to be processed The display process of the video stream composed of the previous frame image will not be stuck, and can meet the real-time visualization requirements of the first object marking information. In summary, using the ARM development board's ability to process data in parallel, the mechanism for judging whether to mark an image to be processed based on the processing time, and the first object mark information stored in the memory can meet the real-time visualization requirements of image processing.
针对以上方案所存在的缺陷,均是发明人在经过实践并仔细研究后得出的结果,因此,上述问题的发现过程以及下文中本公开针对上述问题所提出的解决方案,都应该是发明人在本公开过程中对本公开做出的贡献。The defects in the above solutions are all the results obtained by the inventor after practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed by the present disclosure below for the above problems should be the result of the inventor Contributions made to this disclosure during the course of this disclosure.
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。It should be noted that like numerals and letters denote similar items in the following figures, therefore, once an item is defined in one figure, it does not require further definition and explanation in subsequent figures.
下面对本公开实施例中涉及到的特定名词进行介绍:The specific nouns involved in the embodiments of the present disclosure are introduced below:
ARM处理器(Advanced RISC Machines,ARM),是一种低功耗成本的RISC微处理器。ARM processor (Advanced RISC Machines, ARM) is a RISC microprocessor with low power consumption and cost.
ARM开发板,即以ARM的内核芯片作为CPU,同时附加其他外围功能的嵌入式开发板,用于评估内核芯片的功能和研发各类科技类企业的产品。ARM development board, that is, an embedded development board with ARM core chip as the CPU and additional peripheral functions, used to evaluate the functions of the core chip and develop products of various technology companies.
中央处理器(central processing unit,简称CPU)作为计算机系统的运算和控制核心,是信息处理、程序运行的最终执行单元。The central processing unit (CPU for short) is the computing and control core of the computer system, and is the final execution unit for information processing and program operation.
图形处理器(Graphics Processing Unit,GPU),又称显示核心、视觉处理器、显示芯片,是一种专门在个人电脑、工作站、游戏机和一些移动设备(如平板电脑、智能手机等)上做图像和图形相关运算工作的微处理器。Graphics Processing Unit (GPU), also known as display core, visual processor, and display chip, is a graphics processing unit designed for use in personal computers, workstations, game consoles, and some mobile devices (such as tablets, smartphones, etc.) Microprocessor for image and graphics related operations.
精简指令集计算机(RISC:Reduced Instruction Set Computing,RISC)是一种执行较少 类型计算机指令的微处理器。RISC: Reduced Instruction Set Computing (RISC) is a microprocessor that executes fewer types of computer instructions.
OpenCV是一个基于BSD许可(开源)发行的跨平台计算机视觉和机器学习软件库,可以运行在Linux、Windows、Android和Mac OS操作系统上。它轻量级而且高效,由一系列C函数和少量C++类构成,同时提供了Python、Ruby、MATLAB等语言的接口,实现了图像处理和计算机视觉方面的很多通用算法。OpenCV is a cross-platform computer vision and machine learning software library released under the BSD license (open source), which can run on Linux, Windows, Android and Mac OS operating systems. It is lightweight and efficient. It consists of a series of C functions and a small number of C++ classes. It also provides interfaces for languages such as Python, Ruby, and MATLAB, and implements many general-purpose algorithms in image processing and computer vision.
FFmpeg是一套可以用来记录、转换数字音频、视频,并能将其转化为流的开源计算机程序。FFmpeg is a set of open source computer programs that can be used to record, convert digital audio and video, and convert them into streams.
Neon是适用于ARM处理器的一种128位SIMD(Single Instruction,Multiple Data,单指令、多数据)扩展结构。Neon is a 128-bit SIMD (Single Instruction, Multiple Data, Single Instruction, Multiple Data) extension structure for ARM processors.
YUV,是一种颜色编码方法,常使用在各个视频处理组件中。YUV在对照照片或视频编码时,考虑到人类的感知能力,允许降低色度的带宽。其中,Y表示明亮度,U和V表示色度。可以包括UYVU格式和NV12格式。YUV, is a color encoding method that is often used in various video processing components. YUV allows for reduced chroma bandwidth by taking human perception into account when encoding photos or videos. Among them, Y represents brightness, and U and V represent chroma. Can include UYVU format and NV12 format.
pack,一种用于管理添加信息的排序方法,只有上下左右的关系,每个添加信息按照添加顺序进行排列。pack, a sorting method for managing added information, there is only a relationship between up, down, left, and right, and each added information is arranged in the order of addition.
线性插值是指插值函数为一次多项式的插值方式,其在插值节点上的插值误差为零。Linear interpolation refers to the interpolation method in which the interpolation function is a polynomial, and its interpolation error on the interpolation node is zero.
BGR,OpenCV默认的通道。其中B表示蓝色,G表示绿色,R表示红色。BGR, the default channel of OpenCV. Among them, B represents blue, G represents green, and R represents red.
QNX,一种商用的遵从POSIX规范的类Unix实时操作系统。是一种基于优先级抢占的硬实时操作系统。QNX, a commercial Unix-like real-time operating system that complies with the POSIX specification. It is a hard real-time operating system based on priority preemption.
码率,是数据传输时单位时间传送的数据位数,比如kbps即千位每秒。The code rate is the number of data bits transmitted per unit time during data transmission, such as kbps, which is thousands of bits per second.
H264,是一种数字视频压缩格式,H264, is a digital video compression format,
实时流传输协议,(Real Time Streaming Protocol,RTSP)是TCP/IP协议体系中的一个应用层协议,用来控制声音或影像的多媒体串流协议,并允许同时多个串流需求控制。Real Time Streaming Protocol, (Real Time Streaming Protocol, RTSP) is an application layer protocol in the TCP/IP protocol system, which is used to control the multimedia streaming protocol of audio or video, and allows multiple streaming requirements to be controlled at the same time.
Ubuntu是一个以桌面应用为主的Linux操作系统。Ubuntu is a Linux operating system mainly for desktop applications.
android是一种基于Linux内核的自由及开放源代码的操作系统。Android is a free and open source operating system based on the Linux kernel.
Linux是一种免费使用和自由传播的类UNIX操作系统。Linux is a UNIX-like operating system that is free to use and spread freely.
X86-64,即64-bit extended的简写,是X86架构的64位拓展。X86-64, short for 64-bit extended, is a 64-bit extension of the X86 architecture.
为便于对本实施例进行理解,首先对本公开实施例所公开的一种图像处理方法进行详细介绍,本公开实施例所提供的图像处理方法的执行主体一般为ARM开发板中的ARM处理器。这里的ARM开发板可以存储有经过QNX系统编译后的计算机可读指令。在一些可能的实现方式中,该图像处理方法可以通过ARM处理器调用存储器中存储的计算机可读指令的方式来实现。To facilitate the understanding of this embodiment, an image processing method disclosed in the embodiment of the present disclosure is firstly introduced in detail. The image processing method provided in the embodiment of the present disclosure is generally executed by an ARM processor in an ARM development board. The ARM development board here can store computer-readable instructions compiled by the QNX system. In some possible implementation manners, the image processing method may be implemented by calling a computer-readable instruction stored in a memory by an ARM processor.
下面以执行主体为ARM处理器为例对本公开实施例提供的图像处理方法加以说明。The image processing method provided by the embodiment of the present disclosure will be described below by taking the execution subject as an ARM processor as an example.
参见图1所示,为本公开实施例提供的一种图像处理方法的流程图,所述方法包括步骤S101~S104,其中:Referring to FIG. 1 , which is a flowchart of an image processing method provided by an embodiment of the present disclosure, the method includes steps S101 to S104, wherein:
S101:获取待处理图像,以及待处理图像的前一帧图像对应的处理时长。S101: Obtain the image to be processed and the processing time corresponding to the previous frame image of the image to be processed.
其中,待处理图像和前一帧图像可以包括拍摄设备拍摄到的图像,比如车载摄像头拍摄到的车舱内的图像,该图像可以包括对象,该对象可以为司机和/或乘客等。前一帧图像可以为当前帧图像(即待处理图像)的上一帧图像。Wherein, the image to be processed and the previous frame of image may include an image captured by a shooting device, such as an image in a vehicle cabin captured by a vehicle camera, and the image may include an object, such as a driver and/or a passenger. The previous frame image may be a previous frame image of the current frame image (that is, the image to be processed).
这里所描述的拍摄设备可以为任意有QNX平台驱动的摄像头。其中,摄像头的QNX驱动程序可替换,本公开实施例不进行具体限定。The shooting device described here can be any camera driven by the QNX platform. Wherein, the QNX driver of the camera can be replaced, which is not specifically limited in this embodiment of the present disclosure.
本步骤中的处理时长可以为:The processing time in this step can be:
在对前一帧图像进行标记处理的情况下,处理时长为对前一帧图像进行目标格式转换,并在目标格式转换过程中进行标记处理对应的时长。In the case of performing tagging processing on the previous frame image, the processing duration is the duration corresponding to performing target format conversion on the previous frame image and performing tagging processing during the target format conversion process.
在未对前一帧图像进行标记处理的情况下,处理时长为对前一帧图像进行目标格式转换对应的时长。In the case where the marking process is not performed on the previous frame of image, the processing duration is the duration corresponding to the target format conversion of the previous frame of image.
在一些实施例中,标记处理可以为对第一目标格式的图像中的对象进行标记的处理,具体包括通过检测第一目标格式的图像中的对象、识别第一目标格式的图像中的对象的类型、识别第一目标格式的图像中的对象的状态、识别第一目标格式的图像中的对象的属性中的一项或多项执行的标记处理。示例性的,第一目标格式的图像可以为UYVY格式的图像,可以对UYVY格式的图像中的人脸进行标记,具体可以生成针对人脸的检测框,并且,在一些实施例中,可以在目标格式转换过程中进行标记处理。In some embodiments, the labeling process may be a process of labeling an object in an image in the first target format, specifically including detecting an object in an image in the first target format and identifying an object in the image in the first target format The tagging process performed by one or more of type, identifying a state of the object in the image in the first target format, identifying an attribute of the object in the image in the first target format. Exemplarily, the image in the first target format can be an image in UYVY format, and the human face in the image in UYVY format can be marked, specifically, a detection frame for a human face can be generated, and, in some embodiments, can be Tag processing occurs during target format conversion.
在一些实施例中,目标格式转换可以包括第一格式转换和第二格式转换,其中,对图像进行第一格式转换可以得到具有第一目标格式的图像,对图像进行第二格式转换可以得到具有第二目标格式的图像。第二目标格式的图像可以被传输至显示设备进行显示。示例性的,第一目标格式可以为BGR格式,第二目标格式可以为NV12格式。具有第一目标格式的图像可以为BGR图像,具有第二目标格式的图像可以为NV12图像。In some embodiments, the target format conversion may include a first format conversion and a second format conversion, wherein, performing the first format conversion on the image may obtain an image having the first target format, and performing the second format conversion on the image may obtain an image having the An image in the second target format. The image in the second target format may be transmitted to a display device for display. Exemplarily, the first target format may be BGR format, and the second target format may be NV12 format. The image with the first object format may be a BGR image, and the image with the second object format may be an NV12 image.
在一些实施例中,可以实时获取拍摄设备拍摄到的环境图像,即将该环境图像作为待处理图像。In some embodiments, the environmental image captured by the shooting device may be acquired in real time, that is, the environmental image may be used as the image to be processed.
在另一些实施例中,拍摄设备拍摄到的图像不一定包括对象,因此,可以对不包括对象的图像进行过滤处理,示例性的,获取车载摄像头拍摄到的车舱内的环境图像,识别环境图像中是否包含预设对象,比如人,在包含预设对象的情况下,将包含预设对象的环境图像作为待处理图像;在不包含预设对象的情况下,可以将该环境图像剔除,进行下一帧图像的处理。In some other embodiments, the image captured by the shooting device does not necessarily include the object, therefore, the image that does not include the object can be filtered. Whether the image contains a preset object, such as a person. If the preset object is included, the environment image containing the preset object will be used as the image to be processed; if the preset object is not included, the environment image can be removed. Process the next frame of image.
示例性的,待处理图像的格式可以包括YUV格式中的UYVY格式或NV12格式等。该ARM处理器单独开辟了一条图像获取进程,实时获取摄像头采集到的UYVY格式或NV12格式的待处理图像,之后,将该待处理图像复制两份,分别存储到内存A和内存B中。Exemplarily, the format of the image to be processed may include UYVY format or NV12 format among YUV formats. The ARM processor independently develops an image acquisition process to acquire the image to be processed in UYVY format or NV12 format collected by the camera in real time, and then copies the image to be processed in two copies and stores them in memory A and memory B respectively.
S102:对待处理图像进行第一格式转换,得到具有第一目标格式的第一目标图像。S102: Perform first format conversion on the image to be processed to obtain a first target image in the first target format.
在一些实施例中,为了保证目标设备实时展示的视频流流畅,因此,在图像处理过程中,需要保证图像格式转换进程优先处理,即为该进程配置较高的优先级。In some embodiments, in order to ensure the smoothness of the video stream displayed by the target device in real time, during the image processing process, it is necessary to ensure that the image format conversion process is processed first, that is, configure a higher priority for this process.
具体实施时,可以利用预先设置的高优先级的图像格式转换进程,对待处理图像进行第一格式转换,得到具有第一目标格式的第一目标图像。其中,第一目标格式可以为BGR格式,具有BGR格式的第一目标图像即为BGR图像。During specific implementation, a preset high-priority image format conversion process may be used to perform first format conversion on the image to be processed to obtain a first target image in the first target format. Wherein, the first target format may be a BGR format, and the first target image in the BGR format is a BGR image.
示例性的,以利用车载摄像头拍摄到的UYVY格式的待处理图像为例,利用高优先级的图像格式转换进程获取内存A中存储的待处理图像,对待处理图像进行第一格式转换,将UYVY格式转换为BGR格式,得到具有BGR格式的BGR图像。Exemplarily, taking the image to be processed in the UYVY format captured by the vehicle-mounted camera as an example, the image to be processed stored in the memory A is obtained by using the high-priority image format conversion process, and the image to be processed is converted into the first format, and the UYVY The format is converted to the BGR format, and a BGR image with the BGR format is obtained.
S103:在处理时长未超过第一预设时长的情况下,通过对待处理图像进行标记处理得到第一对象标记信息,并将第一对象标记信息标记在第一目标图像上,得到第二目标图像。S103: In the case that the processing time does not exceed the first preset time length, obtain the first object marking information by marking the image to be processed, and mark the first object marking information on the first target image to obtain the second target image .
其中,第一对象标记信息可以包括待处理图像中的对象的标记信息,或者,与待处理图像的拍摄时间差小于第二预设时长的历史图像中的对象的标记信息。Wherein, the first object tag information may include tag information of objects in the image to be processed, or tag information of objects in historical images whose shooting time difference from the image to be processed is less than a second preset duration.
一般情况下,对图像进行标记处理的过程较慢,可能会导致处理时长过长,进而导致展示的视频流卡顿,即连续两帧图像展示卡顿,不能满足图像展示的流畅性要求。为了满足图像展示的流畅性要求,需要保证处理时长不能超过第一预设时长,才能对待处理图像进行标记处理,进而该待处理图像与前一帧图像组成的视频流展示过程才不至于卡顿,才能满足第一对象标记信息的实时可视化要求。In general, the process of tagging images is slow, which may lead to a long processing time, which will cause the displayed video stream to freeze, that is, the display of two consecutive frames of images freezes, which cannot meet the smoothness requirements of image display. In order to meet the fluency requirements of image display, it is necessary to ensure that the processing time does not exceed the first preset time length before marking the image to be processed, so that the display process of the video stream composed of the image to be processed and the previous frame image will not be stuck , in order to meet the real-time visualization requirements of the first object label information.
在一些实施例中,由于识别待处理图像中的对象,并生成第一对象标记信息的处理过程较慢,因此,为了不影响图像处理的实时性,可以将预先设置的对象识别进程设置为低优先级。低优先级比高优先级的优先级低,可调用的资源也相对较少。示例性的, 在对象为驾驶员的情况下,对象识别进程可以包括人脸识别算法模块,即可以对驾驶员的人脸进行识别。In some embodiments, since the process of identifying the object in the image to be processed and generating the first object label information is relatively slow, in order not to affect the real-time performance of the image processing, the preset object recognition process can be set to low priority. Low priority has lower priority than high priority, and relatively fewer resources can be invoked. Exemplarily, in the case that the object is a driver, the object recognition process may include a face recognition algorithm module, that is, the driver's face may be recognized.
在一些实施例中,在对所述待处理图像进行第一格式转换的过程中对所述待处理图像中的对象进行标记处理,并在完成对所述待处理图像进行的第一格式转换得到第一目标图像时,在获取到对所述待处理图像中的对象进行标记处理得到的标记信息的情况下,即,在存储器中存储有待处理图像中的对象的标记信息的情况下,可以从存储器中获取该待处理图像中的对象的标记信息,并将其作为第一对象标记信息,等待为待处理图像中的对象进行标记处理。In some embodiments, during the process of performing the first format conversion on the image to be processed, the object in the image to be processed is marked, and after the first format conversion on the image to be processed is completed, the obtained For the first target image, when the marking information obtained by marking the object in the image to be processed is obtained, that is, when the marking information of the object in the image to be processed is stored in the memory, it can be obtained from The marking information of the object in the image to be processed is acquired in the memory, and used as the first object marking information, waiting to be marked for the object in the image to be processed.
这里,将待处理图像中的对象的标记信息存入存储器的过程,具体的,获取内存B的待处理图像,将该待处理图像传输到对象识别进程,利用该对象识别进程中的对象识别算法,比如人脸识别算法,对待处理图像中的对象进行识别,得到对象的第一对象标记信息,并将该第一对象标记信息存储到存储器中,等待调用。Here, the process of storing the label information of the object in the image to be processed into the memory, specifically, acquiring the image to be processed in the memory B, transferring the image to be processed to the object recognition process, and using the object recognition algorithm in the object recognition process , such as a face recognition algorithm, recognizes the object in the image to be processed, obtains the first object tag information of the object, and stores the first object tag information in a memory, waiting to be called.
在一些实施例中,在完成对所述待处理图像进行的第一格式转换得到第一目标图像时,由于识别待处理图像中的对象,并生成该对象的标记信息的处理过程较慢,因此,在未获取到对待处理图像中的对象进行标记处理得到的标记信息的情况下,还可以从存储器中获取与待处理图像的拍摄时间差小于第二预设时长的历史图像中的对象的标记信息,并将历史图像中的对象的标记信息作为第一对象标记信息。比如,将前一帧图像中的对象的标记信息作为第一对象标记信息。In some embodiments, when the first format conversion of the image to be processed is completed to obtain the first target image, since the process of identifying the object in the image to be processed and generating the tag information of the object is relatively slow, the , if the marking information obtained by marking the object in the image to be processed is not obtained, the marking information of the object in the historical image whose shooting time difference with the image to be processed is less than a second preset duration may also be obtained from the memory , and use the tag information of the object in the historical image as the first object tag information. For example, the label information of the object in the previous frame image is used as the first object label information.
通过该实施方式,在获取到待处理图像中的对象的标记信息时,利用待处理图像中的对象的标记信息对待处理图像中的对象进行标记,在未能获取到待处理图像中的对象的标记信息的情况下,可以利用历史图像中的对象的标记信息对待处理图像中的对象进行标记。由于与待处理图像的拍摄时间差小于第二预设时长的历史图像中的对象之间变化较小,因此,不会导致该历史图像中的对象的标记信息与待处理图像中的对象的标记信息差异较大的情况,即可以利用历史图像中的对象的标记信息对待处理图像中的对象进行标记。Through this embodiment, when the tag information of the object in the image to be processed is acquired, the object in the image to be processed is marked with the tag information of the object in the image to be processed, and if the object in the image to be processed cannot be obtained In the case of marking information, the marking information of the object in the historical image can be used to mark the object in the image to be processed. Since the difference between the shooting time of the image to be processed and the object in the historical image is less than the second preset duration, the tag information of the object in the historical image will not be different from the tag information of the object in the image to be processed. In the case of a large difference, the object in the image to be processed can be marked by using the marking information of the object in the historical image.
示例性的,由于识别对象过程较慢,经过高优先级进行第一格式转换后得到第一目标图像时,该待处理图像中的对象对应的标记信息可能还未生成,即存储器中还未存储有该对象对应的标记信息,则此时可以调用已经存储在存储器中的、与待处理图像的拍摄时间差小于第二预设时长的历史图像中的对象对应的标记信息。其中,与待处理图像的拍摄时间差小于第二预设时长的历史图像,可以包括当前帧待处理图像之前的三帧图像。这里,为了减少存储器存储标记信息的内存,可以仅保存最近三帧历史图像中对象对应的标记信息,从而降低其所占用的内存,提高算法运行速度。需要说明的是,第二预设时长还可以根据具体应用场景进行设置,本公开实施例对此不进行限定。Exemplarily, since the process of recognizing objects is slow, when the first target image is obtained after converting the first format with a high priority, the tag information corresponding to the object in the image to be processed may not have been generated, that is, it has not been stored in the memory If there is tag information corresponding to the object, then the tag information already stored in the memory and corresponding to the object in the historical image whose shooting time difference of the image to be processed is less than the second preset time length can be called at this time. Wherein, the historical image whose shooting time difference with the image to be processed is less than the second preset duration may include three frames of images before the current frame of the image to be processed. Here, in order to reduce the memory for storing the label information, only the label information corresponding to the object in the last three frames of historical images can be saved, thereby reducing the memory occupied by it and increasing the running speed of the algorithm. It should be noted that the second preset duration may also be set according to a specific application scenario, which is not limited in this embodiment of the present disclosure.
该第一对象标记信息可以包括但不仅限于对象的检测框信息、对象的身份标识符、对象的状态特征信息、对象的属性特征信息中的至少一种。其中,检测框信息可以包括检测框中心点坐标,检测框的尺寸信息,即长度和宽度等。对象的身份标识符可以为指示对象身份信息的标识,比如司机标识或乘客标识等。对象的状态特征信息可以包括对象行为,比如玩手机、把握方向盘、未系安全带等。对象的属性特征信息可以包括年龄阶段属性,比如老人、成人、儿童等。The first object label information may include but not limited to at least one of object detection frame information, object identifier, object state characteristic information, and object attribute characteristic information. Wherein, the detection frame information may include the coordinates of the center point of the detection frame, the size information of the detection frame, that is, the length and width, and the like. The object's identity identifier may be an identity indicating the identity information of the object, such as a driver's identity or a passenger's identity. The state characteristic information of the object may include the behavior of the object, such as playing with a mobile phone, holding the steering wheel, not wearing a seat belt, and so on. The attribute feature information of the object may include age stage attributes, such as old people, adults, children, and so on.
针对第一预设时长,示例性的,综合考虑多帧图像组成视频流后的播放流畅度,依据经验,可以将第一预设时长设置为50ms。需要说明的是,该第一预设时长在不同的应用场景还可以根据经验值设置其他数值,本公开实施例不进行限定。With regard to the first preset duration, for example, considering comprehensively the playback fluency of video streams composed of multiple frames of images, based on experience, the first preset duration may be set to 50 ms. It should be noted that, in different application scenarios, the first preset duration may also be set to other values according to empirical values, which are not limited in this embodiment of the present disclosure.
这里,第二目标图像为记录有第一对象标记信息的第一目标对象。Here, the second target image is the first target object recorded with the first object mark information.
S104:将第二目标图像转换为第三目标图像,并将第三目标图像发送到目标设备。S104: Convert the second target image into a third target image, and send the third target image to the target device.
这里,由于第二目标图像不可通过目标设备进行展示,因此,本步骤中,将第二目标图像转换为可在目标设备上展示的第三目标图像,具体的,可以将第二目标图像进 行第二格式转换,得到第二目标格式的第三目标图像。其中,第二目标格式为目标设备可显示的图像格式,具体的,第二目标格式可以为NV12格式,第三目标图像可以为NV12格式的图像。这里,第三目标图像包含第一对象标记信息。Here, since the second target image cannot be displayed by the target device, in this step, the second target image is converted into a third target image that can be displayed on the target device. converting the second format to obtain a third target image in the second target format. Wherein, the second target format is an image format that can be displayed by the target device, specifically, the second target format may be NV12 format, and the third target image may be an image in NV12 format. Here, the third target image contains the first object label information.
由于目标设备无法显示第一目标格式的第一目标图像,因此,需要将具有第一目标格式的第二目标图像进行第二格式转换,得到能够利用目标设备进行显示的第二目标格式的第三图像,其第二格式转换过程利用了ARM开发板能够并行处理数据的功能,能够提高第二目标图像转换为可展示的第三目标图像的速度。Since the target device cannot display the first target image in the first target format, it is necessary to convert the second target image in the first target format into the second format to obtain a third target image in the second target format that can be displayed by the target device. For the image, the second format conversion process utilizes the parallel data processing function of the ARM development board, which can increase the speed of converting the second target image into a displayable third target image.
之后,可以将转换后的第三目标图像存储到内存C中。Afterwards, the converted third target image can be stored in memory C.
目标设备包括显示屏,可展示第三目标图像。将第三目标图像发送到目标设备,具体的,通过预先设置的视频编码进程获取内存C中的第三目标图像,并对第三目标图像进行编码处理,例如,该视频编码进程调用QNX平台支持的视频编码接口和视频处理单元对第三目标图像进行编码处理,该视频处理单元配置有图像编码策略,码率。将第三目标图像编码成H264数据视频流格式,之后,将编码后的H264数据通过一种RTSP服务器发布到目标设备上进行展示。其中,该RTSP服务器是根据QNX特定的网络组件库构成的。The target device includes a display screen displaying a third target image. Send the third target image to the target device, specifically, obtain the third target image in the memory C through the preset video encoding process, and encode the third target image, for example, the video encoding process calls the QNX platform support The video encoding interface and the video processing unit perform encoding processing on the third target image, and the video processing unit is configured with an image encoding strategy and a code rate. The third target image is encoded into the H264 data video stream format, and then the encoded H264 data is published to the target device through an RTSP server for display. Wherein, the RTSP server is formed according to a specific network component library of QNX.
针对S101中的前一帧图像,对前一帧图像的处理过程可以包括对前一帧图像进行目标格式转换的过程,因此,处理时长可以为前一帧图像进行目标格式转换对应的时长。For the previous frame of image in S101, the processing of the previous frame of image may include the process of performing target format conversion on the previous frame of image, therefore, the processing duration may be the duration corresponding to the target format conversion of the previous frame of image.
在一些实施例中,在确定前一帧图像的上一帧图像的图像处理时长超过第一预设时长的情况下,则不对该前一帧图像进行标记处理,即前一帧图像的处理时长为前一帧图像进行目标格式转换对应的时长,且不包括在前一帧图像进行目标格式转换过程中进行标记处理的时长。基于此,对前一帧图像进行目标格式转换,具体实施时,可以先对前一帧图像进行第一格式转换,得到具有第一目标格式的第一格式图像;对第一格式图像进行第二格式转换,得到具有第二目标格式的第二格式图像。In some embodiments, when it is determined that the image processing duration of the previous frame image of the previous frame image exceeds the first preset duration, the previous frame image is not marked, that is, the processing duration of the previous frame image is The duration corresponding to the target format conversion of the previous frame image, and does not include the duration of marking processing during the target format conversion process of the previous frame image. Based on this, the target format conversion is performed on the previous frame image. During specific implementation, the first format conversion can be performed on the previous frame image to obtain the first format image with the first target format; the second format conversion is performed on the first format image. format conversion to obtain a second format image with a second target format.
示例性的,在第一目标格式为BGR格式的情况下,第一格式图像为BGR图像,在第二目标格式为NV12格式的情况下,第二格式图像为NV12图像。Exemplarily, when the first target format is the BGR format, the first format image is a BGR image, and when the second target format is the NV12 format, the second format image is an NV12 image.
在另一些实施例中,在确定前一帧图像的上一帧图像的图像处理时长不超过第一预设时长的情况下,则可以对该前一帧图像进行标记处理,即前一帧图像的处理时长为前一帧图像进行目标格式转换,并在目标格式转换过程中进行标记处理对应的时长。基于此,对前一帧图像进行目标格式转换,并在目标格式转换过程中进行标记处理,具体实施时,首先,可以对前一帧图像进行第一格式转换,得到具有第一目标格式的第一格式图像;之后,获取存储器中的第二对象标记信息,并将第二对象标记信息标记在第一格式图像上,得到第一格式标记图像,其中,第二对象标记信息可以包括前一帧图像或与前一帧的拍摄时间差小于第二预设时长的历史图像中的对象的标记信息;之后,再对第一格式标记图像进行第二格式转换,得到具有第二目标格式的第二格式图像。满足了对前一帧图像中的对象进行标记,得到第二对象标记信息并进行展示的实时可视化要求。In some other embodiments, when it is determined that the image processing duration of the previous frame image of the previous frame image does not exceed the first preset duration, the previous frame image may be marked, that is, the previous frame image The processing time is the time corresponding to the target format conversion of the previous frame image and the marking process during the target format conversion process. Based on this, the target format conversion is performed on the previous frame image, and marking processing is performed during the target format conversion process. In specific implementation, first, the first format conversion can be performed on the previous frame image to obtain the first target format image. A format image; after that, acquire the second object tag information in the memory, and mark the second object tag information on the first format image to obtain the first format tag image, wherein the second object tag information may include the previous frame The mark information of the object in the image or the historical image whose shooting time difference with the previous frame is less than the second preset duration; after that, the second format conversion is performed on the first format marked image to obtain the second format with the second target format image. It satisfies the real-time visualization requirement of marking the object in the previous frame image, obtaining and displaying the marking information of the second object.
这里,对象的第二对象标记信息包括该对象的检测框信息、该对象的身份标识符、该对象的状态特征信息、该对象的属性特征信息中的至少一种。Here, the second object marking information of the object includes at least one of the detection frame information of the object, the identity identifier of the object, the state characteristic information of the object, and the attribute characteristic information of the object.
在一些实施例中,处理时长超过第一预设时长的原因可以包括对前一帧图像中的对象进行标记处理,导致标记过程时长过长,进而造成处理时长超过第一预设时长,为了满足图像处理的实时性以及图像展示的流畅性要求,在处理时长超过第一预设时长的情况下,可以直接对第一目标图像进行第二格式转换,得到具有第二目标格式的第四目标图像;将第四目标图像发送到目标设备。In some embodiments, the reason why the processing time exceeds the first preset time may include marking the object in the previous frame of image, which causes the marking process to take too long, which in turn causes the processing time to exceed the first preset time. In order to meet the The real-time performance of image processing and the smoothness of image display require that when the processing time exceeds the first preset time length, the first target image can be directly converted to the second format to obtain the fourth target image with the second target format ; Send the fourth target image to the target device.
这里,在处理时长超过第一预设时长的情况下,可以直接将第一目标图像进行第二格式转换,避免了后续为第一目标图像进行标记处理后,处理时长超出第一预设时长的情况,保证了图像处理的实时性以及图像展示的流畅性要求。Here, when the processing duration exceeds the first preset duration, the first target image can be directly converted to the second format, avoiding the problem that the processing duration exceeds the first preset duration after subsequent marking processing is performed for the first target image. The situation guarantees the real-time performance of image processing and the fluency requirements of image display.
示例性的,第四目标图像可以为NV12格式的图像。Exemplarily, the fourth target image may be an image in NV12 format.
将第四目标图像发送到目标设备,并利用目标设备展示第四目标图像,利用目标设备展示第四目标图像的详细描述可以参照上述将第三目标图像发送到目标设备的过程,在此不再赘述。Send the fourth target image to the target device, and use the target device to display the fourth target image. The detailed description of using the target device to display the fourth target image can refer to the above-mentioned process of sending the third target image to the target device, which will not be repeated here repeat.
这里,针对连续两帧图像,其中有一帧缺少第一对象标记信息,不会影响用户所能察觉到的展示效果,仍然能够满足图像处理的实时可视化要求。Here, for two consecutive frames of images, one frame lacks the first object label information, which will not affect the display effect perceived by the user, and can still meet the real-time visualization requirements of image processing.
在一个或一些实施例中,在所述处理时长未超过第一预设时长的情况下,由于识别待处理图像中的对象,并生成第一对象标记信息的处理过程较慢,因此,通过对待处理图像进行对象识别的进程设置低优先级,即第二预设优先级,和对图像格式转换进程设置高优先级,即第一预设优先级的方式,能够保证图像格式转换并发送到目标设备展示的实时性要求。In one or some embodiments, when the processing duration does not exceed the first preset duration, since the processing process of identifying the object in the image to be processed and generating the first object tag information is relatively slow, by treating The process of processing images for object recognition sets a low priority, that is, the second preset priority, and sets a high priority for the image format conversion process, that is, the first preset priority, which can ensure that the image format is converted and sent to the target Real-time requirements for device display.
针对图像格式转换进程,具体实施时,首先,获取第一预设优先级;之后,按照第一预设优先级,为图像处理进程分配第二资源,并利用第二资源通过图像处理进程对待处理图像进行第一格式转换和/或第二格式转换。此外,可选地,在优先完成第一格式转换和第二格式转换的情况下,图像处理进程也可以执行待处理图像的标记处理。For the image format conversion process, during specific implementation, first, obtain the first preset priority; then, according to the first preset priority, allocate a second resource to the image processing process, and use the second resource to be processed through the image processing process The image undergoes first format conversion and/or second format conversion. In addition, optionally, the image processing process may also perform marking processing of the image to be processed under the condition that the first format conversion and the second format conversion are completed first.
这里,图像处理,即为利用第二资源对待处理图像进行第一格式转换、第二格式转换和标记处理等中的至少一项。其中,针对图像处理中的标记处理,还可以基于处理时长判断是否为待处理图像进行标记处理。Here, the image processing refers to performing at least one of the first format conversion, the second format conversion, and marking processing on the image to be processed by using the second resource. Wherein, for the marking process in the image processing, it may also be determined based on the processing duration whether the marking process is performed on the image to be processed.
针对对象识别进程,具体实施时,获取第二预设优先级,按照第二预设优先级为对象识别处理进程分配第一资源,并利用第一资源对待处理图像进行对象检测、对象识别、对象状态识别和对象属性识别中的至少一项标记处理,以确定待处理图像中的对象的第一对象标记信息。在这里,资源是指系统资源或计算资源,例如系统的内存、CPU等。For the object recognition process, during specific implementation, the second preset priority is obtained, the first resource is allocated to the object recognition processing process according to the second preset priority, and the first resource is used to perform object detection, object recognition, and object detection on the image to be processed. At least one of state recognition and object attribute recognition is tagged to determine first object tag information of the object in the image to be processed. Here, the resources refer to system resources or computing resources, such as system memory, CPU, and the like.
这里,第一预设优先级高于第二预设优先级,第一预设优先级,即为上述的高优先级,第二预设优先级可以为上述的低优先级。第一资源的资源量少于第二资源的资源量。Here, the first preset priority is higher than the second preset priority, the first preset priority is the above-mentioned high priority, and the second preset priority may be the above-mentioned low priority. The resource amount of the first resource is less than the resource amount of the second resource.
这里,对待处理图像进行对象识别,确定待处理图像中的对象的第一对象标记信息的过程,可以参照上述确定第一对象标记信息的详细说明,重复之处在此不再赘述。Here, for the process of performing object recognition on the image to be processed and determining the first object label information of the object in the image to be processed, refer to the above detailed description of determining the first object label information, and repeating details will not be repeated here.
上述,由于图像采集设备的采集频率较高,因此,前一帧图像和待处理图像较为相近,利用存储器中存储的前一帧图像对应的第一对象标记信息同样能够为当前帧待处理图像进行标记,不会影响用户所能察觉到的展示效果,因此,经过该实施方式处理能够满足图像处理的实时可视化要求。As mentioned above, since the acquisition frequency of the image acquisition device is relatively high, the image of the previous frame is relatively similar to the image to be processed, and the first object tag information corresponding to the image of the previous frame stored in the memory can also be used for the image of the current frame to be processed. The mark will not affect the display effect perceived by the user. Therefore, the processing in this embodiment can meet the real-time visualization requirement of image processing.
针对上述S101~S104,参见图2所示,其为图像处理过程的具体实施流程示意图。包括附图标记21表示拍摄设备获取到的待处理图像,附图标记22表示图像格式转换进程,附图标记23表示对象识别进程,附图标记24表示存储器存储的第一对象标记信息,附图标记25表示判断是否允许对第一目标图像进行标记,其中,允许的情况可以包括处理时长未超过第一预设时长的情况,不允许的情况可以包括处理时长超过第一预设时长的情况。附图标记26表示允许对第一目标图像进行标记,得到第二目标图像,附图标记27表示对包含标记的第二目标图像进行第二格式转换,将转换后的图像存入内存C。附图标记28表示在不允许对第一目标图像进行标记时直接对第一目标图像进行第二格式转换,将转换后的图像存入内存C。附图标记29表示内存C。Regarding the above S101-S104, please refer to FIG. 2, which is a schematic diagram of a specific implementation flow of the image processing process. Reference numeral 21 represents the image to be processed acquired by the shooting device, reference numeral 22 represents the image format conversion process, reference numeral 23 represents the object recognition process, and reference numeral 24 represents the first object tag information stored in the memory. Mark 25 represents judging whether to allow marking of the first target image, wherein the permitted case may include the case that the processing time does not exceed the first preset time length, and the disallowed case may include the processing time exceeds the first preset time length. Reference numeral 26 indicates that the first target image is allowed to be marked to obtain a second target image, and reference numeral 27 indicates that the second target image including the mark is converted into a second format, and the converted image is stored in the memory C. Reference numeral 28 indicates that when the first target image is not allowed to be marked, the second format conversion is directly performed on the first target image, and the converted image is stored in the memory C. Reference numeral 29 denotes a memory C.
针对上述对待处理图像进行第一格式转换,具体实施时,可以参见下述S1021~S1024:For the above-mentioned conversion of the first format of the image to be processed, for specific implementation, please refer to the following S1021-S1024:
S1021:获取待处理图像的第一颜色编码信息;第一颜色编码信息中包括多个第一亮度信息和多组第一色彩信息,待处理图像中每个像素点对应一个第一亮度信息,至少一个第一亮度信息对应一组第一色彩信息。S1021: Acquire the first color coding information of the image to be processed; the first color coding information includes a plurality of first brightness information and multiple sets of first color information, and each pixel in the image to be processed corresponds to a first brightness information, at least One piece of first brightness information corresponds to a group of first color information.
本步骤中,第一颜色编码信息可以包括以UYVY格式对待处理图像进行编码的编 码信息,其中,UYVY格式为YUV格式中的其中一种水平取样,垂直完全采样格式。或者,还可以为以NV12格式对待处理图像进行编码的编码信息,其中,NV12格式为YUV格式中的其中一种水平取样,垂直2:1采样格式。或者,还可以为以AYUV格式对待处理图像进行编码的编码信息,其中,AYUV格式为YUV格式中的其中一种完全取样格式。In this step, the first color coding information may include coding information for encoding the image to be processed in the UYVY format, wherein the UYVY format is one of the horizontal sampling and vertical full sampling formats in the YUV format. Alternatively, it may also be encoding information for encoding the image to be processed in the NV12 format, where the NV12 format is one of the YUV formats for horizontal sampling and vertical 2:1 sampling. Alternatively, it may also be encoding information for encoding the image to be processed in AYUV format, where the AYUV format is one of the full sampling formats in the YUV format.
示例性的,以待处理图像为UYVY格式图像为例,第一颜色编码信息中包括多个第一亮度信息,即多个Y;以及,多组第一色彩信息,即多组UV。待处理图像的每个像素点对应一个Y,每两个第一亮度信息对应一组第一色彩信息。Exemplarily, taking the image to be processed as an image in UYVY format as an example, the first color coding information includes multiple first brightness information, that is, multiple Ys; and multiple sets of first color information, that is, multiple sets of UV. Each pixel of the image to be processed corresponds to a Y, and every two pieces of first brightness information correspond to a set of first color information.
在一些实施例中,还获取待处理图像的图像尺寸,包括待处理图像的宽度和高度。In some embodiments, the image size of the image to be processed is also acquired, including the width and height of the image to be processed.
S1022:基于第一颜色编码信息的第一排序顺序,并行提取多个第一亮度信息,得到第一信息序列,以及,基于第一颜色编码信息的第一排序顺序,并行提取多组第一色彩信息,得到第二信息序列。S1022: Based on the first sort order of the first color coding information, extract a plurality of first brightness information in parallel to obtain a first information sequence, and, based on the first sort order of the first color coding information, extract multiple groups of first colors in parallel information to obtain the second information sequence.
本步骤中,第一颜色编码信息的第一排序顺序可以为pack排序顺序,即按照添加顺序进行排列。In this step, the first sorting order of the first color-coded information may be the pack sorting order, that is, it is arranged according to the adding order.
例如,UYVY格式按照添加顺序进行排列,得到第一颜色编码信息的第一排序顺序为UYVYUYVY……。其中,Y、U、V即为像素点的元素。另外,可以基于上述获取到的待处理图像的图像尺寸,确定第一排序顺序UYVYUYVY……中每个元素的地址,按照地址并行提取对应位置的元素。For example, the UYVY format is arranged according to the order of addition, and the first sorting order of the first color-coded information obtained is UYVYUYVY . . . . Among them, Y, U, V are the elements of the pixel. In addition, the address of each element in the first sorting order UYVYUYVY . . . may be determined based on the acquired image size of the image to be processed, and elements at corresponding positions may be extracted in parallel according to the address.
这里,第一亮度信息在第一颜色编码信息中的排列方式符合一定的排序特征,比如位于奇数位或者偶数位。延续上例,UYVYUYVY……的排序位置依次为第0位,第1位,第2位,第3位,第4位,第5位,第6位,第7位,……。在UYVYUYVY……中第一亮度信息Y位于奇数位,第一色彩信息U和V位于偶数位。Here, the arrangement manner of the first brightness information in the first color coding information conforms to a certain sorting feature, for example, it is located in an odd numbered position or an even numbered position. Continuing the above example, the sorting positions of UYVYUYVY... are 0th, 1st, 2nd, 3rd, 4th, 5th, 6th, 7th,.... In UYVYUYVY..., the first luminance information Y is located at odd-numbered bits, and the first color information U and V are located at even-numbered bits.
具体实施时,在确定了第一颜色编码信息的第一排序顺序之后,可以确定待处理图像的首个元素地址。基于ARM中寄存器的存储容量,确定ARM开发板的并行处理性能信息;基于第一颜色编码信息的第一排序顺序和并行处理性能信息,从首个元素地址开始,可以利用Neon依次并行提取第一排序顺序中的多个第一亮度信息,得到第一信息序列;以及基于第一颜色编码信息的第一排序顺序和并行处理性能信息,从首个元素地址开始,可以利用Neon依次并行提取第一排序顺序中的多组第一色彩信息,得到第二信息序列。During specific implementation, after the first sort order of the first color coding information is determined, the address of the first element of the image to be processed may be determined. Based on the storage capacity of the registers in ARM, determine the parallel processing performance information of the ARM development board; based on the first sorting order and parallel processing performance information of the first color-coded information, starting from the first element address, Neon can be used to sequentially extract the first in parallel. A plurality of first brightness information in the sorting order to obtain the first information sequence; and based on the first sorting order and parallel processing performance information of the first color coding information, starting from the first element address, Neon can be used to sequentially extract the first in parallel The plurality of sets of first color information in the sequence are sorted to obtain a second information sequence.
这里,由于每个元素占8bit,在图像格式转换过程中元素计算附带有8bit的符号(包括正“+”、负“-”等),因此,每个元素需要占16bit内存。ARM中寄存器的存储容量可以为128bit,其并行处理性能信息可以包括一次并行提取不带符号的16个元素,或者,是带符号的8个元素。Here, since each element occupies 8 bits, 8-bit symbols (including positive "+" and negative "-", etc.) are attached to the element calculation during the image format conversion process. Therefore, each element needs to occupy 16 bits of memory. The storage capacity of the register in the ARM may be 128 bits, and its parallel processing performance information may include a parallel extraction of 16 elements without a sign, or 8 elements with a sign.
示例性的,以待处理图像为UYVY格式的图像为例,第一排序顺序为UYVYUYVY……,对应地址可以为0、1、2、3、4、5、6、7、……,可以确定出第一亮度信息在第一颜色编码信息中的排序位置为奇数位,即1、3、5、7、……,可以确定出第一色彩信息在第一颜色编码信息中的排序位置为偶数位,即0、2、4、6、……,之后,从首个元素地址开始,可以利用Neon每次并行提取奇数位的8个第一亮度信息,即地址1、3、5、7、9、11、13、15对应的Y,之后,循环执行提取过程,不断获取第一亮度信息,再基于得到的多个第一亮度信息,确定第一信息序列为YYYYYYYY……;可以利用Neon每次并行提取偶数位的4组第一色彩信息,分别为4个第一色彩子信息U和4个第二色彩子信息V,即地址0、4、8、12对应的U和地址2、6、10、14对应的V,之后,循环执行提取过程,不断获取第一色彩信息,再基于得到的多组第一色彩信息,确定得到第二信息序列为UVUVUVUV……。Exemplarily, taking the image to be processed as an image in UYVY format as an example, the first sorting order is UYVYUYVY..., and the corresponding addresses can be 0, 1, 2, 3, 4, 5, 6, 7,..., which can be determined It can be determined that the sorting position of the first brightness information in the first color coding information is an odd number, that is, 1, 3, 5, 7, ..., and it can be determined that the sorting position of the first color information in the first color coding information is an even number bits, that is, 0, 2, 4, 6, ..., after that, starting from the first element address, you can use Neon to extract 8 first brightness information of odd bits in parallel each time, that is, addresses 1, 3, 5, 7, 9, 11, 13, and 15 correspond to Y, and then execute the extraction process cyclically to continuously obtain the first brightness information, and then determine the first information sequence as YYYYYYYY based on the obtained multiple first brightness information...; you can use Neon every Extract 4 sets of first color information with even bits in parallel, which are 4 first color sub-information U and 4 second color sub-information V, namely U corresponding to addresses 0, 4, 8, 12 and addresses 2, 6 , 10, and 14 corresponding to V, and then execute the extraction process cyclically to continuously obtain the first color information, and then determine the second information sequence as UVUVUVUV... based on the obtained multiple sets of first color information.
上述分别并列提取出多个第一亮度信息和多组第一色彩信息,能够快速得到待处理图像中的多个像素点对应的第一信息序列和第二信息序列,进而提高待处理图像中的 多个像素点的图像格式转换的效率。By extracting a plurality of first brightness information and a plurality of sets of first color information in parallel, the first information sequence and the second information sequence corresponding to a plurality of pixels in the image to be processed can be quickly obtained, thereby improving the image quality in the image to be processed. The efficiency of image format conversion for multiple pixels.
S1023:基于一组第一色彩信息对应的第一亮度信息的第一数量、第二信息序列和第一信息序列,确定每个像素点对应的颜色编码子信息。S1023: Based on the first quantity of the first brightness information corresponding to a set of first color information, the second information sequence, and the first information sequence, determine color coding sub-information corresponding to each pixel.
本步骤中,一组第一色彩信息对应的第一亮度信息的第一数量可以表示第一亮度信息共享一组第一色彩信息的数量。例如,针对UYVY格式,一组第一色彩信息对应两个第一亮度信息,即两个第一亮度信息共享一组第一色彩信息;针对NV12格式,一组第一色彩信息对应四个第一亮度信息,即四个第一亮度信息共享一组第一色彩信息;针对AYUV格式,一组第一色彩信息对应一个第一亮度信息,即一个第一亮度信息共享一组第一色彩信息。In this step, the first quantity of the first brightness information corresponding to a group of first color information may indicate the quantity of the first brightness information sharing a group of first color information. For example, for the UYVY format, a set of first color information corresponds to two first brightness information, that is, two first brightness information share a set of first color information; for the NV12 format, a set of first color information corresponds to four first Brightness information, that is, four first brightness information share a set of first color information; for the AYUV format, a set of first color information corresponds to one first brightness information, that is, one first brightness information shares a set of first color information.
这里,第一色彩信息可以包括第一色彩子信息和第二色彩子信息,具体的,比如第一色彩信息为UV,则第一色彩子信息可以为U,第二色彩子信息可以为V。每个像素点对应的颜色编码子信息包括第一亮度信息Y、第一色彩子信息可以为U和第二色彩子信息可以为V。Here, the first color information may include first color sub-information and second color sub-information. Specifically, for example, if the first color information is UV, the first color sub-information may be U, and the second color sub-information may be V. The color coding sub-information corresponding to each pixel includes first brightness information Y, the first color sub-information may be U, and the second color sub-information may be V.
示例性的,针对UYVY格式的待处理图像,可以确定一组第一色彩信息UV对应两个第一亮度信息Y,即第一数量为2。在第一信息序列为YYYY,第二信息序列为UVUV的情况下,第一信息序列对应的第一个第一亮度信息Y,对应第一组第一色彩信息UV;第一信息序列对应的第二个第一亮度信息Y,对应第一组第一色彩信息UV;第一信息序列对应的第三个第一亮度信息Y,对应第二组第一色彩信息UV;第一信息序列对应的第四个第一亮度信息Y,对应第二组第一色彩信息UV。进而,可以确定待处理图像中的第一个像素点对应的颜色编码子信息为第一个第一亮度信息Y和第一组第一色彩信息UV;可以确定待处理图像中的第二个像素点对应的颜色编码子信息为第二个第一亮度信息Y和第一组第一色彩信息UV;可以确定待处理图像中的第三个像素点对应的颜色编码子信息为第三个第一亮度信息Y和第二组第一色彩信息UV;可以确定待处理图像中的第四个像素点对应的颜色编码子信息为第四个第一亮度信息Y和第二组第一色彩信息UV。同理,按照上述过程,循环利用Neon并列提取的其他多个第一亮度信息和其他多组第一色彩信息,可以确定出待处理图像中的每个像素点的颜色编码子信息。Exemplarily, for an image to be processed in UYVY format, it may be determined that a set of first color information UV corresponds to two first brightness information Y, that is, the first number is two. In the case that the first information sequence is YYYY and the second information sequence is UVUV, the first first brightness information Y corresponding to the first information sequence corresponds to the first group of first color information UV; the first information sequence corresponds to the first The two first brightness information Ys correspond to the first group of first color information UV; the third first brightness information Y corresponding to the first information sequence corresponds to the second group of first color information UV; the first information sequence corresponds to the first The four first brightness information Ys correspond to the second group of first color information UV. Furthermore, it can be determined that the color coding sub-information corresponding to the first pixel in the image to be processed is the first first brightness information Y and the first group of first color information UV; it can be determined that the second pixel in the image to be processed The color coding sub-information corresponding to the point is the second first brightness information Y and the first group of first color information UV; it can be determined that the color coding sub-information corresponding to the third pixel in the image to be processed is the third first Brightness information Y and the second group of first color information UV; it can be determined that the color coding sub-information corresponding to the fourth pixel in the image to be processed is the fourth first brightness information Y and the second group of first color information UV. Similarly, according to the above process, the color coding sub-information of each pixel in the image to be processed can be determined by recycling other multiple first brightness information and other multiple sets of first color information extracted in parallel by Neon.
S1024:基于每个像素点对应的颜色编码子信息,得到具有第一目标格式的第一目标图像。S1024: Obtain a first target image in a first target format based on the color-coded sub-information corresponding to each pixel.
本步骤中,第一目标格式可以包括但不仅限于BGR格式。在确定待处理图像为UYVY格式的图像的情况下,第一目标格式的第一目标图像则可以为BGR格式的图像。In this step, the first target format may include but not limited to BGR format. In a case where it is determined that the image to be processed is an image in UYVY format, the first target image in the first target format may be an image in BGR format.
具体实施时,首先,可以基于每个像素点对应的颜色编码子信息,分别确定每个像素点对应于第一目标格式的第三颜色编码信息;之后,基于每个像素点对应的第三颜色编码信息,得到具有第一目标格式的第一目标图像。During specific implementation, first, based on the color coding sub-information corresponding to each pixel, respectively determine the third color coding information corresponding to each pixel in the first target format; then, based on the third color coding information corresponding to each pixel The information is encoded to obtain a first target image having a first target format.
这里,可以利用线性插值函数计算出待处理图像中的每个像素点对应的第一目标格式的第三颜色编码信息。Here, the third color coding information in the first target format corresponding to each pixel in the image to be processed may be calculated by using a linear interpolation function.
这里,在第一目标格式为BGR格式的情况下,第三颜色编码信息可以包括元素B,元素G元素R。Here, in the case that the first target format is the BGR format, the third color coding information may include element B, element G and element R.
示例性的,以将UYVY格式的待处理图像转换为BGR格式的第一目标图像为例,针对一个像素点对应的颜色编码子信息,即Y 1、U 1、V 1,利用线性插值函数f(Y,U,V),确定该像素点的对应的BGR格式的第三颜色编码信息,记为B=αf(Y 1,U 1,V 1),G=βf(Y 1,U 1,V 1),R=γf(Y 1,U 1,V 1),其中,α表示计算该像素中的B元素对应的在线性插值函数中的固定系数;β表示计算该像素中的G元素对应的在线性插值函数中的固定系数;γ表示计算该像素中的R元素对应的在线性插值函数中的固定系数。上述α、β、γ可以按照实际应用场景和经验值进行设定,本公开实施例不进行具体限定。在确定了该像素点的第二颜色编码信息B、G、R之后,确定该像素点从UYVY格式转换为BGR 格式。同理,针对待处理图像中的每个像素点,按照上述像素点的格式转换方式,最终得到具有第一目标格式的第一目标图像,即BGR格式的BGR图像。 Exemplarily, taking the conversion of the image to be processed in UYVY format into the first target image in BGR format as an example, for the color coding sub-information corresponding to a pixel, that is, Y 1 , U 1 , V 1 , use the linear interpolation function f (Y, U, V), determine the third color coding information in BGR format corresponding to the pixel point, recorded as B=αf(Y 1 , U 1 , V 1 ), G=βf(Y 1 , U 1 , V 1 ), R=γf(Y 1 , U 1 , V 1 ), where, α means to calculate the fixed coefficient in the linear interpolation function corresponding to the B element in the pixel; β means to calculate the corresponding G element in the pixel The fixed coefficient in the linear interpolation function of ; γ means calculating the fixed coefficient in the linear interpolation function corresponding to the R element in the pixel. The foregoing α, β, and γ may be set according to actual application scenarios and empirical values, and are not specifically limited in the embodiments of the present disclosure. After the second color coding information B, G, R of the pixel is determined, it is determined that the pixel is converted from the UYVY format to the BGR format. Similarly, for each pixel in the image to be processed, the first target image in the first target format, that is, the BGR image in BGR format, is finally obtained according to the format conversion method of the above pixel.
另外,在计算出每个像素点的BGR元素之后,可以按照每个像素点的先后顺序,从BGR图像中首个元素的地址开始,将每个像素点对应的元素存入内存D中。In addition, after the BGR element of each pixel is calculated, the element corresponding to each pixel can be stored in memory D according to the order of each pixel, starting from the address of the first element in the BGR image.
上述S1021~S1024,利用了ARM开发板中的Neon扩展结构以及CPU自带的寄存器,能够从寄存器中存储的第一颜色编码信息中并行提取多个第一亮度信息和多组第一色彩信息,由于并行提取能够成倍提高信息获取速度,因此能够实现在CPU上成倍加速图像格式转换,能够满足实时性图像格式转换的需求。本实施例不依赖于GPU等图像处理设备,能够降低图像格式转换的硬件成本;另外,本实施例为实时图像格式转换提供了ARM开发板通用的图像格式转换方法,同时,与X86-64平台相比,ARM开发板的功耗和硬件成本较低。The above S1021-S1024 utilize the Neon extension structure in the ARM development board and the registers that come with the CPU to extract multiple first brightness information and multiple sets of first color information in parallel from the first color coding information stored in the register. Since the parallel extraction can double the speed of information acquisition, it can realize the double acceleration of image format conversion on the CPU, which can meet the needs of real-time image format conversion. This embodiment does not depend on image processing devices such as GPU, and can reduce the hardware cost of image format conversion; in addition, this embodiment provides a general image format conversion method for ARM development boards for real-time image format conversion. In comparison, the power consumption and hardware cost of the ARM development board are lower.
针对上述对第二目标图像进行第二格式转换,得到具有第二目标格式的第三目标图像。其中,第二目标格式对应第二颜色编码信息;第二颜色编码信息中包括第二亮度信息和第二色彩信息;第三目标图像中每个像素点对应一个第二亮度信息,至少一个第二亮度信息对应一组第二色彩信息。In view of the above, the second format conversion is performed on the second target image to obtain a third target image in the second target format. Wherein, the second target format corresponds to the second color coding information; the second color coding information includes the second brightness information and the second color information; each pixel in the third target image corresponds to a second brightness information, at least one second The brightness information corresponds to a set of second color information.
示例性的,第二目标格式可以包括但不仅限于NV12格式,第二颜色编码信息中包括第二亮度信息Y,第二色彩信息UV。NV12格式图像的每个像素点对应一个第二亮度信息,四个第二亮度信息对应一组第二色彩信息。Exemplarily, the second target format may include but not limited to NV12 format, and the second color coding information includes second brightness information Y and second color information UV. Each pixel of the image in the NV12 format corresponds to one piece of second brightness information, and four pieces of second brightness information correspond to a group of second color information.
将第二目标图像转换为第二目标格式的第三目标图像,具体实施时,可以参见下述S301~304:Convert the second target image into a third target image in the second target format. For specific implementation, refer to the following S301-304:
S301:获取第二目标图像中每个像素点对应的第三颜色编码信息。S301: Obtain third color coding information corresponding to each pixel in the second target image.
这里,由于在进行第二格式转换过程中,不涉及第二目标图像中包含的第一对象标记信息,因此,第二目标图像中每个像素点对应的第三颜色编码信息,即为第一目标图像中每个像素点对应的第三颜色编码信息。Here, since the first object label information contained in the second target image is not involved in the second format conversion process, the third color coding information corresponding to each pixel in the second target image is the first The third color coding information corresponding to each pixel in the target image.
S302:基于第三颜色编码信息,并行计算,得到第三目标图像中每个像素点对应的第二亮度信息。S302: Based on the third color coding information, perform parallel calculation to obtain second brightness information corresponding to each pixel in the third target image.
具体实施时,可以基于上述确定的每个像素点对应于BGR格式的第三颜色编码信息,即B=αf(Y,U,V),G=βf(Y,U,V),R=γf(Y,U,V),利用线性插值函数进行并行计算,得到第二目标图像的每个像素点对应的第二亮度信息,即Y=δf(B,G,R),其中,δ表示计算该像素中的第二亮度信息Y对应的在线性插值函数中的固定系数,可以根据经验值定义,本公开实施例不进行具体限定。During specific implementation, each pixel determined above may correspond to the third color coding information in BGR format, that is, B=αf(Y, U, V), G=βf(Y, U, V), R=γf (Y, U, V), using a linear interpolation function to perform parallel calculations to obtain the second luminance information corresponding to each pixel of the second target image, that is, Y=δf(B, G, R), where δ represents calculation The fixed coefficients in the linear interpolation function corresponding to the second luminance information Y in the pixel may be defined according to empirical values, which are not specifically limited in the embodiments of the present disclosure.
这里,并行计算可以为利用Neon从三个寄存器分别并行提取存储的8个8bit的第三颜色编码信息中的元素B,8个8bit的第三颜色编码信息中的元素G,8个8bit的第三颜色编码信息中的元素R,得到8组第三颜色编码信息BGR,即8个像素点,之后,利用线性插值函数Y=δf(B,G,R)并行计算8组BGR,得到其中每组BGR(每个像素点)对应的第二亮度信息。循环调用Neon并行计算,直到得到第二目标图像对应的每个像素点格式转换后的第二亮度信息,即可得到第三目标图像中每个像素点对应的第二亮度信息。Here, the parallel calculation can be to use Neon to extract in parallel the element B in the eight 8-bit third color-coded information stored in parallel, the element G in the eight 8-bit third color-coded information, and the eight 8-bit third color-coded information from the three registers. The element R in the three-color coding information obtains 8 groups of third color coding information BGR, that is, 8 pixel points, and then uses the linear interpolation function Y=δf(B, G, R) to calculate 8 groups of BGR in parallel to obtain each of them The second luminance information corresponding to the group BGR (each pixel). The Neon parallel calculation is called circularly until the format-converted second luminance information of each pixel corresponding to the second target image is obtained, and then the second luminance information corresponding to each pixel in the third target image is obtained.
S303:基于一组第二色彩信息对应的第二亮度信息的第二数量和第三颜色编码信息,并行计算,得到第三目标图像中每个像素点对应的第二色彩信息。S303: Based on the second quantity of the second brightness information corresponding to a set of second color information and the third color coding information, perform parallel calculation to obtain the second color information corresponding to each pixel in the third target image.
本步骤中,一组第二色彩信息对应的第二亮度信息的第二数量可以表示第二亮度信息共享一组第二色彩信息的数量。示例性的,在第二目标格式为NV12格式的情况下,第二数量为4。In this step, the second quantity of the second brightness information corresponding to a group of second color information may represent the quantity of the second brightness information sharing a group of second color information. Exemplarily, when the second target format is NV12 format, the second number is 4.
具体实施时,基于一组第二色彩信息对应的第二亮度信息的第二数量,确定目标像素点的排序特征信息;目标像素点包括用于确定第二色彩信息的像素点;基于排序特征信息和第二目标图像中每个像素点对应的第三颜色编码信息,确定目标像素点对应的 第三颜色编码信息;基于目标像素点对应的第三颜色编码信息,并行计算,得到第三目标图像的每个像素点对应的第二色彩信息。During specific implementation, based on the second quantity of the second luminance information corresponding to a set of second color information, the sorting feature information of the target pixel is determined; the target pixel includes pixels used to determine the second color information; based on the sorting feature information The third color coding information corresponding to each pixel in the second target image is determined to determine the third color coding information corresponding to the target pixel; based on the third color coding information corresponding to the target pixel, parallel calculation is performed to obtain the third target image The second color information corresponding to each pixel.
这里,由于第二数量不同,则确定的目标像素点的个数不同。例如,在第二数量为4的情况下,即四个第二亮度信息共享一组第二色彩信息,则第二目标图像中的四个像素点,确定一个目标像素点,即目标像素点的个数为第二目标图像中像素点个数的四分之一。具体的可以参见图3所示,其为从第二目标图像中确定出的目标像素点的示意图。其中,31表示4×4的第二目标图像;32表示第二目标图像中的像素点,共有16个像素点;33表示目标像素点,共有4个,即为16个第二目标图像中的像素点的数量的四分之一。Here, since the second numbers are different, the number of determined target pixel points is different. For example, in the case where the second number is 4, that is, four second brightness information share a set of second color information, then four pixels in the second target image determine one target pixel, that is, the target pixel The number is a quarter of the number of pixels in the second target image. For details, refer to FIG. 3 , which is a schematic diagram of target pixels determined from the second target image. Among them, 31 represents the second target image of 4×4; 32 represents the pixels in the second target image, and there are 16 pixels in total; 33 represents the target pixels, and there are 4 in total, that is, the pixels in the 16 second target images A quarter of the number of pixels.
在第二数量为4的情况下,目标像素点的排序特征信息为偶数行、偶数列第二目标图像中的像素点的位置信息,如图3中的,第0行、第0列,第0行、第2列,第2行、第0列,第2行、第2列。In the case where the second number is 4, the sorting feature information of the target pixel points is the position information of the pixels in the second target image in even rows and even columns, as shown in Figure 3, the 0th row, the 0th column, the 0th row Row 0, column 2, row 2, column 0, row 2, column 2.
这里,并行计算可以是利用Neon从三个寄存器分别并行提取存储的排序特征信息对应的行、列所在位置处的元素B、元素G和元素R,确定至少一组第三颜色编码信息BGR,即至少一个像素点,之后,利用线性插值函数U=εf(B,G,R),V=θf(B,G,R),并行计算提取到的BGR,得到每组BGR(每个像素点)对应的第二色彩信息U和V。其中,ε表示计算该像素中的第二色彩信息U对应的在线性插值函数中的固定系数,θ表示计算该像素中的第二色彩信息V对应的在线性插值函数中的固定系数,可以根据经验值定义,本公开实施例不进行具体限定。之后,循环调用Neon并行计算,直到得到第二目标图像对应的每个像素点格式转换后的第二色彩信息,即可得到第三目标图像中每个像素点对应的第二色彩信息。Here, the parallel computing can be to use Neon to extract in parallel the elements B, element G and element R corresponding to the row and column positions corresponding to the stored sorting feature information from the three registers, and determine at least one set of third color coding information BGR, namely At least one pixel, and then use the linear interpolation function U=εf(B, G, R), V=θf(B, G, R) to calculate the extracted BGR in parallel to obtain each group of BGR (each pixel) Corresponding second color information U and V. Wherein, ε represents the calculation of the fixed coefficient in the linear interpolation function corresponding to the second color information U in the pixel, and θ represents the calculation of the fixed coefficient in the linear interpolation function corresponding to the second color information V in the pixel, which can be calculated according to Empirical value definitions are not specifically limited in the embodiments of the present disclosure. Afterwards, the Neon parallel calculation is called circularly until the second color information after the format conversion of each pixel corresponding to the second target image is obtained, and then the second color information corresponding to each pixel in the third target image is obtained.
S304:基于第三目标图像中每个像素点对应的第二亮度信息和第二色彩信息,得到具有第二目标格式的第三目标图像。S304: Obtain a third target image with a second target format based on the second brightness information and second color information corresponding to each pixel in the third target image.
具体的,基于第三目标图像的每个像素点对应的第二亮度信息和第二色彩信息,确定每个像素点对应的第二颜色编码信息;基于第二颜色编码信息,得到具有第二目标格式的第三目标图像。Specifically, based on the second brightness information and the second color information corresponding to each pixel of the third target image, determine the second color coding information corresponding to each pixel; based on the second color coding information, obtain the format of the third target image.
这里,一个像素点对应一个第二亮度信息,根据一组第二色彩信息对应的第二亮度信息的第二数量,确定第二数量像素点共享一组第二色彩信息。Here, one pixel corresponds to one second brightness information, and according to the second amount of second brightness information corresponding to a group of second color information, it is determined that the second number of pixels share a group of second color information.
示例性的,在第二子格式为NV12格式的情况下,确定4×4的第三目标图像的每个像素点对应的第二亮度信息和第二色彩信息,即YYYYYYYYYYYYYYYY和UVUVUVUV,则每个像素点对应的第二颜色编码信息可以为YYYYYYYYYYYYYYYY UVUVUVUV,即得到NV12格式的第三目标图像为YYYYYYYYYYYYYYYY UVUVUVUV。Exemplarily, when the second sub-format is the NV12 format, determine the second brightness information and second color information corresponding to each pixel of the 4×4 third target image, that is, YYYYYYYYYYYYYYYYYY and UVUVUVUV, then each The second color coding information corresponding to the pixel can be YYYYYYYYYYYYYYYY UVUVUVUV, that is, the third target image in NV12 format is YYYYYYYYYYYYYYYYUVUVUVUV.
在计算出每个像素点的第二亮度信息和第二色彩信息之后,将生成的第三目标图像中的第一个第二亮度信息存入预先设置的第二亮度信息首地址中,并按照顺序依次存储其余的第二亮度信息;将生成的第三目标图像中的第一组第二色彩信息存入预先设置的第二色彩信息首地址,并按照顺序依次存储其余的第二色彩信息,以使后续基于第二亮度信息首地址和第二色彩信息首地址从内存中调用第三目标图像。After calculating the second brightness information and second color information of each pixel, store the first second brightness information in the generated third target image into the preset first address of the second brightness information, and follow the storing the rest of the second brightness information sequentially; storing the first group of second color information in the generated third target image into the preset first address of the second color information, and storing the rest of the second color information in order, The third target image is subsequently called from the memory based on the first address of the second brightness information and the first address of the second color information.
上述S301~S304,基于ARM开发板中的寄存器存储的多个像素点对应的第三颜色编码信息,能够并行计算得到该多个像素点的第二亮度信息,基于ARM开发板中的寄存器存储的多个像素点对应的第三颜色编码信息,能够并行计算得到该多个像素点的第二色彩信息,相比较依次计算每个像素点的第二亮度信息和第二色彩信息,本实施方式能够成倍提高第二亮度信息和第二色彩信息的计算效率,进而提高图像格式转换的效率。The above S301-S304, based on the third color coding information corresponding to a plurality of pixels stored in the registers in the ARM development board, can be calculated in parallel to obtain the second brightness information of the plurality of pixels, based on the information stored in the registers in the ARM development board The third color coding information corresponding to multiple pixels can be calculated in parallel to obtain the second color information of the multiple pixels. Compared with sequentially calculating the second brightness information and the second color information of each pixel, this embodiment can The calculation efficiency of the second brightness information and the second color information is doubled, thereby improving the efficiency of image format conversion.
在一些实施例中,针对S303,基于一组第二色彩信息对应的第二亮度信息的第二数量,确定寄存器的第三数量;利用第三数量的寄存器存储第三颜色编码信息,并基于寄存器存储第三颜色编码信息进行并行计算,得到第三目标图像的每个像素点对应的第 二色彩信息。In some embodiments, for S303, the third number of registers is determined based on the second number of second brightness information corresponding to a set of second color information; the third number of registers is used to store the third color coding information, and based on the register The third color coding information is stored for parallel calculation to obtain the second color information corresponding to each pixel of the third target image.
示例性的,针对BGR格式图像转换为NV12格式图像,四个第二亮度信息共享一组第二色彩信息,在并行计算第二色彩信息时,利用Neon并行计算提取第三颜色编码信息BGR时,一次仅能提取出4组BGR,即偶数行、偶数列,或者,奇数行、奇数列的BGR,利用Neon并行计算最多能同时处理8组BGR,如果仅利用并行提取出的4组BGR将浪费Neon算力,因此,可以同时调用两个寄存器(即第三数量为2)存储的第三颜色编码信息,同时提取8组BGR,利用线性插值函数,能够同时并行计算出16个像素点对应的第二色彩信息,提高了第二色彩信息的计算效率,进而提高了BGR格式图像转换为NV12格式图像的图像转换效率。Exemplarily, for converting a BGR format image into an NV12 format image, four second brightness information shares a set of second color information. When calculating the second color information in parallel, when using Neon parallel calculation to extract the third color coding information BGR, Only 4 groups of BGRs can be extracted at a time, that is, BGRs of even-numbered rows and even-numbered columns, or BGRs of odd-numbered rows and odd-numbered columns. Neon parallel computing can process up to 8 groups of BGRs at the same time. If only 4 groups of BGRs extracted in parallel are used, it will be wasteful. Neon computing power, therefore, the third color coding information stored in two registers (that is, the third number is 2) can be called at the same time, and 8 groups of BGR can be extracted at the same time, and the linear interpolation function can be used to simultaneously calculate the corresponding color of 16 pixels The second color information improves the calculation efficiency of the second color information, thereby improving the image conversion efficiency of converting the BGR format image into the NV12 format image.
另外,本公开实施例还提供了一种检测方法,其执行主体为可显示设备,比如上述的目标设备。其应用场景可以为车辆驾驶场景,对司机和乘客进行监管。In addition, an embodiment of the present disclosure also provides a detection method, which is executed by a displayable device, such as the above-mentioned target device. Its application scenario can be a vehicle driving scenario to supervise drivers and passengers.
该可显示设备通过RTSP协议获取到在车舱内拍摄的待处理图像,利用上述图像处理方法对待处理图像进行处理,并展示处理后得到的第三目标图像。基于展示的第三目标图像,对车辆的驾驶进行安全预警。例如,第三目标图像包括第一对象标记信息,基于展示的第一对象标记信息确定司机和/或乘客的状态特征信息,并判断是否需要安全预警,比如,当司机的状态特征信息指示司机有玩手机和不系安全带的问题,则及时向司机发送安全预警提示信息。例如,在第一对象标记信息指示对象的属性特征信息为儿童、且该儿童没有坐在安全椅上的情况下,则及时向乘客发送安全预警提示信息。具体示例在此不再一一列举。The displayable device acquires the image to be processed captured in the cabin through the RTSP protocol, processes the image to be processed by the above image processing method, and displays the processed third target image. Based on the displayed image of the third target, a safety warning is given to the driving of the vehicle. For example, the third target image includes the first object label information, and determine the status feature information of the driver and/or passengers based on the displayed first object label information, and determine whether a safety warning is required, for example, when the driver’s status feature information indicates that the driver has If there are problems with playing with mobile phones and not wearing seat belts, a safety warning prompt message will be sent to the driver in time. For example, when the first object tag information indicates that the attribute feature information of the object is a child, and the child is not sitting in the safety seat, the safety warning prompt information is sent to the passenger in time. Specific examples are not listed here one by one.
基于上述实施例,利用ARM开发板能够并行处理数据的功能,例如ARM开发板中的单命令多数据并行处理库Neon以及CPU自带的寄存器,能够成倍提高图像格式转换的速度,满足了图像处理的实时性;另外,一般情况下,对图像进行标记处理的过程较慢,可能会导致处理时长多长,进而导致展示的视频流卡顿,即连续两帧图像展示卡顿,不能满足图像展示的流畅性要求。基于上述图像格式转换满足了图像处理的实时性的特点,要满足图像展示的流畅性要求,就需要保证处理时长不能超过第一预设时长,才能对待处理图像进行标记处理,进而该待处理图像与前一帧图像组成的视频流展示过程才不至于卡顿,才能满足第一对象标记信息的实时可视化要求。综上,利用ARM开发板能够并行处理数据的功能、基于处理时长判断是否为待处理图像进行标记处理的机制、以及存储在存储器中的第一对象标记信息,能够满足图像处理的实时可视化要求。Based on the above-mentioned embodiments, using the function of ARM development board that can process data in parallel, such as the single-command multiple data parallel processing library Neon in the ARM development board and the registers that come with the CPU, can double the speed of image format conversion and meet the requirements of the image format. Real-time processing; in addition, under normal circumstances, the process of marking images is slow, which may lead to long processing time, which will cause the displayed video stream to freeze, that is, the display of two consecutive frames of images freezes, which cannot meet the requirements of the image. Fluency requirements for display. Based on the above-mentioned image format conversion that satisfies the real-time characteristics of image processing, in order to meet the fluency requirements of image display, it is necessary to ensure that the processing time cannot exceed the first preset time length before marking the image to be processed, and then the image to be processed The display process of the video stream composed of the previous frame image will not be stuck, and can meet the real-time visualization requirements of the first object marking information. In summary, using the ARM development board's ability to process data in parallel, the mechanism for judging whether to mark an image to be processed based on the processing time, and the first object mark information stored in the memory can meet the real-time visualization requirements of image processing.
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。Those skilled in the art can understand that in the above method of specific implementation, the writing order of each step does not mean a strict execution order and constitutes any limitation on the implementation process. The specific execution order of each step should be based on its function and possible The inner logic is OK.
基于同一发明构思,本公开实施例中还提供了与图像处理方法对应的图像处理装置,由于本公开实施例中的图像处理装置解决问题的原理与本公开实施例上述图像处理方法相似,因此装图像处理置的实施可以参见图像处理方法的实施,重复之处不再赘述。Based on the same inventive concept, the embodiment of the present disclosure also provides an image processing device corresponding to the image processing method. Since the problem-solving principle of the image processing device in the embodiment of the present disclosure is similar to the above-mentioned image processing method in the embodiment of the present disclosure, the device For the implementation of the image processing device, reference may be made to the implementation of the image processing method, and repeated descriptions will not be repeated.
参照图4所示,为本公开实施例提供的一种图像处理装置的示意图,所述装置包括:第一信息获取模块401、图像转换模块402、图像标记模块403和第一图像处理模块404;其中,Referring to FIG. 4 , which is a schematic diagram of an image processing device provided by an embodiment of the present disclosure, the device includes: a first information acquisition module 401, an image conversion module 402, an image marking module 403, and a first image processing module 404; in,
第一信息获取模块401,用于获取待处理图像,以及所述待处理图像的前一帧图像对应的处理时长;其中,在对所述前一帧图像进行标记处理的情况下,所述处理时长为对所述前一帧图像进行目标格式转换,并在所述目标格式转换过程中进行标记处理对应的时长;在未对所述前一帧图像进行标记处理的情况下,所述处理时长为对所述前一帧图像进行所述目标格式转换对应的时长;The first information acquisition module 401 is configured to acquire the image to be processed, and the processing duration corresponding to the previous frame image of the image to be processed; wherein, in the case of marking the previous frame image, the processing The duration is the duration corresponding to performing target format conversion on the previous frame image and marking processing during the target format conversion process; if the previous frame image is not marked, the processing duration The duration corresponding to the conversion of the target format for the previous frame image;
图像转换模块402,用于对所述待处理图像进行第一格式转换,得到具有第一目标格式的第一目标图像;An image conversion module 402, configured to convert the image to be processed into a first format to obtain a first target image in a first target format;
图像标记模块403,用于在所述处理时长未超过第一预设时长的情况下,通过对所 述待处理图像进行标记处理得到第一对象标记信息,并将所述第一对象标记信息标记在所述第一目标图像上,得到第二目标图像;An image marking module 403, configured to obtain first object marking information by performing marking processing on the image to be processed when the processing time does not exceed a first preset time length, and mark the first object marking information Obtaining a second target image on the first target image;
第一图像处理模块404,用于将所述第二目标图像转换为第三目标图像,并将所述第三目标图像发送到目标设备。The first image processing module 404 is configured to convert the second target image into a third target image, and send the third target image to the target device.
一种可选的实施方式中,所述第一图像处理模块404,用于对所述第二目标图像进行第二格式转换,得到具有第二目标格式的第三目标图像;其中,所述第二目标格式为所述目标设备可显示的图像格式。In an optional implementation manner, the first image processing module 404 is configured to perform second format conversion on the second target image to obtain a third target image in the second target format; wherein, the first The second target format is an image format that the target device can display.
一种可选的实施方式中,所述图像标记模块403,用于在获取到所述待处理图像中的对象的标记信息的情况下,将所述待处理图像中的对象的标记信息作为所述第一对象标记信息;在未获取到所述待处理图像中的对象的标记信息的情况下,获取与所述待处理图像的拍摄时间差小于第二预设时长的历史图像中的对象的标记信息,并将所述历史图像中的对象的标记信息作为所述第一对象标记信息。In an optional implementation manner, the image marking module 403 is configured to use the marking information of the object in the image to be processed as the The first object tag information; if the tag information of the object in the image to be processed is not obtained, acquire the tag of the object in the historical image whose shooting time difference with the image to be processed is less than a second preset duration information, and use the tag information of the object in the historical image as the first object tag information.
一种可选的实施方式中,所述第一图像处理模块404,还用于在确定所述处理时长之后,在所述处理时长超过所述第一预设时长的情况下,对所述第一目标图像进行第二格式转换,得到具有所述第二目标格式的第四目标图像;将所述第四目标图发送到所述目标设备。In an optional implementation manner, the first image processing module 404 is further configured to: after determining the processing duration, if the processing duration exceeds the first preset duration, Converting a target image to a second format to obtain a fourth target image in the second target format; sending the fourth target image to the target device.
一种可选的实施方式中,所述装置还包括对象识别模块405和第二图像处理模块406;In an optional implementation manner, the device further includes an object recognition module 405 and a second image processing module 406;
所述第一信息获取模块401,还用于在获取待处理图像之后,获取第一预设优先级和第二预设优先级;The first information acquiring module 401 is further configured to acquire a first preset priority and a second preset priority after acquiring the image to be processed;
所述对象识别模块405,用于按照所述第二预设优先级为对象识别处理进程分配第一资源,并利用所述第一资源通过所述对象识别处理进程对所述待处理图像进行对象识别,确定所述待处理图像中的对象的第一对象标记信息;The object recognition module 405 is configured to allocate a first resource to the object recognition processing process according to the second preset priority, and use the first resource to target the image to be processed through the object recognition processing process identifying and determining first object tag information of the object in the image to be processed;
所述第二图像处理模块406,用于按照所述第一预设优先级,为图像处理进程分配第二资源,并利用所述第二资源通过所述图像处理进程对所述待处理图像进行第一格式转换和第二格式转换中的至少一项。The second image processing module 406 is configured to allocate a second resource to an image processing process according to the first preset priority, and use the second resource to process the image to be processed through the image processing process At least one of the first format conversion and the second format conversion.
一种可选的实施方式中,所述图像转换模块402,用于获取所述待处理图像的第一颜色编码信息;所述第一颜色编码信息中包括多个第一亮度信息和多组第一色彩信息,所述待处理图像中每个像素点对应一个第一亮度信息,至少一个第一亮度信息对应一组第一色彩信息;基于所述第一颜色编码信息的第一排序顺序,并行提取多个第一亮度信息,得到第一信息序列,以及,基于所述第一颜色编码信息的第一排序顺序,并行提取多组第一色彩信息,得到第二信息序列;基于一组第一色彩信息对应的第一亮度信息的第一数量、所述第二信息序列和所述第一信息序列,确定每个像素点对应的颜色编码子信息;基于每个像素点对应的颜色编码子信息,得到具有所述第一目标格式的第一目标图像。In an optional implementation manner, the image conversion module 402 is configured to obtain first color coding information of the image to be processed; the first color coding information includes a plurality of first brightness information and a plurality of sets of first color coding information. A color information, each pixel in the image to be processed corresponds to a first brightness information, at least one first brightness information corresponds to a group of first color information; based on the first sort order of the first color coding information, parallel extracting a plurality of first luminance information to obtain a first information sequence, and, based on the first sort order of the first color coding information, extracting multiple sets of first color information in parallel to obtain a second information sequence; based on a set of first The first quantity of the first brightness information corresponding to the color information, the second information sequence and the first information sequence determine the color coding sub-information corresponding to each pixel; based on the color coding sub-information corresponding to each pixel , to obtain a first target image with the first target format.
一种可选的实施方式中,所述第二目标格式对应第二颜色编码信息;所述第二颜色编码信息中包括第二亮度信息和第二色彩信息;所述第三目标图像中每个像素点对应一个第二亮度信息,至少一个第二亮度信息对应一组第二色彩信息;In an optional implementation manner, the second target format corresponds to second color coding information; the second color coding information includes second brightness information and second color information; each of the third target images A pixel corresponds to a piece of second brightness information, and at least one piece of second brightness information corresponds to a set of second color information;
所述第一图像处理模块404,用于获取所述第二目标图像中每个像素点对应的第三颜色编码信息;基于所述第三颜色编码信息,并行计算,得到所述第三目标图像中每个像素点对应的第二亮度信息;基于一组所述第二色彩信息对应的第二亮度信息的第二数量和所述第三颜色编码信息,并行计算,得到所述第三目标图像中每个像素点对应的第二色彩信息;基于所述第三目标图像中每个像素点对应的第二亮度信息和第二色彩信息,得到具有所述第二目标格式的第三目标图像。The first image processing module 404 is configured to obtain the third color coding information corresponding to each pixel in the second target image; based on the third color coding information, perform parallel calculation to obtain the third target image The second brightness information corresponding to each pixel in the second color information; based on the second quantity of the second brightness information corresponding to the second color information and the third color coding information, parallel calculation is performed to obtain the third target image second color information corresponding to each pixel in the third target image; based on the second brightness information and second color information corresponding to each pixel in the third target image, a third target image with the second target format is obtained.
一种可选的实施方式中,所述第一对象标记信息包括对象的检测框信息、对象的身份标识符、所述对象的状态特征信息、所述对象的属性特征信息中的至少一种。In an optional implementation manner, the first object marking information includes at least one of detection frame information of the object, an identifier of the object, state characteristic information of the object, and attribute characteristic information of the object.
一种可选的实施方式中,所述待处理图像包括在车舱内拍摄的图像,所述对象包括司机和/或乘客。In an optional implementation manner, the images to be processed include images captured in a vehicle cabin, and the objects include drivers and/or passengers.
关于图像处理装置中的各模块的处理流程、以及各模块之间的交互流程的描述可以参照上述图像处理方法实施例中的相关说明,这里不再详述。For the description of the processing flow of each module in the image processing device and the interaction flow between the modules, reference may be made to the relevant description in the above embodiment of the image processing method, which will not be described in detail here.
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。Those skilled in the art can understand that in the above method of specific implementation, the writing order of each step does not mean a strict execution order and constitutes any limitation on the implementation process. The specific execution order of each step should be based on its function and possible The inner logic is OK.
基于同一发明构思,本公开实施例中还提供了与检测方法对应的检测装置,由于本公开实施例中的检测装置解决问题的原理与本公开实施例上述检测方法相似,因此检测装置的实施可以参见检测方法的实施,重复之处不再赘述。Based on the same inventive concept, the embodiment of the disclosure also provides a detection device corresponding to the detection method. Since the principle of the detection device in the embodiment of the disclosure to solve the problem is similar to the above detection method of the embodiment of the disclosure, the implementation of the detection device can be Refer to the implementation of the detection method, and the repeated parts will not be repeated.
参照图5所示,为本公开实施例提供的一种检测装置的示意图,该检测装置包括:第二信息获取模块501、第三图像处理模块502和预警模块503;其中,Referring to FIG. 5 , it is a schematic diagram of a detection device provided by an embodiment of the present disclosure. The detection device includes: a second information acquisition module 501, a third image processing module 502, and an early warning module 503; wherein,
第二信息获取模块501,用于获取在车舱内拍摄的待处理图像以及所述待处理图像的前一帧图像对应的处理时长;其中,在对所述前一帧图像进行标记处理的情况下,所述处理时长为对所述前一帧图像进行目标格式转换,并在所述目标格式转换过程中进行标记处理对应的时长;在未对所述前一帧图像进行标记处理的情况下,所述处理时长为对所述前一帧图像进行所述目标格式转换对应的时长;The second information acquisition module 501 is used to acquire the image to be processed taken in the cabin and the processing duration corresponding to the previous frame image of the image to be processed; wherein, in the case of marking the previous frame image Next, the processing duration is the duration corresponding to performing target format conversion on the previous frame image and marking processing during the target format conversion process; if the previous frame image is not marked. , the processing duration is the duration corresponding to the target format conversion of the previous frame image;
第三图像处理模块502,用于对所述待处理图像进行第一格式转换,得到具有第一目标格式的第一目标图像;在所述处理时长未超过第一预设时长的情况下,通过对所述待处理图像进行标记处理得到第一对象标记信息,并将所述第一对象标记信息标记在所述第一目标图像上,得到第二目标图像;将所述第二目标图像转换为第三目标图像,并进行展示;The third image processing module 502 is configured to perform first format conversion on the image to be processed to obtain a first target image in the first target format; when the processing time does not exceed the first preset time length, by performing marking processing on the image to be processed to obtain first object marking information, and marking the first object marking information on the first target image to obtain a second target image; converting the second target image to The third target image, and display it;
预警模块503,用于基于展示的第三目标图像,对车辆的驾驶进行安全预警。The warning module 503 is configured to give a safety warning to the driving of the vehicle based on the displayed third target image.
关于检测装置中的各模块的处理流程、以及各模块之间的交互流程的描述可以参照上述检测方法实施例中的相关说明,这里不再详述。For the description of the processing flow of each module in the detection device and the interaction flow between the modules, reference may be made to the relevant description in the above embodiment of the detection method, which will not be described in detail here.
基于同一技术构思,本申请实施例还提供了一种计算机设备。参照图6所示,为本申请实施例提供的计算机设备的结构示意图,包括:Based on the same technical idea, the embodiment of the present application also provides a computer device. Referring to Figure 6, it is a schematic structural diagram of a computer device provided in the embodiment of the present application, including:
处理器61、存储器62和总线63。其中,存储器62存储有处理器61可执行的机器可读指令,处理器61用于执行存储器62中存储的机器可读指令,所述机器可读指令被处理器61执行时,处理器61执行下述步骤:S101:获取待处理图像,以及待处理图像的前一帧图像对应的处理时长;S102:对待处理图像进行第一格式转换,得到具有第一目标格式的第一目标图像;S103:在处理时长未超过第一预设时长的情况下,通过对待处理图像进行标记处理得到第一对象标记信息,并将第一对象标记信息标记在第一目标图像上,得到第二目标图像;S104:将第二目标图像转换为第三目标图像,并将第三目标图像发送到目标设备。 processor 61 , memory 62 and bus 63 . Wherein, the memory 62 stores machine-readable instructions executable by the processor 61, and the processor 61 is used to execute the machine-readable instructions stored in the memory 62. When the machine-readable instructions are executed by the processor 61, the processor 61 executes The following steps: S101: Acquire the image to be processed and the processing time corresponding to the previous frame image of the image to be processed; S102: Perform first format conversion on the image to be processed to obtain a first target image with the first target format; S103: If the processing duration does not exceed the first preset duration, the first object marking information is obtained by marking the image to be processed, and the first object marking information is marked on the first target image to obtain a second target image; S104 : Convert the second target image to the third target image and send the third target image to the target device.
上述存储器62包括内存621和外部存储器622;这里的内存621也称内存储器,用于暂时存放处理器61中的运算数据,以及与硬盘等外部存储器622交换的数据,处理器61通过内存621与外部存储器622进行数据交换,当计算机设备运行时,处理器61与存储器62之间通过总线63通信,使得处理器61在执行上述方法实施例中所提及的执行指令。Above-mentioned memory 62 comprises memory 621 and external memory 622; Memory 621 here is also called internal memory, is used for temporarily storing the operation data in processor 61, and the data exchanged with external memory 622 such as hard disk, processor 61 communicates with memory 621 through memory 621. The external memory 622 performs data exchange. When the computer device is running, the processor 61 communicates with the memory 62 through the bus 63, so that the processor 61 executes the execution instructions mentioned in the above method embodiments.
本公开实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述方法实施例中所述的图像处理方法的步骤。其中,该存储介质可以是易失性或非易失的计算机可读取存储介质。Embodiments of the present disclosure further provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is run by a processor, the steps of the image processing method described in the foregoing method embodiments are executed. Wherein, the storage medium may be a volatile or non-volatile computer-readable storage medium.
本公开实施例还提供一种计算机程序产品,包括计算机指令,所述计算机指令被处理器执行时实现上述的图像处理方法的步骤。其中,计算机程序产品可以是任何能实现上述图像处理方法的产品,该计算机程序产品做出贡献的部分或全部方案可以以软件 产品(例如软件开发包(Software Development Kit,SDK))的形式体现,该软件产品可以被存储在一个存储介质中,通过包含的计算机指令使得相关设备或处理器执行上述图像处理方法的部分或全部步骤。An embodiment of the present disclosure further provides a computer program product, including computer instructions, and when the computer instructions are executed by a processor, the steps of the above-mentioned image processing method are implemented. Wherein, the computer program product may be any product capable of implementing the above-mentioned image processing method, and part or all of the solutions contributed by the computer program product may be embodied in the form of software products (such as software development kits (Software Development Kit, SDK)), The software product may be stored in a storage medium, and the computer instructions contained therein cause a relevant device or processor to execute some or all steps of the above-mentioned image processing method.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。在本公开所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,又例如,多个模块或组件可以结合,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些通信接口,装置或模块的间接耦合或通信连接,可以是电性,机械或其它的形式。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the device described above can refer to the corresponding process in the foregoing method embodiment, and details are not repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed devices and methods may be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of the modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules or components can be combined. Or some features can be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces, and the indirect coupling or communication connection of devices or modules may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。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 may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本公开各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。In addition, each functional module in each embodiment of the present disclosure may be integrated into one processing module, each module may exist separately physically, or two or more modules may be integrated into one module.
所述功能如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个处理器可执行的非易失的计算机可读取存储介质中。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium executable by a processor. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present disclosure. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disc and other media that can store program codes. .
最后应说明的是:以上所述实施例,仅为本公开的具体实施方式,用以说明本公开的技术方案,而非对其限制,本公开的保护范围并不局限于此,尽管参照前述实施例对本公开进行了详细的说明,本领域的普通技术人员应当理解:任何熟悉本技术领域的技术人员在本公开揭露的技术范围内,其依然可以对前述实施例所记载的技术方案进行修改或可轻易想到变化,或者对其中部分技术特征进行等同替换;而这些修改、变化或者替换,并不使相应技术方案的本质脱离本公开实施例技术方案的精神和范围,都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应所述以权利要求的保护范围为准。Finally, it should be noted that: the above-mentioned embodiments are only specific implementations of the present disclosure, and are used to illustrate the technical solutions of the present disclosure, rather than limit them, and the protection scope of the present disclosure is not limited thereto, although referring to the aforementioned The embodiments have described the present disclosure in detail, and those skilled in the art should understand that any person familiar with the technical field can still modify the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present disclosure Changes can be easily imagined, or equivalent replacements can be made to some of the technical features; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in this disclosure. within the scope of protection. Therefore, the protection scope of the present disclosure should be defined by the protection scope of the claims.

Claims (14)

  1. 一种图像处理方法,其特征在于,应用于ARM开发板,包括:An image processing method is characterized in that being applied to an ARM development board, comprising:
    获取待处理图像,以及所述待处理图像的前一帧图像对应的处理时长;其中,在对所述前一帧图像进行标记处理的情况下,所述处理时长为对所述前一帧图像进行目标格式转换、并在所述目标格式转换过程中进行标记处理对应的时长;在未对所述前一帧图像进行标记处理的情况下,所述处理时长为对所述前一帧图像进行所述目标格式转换对应的时长;Acquiring the image to be processed, and the processing duration corresponding to the previous frame image of the image to be processed; wherein, in the case of marking the previous frame image, the processing duration is for the previous frame image Perform target format conversion and perform marking processing corresponding to the target format conversion process; in the case that the previous frame image is not marked, the processing time is the previous frame image The duration corresponding to the conversion of the target format;
    对所述待处理图像进行第一格式转换,得到具有第一目标格式的第一目标图像;performing a first format conversion on the image to be processed to obtain a first target image having a first target format;
    在所述处理时长未超过第一预设时长的情况下通过对所述待处理图像进行标记处理得到第一对象标记信息,并将所述第一对象标记信息标记在所述第一目标图像上,得到第二目标图像;When the processing duration does not exceed a first preset duration, first object marking information is obtained by performing marking processing on the image to be processed, and marking the first object marking information on the first target image , get the second target image;
    将所述第二目标图像转换为第三目标图像,并将所述第三目标图像发送到目标设备。The second target image is converted to a third target image, and the third target image is sent to a target device.
  2. 根据权利要求1所述的图像处理方法,其特征在于,所述将所述第二目标图像转换为第三目标图像,包括:The image processing method according to claim 1, wherein said converting the second target image into a third target image comprises:
    对所述第二目标图像进行第二格式转换,得到具有第二目标格式的第三目标图像;其中,所述第二目标格式为所述目标设备可显示的图像格式。performing second format conversion on the second target image to obtain a third target image in the second target format; wherein the second target format is an image format displayable by the target device.
  3. 根据权利要求1或2所述的图像处理方法,其特征在于,所述通过对所述待处理图像进行标记处理得到第一对象标记信息,包括:The image processing method according to claim 1 or 2, wherein the first object marking information obtained by marking the image to be processed comprises:
    在对所述待处理图像进行第一格式转换的过程中对所述待处理图像中的对象进行标记处理;Marking objects in the image to be processed during the first format conversion process of the image to be processed;
    在完成对所述待处理图像进行的所述第一格式转换得到所述第一目标图像时,响应于获取到对所述待处理图像中的对象进行标记处理得到的标记信息,将所述待处理图像中的对象的标记信息作为所述第一对象标记信息;When the first format conversion of the image to be processed is completed to obtain the first target image, in response to acquiring marking information obtained by marking objects in the image to be processed, converting the image to be processed into processing tagging information of objects in the image as the first object tagging information;
    在完成对所述待处理图像进行的所述第一格式转换得到所述第一目标图像时,响应于未获取到对所述待处理图像中的对象进行标记处理得到的标记信息,获取与所述待处理图像的拍摄时间差小于第二预设时长的历史图像中的对象的标记信息,并将所述历史图像中的对象的标记信息作为所述第一对象标记信息。When the conversion of the first format of the image to be processed is completed to obtain the first target image, in response to not obtaining the marking information obtained by marking the object in the image to be processed, acquiring the same as the first target image The mark information of the object in the historical image whose shooting time difference of the image to be processed is less than the second preset duration is used as the first object mark information.
  4. 根据权利要求1至3任一项所述的图像处理方法,其特征在于,所述方法还包括:The image processing method according to any one of claims 1 to 3, wherein the method further comprises:
    在所述处理时长超过所述第一预设时长的情况下,对所述第一目标图像进行第二格式转换,得到具有所述第二目标格式的第四目标图像;When the processing duration exceeds the first preset duration, performing second format conversion on the first target image to obtain a fourth target image having the second target format;
    将所述第四目标图像发送到所述目标设备。The fourth target image is sent to the target device.
  5. 根据权利要求1至4任一项所述的图像处理方法,其特征在于,所述方法还包括:The image processing method according to any one of claims 1 to 4, wherein the method further comprises:
    在所述处理时长未超过第一预设时长的情况下,In the case that the processing duration does not exceed the first preset duration,
    按照第二预设优先级为对象识别处理进程分配第一资源,并利用所述第一资源通过所述对象识别处理进程对所述待处理图像进行对象检测、对象识别、对象状态识别和对象属性识别中至少一项标记处理,以确定所述待处理图像中的对象的第一对象标记信息;Allocating a first resource to the object recognition processing process according to a second preset priority, and using the first resource to perform object detection, object recognition, object state recognition and object attribute on the image to be processed through the object recognition processing process identifying at least one labeling process to determine first object labeling information for an object in said image to be processed;
    按照第一预设优先级,为图像处理进程分配第二资源,并利用所述第二资源通过所述图像处理进程对所述待处理图像进行第一格式转换和第二格式转换中的至少一项;其中,所述第一预设优先级高于所述第二预设优先级。Allocating a second resource to the image processing process according to the first preset priority, and using the second resource to perform at least one of the first format conversion and the second format conversion on the image to be processed through the image processing process item; wherein, the first preset priority is higher than the second preset priority.
  6. 根据权利要求1所述的图像处理方法,其特征在于,所述对所述待处理图像进行第一格式转换,得到具有第一目标格式的第一目标图像,包括:The image processing method according to claim 1, wherein said converting the image to be processed into a first format to obtain a first target image with a first target format comprises:
    获取所述待处理图像的第一颜色编码信息;所述第一颜色编码信息中包括多个第一亮度信息和多组第一色彩信息,所述待处理图像中每个像素点对应一个第一亮度信息, 至少一个第一亮度信息对应一组第一色彩信息;Acquiring first color coding information of the image to be processed; the first color coding information includes a plurality of first brightness information and multiple sets of first color information, and each pixel in the image to be processed corresponds to a first Brightness information, at least one piece of first brightness information corresponds to a set of first color information;
    基于所述第一颜色编码信息的第一排序顺序,并行提取多个第一亮度信息,得到第一信息序列,以及,基于所述第一颜色编码信息的第一排序顺序,并行提取多组第一色彩信息,得到第二信息序列;Based on the first sorting order of the first color coding information, extracting a plurality of first brightness information in parallel to obtain a first information sequence, and, based on the first sorting order of the first color coding information, extracting multiple sets of first brightness information in parallel a color information to obtain a second information sequence;
    基于一组第一色彩信息对应的第一亮度信息的第一数量、所述第二信息序列和所述第一信息序列,确定每个像素点对应的颜色编码子信息;Determine the color coding sub-information corresponding to each pixel based on the first quantity of the first brightness information corresponding to a set of first color information, the second information sequence, and the first information sequence;
    基于所述待处理图像中每个像素点对应的颜色编码子信息,得到具有所述第一目标格式的第一目标图像。Based on the color-coded sub-information corresponding to each pixel in the image to be processed, a first target image in the first target format is obtained.
  7. 根据权利要求2所述的图像处理方法,其特征在于,所述第二目标格式对应第二颜色编码信息;所述第二颜色编码信息中包括第二亮度信息和第二色彩信息;所述第三目标图像中每个像素点对应一个第二亮度信息,至少一个第二亮度信息对应一组第二色彩信息;The image processing method according to claim 2, wherein the second target format corresponds to second color coding information; the second color coding information includes second brightness information and second color information; Each pixel in the three target images corresponds to a second brightness information, and at least one second brightness information corresponds to a set of second color information;
    所述对所述第二目标图像进行第二格式转换,得到具有第二目标格式的第三目标图像,包括:The converting the second target image to the second format to obtain a third target image with the second target format includes:
    获取所述第二目标图像中每个像素点对应的第三颜色编码信息;Acquiring third color coding information corresponding to each pixel in the second target image;
    基于所述第三颜色编码信息,并行计算,得到所述第三目标图像中每个像素点对应的第二亮度信息;Obtaining second brightness information corresponding to each pixel in the third target image through parallel calculation based on the third color coding information;
    基于一组所述第二色彩信息对应的第二亮度信息的第二数量和所述第三颜色编码信息,并行计算,得到所述第三目标图像中每个像素点对应的第二色彩信息;Based on a set of second quantities of second brightness information corresponding to the second color information and the third color coding information, perform parallel calculations to obtain second color information corresponding to each pixel in the third target image;
    基于所述第三目标图像中每个像素点对应的第二亮度信息和第二色彩信息,得到具有所述第二目标格式的第三目标图像。A third target image with the second target format is obtained based on the second brightness information and second color information corresponding to each pixel in the third target image.
  8. 根据权利要求1至7任一项所述的图像处理方法,其特征在于,所述第一对象标记信息包括对象的检测框信息、对象的身份标识符、所述对象的状态特征信息、所述对象的属性特征信息中的至少一种。The image processing method according to any one of claims 1 to 7, wherein the first object marking information includes detection frame information of the object, an identity identifier of the object, state feature information of the object, the At least one of the attribute feature information of the object.
  9. 根据权利要求1至8任一项所述的图像处理方法,其特征在于,所述待处理图像包括在车舱内拍摄的图像,所述对象包括驾驶员和/或乘客。The image processing method according to any one of claims 1 to 8, characterized in that the image to be processed includes an image taken in a vehicle cabin, and the object includes a driver and/or a passenger.
  10. 一种检测方法,其特征在于,包括:A detection method, characterized in that, comprising:
    获取在车舱内拍摄的待处理图像以及所述待处理图像的前一帧图像对应的处理时长;其中,在对所述前一帧图像进行标记处理的情况下,所述处理时长为对所述前一帧图像进行目标格式转换,并在所述目标格式转换过程中进行标记处理对应的时长;在未对所述前一帧图像进行标记处理的情况下,所述处理时长为对所述前一帧图像进行所述目标格式转换对应的时长;Acquiring the processing duration corresponding to the image to be processed taken in the cabin and the previous frame image of the image to be processed; wherein, in the case of marking the previous frame image, the processing duration is The target format conversion of the previous frame image, and the duration corresponding to the marking process during the target format conversion process; if the marking process is not performed on the previous frame image, the processing duration is for the The duration corresponding to the conversion of the target format of the previous frame image;
    对所述待处理图像进行第一格式转换,得到具有第一目标格式的第一目标图像;performing a first format conversion on the image to be processed to obtain a first target image having a first target format;
    在所述处理时长未超过第一预设时长的情况下,通过对所述待处理图像进行标记处理得到第一对象标记信息,并将所述第一对象标记信息标记在所述第一目标图像上,得到第二目标图像;If the processing duration does not exceed a first preset duration, first object marking information is obtained by marking the image to be processed, and marking the first object marking information on the first target image On, get the second target image;
    将所述第二目标图像转换为第三目标图像,并进行展示;converting the second target image into a third target image and displaying it;
    基于展示的第三目标图像,对车辆的驾驶进行安全预警。Based on the displayed image of the third target, a safety warning is given to the driving of the vehicle.
  11. 一种图像处理装置,其特征在于,包括:An image processing device, characterized in that it comprises:
    第一信息获取模块,用于获取待处理图像,以及所述待处理图像的前一帧图像对应的处理时长;其中,在对所述前一帧图像进行标记处理的情况下,所述处理时长为对所述前一帧图像进行目标格式转换,并在所述目标格式转换过程中进行标记处理对应的时长;在未对所述前一帧图像进行标记处理的情况下,所述处理时长为对所述前一帧图像进行所述目标格式转换对应的时长;The first information acquisition module is used to acquire the image to be processed, and the processing duration corresponding to the previous frame image of the image to be processed; wherein, in the case of marking the previous frame image, the processing duration In order to perform target format conversion on the previous frame image, and perform marking processing corresponding to the duration during the target format conversion process; in the case that the previous frame image is not marked, the processing duration is Performing the duration corresponding to the target format conversion on the previous frame image;
    图像转换模块,用于对所述待处理图像进行第一格式转换,得到具有第一目标格式的第一目标图像;An image conversion module, configured to convert the image to be processed into a first format to obtain a first target image in a first target format;
    图像标记模块,用于在所述处理时长未超过第一预设时长的情况下,通过对所述待处理图像进行标记处理得到第一对象标记信息,并将所述第一对象标记信息标记在所述第一目标图像上,得到第二目标图像;An image marking module, configured to obtain first object marking information by performing marking processing on the image to be processed when the processing time does not exceed a first preset time length, and mark the first object marking information in Obtaining a second target image on the first target image;
    第一图像处理模块,用于将所述第二目标图像转换为第三目标图像,并将所述第三目标图像发送到目标设备。A first image processing module, configured to convert the second target image into a third target image, and send the third target image to the target device.
  12. 一种检测装置,其特征在于,包括:A detection device is characterized in that it comprises:
    第二信息获取模块,用于获取在车舱内拍摄的待处理图像以及所述待处理图像的前一帧图像对应的处理时长;其中,在对所述前一帧图像进行标记处理的情况下,所述处理时长为对所述前一帧图像进行目标格式转换,并在所述目标格式转换过程中进行标记处理对应的时长;在未对所述前一帧图像进行标记处理的情况下,所述处理时长为对所述前一帧图像进行所述目标格式转换对应的时长;The second information acquisition module is used to acquire the image to be processed taken in the cabin and the processing duration corresponding to the previous frame image of the image to be processed; wherein, in the case of marking the previous frame image , the processing duration is the duration corresponding to performing target format conversion on the previous frame image and marking processing during the target format conversion process; in the case of not performing marking processing on the previous frame image, The processing duration is the duration corresponding to the target format conversion of the previous frame image;
    第三图像处理模块,用于对所述待处理图像进行第一格式转换,得到具有第一目标格式的第一目标图像;在所述处理时长未超过第一预设时长的情况下,通过对所述待处理图像进行标记处理得到第一对象标记信息,并将所述第一对象标记信息标记在所述第一目标图像上,得到第二目标图像;将所述第二目标图像转换为第三目标图像,并进行展示;The third image processing module is configured to convert the image to be processed into a first format to obtain a first target image in the first target format; when the processing time does not exceed the first preset time length, by converting performing marking processing on the image to be processed to obtain first object marking information, and marking the first object marking information on the first target image to obtain a second target image; converting the second target image into a first target image Three target images and display them;
    预警模块,用于基于展示的第三目标图像,对车辆的驾驶进行安全预警。The early warning module is used to give a safety warning to the driving of the vehicle based on the displayed third target image.
  13. 一种计算机设备,其特征在于,包括:处理器、存储器和总线,所述存储器存储有所述处理器可执行的机器可读指令,当计算机设备运行时,所述处理器与所述存储器之间通过总线通信,所述机器可读指令被所述处理器执行时执行如权利要求1至9任一项所述的图像处理方法的步骤,或者,执行如权利要求10所述的检测方法的步骤。A computer device, characterized in that it includes: a processor, a memory, and a bus, the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the connection between the processor and the memory The machine-readable instructions are executed by the processor through the bus, and the steps of the image processing method according to any one of claims 1 to 9 are executed, or the steps of the detection method according to claim 10 are executed. step.
  14. 一种计算机可读存储介质,其特征在于,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行如权利要求1至9任一项所述的图像处理方法的步骤,或者,执行如权利要求10所述的检测方法的步骤。A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is run by a processor, the steps of the image processing method according to any one of claims 1 to 9 are executed , or, execute the steps of the detection method as claimed in claim 10.
PCT/CN2022/088545 2021-07-30 2022-04-22 Image processing WO2023005286A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110875661.9A CN113613071B (en) 2021-07-30 2021-07-30 Image processing method, device, computer equipment and storage medium
CN202110875661.9 2021-07-30

Publications (1)

Publication Number Publication Date
WO2023005286A1 true WO2023005286A1 (en) 2023-02-02

Family

ID=78306317

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/088545 WO2023005286A1 (en) 2021-07-30 2022-04-22 Image processing

Country Status (2)

Country Link
CN (1) CN113613071B (en)
WO (1) WO2023005286A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113613071B (en) * 2021-07-30 2023-10-20 上海商汤临港智能科技有限公司 Image processing method, device, computer equipment and storage medium
CN115661325A (en) * 2022-12-21 2023-01-31 麒麟软件有限公司 Method and system for optimizing texture format conversion based on NEON instruction

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109196865A (en) * 2017-03-27 2019-01-11 华为技术有限公司 A kind of data processing method and terminal
CN109886928A (en) * 2019-01-24 2019-06-14 平安科技(深圳)有限公司 A kind of target cell labeling method, device, storage medium and terminal device
WO2020001759A1 (en) * 2018-06-27 2020-01-02 Telefonaktiebolaget Lm Ericsson (Publ) Object tracking in real-time applications
CN110728210A (en) * 2019-09-25 2020-01-24 上海交通大学 Semi-supervised target labeling method and system for three-dimensional point cloud data
US20210158045A1 (en) * 2018-06-22 2021-05-27 Hewlett-Packard Development Company, L.P. Image markups
CN113613071A (en) * 2021-07-30 2021-11-05 上海商汤临港智能科技有限公司 Image processing method and device, computer equipment and storage medium

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4526674B2 (en) * 2000-09-19 2010-08-18 株式会社バンダイナムコゲームス GAME DEVICE AND INFORMATION STORAGE MEDIUM
JP3802521B2 (en) * 2003-09-02 2006-07-26 ソニー株式会社 Encoding apparatus, encoding control method, and encoding control program
JP4670631B2 (en) * 2005-12-26 2011-04-13 ソニー株式会社 Image processing apparatus, image processing method, program for image processing method, and recording medium recording program for image processing method
JP5652066B2 (en) * 2010-09-03 2015-01-14 ヤマハ株式会社 Movie compression control device, movie recording device, and movie recording / playback device
JP2013046190A (en) * 2011-08-24 2013-03-04 Riso Kagaku Corp Image processor
CN102868871B (en) * 2012-10-24 2015-03-25 广东威创视讯科技股份有限公司 Method and device for converting video image format
US20190020877A1 (en) * 2016-01-21 2019-01-17 Sony Corporation Image processing apparatus and method
CN107967669B (en) * 2017-11-24 2022-08-09 腾讯科技(深圳)有限公司 Picture processing method and device, computer equipment and storage medium
CN109379624B (en) * 2018-11-27 2021-03-02 Oppo广东移动通信有限公司 Video processing method and device, electronic equipment and storage medium
CN111091091A (en) * 2019-12-16 2020-05-01 北京迈格威科技有限公司 Method, device and equipment for extracting target object re-identification features and storage medium
CN113111682A (en) * 2020-01-09 2021-07-13 阿里巴巴集团控股有限公司 Target object sensing method and device, sensing base station and sensing system
CN111343463A (en) * 2020-04-14 2020-06-26 北京都是科技有限公司 Image coding device and method and image coder
CN111949511A (en) * 2020-07-09 2020-11-17 厦门美柚股份有限公司 Application program pause processing method and device, terminal and storage medium
CN112040082B (en) * 2020-09-10 2021-05-14 广东新禾道信息科技有限公司 Image picture batch processing method and device, server and storage medium
CN112887510A (en) * 2021-01-19 2021-06-01 三一重工股份有限公司 Video playing method and system based on video detection

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109196865A (en) * 2017-03-27 2019-01-11 华为技术有限公司 A kind of data processing method and terminal
US20210158045A1 (en) * 2018-06-22 2021-05-27 Hewlett-Packard Development Company, L.P. Image markups
WO2020001759A1 (en) * 2018-06-27 2020-01-02 Telefonaktiebolaget Lm Ericsson (Publ) Object tracking in real-time applications
CN109886928A (en) * 2019-01-24 2019-06-14 平安科技(深圳)有限公司 A kind of target cell labeling method, device, storage medium and terminal device
CN110728210A (en) * 2019-09-25 2020-01-24 上海交通大学 Semi-supervised target labeling method and system for three-dimensional point cloud data
CN113613071A (en) * 2021-07-30 2021-11-05 上海商汤临港智能科技有限公司 Image processing method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN113613071B (en) 2023-10-20
CN113613071A (en) 2021-11-05

Similar Documents

Publication Publication Date Title
WO2023005286A1 (en) Image processing
US11871011B2 (en) Efficient lossless compression of captured raw image information systems and methods
CN108461061B (en) Display system and method for supplying data to display
JP2019517205A5 (en)
US8963944B2 (en) Method, apparatus and system to provide video data for buffering
CN107665128B (en) Image processing method, system, server and readable storage medium
CN105072353B (en) A kind of image decoding based on more GPU spells prosecutor method
JP2019511165A5 (en)
TWI550557B (en) Video data compression format
US20200302573A1 (en) Display method, display device, virtual reality display device, virtual reality device, and storage medium
CN113596581B (en) Image format conversion method, device, computer equipment and storage medium
US9076408B2 (en) Frame data shrinking method used in over-driving technology
CN113366427A (en) Electronic device and control method thereof
US20210097327A1 (en) Parallel histogram calculation with application to palette table derivation
US10140962B2 (en) Display unit, display panel and driving method thereof, and display device
CN107341835B (en) Image processing method, device, electronic equipment and computer readable storage medium
US11039153B2 (en) Efficient processing of translucent objects in video keying
CN110049379B (en) Video delay detection method and system
CN107948652B (en) Method and equipment for image conversion
CN105681800B (en) A kind of device and method that YUV420 quickly changes into rgb format
CN110572712A (en) decoding method and device
US11282168B2 (en) Image processing apparatus, image processing method, and program
CN102394053B (en) Method and device for displaying pure monochrome picture
CN105049929A (en) Method and device for video rendering
CN114339338B (en) Image custom rendering method based on vehicle-mounted video and storage medium

Legal Events

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

Ref document number: 22847904

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE