CN115118987B - Image data processing method, device, equipment and storage medium - Google Patents
Image data processing method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN115118987B CN115118987B CN202210493358.7A CN202210493358A CN115118987B CN 115118987 B CN115118987 B CN 115118987B CN 202210493358 A CN202210493358 A CN 202210493358A CN 115118987 B CN115118987 B CN 115118987B
- Authority
- CN
- China
- Prior art keywords
- image
- compressed
- pixel data
- original
- target
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 49
- 238000003860 storage Methods 0.000 title claims abstract description 34
- 238000000034 method Methods 0.000 claims abstract description 64
- 238000007906 compression Methods 0.000 claims abstract description 41
- 230000006835 compression Effects 0.000 claims abstract description 41
- 238000012545 processing Methods 0.000 claims description 44
- 230000002159 abnormal effect Effects 0.000 claims description 27
- 238000001514 detection method Methods 0.000 claims description 21
- 238000004364 calculation method Methods 0.000 claims description 5
- 238000004590 computer program Methods 0.000 claims description 5
- 230000005540 biological transmission Effects 0.000 abstract description 46
- 238000000605 extraction Methods 0.000 abstract description 8
- 238000005516 engineering process Methods 0.000 abstract description 5
- 238000013473 artificial intelligence Methods 0.000 abstract description 2
- 230000006837 decompression Effects 0.000 description 21
- 238000013144 data compression Methods 0.000 description 17
- 238000010586 diagram Methods 0.000 description 15
- 230000008569 process Effects 0.000 description 15
- 238000004891 communication Methods 0.000 description 10
- 238000004140 cleaning Methods 0.000 description 8
- 238000004422 calculation algorithm Methods 0.000 description 7
- 238000009826 distribution Methods 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000002474 experimental method Methods 0.000 description 3
- 238000012216 screening Methods 0.000 description 3
- 230000001174 ascending effect Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000003709 image segmentation Methods 0.000 description 2
- 238000007689 inspection Methods 0.000 description 2
- 229910000831 Steel Inorganic materials 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 238000005520 cutting process Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000007429 general method Methods 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002085 persistent effect Effects 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
- 239000010959 steel Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001629 suppression Effects 0.000 description 1
- 230000032258 transport Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/42—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods 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/182—Methods 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 pixel
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Image Processing (AREA)
Abstract
The application provides an image data processing method and a corresponding device. The embodiment of the application can be applied to various scenes such as cloud technology, artificial intelligence, intelligent traffic, auxiliary driving and the like. The method comprises the following steps: firstly, carrying out target recognition on the acquired first image data to generate an original target image containing a target object; and then compressing pixel values in the original target image to generate a compressed image. According to the image data processing method provided by the embodiment of the application, the invalid pixel value of the first image is reduced through target extraction; when the original target image is compressed, the number of pixels of the images before and after compression is not changed, so that lossless compression of the original target image is realized; the storage space of the compressed image is reduced by reducing the number of character occupation of the compressed pixel value, and meanwhile, the time of image transmission is reduced, and the efficiency of image transmission is improved.
Description
Technical Field
The present application relates to the field of image processing technologies, and in particular, to an image data processing method, apparatus, device, and storage medium.
Background
In logistics transportation, the container is a goods transportation container with high cost performance. In the transportation process of the container, firstly, a line scanning camera is required to be used for photographing the container, then, the photographed picture is uploaded to target equipment, and then, the container picture is processed through an algorithm deployed on the target equipment; for example: carrying out integrity inspection on the outer surface of the container through a detection algorithm deployed on target equipment, and timely processing the conditions of damage or dent and the like of the outer surface of the container by workers according to inspection results; and extracting the text information on the outer surface of the container through a text recognition algorithm deployed on the target equipment so as to judge whether the text information on the outer surface of the container meets the specification and the like.
The resolution ratio of the container picture obtained by the line scanning camera is higher, the size of the picture is larger, and the storage space occupied by the picture is larger; for example: the size of a single picture is 3500mm multiplied by 1500mm, the resolution ratio of the single picture reaches more than 500 ten thousand pixels, and the occupied storage space can reach 50MB. Because the picture occupies a large space, the problem of serious time consumption in the transmission process can be caused when a large number of taken container pictures are uploaded to the cloud.
Disclosure of Invention
The embodiment of the application provides an image data processing method and a related device, which realize lossless compression of an original image by not changing the number of pixels of the image before and after compression when the original image is compressed, reduce the storage space of the compressed image, reduce the time of image transmission and improve the efficiency of image transmission.
An aspect of the present application provides an image data processing method including:
Acquiring a first image;
Performing target object identification on the first image according to the target detection model to generate an original target image, wherein the original target image contains a target object, the original target image comprises K effective original pixel points, each effective original pixel point corresponds to one original pixel data, and K is an integer larger than 1;
Calculating the difference value between the maximum original pixel data and the minimum original pixel data in the K effective original pixel data;
if the difference value is larger than the threshold value, dividing the K effective original pixel data to obtain first compressed pixel data and second compressed pixel data corresponding to each effective original pixel data;
generating a first compressed image according to the K first compressed pixel data, and generating a second compressed image according to the K second compressed pixel data;
the first compressed image and the second compressed image are used for restoring the original target image; the first compressed image comprises K first compressed pixel points, and each first compressed pixel point corresponds to one first compressed pixel data; the second compressed image comprises K second compressed pixel points, and each second compressed pixel point corresponds to one piece of second compressed pixel data; the first compressed pixel data and the second compressed pixel data are characterized by adopting a first unsigned integer, the original pixel data are characterized by adopting a second unsigned integer, and the character occupation number of the second unsigned integer is larger than that of the first unsigned integer.
Another aspect of the present application provides an image data processing apparatus including:
the first image acquisition module is used for acquiring a first image;
The original target image generation module is used for carrying out target object identification on the first image according to the target detection model to generate an original target image, wherein the original target image comprises a target object, the original target image comprises K effective original pixel points, each effective original pixel point corresponds to one original pixel data, and K is an integer larger than 1;
the difference value calculation module is used for calculating the difference value between the maximum original pixel data and the minimum original pixel data in the K effective original pixel data;
The first compression module is used for dividing K effective original pixel data when the difference value is larger than a threshold value to obtain first compressed pixel data and second compressed pixel data corresponding to each effective original pixel data; generating a first compressed image according to the K first compressed pixel data, and generating a second compressed image according to the K second compressed pixel data;
the first compressed image and the second compressed image are used for restoring the original target image; the first compressed image comprises K first compressed pixel points, and each first compressed pixel point corresponds to one first compressed pixel data; the second compressed image comprises K second compressed pixel points, and each second compressed pixel point corresponds to one piece of second compressed pixel data; the first compressed pixel data and the second compressed pixel data are characterized by adopting a first unsigned integer, the original pixel data are characterized by adopting a second unsigned integer, and the character occupation number of the second unsigned integer is larger than that of the first unsigned integer.
In another implementation manner of the embodiment of the present application, the image data processing apparatus further includes:
And the first compressed image transmission module is used for sending the first compressed image and the second compressed image to the target device so that the target device can generate an original target image according to the first compressed image and the second compressed image.
In another implementation manner of the embodiment of the present application, the image data processing apparatus further includes:
The second compression module is used for subtracting the minimum original pixel data from the K effective original pixel data when the difference value is smaller than or equal to the threshold value to obtain third compressed pixel data corresponding to each effective original pixel data; generating a third compressed image from the K third compressed pixel data;
the third compressed image and the minimum original pixel data are used for restoring the original target image; the third compressed image comprises K third compressed pixel points, each third compressed pixel point corresponds to one third compressed pixel data, and the third compressed pixel data is characterized by adopting a first unsigned integer.
In another implementation manner of the embodiment of the present application, the image data processing apparatus further includes:
And the second compressed image transmission module is used for sending the third compressed image and the minimum original pixel data to the target equipment so that the target equipment can generate an original target image according to the third compressed image and the minimum original pixel data.
In another implementation manner of the embodiment of the present application, the original target image includes L original pixel points, and each original pixel point corresponds to a depth value; l is an integer greater than K;
The image data processing apparatus further includes:
The original target image segmentation module is used for segmenting an original target image to generate M target sub-images, wherein M is an integer greater than 1;
The depth value histogram generation module is used for generating a depth value histogram according to the depth values corresponding to all original pixel points in the target sub-image, wherein the depth value histogram is a statistical graph of the frequency of the pixel points corresponding to each depth value;
The data cleaning module is used for determining abnormal original pixel points in each target sub-image according to the depth value histogram; and respectively eliminating abnormal original pixel points in each target sub-image from the M target sub-images to obtain K effective original pixel points in the original target image.
In another implementation manner of the embodiment of the present application, the data cleaning module is further configured to:
acquiring the total number of original pixel points in the target sub-image;
calculating the number of effective original pixel points in the target sub-image according to the total number of the original pixel points in the target sub-image and the preset duty ratio of the effective original pixel points;
Determining a range interval of the effective depth value from the depth value histogram according to the number of the effective original pixel points in the target sub-image and the pixel point frequency corresponding to each depth value;
and determining the original pixel points which are not in the range interval as abnormal original pixel points.
In another implementation manner of the embodiment of the present application, the image data processing apparatus further includes:
The first decompression module is used for acquiring a fourth compressed image and a fifth compressed image, wherein the fourth compressed image comprises N fourth compressed pixel points, and each fourth compressed pixel point corresponds to one fourth compressed pixel data; the fifth compressed image comprises N fifth compressed pixel points, each fifth compressed pixel point corresponds to one fifth compressed pixel data, and N is an integer larger than 1;
multiplying the N fourth compressed pixel data with a threshold value to obtain N product values;
Performing addition operation according to the N fifth compressed pixel data and the N product values to obtain N first restored pixel data;
and generating a first target restored image according to the N first restored pixel data.
In another implementation manner of the embodiment of the present application, the image data processing apparatus further includes:
the second decompression module is used for acquiring a sixth compressed image and minimum original pixel data, wherein the sixth compressed image comprises N sixth compressed pixel points, each sixth compressed pixel point corresponds to one sixth compressed pixel data, and N is an integer larger than 1;
Performing addition operation according to the N sixth compressed pixel data and the minimum original pixel data to obtain N second restored pixel data;
And generating a second target restored image according to the N second restored pixel data.
Another aspect of the present application provides a computer apparatus comprising:
Memory, transceiver, processor, and bus system;
wherein the memory is used for storing programs;
The processor is used for executing programs in the memory, and the method comprises the steps of executing the aspects;
the bus system is used to connect the memory and the processor to communicate the memory and the processor.
Another aspect of the application provides a computer readable storage medium having instructions stored therein which, when run on a computer, cause the computer to perform the methods of the above aspects.
Another aspect of the application provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the methods provided in the above aspects.
From the above technical solutions, the embodiment of the present application has the following advantages:
The application provides an image data processing method and a corresponding device, wherein the method comprises the following steps: firstly, carrying out target recognition on the acquired first image data to generate an original target image containing a target object; and then compressing pixel values in the original target image to generate a compressed image. According to the image data processing method provided by the embodiment of the application, the invalid pixel value of the first image is reduced through target extraction; when the original target image is compressed, the number of pixels of the images before and after compression is not changed, so that lossless compression of the original target image is realized; the storage space of the compressed image is reduced by reducing the number of character occupation of the compressed pixel value, and meanwhile, the time of image transmission is reduced, and the efficiency of image transmission is improved.
Drawings
FIG. 1 is a schematic diagram illustrating an architecture of an image data processing system according to an embodiment of the present application;
FIG. 2 is a flowchart of an image data processing method according to an embodiment of the present application;
FIG. 3 is a flowchart of an image data processing method according to another embodiment of the present application;
FIG. 4 is a flowchart of an image data processing method according to another embodiment of the present application;
FIG. 5 is a flowchart of an image data processing method according to another embodiment of the present application;
FIG. 6 is a flowchart of an image data processing method according to another embodiment of the present application;
FIG. 7 is a flowchart of an image data processing method according to another embodiment of the present application;
FIG. 8 is a flowchart of an image data processing method according to another embodiment of the present application;
FIG. 9 is a flowchart of an image data processing method according to another embodiment of the present application;
FIG. 10 is a flowchart of a method for processing image data of a container according to an embodiment of the present application;
FIG. 11 is a schematic diagram of a target detection model for detecting a container according to an embodiment of the present application;
FIG. 12 is a schematic illustration of an original container image according to an embodiment of the present application, segmented in 4 equal divisions;
FIG. 13 is a schematic diagram of a histogram of depth values of an image of a container according to an embodiment of the present application;
FIG. 14 is a schematic diagram of an image data processing apparatus according to an embodiment of the present application;
FIG. 15 is a schematic diagram of an image data processing apparatus according to another embodiment of the present application;
FIG. 16 is a schematic diagram of an image data processing apparatus according to another embodiment of the present application;
FIG. 17 is a schematic diagram of an image data processing apparatus according to another embodiment of the present application;
FIG. 18 is a schematic diagram of an image data processing apparatus according to another embodiment of the present application;
FIG. 19 is a schematic view of an image data processing apparatus according to another embodiment of the present application;
FIG. 20 is a schematic diagram of an image data processing apparatus according to another embodiment of the present application;
fig. 21 is a schematic diagram of a server structure according to an embodiment of the present application.
Detailed Description
The embodiment of the application provides an image data processing method and a related device, which realize lossless compression of an original image, reduce the storage space of a compressed image, reduce the time of image transmission and improve the efficiency of image transmission.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented, for example, in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "includes" and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus.
The embodiment of the application can be applied to various scenes, including but not limited to cloud technology, artificial intelligence, intelligent transportation, auxiliary driving and the like.
It should be understood that a container is a cargo transportation container that is common in logistic transportation and is characterized by a relatively large volume. In the transportation process of the container, the container needs to be photographed, the photographed picture is uploaded to target equipment, whether the container has the conditions of surface damage, dent and the like or not is detected through an algorithm deployed on the target equipment, or identification information of the outer surface of the container is detected, so that whether the container meets the specification or not is judged, or attribute information such as length, width, height and the like of the container is obtained through text information of the outer surface of the container. At present, a vehicle passing through a container is photographed through line scanning cameras arranged on two sides of a road, the resolution ratio of a container picture obtained by photographing is high, the size of the picture is large, and the storage space occupied by the picture is large; for example: the size of a single picture is 3500mm multiplied by 1500mm, the resolution ratio of the single picture reaches more than 500 ten thousand pixels, and the occupied storage space can reach 50MB. Because the picture occupies a large space, the time consumption of the transmission process is serious when a large number of taken container pictures are uploaded to the target equipment.
The application can solve the problem that invalid pixels in an image are reduced through target extraction; when the image is compressed, the number of pixels of the image before and after compression is not changed, so that lossless compression is realized; and reducing the storage space of the compressed image by reducing the number of character occupation of the compressed pixel value, reducing the time of image transmission and improving the efficiency of image transmission. The image data processing method provided by the application can be deployed on a server, the server firstly acquires the image data to be processed, then carries out target extraction on the image data, then compresses the image after target extraction, and finally uploads the obtained compressed image to target equipment, and then the target equipment decompresses the received compressed image to obtain a decompressed image.
For ease of understanding, referring to fig. 1, fig. 1 is a diagram illustrating an application environment of an image data processing method according to an embodiment of the present application, and as shown in fig. 1, the image data processing method according to an embodiment of the present application is applied to an image data processing system. The image data processing system includes: photographing device, server and target device. The shooting device is a device for image acquisition, and may be a line scanning camera, a surface scanning camera, a mobile phone with a shooting function, a tablet computer, a smart watch, etc., but is not limited thereto. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, a content distribution network (Content Delivery Network, CDN), basic cloud computing services such as big data and an artificial intelligent platform. The target device may be, but is not limited to, a smart phone, tablet, notebook, desktop, smart box, smart watch, another server, etc. The photographing device and the server are directly or indirectly connected through wired or wireless communication, and embodiments of the present application are not limited herein. The server and the target device may be directly or indirectly connected through wired or wireless communication, and embodiments of the present application are not limited herein.
First, the photographing device performs image acquisition on an object passing through the photographing device to obtain a first image. Then, the photographing device transmits the acquired first image to the server. The server receives the first image, performs target recognition on the first image through the target detection model, and generates an original target image containing the target object. Next, the server calculates a difference value between the maximum original pixel data and the minimum original pixel data among K effective original pixel data in the original target image. If the difference value is larger than the threshold value, the server performs division operation on the K effective original pixel data to obtain first compressed pixel data and second compressed pixel data corresponding to each effective original pixel data. Then, the server generates a first compressed image from the K first compressed pixel data and generates a second compressed image from the K second compressed pixel data. Finally, the server sends the first compressed image and the second compressed image to the target device. The target device receives the first compressed image and the second compressed image, and restores the first compressed image and the second compressed image to obtain a restored image.
The image data processing method in the present application will be described from the perspective of the server. Referring to fig. 2, the image data processing method provided in the embodiment of the application includes: step S110 to step S150.
Specific:
s110, acquiring a first image.
It is understood that the first image is acquired by the photographing device and transmitted to the server. The method for acquiring the first image may be that the photographing device is connected to the server through a wired Communication manner or a wireless Communication manner, where the wireless Communication manner includes conventional bluetooth, bluetooth 4.0, zigBee, near Field Communication (NFC) NEAR FIELD, wireless network Communication technology (WIFI), and so on.
S120, carrying out target object recognition on the first image according to the target detection model, and generating an original target image.
The original target image comprises K effective original pixel points, each effective original pixel point corresponds to one original pixel data, and K is an integer larger than 1.
It should be noted that, the target detection model is a network structure based on a neural network, and the target object identification is performed on the first image through the target detection model. And screening out an image with the target object by adopting a non-maximum suppression method as an original target image, and providing a boundary box of the target object in the original target image. Illustrating: the target object is a container, the target detection model is a model for detecting the container, the target recognition model on the server processes a plurality of first images, and images containing the container are screened out to serve as original target images. The pixel points refer to the minimum unit of an image, and the image may be composed of a plurality of pixel points. Pixel data refers to pixel values, which are values given by a computer when the original target image is digitized.
It can be understood that the target detection model deployed on the server performs target recognition on the first image, and screens out an image containing the target object as an original target image.
S130, calculating a difference value between the maximum original pixel data and the minimum original pixel data in the K effective original pixel data.
It should be noted that, each effective pixel point in the original target image corresponds to one effective original pixel data, and K effective original pixel points correspond to K effective original pixel data.
It can be understood that the server screens out the original pixel data with the largest value and the original pixel data with the smallest value by traversing the effective pixel data corresponding to all the effective pixel points, and calculates the difference value between the largest original pixel data and the smallest original pixel data.
And S140, if the difference value is greater than the threshold value, dividing the K effective original pixel data to obtain first compressed pixel data and second compressed pixel data corresponding to each effective original pixel data.
The threshold value refers to a critical value. The division operation on the effective original pixel data means that the effective original pixel data is used as a dividend, the threshold value is used as a divisor, the obtained quotient value is used as first compressed pixel data, and the remainder is used as second compressed pixel data.
It can be understood that the K effective raw pixel data are divided to obtain K first compressed pixel data and K second compressed pixel data. Each effective original pixel data corresponds to a first compressed pixel data and a second compressed pixel data, and the effective original pixel data can be obtained by multiplying the first compressed pixel data, the second compressed pixel data and a threshold value.
S150, generating a first compressed image according to the K first compressed pixel data, and generating a second compressed image according to the K second compressed pixel data.
The first compressed image and the second compressed image are used for restoring the original target image; the first compressed image comprises K first compressed pixel points, and each first compressed pixel point corresponds to one first compressed pixel data; the second compressed image comprises K second compressed pixel points, and each second compressed pixel point corresponds to one piece of second compressed pixel data; the first compressed pixel data and the second compressed pixel data are characterized by adopting a first unsigned integer, the original pixel data are characterized by adopting a second unsigned integer, and the character occupation number of the second unsigned integer is larger than that of the first unsigned integer.
It should be noted that generating the first compressed image according to the K first compressed pixel data means that the first compressed pixel points corresponding to the K first compressed pixel data are formed into the first compressed image, and the positions of the first compressed pixel points corresponding to each first compressed pixel data are the same as the positions of the effective original pixel points corresponding to the effective original pixel data; generating a second compressed image according to the K second compressed pixel data means that second compressed pixel points corresponding to the K second compressed pixel data are formed into a second compressed image, and the positions of the second compressed pixel points corresponding to each two first compressed pixel data are the same as the positions of the effective original pixel points corresponding to the effective original pixel data; the original target image can be restored by the first compressed image and the second compressed image. Unsigned integer refers to the type of data in the computer, including uint4, uint8, uint16, and the like. The character occupation number of an unsigned integer is understood to be the size of the unsigned integer stored in the computer. The first unsigned integer is uint4 or uint8 and the second unsigned integer is uint16.
It can be understood that the first compressed image is generated by using the first compressed pixel points corresponding to the K first compressed pixel data, and the second compressed image is generated by using the second compressed pixel points corresponding to the K second compressed pixel data.
The embodiment of the application provides an image data processing method, which comprises the following steps: firstly, carrying out target recognition on the acquired first image data to generate an original target image containing a target object; and then compressing pixel values in the original target image to generate a compressed image. According to the image data processing method provided by the embodiment of the application, the invalid pixel value of the first image is reduced through target extraction; when the original target image is compressed, the number of pixels of the images before and after compression is not changed, so that lossless compression of the original target image is realized; the storage space of the compressed image is reduced by reducing the number of character occupation of the compressed pixel value, and meanwhile, the time of image transmission is reduced, and the efficiency of image transmission is improved.
In an optional embodiment of the image data processing method provided in the corresponding embodiment of fig. 2, referring to fig. 3, step S150 further includes: step S160; specific:
And S160, sending the first compressed image and the second compressed image to the target device so that the target device generates an original target image according to the first compressed image and the second compressed image.
It should be noted that the target device may be a device for restoring an original target image according to the first compressed image and the second compressed image, including but not limited to a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, another server, and the like.
Optionally, the server transmits the first compressed image and the second compressed image to the target device. The target device restores the original target image according to the first compressed image and the second compressed image, specifically:
The target device performs multiplication operation on K first compressed pixel data corresponding to K first compressed pixel points in the first compressed image and a threshold value to obtain K product values;
then, carrying out addition operation on K product values and K second compressed pixel data corresponding to K second compressed pixel points in the second compressed image to obtain K effective original pixel data;
and finally, generating an original target image according to K effective original pixel points corresponding to the K effective original pixel data.
According to the method provided by the embodiment of the application, the first compressed image and the second compressed image obtained after the original target image is compressed are sent to the target equipment, and the target equipment can restore the original target image according to the first compressed image and the second compressed image, so that lossless compression and decompression of image data are realized; the transmission time and the transmission channel required for transmitting the original target image are reduced by transmitting the first compressed image and the second compressed image, the image data transmission time is reduced on the premise of guaranteeing lossless compression, and the image data transmission rate is improved.
In an optional embodiment of the image data processing method provided in the corresponding embodiment of fig. 2, referring to fig. 4, the image data processing method further includes: step S240 to step S250; specifically:
S240, if the difference value is smaller than or equal to the threshold value, subtracting the minimum original pixel data from the K effective original pixel data to obtain third compressed pixel data corresponding to each effective original pixel data.
It will be appreciated that subtracting the minimum original pixel data from the K valid original pixel data yields K differences, and the K differences are used as the third compressed pixel data.
S250, generating a third compressed image according to the K third compressed pixel data.
The third compressed image and the minimum original pixel data are used for restoring the original target image; the third compressed image comprises K third compressed pixel points, each third compressed pixel point corresponds to one third compressed pixel data, and the third compressed pixel data is characterized by adopting a first unsigned integer.
It can be understood that K third compressed pixel points corresponding to the K third compressed pixel data are formed into a third compressed image.
The corresponding image data processing method of fig. 4 provides two image data compression methods: one is the method provided in step S140 to step S150, firstly, dividing the effective original pixel data in the original target image to obtain first compressed pixel data and second compressed pixel data, then generating a first compressed image according to the first compressed pixel data, and generating a second compressed image according to the second compressed pixel data, namely, compressing the original target image to obtain the first compressed image and the second compressed image; the other is the method provided in step S240 to step S250, wherein first, subtraction is performed on valid original pixel data in the original target image to obtain third compressed pixel data, and then a third compressed image is generated according to the third compressed pixel data. In the specific execution, one of the step S140 or the step S240 is selected to be executed according to the comparison result between the calculation result obtained in the step S130 and the threshold value.
The method provided in steps S140 to S150 is a general method, which can be adopted for all valid original pixel data in the original target image; while the method provided in steps S240 to S250 is an alternative method, the preferred method provided in steps S240 to S250 may be used only when the difference is smaller than the threshold.
According to the method provided by the embodiment of the application, effective original pixel data in an original target image is calculated by utilizing subtraction operation to obtain third compressed pixel data, and a third compressed image is generated through the third compressed pixel data, namely the original target image is compressed to obtain the third compressed image, the number of pixels of the images before and after compression is not changed, and lossless compression of the original target image is realized; the storage space of the compressed image is reduced by reducing the number of character occupation of the compressed pixel value, and meanwhile, the time of image transmission is reduced, and the efficiency of image transmission is improved.
In an alternative embodiment of the image data processing method provided in the corresponding embodiment of fig. 4, referring to fig. 5, the image data processing method further includes: step S260; specifically:
And S260, transmitting the third compressed image and the minimum original pixel data to the target device so that the target device generates an original target image according to the third compressed image and the minimum original pixel data.
It should be noted that the target device may be a device for restoring the original target image according to the third compressed image and the minimum original pixel data, including but not limited to a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, another server, etc.
Optionally, the server transmits the compressed image according to the third and minimum raw pixel data to the target device. The target device restores the original target image according to the third compressed image and the minimum original pixel data. Specifically:
The target device firstly carries out addition operation on K third compressed pixel data corresponding to the third compressed image and the minimum original pixel data to obtain K effective original pixel data;
and then, generating an original target image according to K effective original pixel points corresponding to the K effective original pixel data.
According to the method provided by the embodiment of the application, the third compressed image obtained by compressing the original target image and the minimum original pixel data are sent to the target equipment, and the target equipment can restore the original target image according to the third compressed image and the minimum original pixel data, so that lossless compression and decompression of the image data are realized; the transmission time required for transmitting the original target image and the occupied space of a transmission channel are reduced by transmitting the third compressed image and the minimum original pixel data, the image data transmission time is reduced on the premise of guaranteeing lossless compression, and the image data transmission rate is improved.
The steps S140 to S150 provide the method of converting the original target image into two compressed images for transmission, and the steps S240 to S250 provide the method of converting the original target image into one compressed image and the minimum original pixel data for transmission. Typically, the transmission of a compressed image and the smallest raw pixel data takes a relatively short time.
In an optional embodiment of the image data processing method provided in the corresponding embodiment of fig. 2 of the present application, the original target image includes L original pixel points, and each original pixel point corresponds to a depth value; l is an integer greater than K; referring to fig. 6, after step S120, the image data processing method further includes steps S1210 to S1240; specifically:
S1210, segmenting the original target image to generate M target sub-images, wherein M is an integer greater than 1.
It should be noted that the splitting of the original target image may be equal-split, and according to a large number of splitting experiments, the original target image is split into 4 parts according to an equal-split manner, so that the effect of eliminating the abnormal original pixels in step S1240 is optimal.
It can be understood that after the original target image is equally divided, M target sub-images with equal sizes are generated from the original target image, and the same number of all original pixel points in each target sub-image is satisfied.
S1220, generating a depth value histogram according to the depth values corresponding to all the original pixels in the target sub-image, wherein the depth value histogram is a statistical graph of the frequency of the pixels corresponding to each depth value.
It should be noted that the depth value may be understood as a distance between the target object and the photographing device, and according to an imaging principle of the line scanning camera, it is known that each pixel point in the image obtained by photographing the line scanning camera corresponds to a depth value. Different original pixel points with the same corresponding depth value exist in the target sub-image, and a depth value histogram is generated according to all the depth values and the frequency of the pixel points corresponding to each depth value; the abscissa of the depth histogram represents the depth value, and the ordinate represents the frequency number of the pixel point corresponding to each depth value.
It can be appreciated that the depth value histogram is generated according to the depth values corresponding to all the original pixel points in the target sub-image, specifically:
N depth values corresponding to L original pixel points in the target sub-image are obtained, wherein N is an integer greater than 1 and is less than or equal to L;
The N depth values are arranged in ascending order, and the frequency of the pixel point corresponding to each depth value is counted;
and generating a depth value histogram according to the N depth values obtained by ascending order and the frequency of the pixel points corresponding to each depth value.
S1230, determining abnormal original pixel points in each target sub-image according to the depth value histogram.
It should be noted that the original pixel points are divided into abnormal original pixel points and effective original pixel points.
S1240, respectively eliminating abnormal original pixel points in each target sub-image from the M target sub-images to obtain K effective original pixel points in the original target image.
It should be noted that, in order to reduce the amount of calculation in step S130, the abnormal original pixel points need to be removed, and only the valid original pixel points remain.
It can be understood that the abnormal original pixel points in each target sub-image are removed, and M target sub-images from which the abnormal original pixel points are removed are combined to obtain K effective original pixel points in the original target image.
According to the method provided by the embodiment of the application, the effective original pixel points in the original target image are obtained by removing the abnormal original pixel points in the original target image, so that invalid data operation is reduced, and the compression time in the image data compression process is shortened; in the process of eliminating abnormal original pixel points in the original target image, the original target image is firstly segmented, and then the abnormal original pixel points are eliminated according to the data in the depth value histogram corresponding to all the original pixel points in each segmented target sub-image, so that the accuracy of data cleaning is improved.
In an alternative embodiment of the image data processing method provided in the corresponding embodiment of fig. 6, referring to fig. 7, step S1230 further includes steps S1231 to S1234; specifically:
s1231, obtaining the total number of original pixel points in the target sub-image.
S1232, calculating the number of effective original pixel points in the target sub-image according to the total number of the original pixel points in the target sub-image and the preset duty ratio of the effective original pixel points.
It should be noted that, the preset duty ratio of the effective original pixel point refers to the ratio of the effective original pixel point to the original pixel point in the original target image obtained through the experiment.
It can be understood that, for a certain target sub-image, the total number of original pixels in the target sub-image is obtained, and the number of effective original pixels in the target sub-image is calculated according to the preset duty ratio of the effective original pixels. For example, the number of original pixels in the original target image is 500 ten thousand, the original target image is segmented according to quartering, 4 target sub-images are obtained, the number of original pixels in each target sub-image is 125 ten thousand, the preset duty ratio of the effective original pixels is 99.99%, and the number of effective original pixels in the target sub-image can be 124.9875 ten thousand through calculation.
S1233, determining a range interval of the effective depth value from the depth value histogram according to the number of the effective original pixel points in the target sub-image and the frequency of the pixel points corresponding to each depth value.
It can be understood that, according to the number of effective original pixels in the target sub-image and the frequency of the pixels corresponding to each depth value, a range interval of the effective depth value is determined from the depth value histogram, specifically: and determining a depth value corresponding to the most frequency of the pixel points from the depth value histogram, taking the depth value as a center, screening the two sides at the same time until the frequency of the pixel points in the depth value range meets the number of effective original pixel points, and obtaining a range interval of the effective depth value from the screening result.
S1234, the original pixel point which is not in the range interval is determined as an abnormal original pixel point.
It should be noted that, the depth value data in the range interval of the effective depth value is effective depth value data, and the pixel point corresponding to the effective depth value data is effective original pixel point; the depth value data outside the range section of the effective depth value is invalid depth value data, and the pixel point corresponding to the invalid depth value data is an abnormal original pixel point.
According to the method provided by the embodiment of the application, whether the pixel points are effective pixel points or abnormal pixel points is judged according to the depth value corresponding to each original pixel point in the original target image, so that the accuracy of data cleaning is improved.
In an optional embodiment of the image data processing method provided in the corresponding embodiment of fig. 2, referring to fig. 8, the image data processing method further includes steps S310 to S340; specifically:
S310, acquiring a fourth compressed image and a fifth compressed image.
The fourth compressed image comprises N fourth compressed pixel points, and each fourth compressed pixel point corresponds to one fourth compressed pixel data; the fifth compressed image comprises N fifth compressed pixel points, each fifth compressed pixel point corresponds to one fifth compressed pixel data, and N is an integer larger than 1.
S320, multiplying the N fourth compressed pixel data with a threshold value to obtain N product values.
S330, performing addition operation according to the N fifth compressed pixel data and the N product values to obtain N first restored pixel data.
S340, generating a first target restored image according to the N first restored pixel data.
The server may compress the original target image and decompress the compressed image.
It can be understood that step S310 to step S340 are decompression methods corresponding to the compression methods of step S140 to step S150.
According to the method provided by the embodiment of the application, the fourth compressed image and the fifth compressed image after compression are restored to the first target restored image, the number of pixels is not changed in the decompression process, and lossless decompression is realized.
In an alternative embodiment of the image data processing method provided in the corresponding embodiment of fig. 2, referring to fig. 9, the image data processing method further includes steps S410 to S430; specifically:
s410, acquiring a sixth compressed image and minimum original pixel data.
The sixth compressed image includes N sixth compressed pixel points, each sixth compressed pixel point corresponds to one sixth compressed pixel data, and N is an integer greater than 1.
And S420, carrying out addition operation on the N sixth compressed pixel data and the minimum original pixel data to obtain N second restored pixel data.
S430, generating a second target restored image according to the N second restored pixel data.
It can be understood that steps S310 to S340 are decompression methods corresponding to the compression methods of steps S240 to S250.
According to the method provided by the embodiment of the application, the compressed sixth compressed image and the minimum original pixel data are restored to the second target restored image, the number of the pixel points is not changed in the decompression process, and lossless decompression is realized.
For easy understanding, an image processing scenario for a container picture will be described below with reference to fig. 10, where the container is a steel box standardized according to specifications, has uniform format and large volume, can be stacked layer by layer, is often used in the transportation logistics industry, and is a cargo transportation container with high cost performance. In general, a truck transports a container through a gate, and in order to obtain a high-precision container picture, a complete container is photographed at the same time, and a line scanning camera is often used for photographing. However, the width and height of the picture shot by the line scanning camera are large, for example 3500×1500, the storage space of the picture is also large, and the single picture can reach 50MB. The pictures of the line scanning camera are transmitted to the cloud end for the algorithm. Because the pictures occupy large space, the transmission process is time-consuming, so that the algorithm service is time-consuming, and the data transmission has become a bottleneck for restricting the whole algorithm service. The embodiment of the application aims to compress data of pictures generated by a line scanning camera so as to reduce time consumption in a data transmission process. Referring to fig. 10, fig. 10 is a flowchart of an image processing method applied to image data processing of a container according to an embodiment of the present application, including:
step 1: and detecting the container body.
Further, first, a first image to be processed is acquired as input data of a target detection network model of the container. Then, a target detection model is designed based on a deep learning network technology, target object identification is carried out on the first image through the target detection model, as shown in fig. 11, fig. 11 is a schematic diagram of the detection of the container by the target detection model, the detection of the container is rapidly completed by the target detection model, and the contour information of the container in the picture is given. The purpose of carrying out container detection and identification and extraction is as follows: by reducing the background area in the first image, only the effective original pixels of the container area are preserved, thereby reducing the amount of pixel data for image data compression.
Step 2: and (5) cutting the container image.
Further, as shown in fig. 12, fig. 12 is a schematic diagram of splitting an original container image in a 4-equal-division manner, because the distances between two ends of the container and the line scanning camera are often larger when the container passes through the line scanning camera, for example, a truck turns to pass through the line scanning camera, the depth value of a part close to the camera is larger, and the depth value of a part far away from the camera is smaller, so that the original container image needs to be split in a 4-equal-division manner, and the depth value distribution range of each split container image is smaller.
Step 3: and denoising the image.
Further, histogram statistics are performed on the depth value of each container image, as shown in fig. 13, and fig. 13 is a schematic diagram of the histogram of the depth value of the container image. The abscissa of the depth value histogram represents the depth value, and the ordinate represents the frequency number of the pixel point. As can be seen from the depth value histogram, the frequency of pixels having too large or too small a depth value is very small, and pixels having too large or too small a depth value are noise generated by the line scan camera. In order to compress image data on valid original pixel data corresponding to valid original pixel points in a range section of a valid depth value in a depth value histogram, noise interference needs to be reduced.
Step 4: image data compression and storage.
Further, according to the characteristics of effective original pixel data, the embodiment provided by the application adopts two different image data compression modes to compress data.
Image data compression scheme 1:
If the difference between the maximum value and the minimum value of the effective original pixel data of the container image is less than or equal to 255, the image data compression mode 1 is adopted, namely, the minimum pixel data of the sub-image is subtracted from all the effective original pixel data of the sub-image. The resulting difference data is represented using uint8, and the effective raw pixel data is not represented using uint 16. And storing the newly obtained data in a portable network graphics (Portable Network Graphics, png) format while preserving the minimum pixel data for this sub-image. Illustrating: if the effective original pixel data of the container image is distributed in 2000-2200, subtracting the minimum pixel data of the sub-image from all the effective original pixel data of the sub-image, namely 2000, the obtained compressed pixel data is distributed in the interval of 0-255, and then the uint16 of the storage type from the effective original pixel data is converted into uint8, so that the effective original pixel data is compressed in a lossless manner, and finally, the compressed pixel data is stored in a png format in a lossless manner, so that the final data compression is completed. The data decompression is the inverse process of the compression operation, firstly, the compressed pixel data of the uint8 is read in, firstly, the data type is converted into the uint16, then, the minimum original pixel data is added to all the compressed pixel data, the restored pixel data is obtained, and a restored image is generated according to the restored pixel data. Each raw pixel data is now error free from valid raw pixel data before decompression.
Image data compression scheme 2:
If the difference between the maximum and minimum values of the original pixel data of the container image is directly greater than 255, then image data compression mode 2 is employed, i.e., all of the original pixel data of the sub-image is divided by 255. And expressing the quotient data and the remainder data corresponding to each original pixel data by using a uid 8, and respectively storing in a png format. Illustrating: if the valid raw pixel data of the container image is distributed in 2000-2500, then all valid raw pixel data of the sub-image is divided by 255 to obtain quotient and remainder, the distribution range of the quotient is between 0-20, the distribution range of the remainder is between 0-255, and both the quotient and the remainder can be represented by using uint8 data types. After the division process, the container image generates 2 compressed images composed of quotient and compressed images composed of remainder, and finally, the two compressed images are saved by using png format. Experiments show that the picture formed by the quotient and the remainder occupies very little space. Data decompression is the inverse of the compression operation. Firstly, reading in a compressed image of a quotient and a compressed image of a remainder, multiplying 255 by each compressed pixel data in the compressed image of the quotient, and adding the compressed pixel data in the image of the remainder, so that the container image is restored without damage.
The method provided by the embodiment of the application can compress the effective part of the data, ignore the invalid information such as the background and the like, and reduce the time for compressing the invalid information; according to the characteristics of effective original pixel data, different compression modes are selected, and the storage space of the data is compressed as much as possible on the premise of guaranteeing lossless compression; both the image data compression method 1 and the image data compression method 2 aim to convert data distributed over a wide range into data ranging from 0 to 255, and further can use the data type of the uint8 and store the data in the lossless coding format of png. The image data compression method 1 differs from the image data compression method 2 in that the image data compression method 1 only needs to store one png data of 0 to 255 and one minimum original pixel data, which is optimal in terms of storage space; although the image data compression scheme 2 stores two png pictures of 0 to 255, the pixel data in the two pictures are respectively quotient and remainder, and their values are generally about 10, so that the png picture occupies very small space. It should be noted that both methods described above are lossless compression, i.e., after data recovery, there may be no error in pixel-by-pixel values with the original data.
The image data processing apparatus of the present application will be described in detail with reference to fig. 14. Fig. 14 is a schematic view of an embodiment of an image data processing apparatus 10 according to an embodiment of the present application, the image data processing apparatus 10 includes:
The first image acquisition module 110 is configured to acquire a first image.
The original target image generating module 120 is configured to perform target object recognition on the first image according to the target detection model, and generate an original target image.
The original target image comprises K effective original pixel points, each effective original pixel point corresponds to one original pixel data, and K is an integer larger than 1.
The difference calculating module 130 is configured to calculate a difference between the maximum original pixel data and the minimum original pixel data in the K effective original pixel data.
The first compression module 140 is configured to divide the K valid original pixel data to obtain first compressed pixel data and second compressed pixel data corresponding to each valid original pixel data when the difference is greater than the threshold; a first compressed image is generated from the K first compressed pixel data, and a second compressed image is generated from the K second compressed pixel data.
The first compressed image and the second compressed image are used for restoring the original target image; the first compressed image comprises K first compressed pixel points, and each first compressed pixel point corresponds to one first compressed pixel data; the second compressed image comprises K second compressed pixel points, and each second compressed pixel point corresponds to one piece of second compressed pixel data; the first compressed pixel data and the second compressed pixel data are characterized by adopting a first unsigned integer, the original pixel data are characterized by adopting a second unsigned integer, and the character occupation number of the second unsigned integer is larger than that of the first unsigned integer.
The embodiment of the application provides an image data processing device, which reduces invalid pixel values of a first image through target extraction; when the original target image is compressed, the number of pixels of the images before and after compression is not changed, so that lossless compression of the original target image is realized; the storage space of the compressed image is reduced by reducing the number of character occupation of the compressed pixel value, and meanwhile, the time of image transmission is reduced, and the efficiency of image transmission is improved.
In an alternative embodiment of the image data processing apparatus provided in the embodiment corresponding to fig. 14 of the present application, referring to fig. 15, the image data processing apparatus 10 further includes:
the first compressed image transmission module 160 is configured to send the first compressed image and the second compressed image to the target device, so that the target device generates an original target image according to the first compressed image and the second compressed image.
According to the device provided by the embodiment of the application, the first compressed image and the second compressed image obtained by compressing the original target image are sent to the target device, and the target device can restore the original target image according to the first compressed image and the second compressed image, so that lossless compression and decompression of image data are realized; the transmission time and the transmission channel required for transmitting the original target image are reduced by transmitting the first compressed image and the second compressed image, the image data transmission time is reduced on the premise of guaranteeing lossless compression, and the image data transmission rate is improved.
In another alternative embodiment of the image data processing apparatus provided in the embodiment corresponding to fig. 14 of the present application, referring to fig. 16, the image data processing apparatus 10 further includes:
The second compression module 240 is configured to subtract the minimum original pixel data from the K valid original pixel data to obtain third compressed pixel data corresponding to each valid original pixel data when the difference is less than or equal to the threshold; and generating a third compressed image according to the K third compressed pixel data.
The third compressed image and the minimum original pixel data are used for restoring the original target image; the third compressed image comprises K third compressed pixel points, each third compressed pixel point corresponds to one third compressed pixel data, and the third compressed pixel data is characterized by adopting a first unsigned integer.
According to the device provided by the embodiment of the application, the effective original pixel data in the original target image is calculated by utilizing subtraction operation to obtain the third compressed pixel data, and the third compressed image is generated through the third compressed pixel data, namely the third compressed image is obtained after the original target image is compressed, the number of pixels of the images before and after compression is not changed, and lossless compression of the original target image is realized; the storage space of the compressed image is reduced by reducing the number of character occupation of the compressed pixel value, and meanwhile, the time of image transmission is reduced, and the efficiency of image transmission is improved.
In another alternative embodiment of the image data processing apparatus provided in the embodiment corresponding to fig. 16 of the present application, referring to fig. 17, the image data processing apparatus 10 further includes:
The second compressed image transmission module 260 is configured to send the third compressed image and the minimum original pixel data to the target device, so that the target device generates the original target image according to the third compressed image and the minimum original pixel data.
According to the device provided by the embodiment of the application, the third compressed image obtained by compressing the original target image and the minimum original pixel data are sent to the target equipment, and the target equipment can restore the original target image according to the third compressed image and the minimum original pixel data, so that lossless compression and decompression of the image data are realized; the transmission time and the transmission channel required for transmitting the original target image are reduced by transmitting the third compressed image and the minimum original pixel data, the image data transmission time is reduced on the premise of guaranteeing lossless compression, and the image data transmission rate is improved.
In another optional embodiment of the image data processing apparatus provided in the embodiment corresponding to fig. 14 of the present application, the original target image includes L original pixel points, and each original pixel point corresponds to a depth value; l is an integer greater than K; referring to fig. 18, the image data processing apparatus 10 further includes:
the original target image segmentation module 1210 is configured to segment the original target image to generate M target sub-images, where M is an integer greater than 1.
The depth value histogram generation module 1220 is configured to generate a depth value histogram according to the depth values corresponding to all the original pixels in the target sub-image, where the depth value histogram is a statistical graph of the frequency of the pixels corresponding to each depth value.
The data cleaning module 1230 is configured to determine an abnormal original pixel point in each target sub-image according to the depth value histogram; and respectively eliminating abnormal original pixel points in each target sub-image from the M target sub-images to obtain K effective original pixel points in the original target image.
According to the device provided by the embodiment of the application, the effective original pixel points in the original target image are obtained by removing the abnormal original pixel points in the original target image, so that invalid data operation is reduced, and the compression time in the image data compression process is shortened; in the process of eliminating abnormal original pixel points in the original target image, the original target image is firstly segmented, and then the abnormal original pixel points are eliminated according to the data in the depth value histogram corresponding to all the original pixel points in each segmented target sub-image, so that the accuracy of data cleaning is improved.
In an alternative embodiment of the image data processing apparatus provided in the corresponding embodiment of fig. 18 of the present application, the data cleaning module 1230 is further configured to: acquiring the total number of original pixel points in the target sub-image; calculating the number of effective original pixel points in the target sub-image according to the total number of the original pixel points in the target sub-image and the preset duty ratio of the effective original pixel points; determining a range interval of the effective depth value from the depth value histogram according to the number of the effective original pixel points in the target sub-image and the pixel point frequency corresponding to each depth value; and determining the original pixel points which are not in the range interval as abnormal original pixel points.
According to the device provided by the embodiment of the application, whether the pixel points are effective pixel points or abnormal pixel points is judged according to the depth value corresponding to each original pixel point in the original target image, so that the accuracy of data cleaning is improved.
In an alternative embodiment of the image data processing apparatus provided in the embodiment corresponding to fig. 14 of the present application, referring to fig. 19, the image data processing apparatus 10 further includes:
A first decompression module 310 for acquiring a fourth compressed image and a fifth compressed image; multiplying the N fourth compressed pixel data with a threshold value to obtain N product values; performing addition operation according to the N fifth compressed pixel data and the N product values to obtain N first restored pixel data; and generating a first target restored image according to the N first restored pixel data.
The fourth compressed image comprises N fourth compressed pixel points, and each fourth compressed pixel point corresponds to one fourth compressed pixel data; the fifth compressed image comprises N fifth compressed pixel points, each fifth compressed pixel point corresponds to one fifth compressed pixel data, and N is an integer larger than 1.
According to the device provided by the embodiment of the application, the fourth compressed image and the fifth compressed image after compression are restored to the first target restored image, the number of pixels is not changed in the decompression process, and lossless decompression is realized.
In an alternative embodiment of the image data processing apparatus provided in the embodiment corresponding to fig. 14 of the present application, referring to fig. 20, the image data processing apparatus 10 further includes:
A second decompression module 410, configured to acquire a sixth compressed image and minimum original pixel data; performing addition operation according to the N sixth compressed pixel data and the minimum original pixel data to obtain N second restored pixel data; and generating a second target restored image according to the N second restored pixel data.
The sixth compressed image comprises N sixth compressed pixel points, each sixth compressed pixel point corresponds to one sixth compressed pixel data, and N is an integer larger than 1;
according to the device provided by the embodiment of the application, the compressed sixth compressed image and the minimum original pixel data are restored to the second target restored image, the number of the pixel points is not changed in the decompression process, and lossless decompression is realized.
Fig. 21 is a schematic diagram of a server structure provided in an embodiment of the present application, where the server 300 may vary considerably in configuration or performance, and may include one or more central processing units (central processing units, CPU) 322 (e.g., one or more processors) and memory 332, one or more storage mediums 330 (e.g., one or more mass storage devices) storing applications 342 or data 344. Wherein the memory 332 and the storage medium 330 may be transitory or persistent. The program stored on the storage medium 330 may include one or more modules (not shown), each of which may include a series of instruction operations on a server. Still further, the central processor 322 may be configured to communicate with the storage medium 330 and execute a series of instruction operations in the storage medium 330 on the server 300.
The Server 300 may also include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input/output interfaces 358, and/or one or more operating systems 341, such as Windows Server TM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM, or the like.
The steps performed by the server in the above embodiments may be based on the server structure shown in fig. 15.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of elements is merely a logical functional division, and there may be additional divisions of actual implementation, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims (12)
1. An image data processing method, comprising:
Acquiring a first image;
Performing target object identification on the first image according to a target detection model to generate an original target image, wherein the original target image comprises the target object, the original target image comprises K effective original pixel points, each effective original pixel point corresponds to one original pixel data, and K is an integer larger than 1;
Calculating the difference value between the maximum original pixel data and the minimum original pixel data in the K effective original pixel data;
If the difference value is greater than a threshold value, performing division operation on the K effective original pixel data to obtain first compressed pixel data and second compressed pixel data corresponding to each effective original pixel data, wherein the division operation refers to operation of taking the effective original pixel data as a dividend and taking the threshold value as a divisor, the first compressed pixel data is a quotient value obtained after the division operation, and the second compressed pixel data is a remainder obtained after the division operation;
Generating a first compressed image according to the K first compressed pixel data, and generating a second compressed image according to the K second compressed pixel data;
Wherein the first compressed image and the second compressed image are used for restoring the original target image; the first compressed image comprises K first compressed pixel points, and each first compressed pixel point corresponds to one first compressed pixel data; the second compressed image comprises K second compressed pixel points, and each second compressed pixel point corresponds to one piece of second compressed pixel data; the first compressed pixel data and the second compressed pixel data are characterized by adopting a first unsigned integer, the original pixel data are characterized by adopting a second unsigned integer, and the character occupation number of the second unsigned integer is larger than that of the first unsigned integer.
2. The image data processing method according to claim 1, wherein after the first compressed image is generated from K pieces of the first compressed pixel data and the second compressed image is generated from K pieces of the second compressed pixel data, the method further comprises:
And sending the first compressed image and the second compressed image to a target device so that the target device generates the original target image according to the first compressed image and the second compressed image.
3. The image data processing method according to claim 1, wherein after calculating a difference between a largest original pixel data and a smallest original pixel data among the K valid original pixel data, the method further comprises:
if the difference value is smaller than or equal to the threshold value, subtracting the minimum original pixel data from K effective original pixel data to obtain third compressed pixel data corresponding to each effective original pixel data;
Generating a third compressed image from the K third compressed pixel data;
Wherein the third compressed image and the minimum original pixel data are used to restore the original target image; the third compressed image comprises K third compressed pixel points, each third compressed pixel point corresponds to one third compressed pixel data, and the third compressed pixel data is characterized by adopting the first unsigned integer.
4. A method of processing image data according to claim 3, wherein after said generating a third compressed image from K of said third compressed pixel data, said method further comprises:
And sending the third compressed image and the minimum original pixel data to a target device, so that the target device generates the original target image according to the third compressed image and the minimum original pixel data.
5. The image data processing method according to claim 1, wherein the original target image includes L original pixels, each of which corresponds to a depth value; l is an integer greater than K;
After the original target image is generated, the method further comprises the following steps:
splitting the original target image to generate M target sub-images, wherein M is an integer greater than 1;
generating a depth value histogram according to the depth values corresponding to all original pixel points in the target sub-image, wherein the depth value histogram is a statistical graph of the frequency of the pixel points corresponding to each depth value;
determining abnormal original pixel points in each target sub-image according to the depth value histogram;
And respectively eliminating the abnormal original pixel points in each target sub-image from the M target sub-images to obtain K effective original pixel points in the original target image.
6. The image data processing method as claimed in claim 5, wherein the determining abnormal original pixels in each target sub-image based on the depth value histogram includes:
acquiring the total number of original pixel points in the target sub-image;
Calculating the number of effective original pixel points in the target sub-image according to the total number of the original pixel points in the target sub-image and the preset duty ratio of the effective original pixel points;
Determining a range interval of an effective depth value from the depth value histogram according to the number of effective original pixel points in the target sub-image and the frequency of the pixel points corresponding to each depth value;
And determining the original pixel points which are not in the range interval as abnormal original pixel points.
7. The image data processing method according to claim 1, wherein the method further comprises:
Acquiring a fourth compressed image and a fifth compressed image, wherein the fourth compressed image comprises N fourth compressed pixel points, and each fourth compressed pixel point corresponds to one fourth compressed pixel data; the fifth compressed image comprises N fifth compressed pixel points, each fifth compressed pixel point corresponds to one fifth compressed pixel data, and N is an integer larger than 1;
multiplying the fourth compressed pixel data by the threshold value according to N pieces of the fourth compressed pixel data to obtain N product values;
Performing addition operation according to the N fifth compressed pixel data and the N product values to obtain N first restored pixel data;
and generating a first target restored image according to the N first restored pixel data.
8. The image data processing method according to claim 1, wherein the method further comprises:
Acquiring a sixth compressed image and the minimum original pixel data, wherein the sixth compressed image comprises N sixth compressed pixel points, each sixth compressed pixel point corresponds to one sixth compressed pixel data, and N is an integer greater than 1;
Performing addition operation according to the N sixth compressed pixel data and the minimum original pixel data to obtain N second restored pixel data;
And generating a second target restored image according to the N second restored pixel data.
9. An image data processing apparatus, comprising:
the first image acquisition module is used for acquiring a first image;
The original target image generation module is used for carrying out target object identification on the first image according to a target detection model to generate an original target image, wherein the original target image comprises the target object, the original target image comprises K effective original pixel points, each effective original pixel point corresponds to one original pixel data, and K is an integer larger than 1;
the difference value calculation module is used for calculating the difference value between the maximum original pixel data and the minimum original pixel data in the K effective original pixel data;
The first compression module is used for carrying out division operation on K effective original pixel data to obtain first compressed pixel data and second compressed pixel data corresponding to each effective original pixel data when the difference value is larger than a threshold value, wherein the division operation refers to operation of taking the effective original pixel data as a divisor and taking the threshold value as a divisor, the first compressed pixel data is a quotient obtained after the division operation, and the second compressed pixel data is a remainder obtained after the division operation; generating a first compressed image according to the K first compressed pixel data, and generating a second compressed image according to the K second compressed pixel data;
Wherein the first compressed image and the second compressed image are used for restoring the original target image; the first compressed image comprises K first compressed pixel points, and each first compressed pixel point corresponds to one first compressed pixel data; the second compressed image comprises K second compressed pixel points, and each second compressed pixel point corresponds to one piece of second compressed pixel data; the first compressed pixel data and the second compressed pixel data are characterized by adopting a first unsigned integer, the original pixel data are characterized by adopting a second unsigned integer, and the character occupation number of the second unsigned integer is larger than that of the first unsigned integer.
10. A computer device, comprising: memory, transceiver, processor, and bus system;
wherein the memory is used for storing programs;
The processor for executing a program in the memory, comprising executing the image data processing method according to any one of claims 1 to 8;
The bus system is used for connecting the memory and the processor so as to enable the memory and the processor to communicate.
11. A computer readable storage medium comprising instructions which, when run on a computer, cause the computer to perform the image data processing method of any of claims 1-8.
12. A computer program product comprising a computer program, characterized in that the computer program is executed by a processor for the image data processing method according to any of claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210493358.7A CN115118987B (en) | 2022-05-07 | 2022-05-07 | Image data processing method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210493358.7A CN115118987B (en) | 2022-05-07 | 2022-05-07 | Image data processing method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115118987A CN115118987A (en) | 2022-09-27 |
CN115118987B true CN115118987B (en) | 2024-05-31 |
Family
ID=83327413
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210493358.7A Active CN115118987B (en) | 2022-05-07 | 2022-05-07 | Image data processing method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115118987B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109379598A (en) * | 2018-09-12 | 2019-02-22 | 合肥埃科光电科技有限公司 | A kind of Lossless Image Compression Algorithm method realized based on FPGA |
CN112449195A (en) * | 2019-09-04 | 2021-03-05 | 阿里巴巴集团控股有限公司 | Method and device for compressing and decompressing image and image processing system |
CN112508793A (en) * | 2020-12-22 | 2021-03-16 | 深圳开立生物医疗科技股份有限公司 | Image scaling method and device, electronic equipment and storage medium |
-
2022
- 2022-05-07 CN CN202210493358.7A patent/CN115118987B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109379598A (en) * | 2018-09-12 | 2019-02-22 | 合肥埃科光电科技有限公司 | A kind of Lossless Image Compression Algorithm method realized based on FPGA |
CN112449195A (en) * | 2019-09-04 | 2021-03-05 | 阿里巴巴集团控股有限公司 | Method and device for compressing and decompressing image and image processing system |
CN112508793A (en) * | 2020-12-22 | 2021-03-16 | 深圳开立生物医疗科技股份有限公司 | Image scaling method and device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN115118987A (en) | 2022-09-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108038422B (en) | Camera device, face recognition method and computer-readable storage medium | |
CN109035319B (en) | Monocular image depth estimation method, monocular image depth estimation device, monocular image depth estimation apparatus, monocular image depth estimation program, and storage medium | |
US20230196837A1 (en) | Action recognition method and apparatus, and device and storage medium | |
CN108154222B (en) | Deep neural network training method and system and electronic equipment | |
Diana Andrushia et al. | Saliency-based image compression using Walsh–Hadamard transform (WHT) | |
CN116188805B (en) | Image content analysis method and device for massive images and image information network | |
WO2018002436A1 (en) | Method and apparatus for removing turbid objects in an image | |
US20150302270A1 (en) | A method of providing a feature descriptor for describing at least one feature of an object representation | |
CN114359665B (en) | Training method and device of full-task face recognition model and face recognition method | |
CN109783680B (en) | Image pushing method, image acquisition device and image processing system | |
CN106503112B (en) | Video retrieval method and device | |
Hung et al. | A fast algorithm of temporal median filter for background subtraction. | |
CN111767915A (en) | License plate detection method, device, equipment and storage medium | |
US20150043807A1 (en) | Depth image compression and decompression utilizing depth and amplitude data | |
CN113657370B (en) | Character recognition method and related equipment thereof | |
Lyu et al. | A GPU‐free real‐time object detection method for apron surveillance video based on quantized MobileNet‐SSD | |
CN114596374A (en) | Image compression method and device | |
CN115118987B (en) | Image data processing method, device, equipment and storage medium | |
CN113888635A (en) | Visual positioning method, related device and computer program product | |
CN113810654A (en) | Image video uploading method and device, storage medium and electronic equipment | |
CN111860557A (en) | Image processing method and device, electronic equipment and computer storage medium | |
US11551462B2 (en) | Document scanning system | |
CN110930287A (en) | Image steganography detection method and device, computer equipment and storage medium | |
CN111243046B (en) | Image quality detection method, device, electronic equipment and storage medium | |
CN110728173A (en) | Video transmission method and device based on target of interest significance detection |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |