OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Thu, 16 Nov 2017 09:05:39 -0600why we do reshape to the matrix of an image before doing pcahttp://answers.opencv.org/question/178471/why-we-do-reshape-to-the-matrix-of-an-image-before-doing-pca/Hi. i am trying to implement PCA algorithm on an image but as i was searching i found many do reshaping to the matrix (image). i understand the concept of the PCA but when it comes to the implementation i don't know what's the benefit of reshaping the image. as far as i know reshaping matrix is like resizing the matrix.
another question.
when i reshape a matrix of 3x3 to 3x1. that means i lost information (i lost 2 columns).AhmedSh3banThu, 16 Nov 2017 09:05:39 -0600http://answers.opencv.org/question/178471/Reshape functionhttp://answers.opencv.org/question/15419/reshape-function/Hi I have to translate from MAtlav to C this lines:
x=reshape(img,r*c,numChannels);
x=reshape(img,r,c,numChannels);
x=reshape(img,r,c);
x=reshape(img,r*c,scalesNumber);
I didn t understand well this function, but I tried with:
x=img.reshape(numColComp,rows*cols);
x=img.reshape(numColComp,rows);
x=img.reshape(numColComp,rows); //or x=img.reshape(0,rows)
x=img.reshape(0,rows);
I suppose I m doing it bad
residentelvioWed, 19 Jun 2013 11:04:08 -0500http://answers.opencv.org/question/15419/