Sharing data between Scilab and Scicos

Mrs. Khan rashaz111 at yahoo.com
Mon Apr 26 19:02:59 CEST 2010


Hello! I am trying to develop a model/GUI in Scicos
that allows a user to:

1. Acquire images from a target hardware
2. Apply image processing algorithm to acquired image
3. Plot relevant parameters
4. Change parameters of the hardware

At the moment, I am concentrating on step 1. My problem right now is:

1. After reading the BMP image using a C routine, I convert the image
array to a Scilab matrix. How can I use this Scilab matrix as an input to
the CMATVIEW block to view the image?

Other relevant information: I will only be dealing with gray-scale images.
The colormap information of BMP file is not important. The image array I
mentioned above, only contains pixel information. The Scilab matrix will
be a two-dimensional structure of pixels. I set the CMATVIEW parameters
to: { graycolormap(256), 0, 255}

In order to share data between Scilab and Scicos, I added the following
lines in the C routine (The C routine is executed when the function is called with flag 4):

// CreateVarFromPtr(1, "i", &xout, &yout, &out);

// (*blk).outptr[0]=istk(1);

"xout" is the height of the BMP file in pixels
"yout" is the width of the BMP file in pixels
"out" is the array of pixel data

But, the CMATVIEW block does not display image. There are no error
messages in either Scilab/Scicos during simulation. When I stop
simulation, the display window of CMATVIEW freezes and I am unable to
close it after that.

I am using a Generic block for this C routine. The output port of Generic
Block is connected to the input port of CMATVIEW. I modified the output
port size of Generic Block to [80, 80] which are the row and column widths
of the image.

I hope this description is clear. Please feel free to contact me if you
need clarification or additional information. Thank you.





      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20100426/715a5a62/attachment.htm>


More information about the users mailing list