CN106651972A - Binary image coding and decoding methods and devices - Google Patents

Binary image coding and decoding methods and devices Download PDF

Info

Publication number
CN106651972A
CN106651972A CN201510740338.5A CN201510740338A CN106651972A CN 106651972 A CN106651972 A CN 106651972A CN 201510740338 A CN201510740338 A CN 201510740338A CN 106651972 A CN106651972 A CN 106651972A
Authority
CN
China
Prior art keywords
pixel
value
image
default
coded data
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.)
Granted
Application number
CN201510740338.5A
Other languages
Chinese (zh)
Other versions
CN106651972B (en
Inventor
蔡巍伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201510740338.5A priority Critical patent/CN106651972B/en
Publication of CN106651972A publication Critical patent/CN106651972A/en
Application granted granted Critical
Publication of CN106651972B publication Critical patent/CN106651972B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

Embodiments of the invention disclose binary image coding and decoding methods and devices and relate to the technical field of image coding and decoding. The coding method comprises steps of obtaining a to-be-coded binary image; obtaining a coding table TL corresponding to a coding length L from a preset coding table database according to the preset coding lengths L; according to a preset pixel point grouping sequence, grouping pixel points included in the to-be-coded binary image; according to the pixel values of the pixel points in each pixel point group after grouping, calculating indexes of corresponding coding elements in the coding table TL of the pixel point group; according to the indexes of the coding elements obtained by calculation, obtaining values of corresponding coding elements in the coding table TL of each pixel point group in the coding table TL; and according to the obtained values of the coding elements, generating coding data corresponding to the to-be-coded binary image. With the scheme provided by the embodiments of the invention, the binary image is coded and then the storage space of the binary image is reduced.

Description

A kind of bi-level image coding, coding/decoding method and device
Technical field
The present invention relates to image encoding and decoding technique field, more particularly to a kind of bi-level image coding, coding/decoding method And device.
Background technology
Recently as the fast development of computer technology, computer vision has obtained more and more extensively applying, And conventional computer vision application would generally be related to character recognition technologies, it is the accuracy rate for improving character recognition, Generally need to utilize a large amount of bianry image samples to be trained the grader for character recognition.
Further, typically stored with the conventional picture format such as BMP as the bianry image of sample, with Sample image increasing number, the quantity of bianry image sample may reach it is ten hundreds of, it is ten hundreds of The memory space that bianry image sample takes is very big, is not easy to user's use.
The content of the invention
The embodiment of the invention discloses a kind of bi-level image coding, coding/decoding method and device, to reduce binary map As the memory space for taking.
To reach above-mentioned purpose, the embodiment of the invention discloses a kind of bi-level image coding method, methods described Including:
Obtain bianry image to be encoded;
According to default code length L, the code length L correspondences are obtained from default coding schedule data base Coding schedule TL, wherein, the coding schedule TLFor recording the index of code element and the value of code element Between corresponding relation, the coding schedule TLIn include 2LThe different code element of individual value, each code element Value be [0,2L- 1] integer in;
According to default pixel order of packets, the pixel included by the bianry image to be encoded is carried out Packet, wherein, after packet, included in each pixel packet, the quantity of pixel is identical, and no more than institute State code length L;
According to the pixel value of pixel included in each pixel packet after packet, calculate the pixel and be grouped In the coding schedule TLIn corresponding code element index;
According to the index of calculated code element, from the coding schedule TLMiddle each pixel that obtains is grouped In the coding schedule TLIn corresponding code element value;
According to the value of the code element for being obtained, the corresponding coded data of the bianry image to be encoded is generated.
It is in a specific embodiment of the present invention, described to be wrapped in each pixel packet according to after packet Pixel value containing pixel, calculates the pixel and is grouped in the coding schedule TLIn corresponding code element rope Draw, including:
For arbitrary pixel is grouped G after packet, according to following formula, calculate the pixel packet G and exist The coding schedule TLIn corresponding code element index indexG,
Wherein, t represents the order of the pixel in pixel packet G of putting in order according to default pixel Number, itRepresent pixel value of the serial number for the pixel of t in pixel packet G.
In a specific embodiment of the present invention, the value according to the code element for being obtained is raw Into the corresponding coded data of the bianry image to be encoded, including:
Obtain the image information of the image to be encoded;
According to the image information for being obtained and the value of the code element for being obtained, according to default information arrangement Rule, generates the corresponding coded data of the bianry image to be encoded.
In a specific embodiment of the present invention, described according to described image information and the volume that obtained The value of data code, according to default information arrangement rule, generates the corresponding volume of the bianry image to be encoded After code data, also include:
The coded data for being generated is stored to default image storage file tail, wherein, the default figure As storage file is used to store the corresponding coded data of at least one bianry image.
It is in a specific embodiment of the present invention, described according to the image information that obtained and to be obtained The value of code element, according to default information arrangement rule, generates the bianry image to be encoded corresponding Coded data, including:
According to following information arrangement rule, the corresponding coded data of the bianry image to be encoded is generated,
Id1Id2Ii1Id2Ii2…Id2Iij…Id2Iin:E,
Wherein, Id1Represent the origin identification of the corresponding coded data of default bianry image, Id2Represent default Separation mark between the image information of bianry image, IijAn image information of bianry image is represented, E is represented The serial data being made up of the value of the code element for being obtained.
In a specific embodiment of the present invention, the bi-level image coding method also includes:
The data modification instruction for the default image storage file is received, wherein, the data modification At least include in instruction:The mark of bianry image to be modified, the mark of image information to be modified and to be modified The modified values of image information;
The mark of the bianry image described to be modified included according to data modification instruction, described default Image storage file in search the corresponding coded data of the bianry image to be modified;
The mark of image information described to be modified that included according to data modification instruction and described to be repaired Change the modified values of image information, change the coded data for finding.
To reach above-mentioned purpose, the embodiment of the invention discloses a kind of bianry image coding/decoding method, methods described Including:
Obtain the coded data of bianry image to be decoded;
According to default code length L, the coded data is parsed, and then obtain described to be decoded two Each pixel of value image is grouped the value of corresponding code element, wherein, pixel is grouped into:According to Default pixel order of packets, carries out packet to the pixel included by the bianry image to be decoded and obtains , included in each pixel packet, the quantity of pixel is identical, and no more than described default coding length Degree L;
According to the default code length L, the code length L is obtained from default decoding table data base Corresponding decoding table TL', wherein, the decoding table TL' for recording the value of code element and the rope of code element Corresponding relation between drawing, the coding schedule TL' in include 2LThe different code element of individual value, each coding unit The value of element is [0,2L- 1] integer in;
According to the value of the code element for being obtained, from the decoding table TL' in obtain each pixel be grouped in institute State decoding table TL' in corresponding code element index;
According to the index of the code element for being obtained, the pixel that each pixel is grouped included pixel is obtained Value;
According to the pixel value for being obtained, the bianry image to be decoded is generated.
In a specific embodiment of the present invention, the index according to the code element for being obtained is obtained The pixel value that each pixel is grouped included pixel is obtained, including:
For the index index of the arbitrary code element for being obtainedD, the index is obtained according to following steps ndexDCorresponding pixel is grouped GDThe pixel value of included pixel:
Determine the index indexDBinary numeral;
According to btValue and the code length L, obtain the pixel and be grouped GDAccording to default picture Vegetarian refreshments puts in order serial number for the pixel value i of the pixel of tt, wherein, btRepresent in the binary numeral from Low level is designated the value of the bit of t, the index to a high position
In a specific embodiment of the present invention, the coded data for obtaining bianry image to be decoded, Including:
According to the mark of bianry image to be decoded, described to be decoded two are obtained from default image storage file The coded data of value image, wherein, the default image storage file is used to store at least one binary map As corresponding coded data.
In a specific embodiment of the present invention, the coded data of the bianry image to be decoded is:Press According to the regularly arranged coded data of following information arrangement,
Id1Id2Ii1Id2Ii2…Id2Iij…Id2Iin:E,
Wherein, Id1Represent the origin identification of the corresponding coded data of default bianry image, Id2Represent default Separation mark between the image information of bianry image, IijAn image information of bianry image is represented, E is represented The serial data being made up of the value of the code element for being obtained.
To reach above-mentioned purpose, the embodiment of the invention discloses a kind of bi-level image coding device, described device Including:
Image obtains module, for obtaining bianry image to be encoded;
Coding schedule obtains module, for according to default code length L, obtaining from default coding schedule data base Obtain the corresponding coding schedule T of the code length LL, wherein, the coding schedule TLFor recording the rope of code element Draw the corresponding relation and the value of code element between, the coding schedule TLIn include 2LThe different coding of individual value Element, the value of each code element is [0,2L- 1] integer in;
Pixel grouping module, for according to default pixel order of packets, to the binary map to be encoded As the pixel for being included is grouped, wherein, pixel included in each pixel packet after packet Quantity is identical, and no more than described code length L;
Index computing module, for the pixel value according to pixel included in each pixel packet after packet, Calculate the pixel and be grouped in the coding schedule TLIn corresponding code element index;
First value obtains module, for the index according to calculated code element, from the coding schedule TLMiddle each pixel of acquisition is grouped in the coding schedule TLIn corresponding code element value;
Coded data generation module, for the value according to the code element for being obtained, generates described to be encoded The corresponding coded data of bianry image.
In a specific embodiment of the present invention, the index computing module, specifically for for packet Arbitrary pixel is grouped G afterwards, according to following formula, calculates the pixel and is grouped G in the coding schedule TL In corresponding code element index indexG,
Wherein, t represents the order of the pixel in pixel packet G of putting in order according to default pixel Number, itRepresent pixel value of the serial number for the pixel of t in pixel packet G.
In a specific embodiment of the present invention, the coded data generation module, including:
Image information obtains submodule, for obtaining the image information of the image to be encoded;
Coded data obtains submodule, for according to the image information for being obtained and the code element for being obtained Value, according to default information arrangement rule, generates the corresponding coded data of the bianry image to be encoded.
In a specific embodiment of the present invention, the bi-level image coding device also includes:
Coded data memory module, after generating coded data in the coded data generation module, will The coded data for being generated is stored to default image storage file tail, wherein, the default image storage File is used to store the corresponding coded data of at least one bianry image.
In a specific embodiment of the present invention, the coded data obtains submodule, specifically for pressing According to following information arrangement rule, the corresponding coded data of the bianry image to be encoded is generated,
Id1Id2Ii1Id2Ii2…Id2Iij…Id2Iin:E,
Wherein, Id1Represent the origin identification of the corresponding coded data of default bianry image, Id2Represent default Separation mark between the image information of bianry image, IijAn image information of bianry image is represented, E is represented The serial data being made up of the value of the code element for being obtained.
In a specific embodiment of the present invention, the bi-level image coding device also includes:
Data modification command reception module, the data for receiving for the default image storage file are repaiied Change instruction, wherein, at least include in the data modification instruction:It is the mark of bianry image to be modified, to be repaired Change the modified values of the mark and image information to be modified of image information;
Coded data searching modul, for the two-value described to be modified included according to data modification instruction The mark of image, searches the corresponding volume of the bianry image to be modified in the default image storage file Code data;
Coded data modified module, for the image described to be modified included according to data modification instruction The modified values of the mark of information and the image information to be modified, change the coded data for finding.
To reach above-mentioned purpose, the embodiment of the invention discloses a kind of bianry image decoding apparatus, described device Including:
Coded data obtains module, for obtaining the coded data of bianry image to be decoded;
Second value obtains module, for according to default code length L, parsing to the coded data, And then the value that each pixel of the bianry image to be decoded is grouped corresponding code element is obtained, wherein, Pixel is grouped into:According to default pixel order of packets, the bianry image to be decoded is included Pixel carries out being grouped what is obtained, and included in each pixel packet, the quantity of pixel is identical, and less In the default code length L;
Decoding table obtains module, for according to the default code length L, from default decoding table data base It is middle to obtain the corresponding decoding table T of the code length LL', wherein, the decoding table TL' for recording code element Value and the index of code element between corresponding relation, the coding schedule TL' in include 2LIndividual value is different Code element, the value of each code element is [0,2L- 1] integer in;
Index obtains module, for the value according to the code element for being obtained, from the decoding table TL' middle acquisition Each pixel is grouped in the decoding table TL' in corresponding code element index;
Pixel value obtains module, for the index according to the code element for being obtained, obtains each pixel point The pixel value of the included pixel of group;
Image generation module, for according to the pixel value for being obtained, generating the bianry image to be decoded.
In a specific embodiment of the present invention, the pixel value obtains module, specifically for obtaining institute The index index of the arbitrary code element for obtainingDCorresponding pixel is grouped GDThe pixel value of included pixel;
Wherein, the pixel value obtains module, including:
Numerical value determination sub-module, for determining the index indexDBinary numeral;
Pixel value obtains submodule, for according to btValue and the code length L, obtain the pixel Point packet GDAccording to default pixel put in order serial number be t pixel pixel value it, wherein, btThe value of the bit of t, the index are designated in representing the binary numeral from low level to a high position
In a specific embodiment of the present invention, the coded data obtains module, specifically for basis The mark of bianry image to be decoded, obtains the bianry image to be decoded from default image storage file Coded data, wherein, it is corresponding that the default image storage file is used at least one bianry image of storage Coded data.
In a specific embodiment of the present invention, the coded data of the bianry image to be decoded is:Press According to the regularly arranged coded data of following information arrangement,
Id1Id2Ii1Id2Ii2…Id2Iij…Id2Iin:E,
Wherein, Id1Represent the origin identification of the corresponding coded data of default bianry image, Id2Represent default Separation mark between the image information of bianry image, IijAn image information of bianry image is represented, E is represented The serial data being made up of the value of the code element for being obtained.
As seen from the above, in scheme provided in an embodiment of the present invention, after obtaining bianry image to be encoded, according to Default code length L, obtains the corresponding coding schedule T of code length L from default coding schedule data baseL, According to default pixel order of packets, the pixel included by bianry image to be encoded is grouped, root According to the pixel value of pixel included in each pixel packet after packet, calculate the pixel and be grouped in coding Table TLIn corresponding code element index, according to the index of calculated code element, from coding schedule TL Middle each pixel of acquisition is grouped in coding schedule TLIn corresponding code element value, according to the volume for being obtained The value of data code, generates the corresponding coded data of bianry image to be encoded.As can be seen that one by more than One code element of multiple pixel correspondences included in pixel packet, therefore, according to the embodiment of the present invention After the scheme of offer is to bi-level image coding to be encoded, the memory space that the coded data for obtaining takes will be much Less than the memory space that bianry image to be encoded takes.
Description of the drawings
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will be to implementing Example or accompanying drawing to be used needed for description of the prior art are briefly described, it should be apparent that, describe below In accompanying drawing be only some embodiments of the present invention, for those of ordinary skill in the art, do not paying On the premise of going out creative work, can be with according to these other accompanying drawings of accompanying drawings acquisition.
Fig. 1 is a kind of schematic flow sheet of bi-level image coding method provided in an embodiment of the present invention;
Fig. 2 is the schematic flow sheet of another kind of bi-level image coding method provided in an embodiment of the present invention;
Fig. 3 is a kind of schematic flow sheet of bianry image coding/decoding method provided in an embodiment of the present invention;
Fig. 4 is a kind of structural representation of bi-level image coding device provided in an embodiment of the present invention;
Fig. 5 is the structural representation of another kind of bi-level image coding device provided in an embodiment of the present invention;
Fig. 6 is a kind of structural representation of bianry image decoding apparatus provided in an embodiment of the present invention.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clearly Chu, it is fully described by, it is clear that described embodiment is only a part of embodiment of the invention, rather than Whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art are not making creation Property work under the premise of the every other embodiment that obtained, belong to the scope of protection of the invention.
Fig. 1 is a kind of schematic flow sheet of bi-level image coding method provided in an embodiment of the present invention, the method bag Include:
S101:Obtain bianry image to be encoded.
Bianry image can be understood as the only image comprising black pixel point and white pixel point.The picture of pixel Plain value is relevant with the variable digit for representing the variable of pixel pixel value that developer sets.
For example, if the variable digit of the variable for representing pixel pixel value is 1bit, usual black picture element The pixel value of point is " 0 ", and to be represented in binary as " 0 ", and the pixel value of white pixel point is " 1 ", with It is represented in binary as " 1 ";
If the variable digit of the variable for representing pixel pixel value is 8bit, the picture of usual black pixel point Element value is " 0 ", and to be represented in binary as " 00000000 ", and the pixel value of white pixel point is " 255 ", To be represented in binary as " 11111111 ";
The variable digit of the variable for being certainly used for representing pixel pixel value can also be other values, situation with it is upper State situation to be similar to, will not enumerate here.
S102:According to default code length L, code length L pair is obtained from default coding schedule data base The coding schedule T for answeringL
Wherein, coding schedule TLFor recording the corresponding pass between the index of code element and the value of code element System, includes 2 in the coding scheduleLThe different code element of individual value, the value of each code element is [0,2L-1] An interior integer.
Default code length can be understood as the digit for the variable of code element in presentation code table.Tool When encoding to bianry image to be encoded of body, can be according to the situation of bianry image to be encoded and to pressure The factors such as the requirement of contracting ratio adjust default code length.The value of default code length L is bigger, using this When the scheme that inventive embodiments are provided carries out picture coding, the compression ratio of the coded data for obtaining is higher.
With reference to concrete practical situations, used in development process, 8bit integer variables are more, so at this L≤8 in a kind of bright relatively good implementation, further, it is contemplated that need in subsequent step to two-value to be encoded The pixel of image carries out pixel packet transaction, and default code length is determined according to following formula Value:
W/L=integers.
Based on foregoing description, the corresponding coding schedule T of default code length L are being generatedLWhen, it may be considered that it is based on Ascii character generates the coding schedule.
S103:According to default pixel order of packets, the pixel included to bianry image to be encoded is clicked through Row packet.
Wherein, default pixel order of packets can be according to pixel column order from left to right, according to picture Element row order from right to left, according to pixel column order from top to bottom, according to pixel column from top to bottom suitable Sequence etc., the application are not defined to this.
Specifically, after packet, included in each pixel packet, the quantity of pixel is identical, and on being not more than State code length L, preferably, after packet included in the packet of each pixel the quantity of pixel be equal to it is above-mentioned Code length L, so can obtain the compression ratio of maximum in the case where code length is fixed.
It should be understood that when being grouped to the pixel included by bianry image to be encoded, can be potentially encountered The pixel that the quantity of the pixel included in last pixel packet is included in being grouped with other pixels The different situation of quantity, at this moment can not carry out any process to last pixel packet, directly after Continuous subsequent step, naturally it is also possible to which pixel is carried out to last pixel packet according to default pixel Polishing process, for example, default pixel can be last pixel of bianry image to be encoded etc., Then again to the pixel supplemented during polishing is processed is abandoned during the decoding data after coding, the application is not This is defined.
S104:According to the pixel value of pixel included in each pixel packet after packet, the pixel is calculated Point is grouped in coding schedule TLIn corresponding code element index.
In a kind of optional implementation of the present invention, for after packet, arbitrary pixel is grouped G, can be according to Following formula, calculates pixel and is grouped G in coding schedule TLIn corresponding code element index indexG,
Wherein, t represent according to default pixel put in order pixel packet G in pixel serial number, it Pixel value of the serial number for the pixel of t in expression pixel packet G.
it<<T is represented itBinary numeral move to right t positions
It is assumed that itRepresented with 1 bit, then itValue may be 0 or 1, L be equal to 3, then
It should be noted that above-mentioned itPixel value of the serial number for the pixel of t in expression pixel packet G, can Being the pixel value of the pixel for directly reading from bianry image to be encoded, it is understood that to be according to straight The pixel value that the pixel value conversion of the pixel for reading is obtained is connect from bianry image to be encoded, for example, directly The pixel value of the pixel read from bianry image to be encoded is 255, and which is represented in binary as " 11111111 ", Then now itCan, the pixel of the pixel that directly to be encoded bianry image read similar with value as 1 It is worth for 0, which is represented in binary as " 00000000 ", then now itCan be with value as 0.
In addition, above-mentioned default pixel puts in order can be and aforementioned default pixel order of packets phase What is closed puts in order, for example, default pixel order of packets be according to pixel column order from left to right with And the sequential packet according to pixel column from top to bottom, then put in order can be for same picture for default pixel Pixel in plain row is arranged according to order from left to right, for the pixel between different pixels row, is pressed According to order arrangement from top to bottom etc..
S105:According to the index of calculated code element, from coding schedule TLMiddle acquisition each pixel point Group is in coding schedule TLIn corresponding code element value.
S106:According to the value of the code element for being obtained, the corresponding coded number of bianry image to be encoded is generated According to.
It should be noted that the coded data generated in this step can be understood as depositing with particular file format The coded data of storage, it is understood that for not with particular file format data storage string.
In a specific embodiment of the present invention, except obtained coding need to be considered when generating coded data Outside the value of element, it is also contemplated that the mark of bianry image to be encoded, width, height, type, image Whether it is effective image etc. image information, the image of these bianry images to be encoded is added in coded data After information, the later stage is can aid in using bianry image to be encoded, the application does not limit the tool of image information The body form of expression.
Specifically, the value according to the code element for being obtained, generates the corresponding coding of bianry image to be encoded During data, it is possible to obtain the image information of image to be encoded, and according to the image information for being obtained and obtained Code element value, according to default information arrangement rule, generate the corresponding volume of bianry image to be encoded Code data.
After generating coded data in the manner described above, if being not desired to the coded data used in later stage use, Can will represent in image information that whether image is that the flag of effective image is set to engineering noise state, and Without the need for the coded data is deleted, when can using the coded data, then image will be represented in image information Be whether that the flag of effective image is set to " effective " state, user is so facilitated to coded data Management.
Optionally, according to the image information for being obtained and the value of the code element for being obtained, according to default Information arrangement rule, when generating the corresponding coded data of bianry image to be encoded, can arrange according to following information Row rule, generates the corresponding coded data of bianry image to be encoded,
Id1Id2Ii1Id2Ii2…Id2Iij…Id2Iin:E,
Wherein, Id1Represent the origin identification of the corresponding coded data of default bianry image, Id2Represent default Separation mark between the image information of bianry image, IijAn image information of bianry image is represented, E is represented The serial data being made up of the value of the code element for being obtained.
Optionally, Id1Can be character " $ ", Id2Can be character "@", it is of course possible to be other values, this Application is not defined to this.
During according to the value composition data string of the code element for being obtained, simply will can be obtained in order The code element for obtaining is arranged together.
For example, the coded data for generating in the manner described above can be with as follows:
$@ID@W@H@L@type@valid@inf:C0C1…Clen-1
Wherein, C0C1…Clen-1As above-mentioned E.
After encoding to bianry image using scheme provided in an embodiment of the present invention, its coded data is only logical Could normally to user's exhibition after crossing the coding/decoding method decoding corresponding with coded method provided in an embodiment of the present invention Show, therefore, the bianry image after warp knit code has higher safety.
As seen from the above, in the scheme that the present embodiment is provided, after obtaining bianry image to be encoded, according to default Code length L, the corresponding coding schedule T of code length L are obtained from default coding schedule data baseL, according to Default pixel order of packets, is grouped to the pixel included by bianry image to be encoded, according to point After group included in the packet of each pixel pixel pixel value, calculate the pixel and be grouped in coding schedule TL In corresponding code element index, according to the index of calculated code element, from coding schedule TLIn obtain Obtain each pixel and be grouped in coding schedule TLIn corresponding code element value, according to obtained coding unit The value of element, generates the corresponding coded data of bianry image to be encoded.As can be seen that a pixel by more than One code element of multiple pixel correspondences included in point packet, therefore, according to the side that the present embodiment is provided After case is to bi-level image coding to be encoded, the memory space that the coded data for obtaining takes far smaller than will be waited to compile The memory space that code bianry image takes.
Those skilled in the art are it should be understood that the substantial amounts of bianry image sample of normal conditions is to classification When device is trained, the quantity of bianry image sample may reach tens of thousands of or even hundreds of thousands, if these files Store in the form of single file, for embedded system, loading these files needs to process a large amount of I/O operation, be nearly impossible.In view of the foregoing, in a kind of relatively good implementation of the present invention, Referring to Fig. 2, there is provided the schematic flow sheet of another kind of bi-level image coding method, compared with previous embodiment, In the present embodiment, in the value according to image information and the code element for being obtained, arrange according to default information Row rule, after generating the corresponding coded data of bianry image to be encoded, also includes:
S107:The coded data for being generated is stored to default image storage file tail.
Wherein, default image storage file is used to store the corresponding coded data of at least one bianry image.
The coded data for being generated is stored to the situation of default image storage file tail based on above-mentioned, at this In a kind of specific implementation of invention, above-mentioned bi-level image coding method can also include:
The data modification instruction for default image storage file is received, wherein, in data modification instruction extremely Include less:The mark of bianry image to be modified, the mark of image information to be modified and image information to be modified Modified values;
The mark of the bianry image to be modified included according to data modification instruction, in default image storage text The corresponding coded data of bianry image to be modified is searched in part;
The mark and image information to be modified of the image information to be modified included according to data modification instruction Modified values, change the coded data for finding.
It is by description above it is recognised that various image informations can be included in coded data, not another here One enumerates.
With image information it is below:Whether image is to illustrate as a example by effective image.
Receive mark and the mark that whether the mark comprising bianry image to be modified, image are effective image After the data modification instruction of the modified values of knowledge, first deposited from default image according to the mark of bianry image to be modified The coded data of the bianry image is found in storage file, then whether image is positioned from the coded data for finding For the mark of effective image, and change the value of the mark.
In practical application, if wanting from default image storage file to delete the coded data of a certain bianry image, Can be realized by changing the value, so without the need for the coded data for really deleting bianry image, when user sends out When now still wanting to using the bianry image, only need to change the bianry image it is above-mentioned be whether effective image mark Value, without the need for going again to find the view data of the bianry image elsewhere, without again toward default Image storage file in add the coded data of the bianry image, the substantial amounts of two-value of user management can be facilitated The coded data of image.
As seen from the above, in the scheme that the present embodiment is provided, the coded data for being generated is stored to default Image storage file tail, and the corresponding coding of multiple bianry images in default image storage file, can be stored Data, then when needing to load multiple files, only need to load the default image storage file, it is clear that I/O operation is reduced to by multiple I/O operation, is needing loading many using scheme provided in an embodiment of the present invention The number of times of I/O operation in the case of individual file, can be greatly reduced.
Corresponding with above-mentioned bi-level image coding method, the embodiment of the present invention additionally provides a kind of bianry image solution Code method.
Fig. 3 is a kind of schematic flow sheet of bianry image coding/decoding method provided in an embodiment of the present invention, the method bag Include:
S301:Obtain the coded data of bianry image to be decoded.
In a kind of specific implementation, can directly from the corresponding single coding file of bianry image to be decoded Obtain the coded data of the bianry image.
In another kind of specific implementation, can be with the mark according to bianry image to be decoded, from default figure Coded data as bianry image to be decoded is obtained in storage file, wherein, default image storage file is used In the corresponding coded data of at least one bianry image of storage.
In this case, the corresponding coded data of multiple bianry images is stored in one file, practical application In when needing to load multiple bianry images, only load a file, reduce the number of times of I/O operation.
S302:According to default code length L, coded data is parsed, and then obtain two-value to be decoded Each pixel of image is grouped the value of corresponding code element.
Wherein, default code length can be understood as the position for the variable of code element in presentation code table Number, the parameter are set in an encoding process.When specifically encoding to bianry image to be decoded, Can be according to the default coding length of the factor such as the situation of bianry image to be decoded and the requirement to compression ratio adjustment Degree.The value of default code length L is bigger, carries out picture coding using scheme provided in an embodiment of the present invention When, the compression ratio of the coded data for obtaining is higher.
In addition, pixel packet is also what is carried out in an encoding process, specifically, pixel is grouped into:Press According to default pixel order of packets, the pixel included to bianry image to be decoded carries out being grouped what is obtained, Included in each pixel packet, the quantity of pixel is identical, and no more than default code length L.
S303:According to default code length L, code length L pair is obtained from default decoding table data base The decoding table T for answeringL'。
Wherein, decoding table TL' be used to record the corresponding pass between the value of code element and the index of code element System, coding schedule TL' in include 2LThe different code element of individual value, the value of each code element is [0,2L-1] An interior integer.
It should be noted that the decoding table being related in the present embodiment is and the coding schedule being related in previous embodiment Corresponding table, is reciprocal relation between the two.
S304:According to the value of the code element for being obtained, from the decoding table TL' middle acquisition each pixel point Group is in the decoding table TL' in corresponding code element index.
S305:According to the index of the code element for being obtained, obtain each pixel and be grouped included pixel Pixel value.
Specifically, in a specific embodiment of the present invention, for the arbitrary code element for being obtained Index indexD, index index can be obtained according to following stepsDCorresponding pixel is grouped GDIncluded pixel The pixel value of point:
It is determined that index indexDBinary numeral;
According to btValue and the code length L, obtain pixel packet GDAccording to default pixel Pixel value i of the serial number that puts in order for the pixel of tt, wherein, btIn expression binary numeral from low level to height Value of the bit-identify for the bit of t, index
Specifically, according to btValue and code length L, obtain pixel packet GDAccording to default picture Vegetarian refreshments puts in order the pixel value i of the pixel for being designated ttWhen, obtain btValue value after, first according to bt Value judge that it is stain or white point to be designated the pixel of t, if btValue be 0, then it represents that above-mentioned pixel Point is stain, if btValue be 1, then it represents that above-mentioned pixel is white point, the then face according to the pixel Color and code length L determine the pixel value of the pixel.
For example, it is assumed that code length L is equal to 1, then
When the pixel is stain, its pixel value is 0;
When the pixel is white point, its pixel value is 1.
Assume that code length L is equal to 8, then
When the pixel is stain, its pixel value is 0;
When the pixel is white point, its pixel value is 255.
Other situations are similar to be will not enumerate here.
It should be noted that it is assumed that binary value is " 1101 ", then from low level to it is high-order each Value is respectively:1st, 0,1,1, from low level to high-order each mark can be:0th, 1,2,3, Certainly, the initial value of above-mentioned mark is to start from 0 here, and its initial value can also be from the beginning of 1 certainly, this Application is not defined to this, in addition, also may be used from low level to high-order each mark in binary numeral To be simply interpreted as according to from low level to each corresponding serial number in the order binary numeral of a high position.
S306:According to the pixel value for being obtained, bianry image to be decoded is generated.
The coded data of bianry image to be decoded is:According to the regularly arranged coded data of following information arrangement,
Id1Id2Ii1Id2Ii2…Id2Iij…Id2Iin:E,
Wherein, Id1Represent the origin identification of the corresponding coded data of default bianry image, Id2Represent default Separation mark between the image information of bianry image, IijAn image information of bianry image is represented, E is represented The serial data being made up of the value of the code element for being obtained.
As seen from the above, in the scheme that the present embodiment is provided, the coded data for being decoded is to two-value to be decoded The pixel included by image is grouped, according to pixel included in each pixel packet after packet Pixel value, calculates the index that the pixel is grouped in corresponding code element in coding schedule, according to being calculated Code element index, each pixel is obtained from coding schedule and is grouped in corresponding coding unit in coding schedule The value of element, according to the value of the code element for being obtained, the coded data of generation.One pixel packet In multiple pixels one code element of correspondence for including, therefore, the scheme decoding provided using the present embodiment The memory space that takes of coded data to be far smaller than memory space that bianry image to be decoded takes.
Corresponding with above-mentioned bi-level image coding method, the embodiment of the present invention additionally provides a kind of bianry image Code device.
Fig. 4 is a kind of structural representation of bi-level image coding device provided in an embodiment of the present invention, the device bag Include:
Image obtains module 401, for obtaining bianry image to be encoded;
Coding schedule obtains module 402, for according to default code length L, from default coding schedule data base It is middle to obtain the corresponding coding schedule T of the code length LL, wherein, the coding schedule TLFor recording code element Index and the value of code element between corresponding relation, the coding schedule TLIn include 2LIndividual value is different Code element, the value of each code element is [0,2L- 1] integer in;
Pixel grouping module 403, for according to default pixel order of packets, to the two-value to be encoded The pixel included by image is grouped, wherein, pixel included in each pixel packet after packet Quantity it is identical, and no more than described code length L;
Index computing module 404, for the pixel according to pixel included in each pixel packet after packet Value, calculates the pixel and is grouped in the coding schedule TLIn corresponding code element index;
First value obtains module 405, for the index according to calculated code element, from the coding Table TLMiddle each pixel of acquisition is grouped in the coding schedule TLIn corresponding code element value;
Coded data generation module 406, for the value according to the code element for being obtained, generate described in wait to compile The corresponding coded data of code bianry image.
Specifically, the index computing module 404, specifically for for after packet arbitrary pixel be grouped G, According to following formula, calculate the pixel and G is grouped in the coding schedule TLIn corresponding code element rope Draw indexG,
Wherein, t represents the order of the pixel in pixel packet G of putting in order according to default pixel Number, itRepresent pixel value of the serial number for the pixel of t in pixel packet G.
Specifically, the coded data generation module 406 can include:
Image information obtains submodule, for obtaining the image information of the image to be encoded;
Coded data obtains submodule, for according to the image information for being obtained and the code element for being obtained Value, according to default information arrangement rule, generates the corresponding coded data of the bianry image to be encoded.
Specifically, the coded data obtains submodule, specifically for according to following information arrangement rule, raw Into the corresponding coded data of the bianry image to be encoded,
Id1Id2Ii1Id2Ii2…Id2Iij…Id2Iin:E,
Wherein, Id1Represent the origin identification of the corresponding coded data of default bianry image, Id2Represent default Separation mark between the image information of bianry image, IijAn image information of bianry image is represented, E is represented The serial data being made up of the value of the code element for being obtained.
As seen from the above, in the scheme that the present embodiment is provided, after obtaining bianry image to be encoded, according to default Code length L, the corresponding coding schedule T of code length L are obtained from default coding schedule data baseL, according to Default pixel order of packets, is grouped to the pixel included by bianry image to be encoded, according to point After group included in the packet of each pixel pixel pixel value, calculate the pixel and be grouped in coding schedule TL In corresponding code element index, according to the index of calculated code element, from coding schedule TLIn obtain Obtain each pixel and be grouped in coding schedule TLIn corresponding code element value, according to obtained coding unit The value of element, generates the corresponding coded data of bianry image to be encoded.As can be seen that a pixel by more than One code element of multiple pixel correspondences included in point packet, therefore, according to the side that the present embodiment is provided After case is to bi-level image coding to be encoded, the memory space that the coded data for obtaining takes far smaller than will be waited to compile The memory space that code bianry image takes.
In a kind of relatively good implementation of the present invention, referring to Fig. 5, there is provided another kind of bi-level image coding dress The structural representation put, compared with previous embodiment, in the present embodiment, said apparatus also include:
Coded data memory module 407, after generating coded data in the coded data generation module, The coded data for being generated is stored to default image storage file tail, wherein, the default image is deposited Storage file is used to store the corresponding coded data of at least one bianry image.
Optionally, above-mentioned bi-level image coding device can also include:
Data modification command reception module, the data for receiving for the default image storage file are repaiied Change instruction, wherein, at least include in the data modification instruction:It is the mark of bianry image to be modified, to be repaired Change the modified values of the mark and image information to be modified of image information;
Coded data searching modul, for the two-value described to be modified included according to data modification instruction The mark of image, searches the corresponding volume of the bianry image to be modified in the default image storage file Code data;
Coded data modified module, for the image described to be modified included according to data modification instruction The modified values of the mark of information and the image information to be modified, change the coded data for finding.
As seen from the above, in the scheme that the present embodiment is provided, the coded data for being generated is stored to default Image storage file tail, and the corresponding coding of multiple bianry images in default image storage file, can be stored Data, then when needing to load multiple files, only need to load the default image storage file, it is clear that I/O operation is reduced to by multiple I/O operation, is needing loading many using scheme provided in an embodiment of the present invention The number of times of I/O operation in the case of individual file, can be greatly reduced.
Corresponding with above-mentioned bianry image coding/decoding method, the embodiment of the present invention additionally provides a kind of bianry image Decoding apparatus.
Fig. 6 is a kind of structural representation of bianry image decoding apparatus provided in an embodiment of the present invention, the device bag Include:
Coded data obtains module 601, for obtaining the coded data of bianry image to be decoded;
Second value obtains module 602, for according to default code length L, carrying out to the coded data Parsing, and then the value that each pixel of the bianry image to be decoded is grouped corresponding code element is obtained, Wherein, pixel is grouped into:According to default pixel order of packets, to the bianry image institute to be decoded Comprising pixel carry out being grouped what is obtained, included in the packet of each pixel, the quantity of pixel is identical, And no more than described default code length L;
Decoding table obtains module 603, for according to the default code length L, from default decoding table number According to the corresponding decoding table T of the code length L are obtained in storehouseL', wherein, the decoding table TL' encode for recording Corresponding relation between the index of the value and code element of element, the coding schedule TL' in include 2LIndividual value is not Same code element, the value of each code element is [0,2L- 1] integer in;
Index obtains module 604, for the value according to the code element for being obtained, from the decoding table TL' in Obtain each pixel and be grouped in the decoding table TL' in corresponding code element index;
Pixel value obtains module 605, for the index according to the code element for being obtained, obtains each pixel The pixel value of the included pixel of packet;
Image generation module 606, for according to the pixel value for being obtained, generating the bianry image to be decoded.
Specifically, the pixel value obtains module 605, specifically for arbitrary code element for being obtained Index indexDCorresponding pixel is grouped GDThe pixel value of included pixel;
Wherein, the pixel value obtains module, including:
Numerical value determination sub-module, for determining the index indexDBinary numeral;
Pixel value obtains submodule, for according to btValue and the code length L, obtain the pixel Point packet GDAccording to default pixel put in order serial number be t pixel pixel value it, wherein, btThe value of the bit of t, the index are designated in representing the binary numeral from low level to a high position
Specifically, the coded data obtains module 601, specifically for the mark according to bianry image to be decoded, The coded data of the bianry image to be decoded is obtained from default image storage file, wherein, it is described pre- If image storage file be used to store the corresponding coded data of at least one bianry image.
Specifically, the coded data of the bianry image to be decoded is:It is regularly arranged according to following information arrangement Coded data,
Id1Id2Ii1Id2Ii2…Id2Iij…Id2Iin:E,
Wherein, Id1Represent the origin identification of the corresponding coded data of default bianry image, Id2Represent default Separation mark between the image information of bianry image, IijAn image information of bianry image is represented, E is represented The serial data being made up of the value of the code element for being obtained.
As seen from the above, in the scheme that the present embodiment is provided, the coded data for being decoded is to two-value to be decoded The pixel included by image is grouped, according to pixel included in each pixel packet after packet Pixel value, calculates the index that the pixel is grouped in corresponding code element in coding schedule, according to being calculated Code element index, each pixel is obtained from coding schedule and is grouped in corresponding coding unit in coding schedule The value of element, according to the value of the code element for being obtained, the coded data of generation.One pixel packet In multiple pixels one code element of correspondence for including, therefore, the scheme decoding provided using the present embodiment The memory space that takes of coded data to be far smaller than memory space that bianry image to be decoded takes.
For device embodiment, as which is substantially similar to embodiment of the method, so the comparison of description is simple Single, related part is illustrated referring to the part of embodiment of the method.
It should be noted that herein, such as first and second or the like relational terms be used merely to by One entity or operation are made a distinction with another entity or operation, and are not necessarily required or implied these There is any this actual relation or order between entity or operation.And, term " including ", "comprising" Or its any other variant is intended to including for nonexcludability, so that including a series of mistake of key elements Journey, method, article or equipment not only include those key elements, but also including be not expressly set out other Key element, or also include the key element intrinsic for this process, method, article or equipment.Do not having In the case of more restrictions, the key element limited by sentence "including a ...", it is not excluded that wanting including described The process of element, method, also there is other identical element in article or equipment.
One of ordinary skill in the art will appreciate that realizing all or part of step in said method embodiment Program be can be by instruct the hardware of correlation to complete, described program can be stored in computer-readable Take in storage medium, the storage medium for obtaining designated herein, such as:ROM/RAM, magnetic disc, CD etc..
Presently preferred embodiments of the present invention is the foregoing is only, protection scope of the present invention is not intended to limit. All any modification, equivalent substitution and improvements made within the spirit and principles in the present invention etc., are all contained in In protection scope of the present invention.

Claims (20)

1. a kind of bi-level image coding method, it is characterised in that methods described includes:
Obtain bianry image to be encoded;
According to default code length L, the code length L correspondences are obtained from default coding schedule data base Coding schedule TL, wherein, the coding schedule TLFor recording the index of code element and the value of code element Between corresponding relation, the coding schedule TLIn include 2LThe different code element of individual value, each code element Value be [0,2L- 1] integer in;
According to default pixel order of packets, the pixel included by the bianry image to be encoded is carried out Packet, wherein, after packet, included in each pixel packet, the quantity of pixel is identical, and no more than institute State code length L;
According to the pixel value of pixel included in each pixel packet after packet, calculate the pixel and be grouped In the coding schedule TLIn corresponding code element index;
According to the index of calculated code element, from the coding schedule TLMiddle each pixel that obtains is grouped In the coding schedule TLIn corresponding code element value;
According to the value of the code element for being obtained, the corresponding coded data of the bianry image to be encoded is generated.
2. method according to claim 1, it is characterised in that described according to each pixel after packet The pixel value of pixel included in packet, calculates the pixel and is grouped in the coding schedule TLIn corresponding volume The index of data code, including:
For arbitrary pixel is grouped G after packet, according to following formula, calculate the pixel packet G and exist The coding schedule TLIn corresponding code element index indexG,
index G = &Sigma; t = 0 t = L - 1 ( i t < < t )
Wherein, t represents the order of the pixel in pixel packet G of putting in order according to default pixel Number, itRepresent pixel value of the serial number for the pixel of t in pixel packet G.
3. method according to claim 1, it is characterised in that described according to the code element for being obtained Value, generate the corresponding coded data of the bianry image to be encoded, including:
Obtain the image information of the image to be encoded;
According to the image information for being obtained and the value of the code element for being obtained, according to default information arrangement Rule, generates the corresponding coded data of the bianry image to be encoded.
4. method according to claim 3, it is characterised in that it is described according to described image information and The value of the code element for being obtained, according to default information arrangement rule, generates the binary map to be encoded After as corresponding coded data, also include:
The coded data for being generated is stored to default image storage file tail, wherein, the default figure As storage file is used to store the corresponding coded data of at least one bianry image.
5. the method according to claim 3 or 4, it is characterised in that described according to the image for being obtained letter The value of breath and the code element for being obtained, according to default information arrangement rule, generates described to be encoded two The corresponding coded data of value image, including:
According to following information arrangement rule, the corresponding coded data of the bianry image to be encoded is generated,
Id1Id2Ii1Id2Ii2...Id2Iij...Id2Iin:E,
Wherein, Id1Represent the origin identification of the corresponding coded data of default bianry image, Id2Represent default Separation mark between the image information of bianry image, IijAn image information of bianry image is represented, E is represented The serial data being made up of the value of the code element for being obtained.
6. method according to claim 4, it is characterised in that methods described also includes:
The data modification instruction for the default image storage file is received, wherein, the data modification At least include in instruction:The mark of bianry image to be modified, the mark of image information to be modified and to be modified The modified values of image information;
The mark of the bianry image described to be modified included according to data modification instruction, described default Image storage file in search the corresponding coded data of the bianry image to be modified;
The mark of image information described to be modified that included according to data modification instruction and described to be repaired Change the modified values of image information, change the coded data for finding.
7. a kind of bianry image coding/decoding method, it is characterised in that methods described includes:
Obtain the coded data of bianry image to be decoded;
According to default code length L, the coded data is parsed, and then obtain described to be decoded two Each pixel of value image is grouped the value of corresponding code element, wherein, pixel is grouped into:According to Default pixel order of packets, carries out packet to the pixel included by the bianry image to be decoded and obtains , included in each pixel packet, the quantity of pixel is identical, and no more than described default coding length Degree L;
According to the default code length L, the code length L is obtained from default decoding table data base Corresponding decoding table T 'L, wherein, the decoding table T 'LFor recording the value of code element and the rope of code element Corresponding relation between drawing, the coding schedule T 'LIn include 2LThe different code element of individual value, each coding unit The value of element is [0,2L- 1] integer in;
According to the value of the code element for being obtained, from the decoding table T 'LMiddle each pixel of acquisition is grouped in institute State decoding table T 'LIn corresponding code element index;
According to the index of the code element for being obtained, the pixel that each pixel is grouped included pixel is obtained Value;
According to the pixel value for being obtained, the bianry image to be decoded is generated.
8. method according to claim 7, it is characterised in that described according to the code element for being obtained Index, obtain the pixel value that each pixel is grouped included pixel, including:
For the index index of the arbitrary code element for being obtainedD, the index is obtained according to following steps indexDCorresponding pixel is grouped GDThe pixel value of included pixel:
Determine the index indexDBinary numeral;
According to btValue and the code length L, obtain the pixel and be grouped GDAccording to default picture Vegetarian refreshments puts in order serial number for the pixel value i of the pixel of tt, wherein, btRepresent in the binary numeral from Low level is designated the value of the bit of t, the index to a high position
9. the method according to claim 7 or 8, it is characterised in that acquisition bianry image to be decoded Coded data, including:
According to the mark of bianry image to be decoded, described to be decoded two are obtained from default image storage file The coded data of value image, wherein, the default image storage file is used to store at least one binary map As corresponding coded data.
10. method according to claim 9, it is characterised in that the coding of the bianry image to be decoded Data are:According to the regularly arranged coded data of following information arrangement,
Id1Id2Ii1Id2Ii2...Id2Iij...Id2Iin:E,
Wherein, Id1Represent the origin identification of the corresponding coded data of default bianry image, Id2Represent default Separation mark between the image information of bianry image, IijAn image information of bianry image is represented, E is represented The serial data being made up of the value of the code element for being obtained.
11. a kind of bi-level image coding devices, it is characterised in that described device includes:
Image obtains module, for obtaining bianry image to be encoded;
Coding schedule obtains module, for according to default code length L, obtaining from default coding schedule data base Obtain the corresponding coding schedule T of the code length LL, wherein, the coding schedule TLFor recording the rope of code element Draw the corresponding relation and the value of code element between, the coding schedule TLIn include 2LThe different coding of individual value Element, the value of each code element is [0,2L- 1] integer in;
Pixel grouping module, for according to default pixel order of packets, to the binary map to be encoded As the pixel for being included is grouped, wherein, pixel included in each pixel packet after packet Quantity is identical, and no more than described code length L;
Index computing module, for the pixel value according to pixel included in each pixel packet after packet, Calculate the pixel and be grouped in the coding schedule TLIn corresponding code element index;
First value obtains module, for the index according to calculated code element, from the coding schedule TLMiddle each pixel of acquisition is grouped in the coding schedule TLIn corresponding code element value;
Coded data generation module, for the value according to the code element for being obtained, generates described to be encoded The corresponding coded data of bianry image.
12. devices according to claim 11, it is characterised in that the index computing module, specifically For for arbitrary pixel packet G after packet, according to following formula, calculate the pixel packet G and exist The coding schedule TLIn corresponding code element index indexG,
index G = &Sigma; t = 0 t = L - 1 ( i t < < t )
Wherein, t represents the order of the pixel in pixel packet G of putting in order according to default pixel Number, itRepresent pixel value of the serial number for the pixel of t in pixel packet G.
13. devices according to claim 11, it is characterised in that the coded data generation module, Including:
Image information obtains submodule, for obtaining the image information of the image to be encoded;
Coded data obtains submodule, for according to the image information for being obtained and the code element for being obtained Value, according to default information arrangement rule, generates the corresponding coded data of the bianry image to be encoded.
14. devices according to claim 13, it is characterised in that described device also includes:
Coded data memory module, after generating coded data in the coded data generation module, will The coded data for being generated is stored to default image storage file tail, wherein, the default image storage File is used to store the corresponding coded data of at least one bianry image.
15. devices according to claim 13 or 14, it is characterised in that the coded data obtains son Module, specifically for according to following information arrangement rule, generating the corresponding coding of the bianry image to be encoded Data,
Id1Id2Ii1Id2Ii2...Id2Iij...Id2Iin:E,
Wherein, Id1Represent the origin identification of the corresponding coded data of default bianry image, Id2Represent default Separation mark between the image information of bianry image, IijAn image information of bianry image is represented, E is represented The serial data being made up of the value of the code element for being obtained.
16. devices according to claim 14, it is characterised in that described device also includes:
Data modification command reception module, the data for receiving for the default image storage file are repaiied Change instruction, wherein, at least include in the data modification instruction:It is the mark of bianry image to be modified, to be repaired Change the modified values of the mark and image information to be modified of image information;
Coded data searching modul, for the two-value described to be modified included according to data modification instruction The mark of image, searches the corresponding volume of the bianry image to be modified in the default image storage file Code data;
Coded data modified module, for the image described to be modified included according to data modification instruction The modified values of the mark of information and the image information to be modified, change the coded data for finding.
17. a kind of bianry image decoding apparatus, it is characterised in that described device includes:
Coded data obtains module, for obtaining the coded data of bianry image to be decoded;
Second value obtains module, for according to default code length L, parsing to the coded data, And then the value that each pixel of the bianry image to be decoded is grouped corresponding code element is obtained, wherein, Pixel is grouped into:According to default pixel order of packets, the bianry image to be decoded is included Pixel carries out being grouped what is obtained, and included in each pixel packet, the quantity of pixel is identical, and less In the default code length L;
Decoding table obtains module, for according to the default code length L, from default decoding table data base It is middle to obtain the corresponding decoding table T ' of the code length LL, wherein, the decoding table T 'LFor recording code element Value and the index of code element between corresponding relation, the coding schedule T 'LIn include 2LIndividual value is different Code element, the value of each code element is [0,2L- 1] integer in;
Index obtains module, for the value according to the code element for being obtained, from the decoding table T 'LMiddle acquisition Each pixel is grouped in the decoding table T 'LIn corresponding code element index;
Pixel value obtains module, for the index according to the code element for being obtained, obtains each pixel point The pixel value of the included pixel of group;
Image generation module, for according to the pixel value for being obtained, generating the bianry image to be decoded.
18. devices according to claim 17, it is characterised in that the pixel value obtains module, tool Body is used for the index index of the arbitrary code element for being obtainedDCorresponding pixel is grouped GDIncluded picture The pixel value of vegetarian refreshments;
Wherein, the pixel value obtains module, including:
Numerical value determination sub-module, for determining the index indexDBinary numeral;
Pixel value obtains submodule, for according to btValue and the code length L, obtain the pixel Point packet GDAccording to default pixel put in order serial number be t pixel pixel value it, wherein, btThe value of the bit of t, the index are designated in representing the binary numeral from low level to a high position index D = &Sigma; t = 0 t = L - 1 ( i t < < t ) .
19. devices according to claim 17 or 18, it is characterised in that the coded data obtains mould Block, specifically for the mark according to bianry image to be decoded, obtains described from default image storage file The coded data of bianry image to be decoded, wherein, the default image storage file is used for storage at least The corresponding coded data of individual bianry image.
20. devices according to claim 19, it is characterised in that the volume of the bianry image to be decoded Code data be:According to the regularly arranged coded data of following information arrangement,
Id1Id2Ii1Id2Ii2...Id2Iij...Id2Iin:E,
Wherein, Id1Represent the origin identification of the corresponding coded data of default bianry image, Id2Represent default Separation mark between the image information of bianry image, IijAn image information of bianry image is represented, E is represented The serial data being made up of the value of the code element for being obtained.
CN201510740338.5A 2015-11-03 2015-11-03 Binary image coding and decoding methods and devices Active CN106651972B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510740338.5A CN106651972B (en) 2015-11-03 2015-11-03 Binary image coding and decoding methods and devices

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510740338.5A CN106651972B (en) 2015-11-03 2015-11-03 Binary image coding and decoding methods and devices

Publications (2)

Publication Number Publication Date
CN106651972A true CN106651972A (en) 2017-05-10
CN106651972B CN106651972B (en) 2020-03-27

Family

ID=58851010

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510740338.5A Active CN106651972B (en) 2015-11-03 2015-11-03 Binary image coding and decoding methods and devices

Country Status (1)

Country Link
CN (1) CN106651972B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110264533A (en) * 2019-06-25 2019-09-20 北京慧眼智行科技有限公司 A kind of data transmission method, device and electronic equipment
CN110288673A (en) * 2019-05-08 2019-09-27 深圳大学 Instruction sequence is mapped to the method and system of image
CN111491169A (en) * 2020-04-22 2020-08-04 湖南国科微电子股份有限公司 Digital image compression method, device, equipment and medium
CN112672132A (en) * 2018-09-30 2021-04-16 Oppo广东移动通信有限公司 Data processing method and device, electronic equipment and storage medium
CN112866181A (en) * 2019-11-28 2021-05-28 上海商汤智能科技有限公司 Data decoding device, accelerator, and system on chip

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0395394A2 (en) * 1989-04-26 1990-10-31 Canon Kabushiki Kaisha Image encoding method
CN102256124A (en) * 2011-06-30 2011-11-23 杭州海康威视软件有限公司 Image layered coding method and device
CN104378644A (en) * 2013-08-16 2015-02-25 上海天荷电子信息有限公司 Fixed-width variable-length pixel sample value string matching strengthened image compression method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0395394A2 (en) * 1989-04-26 1990-10-31 Canon Kabushiki Kaisha Image encoding method
CN102256124A (en) * 2011-06-30 2011-11-23 杭州海康威视软件有限公司 Image layered coding method and device
CN104378644A (en) * 2013-08-16 2015-02-25 上海天荷电子信息有限公司 Fixed-width variable-length pixel sample value string matching strengthened image compression method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
高健 等: "数据多次分组的图像无损压缩算法", 《计算机系统应用》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112672132A (en) * 2018-09-30 2021-04-16 Oppo广东移动通信有限公司 Data processing method and device, electronic equipment and storage medium
CN112672132B (en) * 2018-09-30 2023-12-26 Oppo广东移动通信有限公司 Data processing method and device, electronic equipment and storage medium
CN110288673A (en) * 2019-05-08 2019-09-27 深圳大学 Instruction sequence is mapped to the method and system of image
CN110264533A (en) * 2019-06-25 2019-09-20 北京慧眼智行科技有限公司 A kind of data transmission method, device and electronic equipment
CN112866181A (en) * 2019-11-28 2021-05-28 上海商汤智能科技有限公司 Data decoding device, accelerator, and system on chip
CN112866181B (en) * 2019-11-28 2023-05-26 上海商汤智能科技有限公司 Data decoding device, accelerator, and system on chip
CN111491169A (en) * 2020-04-22 2020-08-04 湖南国科微电子股份有限公司 Digital image compression method, device, equipment and medium

Also Published As

Publication number Publication date
CN106651972B (en) 2020-03-27

Similar Documents

Publication Publication Date Title
CN106651972A (en) Binary image coding and decoding methods and devices
US8838551B2 (en) Multi-level database compression
US11704328B2 (en) Columnar storage and query method and system for time series data
CN103761229B (en) Data processing method and device
WO2004042930A3 (en) Content-based segmentation scheme for data compression
CN106021579B (en) A kind of compression method of historical data base
CN101430714B (en) Content structuring process method and system based on model
CN102750379B (en) Fast character string matching method based on filtering type
CN104715039A (en) Column-based storage and research method and equipment based on hard disk and internal storage
CN109598334B (en) Sample generation method and device
CN110162290B (en) Compression method for DeMURA data of OLED screen
CN105488471B (en) A kind of font recognition methods and device
CN101963944A (en) Object storage method and system
JP2004536481A (en) Encoding and decoding method of path in tree structure of structured document
CN104243095A (en) Code word type blind identification method for convolutional code and linear block code
CN104951482B (en) A kind of method and device of the image file of operation Sparse formats
JP2006351001A (en) Content characteristic quantity extraction method and device, and content identity determination method and device
US20150242448A1 (en) Secure and lossless data compression
CN114491187A (en) Intelligent natural resource monitoring integrated system
Pibiri et al. Dynamic elias-fano representation
CN103929499A (en) Internet of things heterogeneous identification recognition method and system
CN104077272B (en) A kind of method and apparatus of dictionary compression
CN107818131A (en) A kind of method for comparing travel paths using string of binary characters
CN116737716A (en) Time sequence data compression method and device
CN202931290U (en) Compression hardware system based on GZIP

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