Logical thinking is always a bottleneck for me. Looking at others in a large number of articles, and I myself also for some trifles suppressed, the article is still empty, the heart really is not a taste. Just in decadent again cheer up once again. Seriously, the image allignment a good study, and strive to turn a body here.
MATLAB will use some of the image preprocessing, the most classic to several degrees of an image matrix Vectorization (vectorize). To put it bluntly, the image matrix is pulled into a long column vector. I used to do this job and would often use the reshape function. But this kind of functional processing method is not MATLAB style, yesterday and the younger brother discussed image allignment problem, suddenly be educated in fact this expression is the simplest
A=a (:)
Think about this is the real Matlab style! himself really is super stupid!
According to this idea you can do a small function that reads the same size JPG images in a given directory and pulls them into a column vector to store in a new matrix:
function [X,colvectorx,numimgs] = Readimgs (folder,imgtype) IMGs = Dir ([Folder '/' imgtype]); Numimgs = size (imgs,1); image = Imread ([Folder '/' IMGs (1). name]);%%normalizeing the image dataimage=normalimg (image); Storing the Image datax = zeros ([Size (Image) Numimgs]); Colvectorx=zeros ([Size (image,1) *size (image,2) *size (image,3) numimgs]);% vectorized datafor i=1:numimgs image = Double (Imread ([Folder '/' IMGs (i). name])); if (size (image,3) = = 1) X (:,:, i) = image; else X (:,:,:, i) = image;% I is the index of the image sequence% Colvectorx (:, i) =reshape (image,1,size (image,1) * Size (image,2) *size (image,3)) ';%I T ' s so stupid Colvectorx (:, i) =image (:) '; endend
over! The writing is ugly, we barely look at .......
Some preprocessing methods in the process of image processing