Implementing JBIG in MATLAB
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I am trying to implement JBIG, I want to know the compression ratio for certain images. The only open source implementation is done by Markus K. the JBIG-KIT however it is written in c.
However there are a certain implementation of MATLAB that is using the executables of from it's pbmtools
I was able to generate the pbmtojbg and jbgtopbm executable and put them in the same folder as the .m file. However the program is not picking them. In some older discussions they have stated the use of callib() function but I am not sure how that would be able to help here.
Please help.
5 Kommentare
Walter Roberson
am 10 Feb. 2023
You never do anything with the content of named_jpg except find length() of it. You should instead
dinfo = dir(name_jbg);
cnt = dinfo.bytes;
which will tell you the size on disk of the file.
I need to find the compression ratio achieved by JBIG
Looking at the file size will not tell you that, not exactly. Every image file has headers that describe the image (the amount of detail can be variable especially if EXIF is used.) Some of that information may be needed in order to reconstruct the image, such as the image height and width and number of color panes, and a code indicating which compression scheme was used. But the rest of it might just be overhead, nice to have but not necessary. For example there might be room for a copyright notice, or (common) there might be a description of the X and Y resolutions. The essential information such as height and width and encoding scheme needs to be considered to be part of the size of the compressed representation, but copyrights and resolutions and time the file was created and such should not be considered to be part of the size of the output representation -- they are elements of the "container" but not of the compressed representation. Disk size tells you the size of the container, but not the size of the "essential" parts of what is stored.
Sometimes what you need to do is compress an empty image, then an image with one grayscale pixel, then an image with one color pixel, and a couple of other possibilities -- for example how does the size of one row with 32 columns compare to the size of two rows with 16 columns? You can then build a proposed model and fit the known values to try to figure out what the various components are that go into determining the output size.
... Basically it is typically better to analyze the code to figure out how to calculate actual compression ratio as distinct from container overhead.
Antworten (0)
Siehe auch
Kategorien
Mehr zu Convert Image Type finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!