[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XForms] image convolution

From: alessandro basili
Subject: Re: [XForms] image convolution
Date: Fri, 27 Apr 2012 12:45:31 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:11.0) Gecko/20120327 Thunderbird/11.0.1

On 4/26/2012 7:25 PM, Jens Thoms Toerring wrote:
>>>     for (weight = i = 0; i < kcol * krow; i++)
>>>         weight += kernel[0][i];
>> where kcol and krow are the columns and rows of the kernel. Since the
>> kernel is allocated with fl_get_matrix function the variable /i/ will
>> certainly go beyond the array dimensions.
>> Is this a potential problem or I'm missing something?
> What you get back from fl_get_matrix() is actually (a pointr
> to) an array of pointers (lets call ir 'result'), with result[0]
> being a pointer to memory of kcols*krows times the size of the
> individual elements bytes. result[1] is a pointer to the start
> of the second row of the elements, resut[2] the thri row etc.

got your point. Clear.

>> By the way, my pseudo code is the following:
>>> int kcol = 5, krow = 5;
>>> int **kernel = fl_get_matrix(kcol, krow, sizeof(**kernel));
>>> init_kernel(kernel, "gaussian", kcol, krow);
>>> flimage_convolve(im, kernel, kcol, krow);
> This looks quite ok to me, but I can't tell what you're
> doing in init_kernel();-) Do you have something I could
> debug on? I have spent only minmal amount of time on the
> flimage stuff, so there could still lurk a lot of bugs...

actually the init_kernel() function is simply the function that
initialize the kernel with a gaussian filter, nothing special with it to me.

>                             Best regards, Jens

reply via email to

[Prev in Thread] Current Thread [Next in Thread]