HOG in Matlab - split images into blocks and calculate the orientations -
enter image description herei have problem. have implemented code split image blocks calculating orientations each block, code:
a=imread('009055_0m54.jpg'); a1=imresize(a,[300,340]); cbs=100; ck1=1; cblock(:,:,:,1)=a1(1:100,1:100,:); cblock(:,:,:,5)=a1(101:200,1:100,:); cblock(:,:,:,9)=a1(201:300,1:100,:); ci1=1:3 ck1=ck1+1; cj1=1:3 row1=80 ; row2=180; cblock(:,:,:,ck1)=a1( (cbs*(ci1-1)+1:cbs*(ci1-1)+cbs), ((row1+1)+(cj1-1)*80:row2+(cj1-1)*80),:); ck1=ck1+1; [featurevector, hogvisualization] = extracthogfeatures(cblock(:,:,:,ck1)); figure; imshow(cblock(:,:,:,ck1)); hold on; plot(hogvisualization); end end
it works, blocks black, without image. if example edit line:
imshow(cblock(:,:,:,1)); hold on;
the program shows me 6 equal block, works well! example, edit line in:
imshow(cblock(:,:,:,3)); hold on;
the program shows me 6 blocks, of 5 equal blocks , first block such black block, without image! in fact when used main code:
imshow(cblock(:,:,:,ck1)); hold on;
the block 3 black code! please, me! everyone
to try replicate 1 need image comes , extracthogfeatures function ?
Comments
Post a Comment