Archive for the ‘Uncategorized’ Category

Loading JP2 and J2K images works!

July 31, 2006

I was finally able to find the error in my jpeg2000 plugin code. The reason for the error was that I was not reading the filename properly (basically reading NULL) and because of this I was getting segmentation faults when it tried to load images. I always assumed that the run function would automatically have the filename and never bothered to check this!  I solved the problem by providing the necessary arguments in the query function.

The good thing is that the load plugin is working smoothly on the select images that I tested it on. It may be a little slow but I can definitely speed it up using row processing. I used the openjpeg library although I could have used the jasper library as well because the problem I was getting was common. But the openjpeg library is specifically geared towards jpeg2000 development and the library functions are a lot more easier to use that the jasper library. The final code is also very clean.

A screenshot of how the image was loaded is shown below.


I will be out attending a family function for the next two days and will start working on refining the current load code and then work on saving as jp2 or j2k images.


Compiling GIMP from source

May 29, 2006

I was confused when I did not notice any options (quality, blocksize etc) for converting to jpeg2000 but on digging out the manual I found a whole bunch of options to specify.  These were also defined in the jp2.c file provided by jasper, but I guess I overlooked it.  So I know what controlling parameters to put in the final interface.

I also got myself the source code of GIMP 2.2 and compiled it.  It took a while to get all the necessary libraries, but it worked out well in the end.  I looked at the jpeg.c plug-in and will use this as a starting point for the jp2 plug-in.  I have got everything I needed and should be able to get something useful working by tomorrow.

Schedule for the next couple of days:

  1. Write code using jasper libraries to read jp2 files.
  2. Learn how to write plug-ins and also how to add the jp2 extensions to the gimp interface.
  3. Write code for saving images as jp2 files

Hopefully I should be abe to these by Wednesday.  My parents have planned a 2 week vacation to visit several places followed by a week of stay at my grandparents place starting this Thursday.  I may not get much coding done during this time, but will catch up on reading for other wavelet applications.  The good thing is that I don't have any more plans to go out after that so I can spend all my time ont his project

The start of summer

May 26, 2006

Well my summer as officially started and will mainly go by in implementing various wavelet based applications for GIMP. This what this blog is about and I will mainly discuss various things I am implementing. A rough proposal for the same can be found here.

I have already started working on making a jpeg2000 plug-in using libraries provided by the Jasper project. So far I have installed vmware on my windows and got an ubuntu system working for the necessary development. I have installed the jasper libraries and have gone over the jpeg2000 paper that they have provided. I tried using the code on some test images and it seems to be working fine. One thing which bugs me is that on convering an image to jpeg2000, there are no parameters that I can input. I was guessing there would such an option depending on how much wavelet coefficient to choose. I may have to go over the manual to see what is going on there. Other than that the libraries seem to be well written and documented so I should not have trouble using them. After doing some more reading today, tomorrow I will look more closely at the given code and hopefully get something useful out of it so that. Then I will start learning how to write a GIMP plug-in and then things should move along well. I am really excited on learning on how to write plug-in as its been a while since I have done some hardcore C programming. The past year has been all Matlab realted stuff. Well I am officially an engineer now, so theoretically I should not have problems..or will I!!