<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><pre>Hello! I am trying to develop a model/GUI in Scicos<br>that allows a user to:<br><br>1. Acquire images from a target hardware<br>2. Apply image processing algorithm to acquired image<br>3. Plot relevant parameters<br>4. Change parameters of the hardware<br><br>At the moment, I am concentrating on step 1. My problem right now is:<br><br>1. After reading the BMP image using a C routine, I convert the image<br>array to a Scilab matrix. How can I use this Scilab matrix as an input to<br>the CMATVIEW block to view the image?<br><br>Other relevant information: I will only be dealing with gray-scale images.<br>The colormap information of BMP file is not important. The image array I<br>mentioned above, only contains pixel information. The Scilab matrix will<br>be a two-dimensional structure of pixels. I set the CMATVIEW parameters<br>to: { graycolormap(256), 0,
 255}<br><br>In order to share data between Scilab and Scicos, I added the following<br>lines in the C routine (The C routine is executed when the function is called with flag 4):<br><br>// CreateVarFromPtr(1, "i", &xout, &yout, &out);<br><br>// (*blk).outptr[0]=istk(1);<br><br>"xout" is the height of the BMP file in pixels<br>"yout" is the width of the BMP file in pixels<br>"out" is the array of pixel data<br><br>But, the CMATVIEW block does not display image. There are no error<br>messages in either Scilab/Scicos during simulation. When I stop<br>simulation, the display window of CMATVIEW freezes and I am unable to<br>close it after that.<br><br>I am using a Generic block for this C routine. The output port of Generic<br>Block is connected to the input port of CMATVIEW. I modified the output<br>port size of Generic Block to [80, 80] which are the row and column widths<br>of the image.<br><br>I hope this description is clear. Please feel
 free to contact me if you<br>need clarification or additional information. Thank you.<br><br><br></pre></td></tr></table><br>