how to do windowing in image using matlab?
이전 댓글 표시
how to do windowing in image using matlab?
댓글 수: 2
SRI
2014년 7월 3일
Hi shah Could you please clear with your question so that we can assist you with the solution
Sheema Khattak
2014년 7월 4일
답변 (2개)
Image Analyst
2014년 7월 4일
0 개 추천
Try conv2(), imfilter(), or nlfilter(), or blockproc() depending on exactly what you want to do. conv2() and imfilter() are for linear filters. nlfilter is for any bizarre custom function you want write and apply to each window. blockproc() is if you want to process windows in "jumps" where it moves from one location to the next by more than 1 pixel.
댓글 수: 5
Image Analyst
2014년 7월 6일
shah, what's the status? Do you have it working? If not, post your image and the kind of filter you want to do, otherwise, mark the Answer as accepted.
Sheema Khattak
2014년 7월 6일
Image Analyst
2014년 7월 6일
I never use fwind1() or fwind2() - you don't need them to do linear filters since you can use conv2() and nlfilter() instead. conv2 is convolution which flips the kernel as convolution required. imfilter() just keeps the kernel as it is (doesn't flip) and multiplies and sums. Same as convolution except without the flip. Makes no different for symmetrical filters. fspecial is used to build kernels (filters) of certain patterns, like Gaussians. nlfilter() is used to build non-linear filters - something other than multiply and sum - which conv2() and imfilter() can't do.
Sheema Khattak
2014년 7월 7일
Image Analyst
2014년 7월 7일
No. To do that you need to do connected components labeling. But even before that you need to do image segmentation to find the "objects". See my Image Segmentation Tutorial: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
SRI
2014년 7월 7일
clc;
close all;
input = imread('cameraman.tif');
[row,col] = size(input);
% minValue = mean(mean(input));
for i = 2:row-1
for j =2:col-1
outImage(i-1:i+1,j-1:j+1) = input(i-1:i+1,j-1:j+1)
% if outImage(i-1:i+1,j-1:j+1) < minValue % outImage(i-1:i+1,j-1:j+1) = 1;
% end
end
end
Hi shah you just apply any filter operation with this code because this will divide a image into 3 *3 matrix after that you can process as you wish
카테고리
도움말 센터 및 File Exchange에서 Image Filtering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!