フィルターのクリア

grouping the pixel pairs and vice versa

2 ビュー (過去 30 日間)
Mahmudul  Hasan
Mahmudul Hasan 2016 年 11 月 30 日
コメント済み: Walter Roberson 2016 年 12 月 2 日
Hello everybody. I found the following codes for grouping the pixels and that works very nice. Can anybody help me to back to the original pixels format. That means i want the pixels values grouping and vice versa.
%grouping the pixel pairs
img=imread('C:\Users\Desktop\image\t1.png');
[rows,cols]=size(img);
[x,y]=ndgrid(1:rows,1:2:cols);
ind=sub2ind(size(img),x,y);
ind_shift=sub2ind(size(img),x,y+1);
pixels1=img(ind);
pixels2=img(ind_shift);
pixels=[pixels1(:) pixels2(:)];
[row1,cols1]=size(pixels);
  3 件のコメント
Mahmudul  Hasan
Mahmudul Hasan 2016 年 12 月 2 日
編集済み: Mahmudul Hasan 2016 年 12 月 2 日
Thanks @Walter Roberson. But how do i resize the image or concatenate the image?
Walter Roberson
Walter Roberson 2016 年 12 月 2 日
The results pixels1 and pixels2 are arrays that represent images. You can resize images in multiple ways including imresize() . You can concatenate arrays with cat() or horzcat() or vertcat() or []

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

回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by