Retrieve the image size

1 回表示 (過去 30 日間)
ARJUN K P
ARJUN K P 2015 年 9 月 20 日
コメント済み: Walter Roberson 2015 年 9 月 20 日
img=imread('ll.bmp'); %512*512 size
imgcopy = img;
imgcopy(end-15:end) = []; %and now it is a vector size 1 * 262128
%doing some process...after that how to retrieve the image as size 512 * 512

採用された回答

Walter Roberson
Walter Roberson 2015 年 9 月 20 日
last16 = 42*ones(16,1); %set it to whatever is to go into the last 16 pixels
rebuilt = reshape([imgcopy(:); last16(:)], size(img));
Note: in your previous question, you were asking about the last 16 pixels of the last row as being removed, and the answer I provided there did that. But in your code here, you are removing the last 16 pixels of the last column, not of the last row. Rebuilding after deleting the last 16 pixels of the last row is slightly different.
  3 件のコメント
ARJUN K P
ARJUN K P 2015 年 9 月 20 日
got ans..thanku walter Sir
Walter Roberson
Walter Roberson 2015 年 9 月 20 日
rebuilt = reshape([imgcopy(:); last16(:)], fliplr(size(img))) .';
The code you have what you attached will only work if the image happens to be square.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with Image Processing Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by