필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

I have an image and I need to extract local features,so I divided it to 16 blocks and size of each block =64 *64 pixels and extract that three color histograms features locally from block, how can i do?

조회 수: 2 (최근 30일)
tic disp('query') [filename, pathname]=uigetfile({'*.jpg'},'queryimage'); img=strcat(pathname,filename); a=imread(img); subplot(4,5,3) imshow(img) set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0.05 1 0.95]); [r, c, numOfBands] = size(a); %dividing image into 8x8 subblocks bs=64;%block size nob=(r/bs)*(c/bs);%Total no of blocks k=0; for i=1:(r/bs) for j=1:(c/bs) T=k+j; T=num2str(T); C=strcat(b,T); col1=bs*(j-1)+1; row1=bs*(i-1)+1; col2=bs*(j-1)+bs; row2=bs*(i-1)+bs; C=imcrop(a,[col1 row1 col2 row2]); end k=k+(r/bs); end b = rgb2hsv(b); % split image into h, s & v planes h = b(:, :, 1); s = b(:, :, 2); v = b(:, :, 3); % Create the histogram quantized into 8×3×3 bins X= zeros(8, 3, 3); for k = 1 : numel(h) indexH = floor(8 * h(k)) + 1; indexS = floor(3 * s(k)) + 1; indexV = floor(3 * v(k)) + 1; if indexH > 8 indexH = 8; end if indexS > 3 indexS = 3; end if indexV > 3 indexV = 3; end X(indexH, indexS, indexV) = X(indexH, indexS, indexV) + 1; end
# like wise i have to compute x for each block and store in a matrix how do i do that?

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by