Solved

very important, how can i run this in visual c++

Posted on 2004-08-30
18
793 Views
Last Modified: 2012-06-27
Hi Experts

Please answer this question

i'm new to Visual C++, " i don't now any thing about this language"

i was searching on the internet for simulating for human body project code, then i found this website please check the link
http://www.fuzzgun.btinternet.co.uk/rodney/humanbody.htm


which contain the full code which writtin in visual c++

http://www.fuzzgun.btinternet.co.uk/rodney/bodypostures.zip
i read the article, and i found that the author said to run this project you have to download the open cv vrom sourceforge
check the site here
http://sourceforge.net/projects/opencvlibrary/
http://prdownloads.sourceforge.net/opencvlibrary/OpenCV_b4a.exe?download

i download the sourch code and i downloaded the open cv library
and i have a usb web camera and i have visual c++ programming language

but the problem i don't know how to use visual c++ and the open cv library, so i can't run the code

i need to implement this code for my graduating project.

please expert i need a detailed steps about how to run this program,  i don't have time to learn visual c++ on this time

please write the answer in details

regards
0
Comment
Question by:firasattar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
  • 4
  • +1
18 Comments
 
LVL 19

Accepted Solution

by:
drichards earned 400 total points
ID: 11932285
You cannot do it with Beta4 of OpenCV without patches to files in bodypostures.zip.  The OpenCV library has apparently changed since the hbp project was written and it is no longer compatible.  I went back to Beta3 and it builds OK.  Here's what I did:

1) Unzip bodypostures.zip into a project directory.

2) install Beta3 of OpenCV (http://prdownloads.sourceforge.net/opencvlibrary/OpenCV_b3.exe?download)  3.1 may also work, but I didn't try it.

3) Open Visual C++ 6.0 and load the "hbp.dsw" file (use File->Open Workspace) and browse the folder where you installed hbp project.  You will find the dsw file in  "<your dir>\Develop\hbp" where <your dir> is where you unzipped in step 1.

4) Right click on "hbp Files" on the FileView tab in VC++ and select "Settings..."

5) In the Settings dialog, go to the C/C++ tab and select the "Preprocessor" category in the dropdown.  In the "Additional include directories:" box, add "<OpenCV install dir>/cv/include;<OpenCV install dir>/cvaux/include".  Do this for both the Debug and Release settings (dropdown in upper left of dialog)

6) Also in Settings dialog, go to the Link tab and select the "Input" category in the right hand dropdown.  In the "Additional library path:" box, type "<OpenCV install dir>/lib" and then select the General category and in "Object/library modules:" add "cv.lib cvaux.lib".  Do step 6 for both Debig and Release settings like step 5.

7) Right click "hbp Files" and select "Build".  You should be good to go.

0
 
LVL 19

Expert Comment

by:mrwad99
ID: 11932423
Hmm.  Looking at that, it appears that you dont need to build the VC++ project.  That is just for the DLL, and the DLL (hbp.dll) is already included in the zip.

It would hence appear that to run the exe that you see on the first page you link to you just need to build the front end VB app.  For this you need Visual Basic.  I take it that this uses the hbp.dll built in VC++.
0
 
LVL 19

Expert Comment

by:mrwad99
ID: 11932436
...hence you don't need OpenCV at all.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Expert Comment

by:drichards
ID: 11932702
By golly your are right.  The dll is in there.  Well if you WERE to rebuild... :)
0
 
LVL 19

Expert Comment

by:drichards
ID: 11932714
But you DO need OpenCV, and the correct version, because there are two dlls that are used from it.  Don't have to rebuild hbp.dll, though.
0
 
LVL 19

Expert Comment

by:mrwad99
ID: 11932745
...so all that the Q'ner needs to do is rebuild the VB project to get the runable exe ("runable exe" - is that a tautology ?!)
0
 
LVL 19

Expert Comment

by:drichards
ID: 11932980
>> ...so all that the Q'ner needs to do is rebuild the VB project to get the runable exe

And install Beta3 of OpenCV because you need cv.dll and cvaux.dll from there.  Beta4 will not work because functions were changed and dll's have diffrerent names.
0
 

Author Comment

by:firasattar
ID: 11942405
Dears

If no need for Visual C++, how can i build  it in visual basic

please tell me the steps to run exe in visual basic

regards
0
 

Author Comment

by:firasattar
ID: 11942721
Dear drichards

i followed your steps, step by step
and when i build the hbp files
this message shows in the output    "hbp.dll - 0 error(s), 0 warning(s)"
so, it's mean there is no error

but when i tried to excute i  pressed Ctrl + F5
and a message box appear "please specify the executable file"

and there is combo box when i drop down to choose i found browse, activeX control test container and default web browser"
what i have to do? and why it shows in the out put hbp.dll
and how can i run the program as exe?

you gave me a reight steps, but in the end, it didn't run, how can i run th eprogram?

please advice?
0
 
LVL 19

Assisted Solution

by:mrwad99
mrwad99 earned 100 total points
ID: 11944443
*You cannot run a DLL*.

You need to build the Visual Basic project in order to run the program that you see in the example screenshots.  There was never a need to use VC++ since the DLL is already built.

Open up VB and run the project that is in the VB GRAB directory.  There is also an exe already in the zip; running that brings up something but maybe you will know more about it...

0
 
LVL 19

Assisted Solution

by:drichards
drichards earned 400 total points
ID: 11945105
>> Open up VB and run the project that is in the VB GRAB directory.  There is also an exe already in the zip;
>>  running that brings up something but maybe you will know more about it...

Yes, which executable are you wanting to run?  There's the "prjFaceMemory.exe" in the zip and you can build "prjVBgrab.exe" from the VBGrab project.

If you need to build VBGrab and your path to the hbp stuff is not "C:\Develop\hbp\...", you will want to change "basWinAPI.bas".  Change all the "Declare ..." statements that refer to hbp.dll to eliminate the path info - just use "hbp.dll".  Example:
----------
        Declare Sub RChbp_update Lib "hbp.DLL" (ByVal cameraIndex As Long, ByRef bmp() As Byte, ByVal width As Long, ByVal height As Long, ByRef NoOfSegments As Long)
----------

Then copy hcp.dll, cv.dll, and cvaux.dll (the last two are from OpenCV) into the directory with the VB executable.  You may want to make these changes to the VBGrab project anyway as it makes it easier to move around.
0
 

Author Comment

by:firasattar
ID: 11950140
dear drichards & mrwad99

thank you very much
it's ok now
in visual c++ i build the hbp.dll
and i opened the "prjVBgrab.exe"

but i have a problem

when you run the "prjVBgrab.exe" click file /camera device
then a combo box screen asking "choose the DirectShow filter for your camera
i selected "Video Blaster WebCam Go Plus(WDM)"
Then when i pressed start this error appeared

"frmQuickCamStereo/CameraPreview/429/ActiveX compnent can't create object"
what is this error mean, and how can i run the application?

i thing i got the answer for the first question and i asked another question here, shall i close the question and open a new question with today question? and how can i increase the points to 1000 point (i know that it limited between 20-500)

and another point "i have a creative web camer old one" with USB 1, is't good for this application

regards



0
 
LVL 19

Expert Comment

by:drichards
ID: 11952727
>> what is this error mean, and how can i run the application?
Looks like there is probably a COM component that needs to be registered.  I am not at my machine right now so I'll check later if mrwad99 has not checked in.
0
 
LVL 19

Expert Comment

by:mrwad99
ID: 11956954
>> ...so I'll check later if mrwad99 has not checked in.

Hehe.  I like that !

>> what is this error mean...

Hmm.  

Error messages like that are always fun.  It seems that you are missing some sort of plugin as drichards has said.  I don't have VB installed on this machine so I cannot easily get the code compiled to get the exe as you have.  Re-read the literature that came with the original zip and see if it says anything.

Regarding the last point, if your webcam does not work with this, then either you need a new webcam or a new project.  Don't go any further with the error unless you are sure that you have what is needed anyway to run all this: it would just be a waste of time.

<Waiting for further comments from drichards>
0
 
LVL 19

Expert Comment

by:drichards
ID: 11957709
There are two dll's in the VBGrab project directory:  CapStill.dll and FSFWrap.dll.  You need to run regsvr32 on these files.

At a command line, change to the VBGrab directory and type:

regsvr32 CapStill.dll
regsvr32 FSFWrap.dll

This will get you past the immediate problem.  Don't know about your camera, though.  I don't have a camera, so I can't tell you if the program actually does anything.
0
 

Author Comment

by:firasattar
ID: 11961574
thank you i solved the problem


i installed the active x graphics component and it's working properly

ypu helped me two much, now i can study the code to create my project

i appreciate your help

thanx
0
 
LVL 19

Expert Comment

by:mrwad99
ID: 11961817
Glad to help.
0
 

Expert Comment

by:YamaArashi
ID: 14211624
Thanks for this - it helped me solve a very similar problem!

(Annoyed with OpenCV for breaking the libs between versions)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A short article about a problem I had getting the GPS LocationListener working.
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question