Real strange thing-someone help me [closed]

asked 2013-06-24 15:56:39 -0600

residentelvio gravatar image

Hi people it happened something strange. this is all the code of my project code I have to present to the 3 of july. It doesnt do what I want(don t open the windows I called SALMAP in the end of main) Really I was testing it. I arrived till here:

if(numColComp!=1){

conspic2 = Mat::zeros(img.rows,img.cols,CV_8UC3);

for(int i_c_comp=2;i_c_comp<numColComp;i_c_comp++){


imfft=FourierTrasform2D(rgbDecorrImg,chrLambda_max,imfft,padSize,sz2filt_r,sz2filt_c);
imfft.convertTo(imfft2,CV_8UC3);
imfft2= imfft2.reshape(numColComp,img.rows);

 namedWindow("Image Display", CV_WINDOW_AUTOSIZE);
 imshow("Image Display", imfft2);
 waitKey(0);
 destroyWindow("Image Display");

rows=*sz2filt_r;
cols=*sz2filt_c;
printf("r =%d , c= %d",rows,cols);

Till this part of code it works good. But after modify something to do it well as convertTO and reshape function to return with type CV_8UC3, because in some function Iuse some functions need a float matrix. Now I try to print matrix to see my errors, but it' impossible. If I want to print everything, a simple Hello world. It doesn t appear in the console.Im using eclipse. I hope it s not broken something. But how output I can see the window of some image(during wowking with code) and it works good.

Does anybody copy and paste on his pc the code and see if you have the same problem? Or help me to see what is the error

#include <stdio.h>
#include <cxcore.h>
#include <cv.h>
#include <highgui.h>
#include <math.h>

using namespace cv;

#define PI 3.14159265

struct ts{
  Mat data;
}tiese[4];

Mat colorDecorrelation(Mat img,int numColComp);
Mat FourierTrasform2D(Mat img, double Lambda_max,Mat imfft,int *padSize,int *sz2filt_r,int *sz2filt_c);
int roundIt(double num);
void pre_filter_Computations(double **radius,double **theta,int cols,int rows);
Mat logGabor(double **filter,Mat imfft,double r_o, double theta_o,double sigma_theta,double **radius,double **theta,int cols,int rows,double sigma_r,int *padSize);
Mat whitening_sqr_meanDistance(Mat X);
void ftshifting(double **filter,int rows,int cols);


int main(){

double achrScales,achrOrient,achrLambda_min,achrScFactor,achrDeltaAng,achrBwF,achrLambda_max,chrScales,chrOrient,chrLambda_min,chrScFactor,chrDeltaAng,chrBwF,chrLambda_max,sigma_r,wavelengths,sigma_theta,sigma,r_o,theta_o;
int nChannels,numColComp,*padSize,rows,cols,maxhw,*sz2filt_r,*sz2filt_c;
double **radius,**theta,**filter;
Mat img = imread("/home/elvio/workspace/aws/src/andaina.JPG");
Mat rgbDecorrImg,imfft,imfft2,imgDecorr,conspic1,conspic,conspic2,Tsquared,inCompImg,Salmap,SumSalmap,maxT,GaussKernel;
Mat achrRpad[4][7],chrRpad[4][5];
vector<Mat>stack;

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

namedWindow("Image Display", CV_WINDOW_AUTOSIZE);
imshow("Image Display", img);
waitKey(0);
destroyWindow("Image Display");

padSize=(int*)malloc(sizeof(int));
sz2filt_r=(int*)malloc(sizeof(int));
sz2filt_c=(int*)malloc(sizeof(int));

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

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

imgDecorr = colorDecorrelation(inCompImg,numColComp);

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

imgDecorr.convertTo(rgbDecorrImg,CV_8UC3);
rgbDecorrImg = rgbDecorrImg.reshape(numColComp,img.rows);

namedWindow("Image Display", CV_WINDOW_AUTOSIZE);
imshow("Image Display", rgbDecorrImg);
waitKey(0);
destroyWindow("Image Display");

if(numColComp==1){
 achrScales=7 ...
(more)
edit retag flag offensive reopen merge delete

Closed for the following reason not a real question by SR
close date 2013-06-30 16:24:45.646999

Comments

1

Are you kidding? Please pay someone to inspect your code. Alternatively, nail it down a specific question.

SR gravatar imageSR ( 2013-06-24 16:51:57 -0600 )edit

i m not kidding. i just wanna know if someone can copy and paste and see for example if he/she can print Hello world just in the first page. Because I can't and it s not possible.

residentelvio gravatar imageresidentelvio ( 2013-06-24 17:10:07 -0600 )edit
1

@residentelvio, i kinda sympathise with you, but SR's verdict is right. you wasted a whole week, crowdsourding any single offending line in your code

again, man gdb

berak gravatar imageberak ( 2013-06-24 17:18:51 -0600 )edit

I understand and I m sorry. you can close this question. it s just very strange. because it worked and printed all. after I returned with the project and it doesn t work again.

residentelvio gravatar imageresidentelvio ( 2013-06-24 17:40:03 -0600 )edit