I was hoping to speed up the code I mentioned last month implementing a line integral convolution (LIC) flow visualization, but I haven’t had time to improve it (and probably won’t for awhile). I would like to eventually write this as a DLM, but until then here’s my pure IDL draft. It contains a main-level program that is an example of using the main routine MG_LIC
.
Let me know if it helps or you make any improvements.
December 18th, 2007 at 11:37 am
I was excited to use this code. We need to provide vector display of data on a globe, but unfortunately the vector options in IDL make vector length a fraction of the grid cell, so any projection other than /CYLINDRICAL provides misleading vector lengths due to changing grid cell sizes. Your code appears to solve this.
There are two issues I have come across: 1) Our dataset is a FLTARR(36,24). It seems I need to scale this by a factor of 10 or more to get decent graphics from MG_LIC. 2) The speed moves from acceptable but slow to unacceptably slow once the array is enlarged.
I look forward to a DLM. I’ll subscribe to the comments feed on this post to monitor progress. I’ll also discuss doing the port ourselves as we are quite interested in this functionality, and let you know if we decide to do so.
December 18th, 2007 at 11:53 am
Yes, datasets have to be scaled to the size of the desired output image. This part is easy, see the main-level example program in the code for an example.
But, yes, the major problem is that it is really slow for any interesting size dataset. A DLM seems to be the way to go here. I’ll be doing some work in this area in January, so I’m hoping to have a faster solution then.
January 17th, 2008 at 2:42 am
I am a studend from China!Now I am doing a image transform in c/c++ just like the twirl transform in the photoshop! Somebody told me that the LIC method could solve the problem .
Maybe because I know little about image ,or my English is poor,I can not understand the paper –Imaging Vector Fields Using Line Integral Convolution well. I do not know how to present it in C/C++.
I do not know if LIC can solve my problem.The input image is not transformed in twirl.Of course,you can see the twirl transform in the photoshop.
Could you help me,please?My question are:
1?Can you please give me the key points of understanding LIC method?
2?Does LIC method can solve my problem?
If there are C/C++ codes with your answer to the two questions is better!
THANK YOU!
January 17th, 2008 at 10:12 am
I started on the DLM for the LIC implementation, hopefully I can finish it up this weekend.
I think that it would be good to answer your question about the key points of understanding the LIC method. I’ll write up a brief description with the article about the DLM.
On the second question, I’m not sure if LIC can solve your problem. I’m certainly no export on this technique, I just read a few papers. But I haven’t seen it used to twirl an image as you describe. I have seen it used on images to create motion blur and a “painted” effect.
March 19th, 2008 at 1:06 pm
[…] is available through vel, plot_field, or using particle_trace without appropriate seeds. I wrote an article about LIC and have a slow implementation. LIT, OSTR, and GSTR are not available from the IDL […]
April 8th, 2008 at 3:53 pm
OK, I finally have this code as a DLM. Execution time is a couple order of magnitudes faster: from 187.0 seconds down to 2.1 seconds for the 512 by 256 example running on my iMac.
I’m going to package this in a visualization library with some other stuff and make it available soon.
April 11th, 2008 at 12:19 am
[…] finished the line-integral convolution (LIC) implementation as a DLM and cleaned it up a bit (see other articles for background). More work is needed, but it can give useful results now. The movie at the […]