Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

what I have to do is this operation in the picture:

C:\fakepath\Immagine.jpg

My code:

Mat img = imread("/home/elvio/workspace/aws/src/andaina.bmp"); 

if(img.empty()){
  cout<<"The image is empty \n";
 return -1;
}

rows=img.rows;
cols= img.cols;
nChannels= img.channels();
numColComp = nChannels ; 

inCompImg = img.reshape(numColComp,rows*cols);

imgDecorr = colorDecorrelation(inCompImg,numColComp); //function colorDecorrelation -obtain: decorrelated image, same dimensions as the original one

 rows=imgDecorr.rows;
 cols=imgDecorr.cols;
 nChannels= imgDecorr.channels();

  imgDecorr.convertTo(rgbDecorrImg,CV_8UC3); //to convert the image in colorDecorrelation function 
    //Infact in colorDecorrelaion I have to convert because of gemm function need a float
    //img.convertTo(img_f,CV_32FC3);
    //img_f=img_f.reshape(1,img.rows*img.cols); // 1 channel

Now I have that problem. I have to do this operation in Matlab:

rgbDecorr= reshape(imgDecorr, r, c, numColComp);

RGBDECORR is the last operation to obtain this part of the work in the image. Thanks helping