i split the image pixels into many small matrices

조회 수: 4 (최근 30일)
parvatham vijay
parvatham vijay 2019년 10월 23일
댓글: Rik 2019년 11월 1일
i split the image pixels into many small overlapping matrices
block(:,:,kk+j)=grey_img((i:i+2),(j:j+2))
i want to recombine this overlapping matrices how please help
  댓글 수: 2
Rik
Rik 2019년 10월 23일
How do you want to recombine this? Purely based on the variable name I think the blockproc function might be a better choice.
Rik
Rik 2019년 10월 23일
Comment posted as answer by parvatham vijay:
Thank you
how to use blockproc for dividing the 256x256 matrix into 3x3 matrix with overlapping,kindly help

댓글을 달려면 로그인하십시오.

채택된 답변

Rik
Rik 2019년 10월 23일
The blockproc function works on distinct blocks. If you want a sliding window operation you need to use a function like nlfilter.
A = imread('cameraman.tif');%load an included 256x256 example image
fun=@(x) max(x(:));
B=nlfilter(A,[3 3],fun);
%show input and output
figure(1),clf(1)%only use clf during debugging
subplot(1,2,1)
imshow(A)
title('original')
subplot(1,2,2)
imshow(B)
title('filtered')
The function can be as complicated as you want it to be.
  댓글 수: 2
Rik
Rik 2019년 10월 27일
Comment posted as answer by parvatham vijay:
what is function @(x), i couldn't get idea,pl.explain how to use function
Thank you
Rik
Rik 2019년 10월 27일
See this link.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

parvatham vijay
parvatham vijay 2019년 11월 1일
i want to create a matrix which contains the numbers from 1 to 256, (3x3 matrix but continiously,)
3 rows and 768 columns.the matrix is a repeated matrix ,here 2nd and third column repeated
then 3rd and 4th column repeated.(1,1 1,2 represents first row ,first column element ;like wise)
1,1 1,2 1,3 1,2 1,3 1,4 1,3 1,4 1,5 ...etc
2,1 2,2 2,3 2,2 2,3 2,4 2,3 2,4 2,5 ....etc
3,1 3,2 3,3 3,2 3,3 3,4 3,3 3,4 3,5 ....etc
i tried this code but i cant get this answer
clear all
close all
a= [1:10];
for i=2:4
j=2:4
a(i,:)=a(i-1,:)+3;
end
this is sample i have taken 1 to 10 numbers
Kindly help
  댓글 수: 1
Rik
Rik 2019년 11월 1일
Please stop posting your comments (or questions) as answer. Also, your question is unformatted, making it difficult to understand. Please use the layout tools to make your question more readable.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by