[Moderator- The subject line should reflect the nature of the
post, not its perceived priority. --mod PN]


i am using C++ on msvc++ 2008 sp1..........now my question is how can i pass 
the stndrd template list to a different function void block_separation(IplImage 
*,IplImage *,list<col_info> &)?????????????????????????????????i am giving both 
function definition here.......




#include "stdafx.h"
#include "cv.h"
#include "highgui.h"
#include "cxcore.h"
#include<stdio.h>
#include<iostream>
#include<list>
#include<cstdlib>

using namespace std;



void show_image(IplImage *);
        IplImage* binary(IplImage *);
        int mode_calculation(IplImage *);
        //void vertical_histogram(IplImage *);
IplImage * vertical_histogram(IplImage*);
IplImage * converting_to_connected_string(IplImage *,int);
void block_separation(IplImage *,IplImage *,list<class col_info>&list);

struct col_info
{
public:
        int x_start;
        int y_cor_val;

        int x_end;
        //int y_end;
public:
        col_info(){}
        col_info(int x_s,int x_e){ x_start=x_s;x_end=x_e;}
        col_info(int y){y_cor_val=y;}




};



void col_sep2(IplImage * img){


        IplImage * con_string=converting_to_connected_string(img,30);
        int i,j,k,i1=0;
        int step1 = img->widthStep/sizeof(uchar);
        int count=0,flag=0,count1=0;
        list<col_info> l;


        for(j=0;j<con_string->width;j++)
        {
                for(i=0;i<con_string->height;i++){
                        if(CV_IMAGE_ELEM(con_string,uchar,i,j)==255)
                                count++;
                        else if(CV_IMAGE_ELEM(con_string,uchar,i,j)==0 && 
count<300)
                                count=0;
                }
                if(count>300) {
                        count1++;
                        count=0;
                }
                if(count1>10)
                {
                        for(i=0;i<con_string->height;i++){
                                k=i;
                                if(CV_IMAGE_ELEM(con_string,uchar,i,j)==255)
                                        count++;
                                else if(CV_IMAGE_ELEM(con_string,uchar,i,j)==0 
&& count<300)
                                        count=0;
                                if(count>300)
                                {
                                        i1=k-count;printf("i1=%d",i1);
                                        
while(CV_IMAGE_ELEM(con_string,uchar,i1,j)==255)
                                        {
                                                
con_string->imageData[i1*step1+(j-(count1/2))]=0;
                                                i1++;
                                        }
                                        l.push_back(col_info(k-count,i1));
                                        l.push_back(col_info(j));
                                        count=0;
                                }
                        }
                        count1=0;
                }
        }
cvSaveImage("D:/outdir/imkcon.jpg",con_string);
show_image(con_string);


block_separation(img,con_string,list<col_info> &l);
}











#include "stdafx.h"
#include "cv.h"
#include "highgui.h"
#include "cxcore.h"
#include<stdio.h>
#include<iostream>
#include<list>
#include<cstdlib>
#include<cmath>


using namespace std;


void show_image(IplImage *);
        IplImage* binary(IplImage *);
        int mode_calculation(IplImage *);
        void col_sep(IplImage *,int);




class col_info;



void block_separation(IplImage *img,IplImage *cols,list<col_info> &l){

        list<col_info>::iterator p=l.begin();

        //while(p!=l.end())
        //{



        //      p++;

        //}















        //int i,j,k;

        //for(i=0;i<img->hight;i++)
        //{
        //      for(j=0;j<img->width;j++)
        //      {
        //              if(CV_IMAGE_ELEM(img,uchar,i,j)==0)


        //IplImage* img = cvCreateImage(cvSize((img->width),img->height), 
img->depth, img->nChannels);




}









i am getting error like:



1>------ Rebuild All started: Project: cvTest, Configuration: Debug Win32 ------
1>Deleting intermediate and output files for project 'cvTest', configuration 
'Debug|Win32'
1>Compiling...
1>stdafx.cpp
1>Compiling...
1>binary.cpp
1>block_separation.cpp
1>col_sep.cpp
1>d:\visual studio 2008\projects\cvtest\cvtest\col_sep.cpp(61) : warning C4309: 
'=' : truncation of constant value
1>d:\visual studio 2008\projects\cvtest\cvtest\col_sep.cpp(55) : warning C4101: 
'val' : unreferenced local variable
1>d:\visual studio 2008\projects\cvtest\cvtest\col_sep.cpp(67) : warning C4101: 
'col_val' : unreferenced local variable
1>d:\visual studio 2008\projects\cvtest\cvtest\col_sep.cpp(40) : warning C4101: 
't' : unreferenced local variable
1>d:\visual studio 2008\projects\cvtest\cvtest\col_sep.cpp(67) : warning C4101: 
'row_val' : unreferenced local variable
1>col_sep2.cpp
1>d:\visual studio 2008\projects\cvtest\cvtest\col_sep2.cpp(23) : warning 
C4099: 'col_info' : type name first seen using 'class' now seen using 'struct'
1>        d:\visual studio 2008\projects\cvtest\cvtest\col_sep2.cpp(20) : see 
declaration of 'col_info'
1>d:\visual studio 2008\projects\cvtest\cvtest\col_sep2.cpp(92) : error C2275: 
'std::list<_Ty>' : illegal use of this type as an expression
1>        with
1>        [
1>            _Ty=col_info
1>        ]
1>coloumn_detection.cpp
1>converting_to_connected_string.cpp
1>cvTest.cpp
1>horizontal_projections_within_boundary.cpp
1>d:\visual studio 
2008\projects\cvtest\cvtest\horizontal_projections_within_boundary.cpp(31) : 
warning C4309: '=' : truncation of constant value
1>mode_calculation.cpp
1>d:\visual studio 2008\projects\cvtest\cvtest\mode_calculation.cpp(64) : 
warning C4018: '<' : signed/unsigned mismatch
1>para_sep.cpp
1>d:\visual studio 2008\projects\cvtest\cvtest\para_sep.cpp(42) : warning 
C4101: 'l' : unreferenced local variable
1>d:\visual studio 2008\projects\cvtest\cvtest\para_sep.cpp(42) : warning 
C4101: 't' : unreferenced local variable
1>show_image.cpp
1>vertical_histogram.cpp
1>d:\visual studio 2008\projects\cvtest\cvtest\vertical_histogram.cpp(32) : 
warning C4309: '=' : truncation of constant value
1>Generating Code...
1>Build log was saved at "file://d:\Visual Studio 
2008\Projects\cvTest\cvTest\Debug\BuildLog.htm"
1>cvTest - 1 error(s), 11 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========


Reply via email to