| Home Introduction User's Guide Download

| developer guide ¡ú Modified Functions |  |

| 1 . Interface functions Before our modification, when you are compiling the interface programme, you should confirm that the file builder.sce is running from the directory where it was under, otherwise the compiling will cease because of errors. When you execute the builder.sce of some interface programme, its corresponding gateway file(ilib_name.c), loader file(loader.sce) and Make file(Makelib.mak) will be produced under the directory where you start Scilab, and then Scilab will compile the interface programme to produce OBJ file. So if Scilab and builder.sce are not under the same directory, Scilab can not find the interface programme, as a result errors will be reported. So if you want to compile an interface programme, you should use the command 'chdir()' firstly to change Scilab's directory to the directory where builder.sce is under. If you want to execute the builder.sce of different interface programmes under different directories at the same time, you must continually change Scilab's directory, it is boring. Because of above trouble, we altered three Scilab's functions ilib_compile.sci, ilib_gen_loader.sci and ilib_gen_Make.sci to make three functions know the directory where the builder.sci is under. When Scilab executes three functions, the directory where you start Scilab will be automatically changed to the directory where the builder.sce is under , then Scilab finds the corresponding files ,executes them and produces some files under the directory. There is no need to change the directory of Scilab artificially to the directory where builder.sce is under before executing builder.sce. It is very convenient.

The modification of the three functions is to get the directory of builder.sce through parameter 'ilib_name', here is the code:

k=strindex(lib_name,['/','\'])
if k~=[] then
path=part(lib_name,1:k($))
lib_name=part(lib_name,k($)+1:length(lib_name))
else
path=''
end
lib_name=strsubst(lib_name,'.c','')
¡
chdir(path);

After the modification of the three functions, builder.sce also needs to be altered. Because we hope to get the directory of builder.sce through ilib_name. So we should add the directory of builder.sce before interface library name, the code is :

ilib_name = 'buider.sce_dir/libname'

After all the above modification ,no matter where Scilab executes builder.sce, the three files will been produced under the directory where builder.sce is under, and then compiling will been correctly done.

2 . SIP functions

1) imshow.sci £º Before when the Windows-version SIP function imshow() displays a truecolor image £¬ the matrix which stores the imformation of image needs to be multiplied a modulus, and images of different formats need different moduli, and even images of the same format need different moduli. This makes display inconveniently. We hope that function imshow() can display any format image in the same form £¬ so we imitate the display way in which the Linux-version SIP function display images . After our modification, the function imshow() can display any format image in the same form, and the matrix doesn't need to multiplied a modulus before displaying an image.

2) ind2rgb.sci: Linux-version SIP has the function, while Windows-version SIP does not. You should alter Linux-version ind2rgb function, if you want execute the function under Windows. Because if you directly execute the function without alter, under Windows the minimum of the index matrix of an indexed image is zero, while the index value 0 will lead to index failure. Through our experiments, we find Linux-version ind2rgb function added the codes 'idx = idx+1;' at the beginning of the function will be correctly executed under Windows.

3) xgetpixel.sci: The original purpose of this function is to get the position of some pixel you point to in a image. After our modification, the function can also get the RGB of some pixel you point to in a truecolor or indexed image. And now the function has three parameters.

We also modify some other SIP functions, there are im2bw.sci, im2gray, dilate.sci and erode.sci . The modification of these functions is hairlike, and our modification is done under the Free Software Foundation's General Public Licence.

Entry
Home Introduction User's Guide
Function Reference
SIP Functions New Image Func Video Functions
Developer's Guide
Graphical Display Video Processing Modified Functions GUI
Demo
Image Processing Video Processing
Support
Future Work Known Bugs FAQ Acknowledgement About Us

|  |  | About Us | Contact Us | Our University Copyright © 2004-2005 Scilab group of Xiamen University, China |  |