Real strange thing-someone help me [closed]

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

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:


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

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

imfft2= imfft2.reshape(numColComp,img.rows);

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

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;

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];

 printf("The image is empty \n");
 return -1;

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


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

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

imgDecorr = colorDecorrelation(inCompImg,numColComp);

nChannels= imgDecorr.channels();

rgbDecorrImg = rgbDecorrImg.reshape(numColComp,img.rows);

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

 achrScales=7 ...
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



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 -0500 )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 -0500 )edit

@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 -0500 )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 -0500 )edit