Load image in form one-dimensional signal
Show older comments
How can I use the Matlab statement "s = leleccum(1:3920)" for any image rather than leleccum image? The number 3920, what it means please I need your help Arkan
Answers (2)
Walter Roberson
on 10 Dec 2016
Img = imread('ImageFileName.png');
s = Img(:) ;
Image Analyst
on 10 Dec 2016
That takes an image called leleccum and stacks all columns on top of each other with col 1 at the top, then col 2 underneath that, then col 3 and so on. Then it extracts the first 3920 elements of that column vector into a new column vector. This may or may not be an exact integer number of columns.
To do it for an image of any other name, simple use the name of the other image.
For example to get the first 58 pixels in image "grayImage", do this:
s = grayImage(1:58)
4 Comments
Walter Roberson
on 10 Dec 2016
Actually it is not an image, it is a 1x4320 double.
Image Analyst
on 10 Dec 2016
OK. I didn't know that because he called it an image and didn't say anything about wavelets or where that variable might have come from. I've added the Wavelet Toolbox to the product list above.
Arkanra Kadhum
on 11 Dec 2016
Edited: Image Analyst
on 11 Dec 2016
Image Analyst
on 11 Dec 2016
OK, so...did you do that? Did you convert your image to double like it said? If not, why not?
Categories
Find more on Image Segmentation and Analysis in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!