0

I'm having trouble with implementing a JBIG compression of a array of bits.

I want to do JBIG compression, as found here: http://www.cl.cam.ac.uk/~mgk25/jbigkit/

So I have downloaded the kit into my Matlab workspace and added it to the build path. I am new to Matlab, can anyone explain what I am meant to do from here to get it to work?

thanks

bonapart3
  • 469
  • 7
  • 20
  • Did the files you downloaded not contain some sort of help files and/or demo code that shows how you use the code? (Note: we should not need to go to another website and download the same code to be able to help you) – nkjt Dec 12 '14 at 12:35
  • Thanks, I actually overlooked an examples folder, but the only thing it has a jbgtests file with % MATLAB code to generate test files that exercise a JBIG codec width = 1200; img = []; for y=1:650; mx = ceil(y / 5); line = uint8(repmat(round(rand(1,mx)),1,ceil(width/mx))) == 1; img = [img ; line(1:width)]; end imwrite(img, 'mx.png', 'PNG'); which doesn't really help me very much – bonapart3 Dec 12 '14 at 14:13
  • @conapart3 - That toolkit looks like it has to be compiled and built, and it is a command-line toolkit. As such, it doesn't look like you can integrate this with MATLAB unless you write a MEX wrapper for it. You'll have to save the images using JBIG in the command-line and decompress using the command-line as well. Either way, unless you write a MEX wrapper to interface the code directly with MATLAB, you can't bring this into MATLAB. – rayryeng Dec 12 '14 at 19:10
  • Thanks rayryeng, I actually spent the whole day trying to figure this out the hard way hahaha!:S I installed a C Compiler, compiled it all, but had no joy. So I found that there is a downloadable toolbox called "toolbox-wavelet" on the matlab file exchange that has the function 'perform-jbig-compression' along with the relevant C-code compression files. It took me a while to get it to work as I realised I had to add the DLLs used by the C code to the WINDOWS path rather than the 'ADD PATH' option in matlab. – bonapart3 Dec 12 '14 at 23:32

0 Answers0