Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > Visual C++
|
Visual C++ Questions specific to Microsoft's Visual C++. For questions not specific to this Microsoft version, use the C++ Programming forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual C++ section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 28th, 2008, 01:27 PM
Registered User
 
Join Date: Jan 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default fail to call a function .

Halo everyone, i am new to this forum and new to vc++ as well. Nice to meet u all.

as my topic mention above, i am failed to call a function.

by using vc++ 6, i create button on GUI and edited code on it. The function is named as shown below.In this part of code, i would like to call another function that called mask and there are 3 variables (m,x,and y)that i wish to bring along to the mask function.

The problem i meet is i failed to call the mask function.
what happen to my code?? is that i should not use "void" ??

Pleas advise ...thanks !!

void CFingerPrintBiometricSystemDlg::OnThinning()
IplImage* temp=cvCreateImage(cvSize(640,480),IPL_DEPTH_8U,1) ;
temp = cvLoadImage( "threshold_thin.bmp", 0 );
if(!temp) printf("Could not load image file:%s\n","threshold_thin.bmp");

int m;
int x=2;
int y=2;

CvScalar s;
for (m=0; m<8 ; m++)
{
    for (x; x< temp->width; x++)
    {
        for (y; y<temp-> height;y++)
        {
            s= cvGet2D(temp,y,x);

            if (s.val[0]=0)
            {
            mask(m,x,y);
            }
        }
    }
}


void CFingerPrintBiometricSystemDlg::mask(int m, int x, int y)
IplImage* temp=cvCreateImage(cvSize(640,480),IPL_DEPTH_8U,1) ;
temp = cvLoadImage( "threshold_thin.bmp", 0 );
if(!temp) printf("Could not load image file: %s\n","threshold_thin.bmp");

CvScalar value_white;
value_white.val[0] =255;
value_white.val[1] =255;
value_white.val[2] =255;

if (m=1)
{
CvScalar p_c;
p_c= cvGet2D(temp,y,x);

CvScalar p_cb;
p_cb = cvGet2D (temp,y-1,x);

CvScalar p_lb;
p_lb = cvGet2D (temp,y-1,x-1);

CvScalar p_rb;
p_rb = cvGet2D (temp,y-1,x+1);

    if (p_c.val[0]==0 && p_cb.val[0]==0 && p_lb.val[0]==0 && p_rb.val[0]==0)
    {
        cvSet2D(temp,y,x-1, value_white);
        cvSet2D(temp,y,x+1, value_white);

        cvSaveImage( "threshold_thin.bmp", temp );
        temp = cvLoadImage( "threshold_thin.bmp", 0 );
    }
}
.
.
.
.
.







Similar Threads
Thread Thread Starter Forum Replies Last Post
Call to function Awkuzu BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 September 19th, 2007 06:13 PM
Call a Function stealthdevil Access VBA 2 November 2nd, 2006 10:38 AM
How to call javascript function from VB function vinod_yadav1919 VB How-To 0 February 13th, 2006 06:03 AM
Help with Javascript function call fakeeyed Javascript 1 January 15th, 2006 04:27 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.