From: Kris zenitis on 26 Apr 2010 19:49 Ok I find a function in the internet that marks what i want exactly i have another question and a help would be appreciable look to this code: <#> % clear all clc X=imread('crowd.jpg'); %image dimensions 270x450 J = rgb2gray(X); J=double(J)/255; J=histeq(J); A=im2col(J,[9,9],'sliding'); % I divide the figure into blocks of 9x9 [m n]=size(A); image=reshape(A,9,9,n); kernel = 'linear'; %just forget the following 8 lines %par_c = input('Give C:'); par_c=1; train_param = ['-t 0 -c ' num2str(par_c)]; model = svmtrain(train_lb, myth,train_param); matia=zeros(n,1); [predict_label, accuracy, dec_values] = svmpredict(-ones(n,1), A', model); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MB=image; fig=reshape(A,9,9,n); for i=1:n %%%%%%%%inside this for i made a white frame in the 9x9 erctangulars i want if dec_values(i)>0 %imshow(image(:,:,i)) matia(i,1)=1; MB(:,:,i)=imrect(fig(:,:,i),1,1,9,9); end end im=reshape(MB,81,n); imII(:,:,j)=im; end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% im=reshape(MB,81,n); im=imII(:,:,45); img=col2im(im,[9,9],[270,450],'sliding'); %%%%%here is the problem i ve tried to show again the complete picture with the frames but i ve problems imshow(img);<#> I ve this message from col2im: ??? Error using ==> reshape To RESHAPE the number of elements must not change. Error in ==> col2im at 84 a = reshape(b,mat(1)-block(1)+1,mat(2)-block(2)+1);
From: Kris zenitis on 27 Apr 2010 06:29 anyone?
From: ImageAnalyst on 27 Apr 2010 09:03 On Apr 27, 6:29 am, "Kris zenitis" <gio.1...(a)hotmai.com> wrote: > anyone? -------------------------------------------------------------------------------------------- Upload crowd.jpg to http://drop.io so people can try it. Pick http://drop.io/zenitis or something like that as your URL
First
|
Prev
|
Pages: 1 2 Prev: remove scientific notation from plot axes Next: Convert C array into mxArray Type |