0
votes

Using scilab for the first time and I do not know how to fix it. I want to convert RGB image to grayscale. What to do?

awefew

1
try to give a detailed information about your question. Add your code , what issue your facing? , where your blocking? , what you tried so far? like the way you have to ask your question. - Agilanbu
Hi Riazul! Welcome to StackOverflow! Could you please include your relevant code and the exact error? Just having an image makes it harder for people to help you with your problem. - Christopher Bradshaw

1 Answers

0
votes

The imread() function doesn't exist natively in Scilab (are you trying to port a Matlab code?). It does exist, however, as part of the SIP (Scilab Image Processing) toolbox which can be downloaded and installed using ATOMS (Scilab's Toolbox Manager). You can find ATOMS under the "Applications>ATOMS" menu in the Scilab console.

SIP also comes with the im2gray() function which essentially does what you want. After having installed and loaded SIP in Atoms, try:

// import RGB jpeg pic
RGBpic = imread("rgb.jpg");
// convert to grayscale
GSpic = im2gray(RGBpic);
// create new figure window and display grayscale pic  
scf(0);clf();
imshow(GSpic);