Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

OpenCV · Open Source Computer Vision Library

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 48143
  • Category: Open Source
  • Founded: Jun 20, 2000
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Messages

Advanced
Messages Help
Messages 72833 - 72862 of 90774   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#72833 From: miro moghazy <miromoghazy@...>
Date: Sun Aug 1, 2010 1:40 pm
Subject: detect dimentions of object on image
miromoghazy
Send Email Send Email
 
hi all i'm new in opencv
my project to detect a car and track it
on first i must detect object from image which mean detect (x,y,width,height)
i make this code and try to save output dimentions in test file but there
nothing saved
can any one help me



[Non-text portions of this message have been removed]

#72834 From: "tony.lockhart@..." <tony.lockhart@...>
Date: Sun Aug 1, 2010 9:55 pm
Subject: Problem creating a Matrix with CV_32FC1 type
tony.lockhar...
Send Email Send Email
 
Hi All,

I am attempting to run Example 3-3 in the Learning OpenCV book.  However each
time I build the code I receive the following error:1>LINK : fatal error
LNK1104: cannot open file 'C:\OpenCV2.1\lib.obj'

Can anyone provide any assistance on this error?

I have added the following setting to the project:
include files:c++->General->Add Include Dir->C:\OpenCV2.1\include\opencv
linker FIles: Linker->General->Add lib->C:\OpenCV2.1\bin
linker input->Add dependencies->C:\OpenCV2.1\lib\cv210.lib
C:\OpenCV2.1\lib\cvaux210.lib C:\OpenCV2.1\lib\cxcore210.lib
C:\OpenCV2.1\lib\highgui210.lib

Here is the code:
// example3_3.cpp : Defines the entry point for the application.
//

#include "stdafx.h"
#include "example3_3.h"

#include <cv.h>
#include <highgui.h>
#include <cxcore.h>
#include <cxtypes.h>

#define MAX_LOADSTRING 100

// Global Variables:
HINSTANCE hInst; 						 // current instance
TCHAR szTitle[MAX_LOADSTRING]; 			 // The title bar text
TCHAR szWindowClass[MAX_LOADSTRING]; 	 // the main window class name

// Forward declarations of functions included in this code module:
ATOM 		 MyRegisterClass(HINSTANCE hInstance);
BOOL 		 InitInstance(HINSTANCE, int);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);

int APIENTRY _tWinMain(HINSTANCE hInstance,
                      HINSTANCE hPrevInstance,
                      LPTSTR    lpCmdLine,
                      int       nCmdShow)
{
	 //Create an OpenCV Matrix Containing some fixed data
	 //See page 208 for array definition
	 float vals[] = {0.866025, -0.5000000, 0.500000, 0.866025};
	 CvMat rotmat;

	 cvInitMatHeader(&rotmat, 2, 2, CV_32FC1, vals);
	 return 0;
}

#72835 From: Shervin Emami <shervin.emami@...>
Date: Mon Aug 2, 2010 12:47 am
Subject: Re: detect dimentions of object on image
emami_s
Send Email Send Email
 
Hi Miro and everyone else having trouble doing anything in OpenCV,

It is normal that when you write a computer program, you spend much
more time fixing the bugs & problems than writing the code at first,
so it expected that your program will fail many times until you fix
all of your bugs and spend many hours or days or weeks trying
different things until it finally works. Thats why it is important to
try just getting a small thing to work and then improve it one step at
a time instead of trying to write a big project without testing it and
then finally seeing that the whole thing does not work and you don't
know why.

In the computer vision field, because most projects are new ideas and
there are no books or websites about most topics, you can't expect
someone to give you an easy tutorial to understand car detection and
car tracking and to give you the full source code for free and to help
you with any of your questions. You will have to design most or all of
your projects by yourself.

So if your problem is that it does not detect anything, then try
reading the book "Learning OpenCV: Computer Vision with the OpenCV
Library" and other computer vision books to understand the basic ideas
of computer vision, until you can figure out how to solve a computer
vision project. After you have learned about different techniques in
computer vision and OpenCV, you can then think that to solve a project
such as car detection and tracking, which techniques and algorithms
you can try, and if it doesn't work then you can think for yourself
what is the problem.

Or if your problem is that you have detected a car but it is not
saving the parameters to your file then you should either practise
computer programming more, or try using an easier programming language
such as Matlab, or spend more time trying to debug your code and solve
it yourself.

Cheers,
Shervin Emami.
http://www.shervinemami.co.cc/openCV.html


On Sun, Aug 1, 2010 at 9:40 PM, miro moghazy <miromoghazy@...> wrote:
>
>
>
> hi all i'm new in opencv
> my project to detect a car and track it
> on first i must detect object from image which mean detect (x,y,width,height)
> i make this code and try to save output dimentions in test file but there
nothing saved
> can any one help me
>
>
>
> [Non-text portions of this message have been removed]
>
>

#72836 From: Shervin Emami <shervin.emami@...>
Date: Mon Aug 2, 2010 1:08 am
Subject: Re: Problem creating a Matrix with CV_32FC1 type
emami_s
Send Email Send Email
 
I am guessing that you are using Visual Studio 2008? Anyway you
configured your project wrong, you basically need something like this:

include files:c++->General->Add Include Dir->C:\OpenCV2.1\include\opencv
linker Files: Linker->General->Add lib->C:\OpenCV2.1\lib
linker input->Add dependencies->cv210.lib cvaux210.lib cxcore210.lib
highgui210.lib

(Notice that the directory for your linker to search should be the
"lib" folder and not the "bin" folder, and also the directory paths
are not given in the dependencies list.)

There are many pages on the web that show this, such as the official
one: "http://opencv.willowgarage.com/wiki/VisualC++_VS2008"

Cheers,
Shervin Emami.
http://www.shervinemami.co.cc/openCV.html


On Mon, Aug 2, 2010 at 5:55 AM, tony.lockhart@...
<tony.lockhart@...> wrote:
>
>
>
> Hi All,
>
> I am attempting to run Example 3-3 in the Learning OpenCV book. However each
time I build the code I receive the following error:1>LINK : fatal error
LNK1104: cannot open file 'C:\OpenCV2.1\lib.obj'
>
> Can anyone provide any assistance on this error?
>
> I have added the following setting to the project:
> include files:c++->General->Add Include Dir->C:\OpenCV2.1\include\opencv
> linker FIles: Linker->General->Add lib->C:\OpenCV2.1\bin
> linker input->Add dependencies->C:\OpenCV2.1\lib\cv210.lib
C:\OpenCV2.1\lib\cvaux210.lib C:\OpenCV2.1\lib\cxcore210.lib
C:\OpenCV2.1\lib\highgui210.lib
>
> Here is the code:
> // example3_3.cpp : Defines the entry point for the application.
> //
>
> #include "stdafx.h"
> #include "example3_3.h"
>
> #include <cv.h>
> #include <highgui.h>
> #include <cxcore.h>
> #include <cxtypes.h>
>
> #define MAX_LOADSTRING 100
>
> // Global Variables:
> HINSTANCE hInst; // current instance
> TCHAR szTitle[MAX_LOADSTRING]; // The title bar text
> TCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name
>
> // Forward declarations of functions included in this code module:
> ATOM MyRegisterClass(HINSTANCE hInstance);
> BOOL InitInstance(HINSTANCE, int);
> LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
> INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
>
> int APIENTRY _tWinMain(HINSTANCE hInstance,
> HINSTANCE hPrevInstance,
> LPTSTR lpCmdLine,
> int nCmdShow)
> {
> //Create an OpenCV Matrix Containing some fixed data
> //See page 208 for array definition
> float vals[] = {0.866025, -0.5000000, 0.500000, 0.866025};
> CvMat rotmat;
>
> cvInitMatHeader(&rotmat, 2, 2, CV_32FC1, vals);
> return 0;
> }
>
>

#72837 From: sara bilal <smosb@...>
Date: Mon Aug 2, 2010 1:20 am
Subject: RE: Visual Studio 2010. the famous "exited with code -1072365566 (0xc0150002)." help
sara_0097
Send Email Send Email
 
dear there:

I am using opencv pre 1.1 and visual c++ 2008 , from what I have done  to solve
the same error , u need to do the following:

1. first download and install visual C++ 2005  redistiributable.

2. Recompile the project  for opencv libraries using visual C++ 2008 runtime in
a directory such as

C:\program file \opencv\_make\opencv.vs 2005.n0_openmp.sln

but must build for debug and release mode...


To: OpenCV@yahoogroups.com
From: get_imaginary@...
Date: Sat, 31 Jul 2010 09:25:39 -0700
Subject: Re: [OpenCV] Visual Studio 2010. the famous "exited with code
-1072365566 (0xc0150002)." help






Hi,

I don't have the solution but I can offer some tips:

Check for updates to your OS and patches for VS2010 and install as needed.

Make sure you've installed the Microsoft Visual C++ 2010 Redistributable
Package. You can get it here:
http://www.microsoft.com/downloads/details.aspx?FamilyID=a7b7a05e-6de6-4d3a-a423\
-37bf0912db84&displaylang=en

Have you run dependency walker? If not, I suggest you do that. Even though your
app runs, a delay-load dll that's missing or incompatible can still cause
problems.

If none of the above gets you over the hump, there's some really good, highly
detailed info on how to fix this error in past messages. Even though it's for
VS2008, it's much more in-depth than what's on the wiki. This may be a bit of a
pain, but you can search past messages on yahoo group web page to find it.

Good luck with this.
Robin

________________________________
From: opencv_odpr <opencv_odpr@...>
To: OpenCV@yahoogroups.com
Sent: Sat, July 31, 2010 8:31:39 AM
Subject: [OpenCV] Visual Studio 2010. the famous "exited with code -1072365566
(0xc0150002)." help

Hi,
I am trying to run the very first demo of open CV.

#include "stdafx.h"
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
#include <stdint.h>
#include <iostream>
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
IplImage *img = cvLoadImage("bilu.JPG");
cvNamedWindow("Image:",1);
cvShowImage("image:",img);

cvWaitKey();
cvDestroyWindow("Image:");
cvReleaseImage(&img);

cout<<"hi momo";
return 0;
}

While the compilation is finished with no errors, it existed with code :
"The program '[8416] hello_world.exe: Native' has exited with code -1072365566
(0xc0150002)."

What should I add/build/link/debug ? to remove this error?
(I understand it is common error when using Open cv, but all the manuals tell
you how to prevent it in VS 2008 and not in 2010. )

Thanks
O

[Non-text portions of this message have been removed]






[Non-text portions of this message have been removed]

#72838 From: "Nithin" <nithintelkar@...>
Date: Mon Aug 2, 2010 5:15 am
Subject: Converting Inverse Perspective Mapped Image (Birds Eye View) back to Perspective
nithintelkar
Send Email Send Email
 
Hi all,

I am working on road lane detection project. I have converted original
perspective image captured from the camera to Inverse Perspective Mapped Image
(Birds Eye View) and obtained fantastic results. But now the problem is, i want
to convert the same birds eye view image back to perspective image. Please let
me know the procedure to do it. I know there is some loss of data during the
conversion, but thats not an issue. waiting for an early solution.

Regards,
Nithin

#72839 From: "naveen.chwl" <naveen.chwl@...>
Date: Mon Aug 2, 2010 7:32 am
Subject: Re: Using OpenCV in a web application
naveen.chwl
Send Email Send Email
 
Would it be possible to include cvcam (from OpenCV 1.x) in JavaCV? It's the only
way I can get 2 cameras to work properly in Windows. Not to encourage people to
use it, but for people like me, who simply have no other choice?

--- In OpenCV@yahoogroups.com, Samuel Audet <samuel.audet@...> wrote:
>
> Ah, then you could use JavaCV:
>  http://code.google.com/p/javacv/
> in a Java applet with the "new" JNLP support:
>  http://jdk6.dev.java.net/plugin2/jnlp/
>
> Samuel
>
> On 2010-07-31 06:08, naveen.chwl wrote:
> > No, I want the OpenCV processing to be done on the client-side.
> >
> > --- In OpenCV@yahoogroups.com, Samuel Audet<samuel.audet@>  wrote:
> >>
> >> If you just want to capture images and send them to your server, you
> >> could use Flash..
>

#72840 From: Samuel Audet <samuel.audet@...>
Date: Mon Aug 2, 2010 7:43 am
Subject: Re: Re: Using OpenCV in a web application
guardia36
Send Email Send Email
 
Someone would need first to create a wrapper in C for cvcam, since it's
quite hard to invoke C++ from another language (and I'm not talking
about just Java, also about Python, Delphi, whatever, you name it)

Samuel

On 2010-08-02 16:32, naveen.chwl wrote:
> Would it be possible to include cvcam (from OpenCV 1.x) in JavaCV? It's the
only way I can get 2 cameras to work properly in Windows. Not to encourage
people to use it, but for people like me, who simply have no other choice?
>
> --- In OpenCV@yahoogroups.com, Samuel Audet<samuel.audet@...>  wrote:
>>
>> Ah, then you could use JavaCV:
>>  http://code.google.com/p/javacv/
>> in a Java applet with the "new" JNLP support:
>>  http://jdk6.dev.java.net/plugin2/jnlp/

#72841 From: Samuel Audet <samuel.audet@...>
Date: Mon Aug 2, 2010 7:48 am
Subject: Re: Re: Using OpenCV in a web application
guardia36
Send Email Send Email
 
Or was cvcam written in C? Don't remember... anyway, if so, yes it's
quite easy to call C functions from Java.. But if you're going to use
Java anyway, it's better to use other portable libraries that are still
supported

Samuel

On 2010-08-02 16:43, Samuel Audet wrote:
> Someone would need first to create a wrapper in C for cvcam, since it's
> quite hard to invoke C++ from another language (and I'm not talking
> about just Java, also about Python, Delphi, whatever, you name it)
>
> Samuel
>
> On 2010-08-02 16:32, naveen.chwl wrote:
>> Would it be possible to include cvcam (from OpenCV 1.x) in JavaCV?
>> It's the only way I can get 2 cameras to work properly in Windows. Not
>> to encourage people to use it, but for people like me, who simply have
>> no other choice?
>>
>> --- In OpenCV@yahoogroups.com, Samuel Audet<samuel.audet@...> wrote:
>>>
>>> Ah, then you could use JavaCV:
>>> http://code.google.com/p/javacv/
>>> in a Java applet with the "new" JNLP support:
>>> http://jdk6.dev.java.net/plugin2/jnlp/

#72842 From: "moore" <sohomartin@...>
Date: Mon Aug 2, 2010 9:50 am
Subject: outsourcing project!!! Please help me
sohomartin
Send Email Send Email
 
Hi Ladies and Gentleman
This is Martin Yang from E-Soft Technologies Ltd., Taiwan.
We have a project which wants to be oursourced.
It is with OpenCV library.
And all function are developed on iPhone3GS/4G.
All softwares and hardwares needed by this project must be owned by yourself.
Personael or people who can do this are welcome.
Please contact me.

Function:
1.Currently Drive identification (identification markings on both sides of the
driveway and fill in translucent blue on the Drive and voice instructions)

2.Currently Drive before the vehicle identification (identification of the
vehicle in front and now Drive marked yellow square and the voice instructions)

3.The vehicle in front of nearly alerts (voice with the red flashing square +
red text)

4.Deviation from the current Drive (voice and green flashing square + green
text)

5.Currently Drive the vehicle in front transform Drive (voice and yellow
flashing square + yellow text)

please contact me by mail. or skype
Mail is martin.yang@...
skype: apachemay

Come on! We want you.

#72843 From: "naveen.chwl" <naveen.chwl@...>
Date: Mon Aug 2, 2010 9:57 am
Subject: Re: Using OpenCV in a web application
naveen.chwl
Send Email Send Email
 
Having looked at cvcam, all the functions to be called by the "user" are
straight global functions (is that what you meant by C functions?). But there
seems to be other C++ stuff going on in the background. Does that mean it's
still easily JavaCV-able? (But I wouldn't know how to JavaCV it myself)

All I know is that cvcam performs about 20 times better than highgui for 2
cameras. Therefore I'd rather cvcam be available in JavaCV as a performance
benchmark to compare the portable libraries to first, if that makes sense. If
the performance of the portable library with 2 cams is anything less that 70%
I'll be sticking with cvcam when the user is running Windows/Linux.

--- In OpenCV@yahoogroups.com, Samuel Audet <samuel.audet@...> wrote:
>
> Or was cvcam written in C? Don't remember... anyway, if so, yes it's
> quite easy to call C functions from Java.. But if you're going to use
> Java anyway, it's better to use other portable libraries that are still
> supported
>
> Samuel
>
> On 2010-08-02 16:43, Samuel Audet wrote:
> > Someone would need first to create a wrapper in C for cvcam, since it's
> > quite hard to invoke C++ from another language (and I'm not talking
> > about just Java, also about Python, Delphi, whatever, you name it)
> >
> > Samuel
> >
> > On 2010-08-02 16:32, naveen.chwl wrote:
> >> Would it be possible to include cvcam (from OpenCV 1.x) in JavaCV?
> >> It's the only way I can get 2 cameras to work properly in Windows. Not
> >> to encourage people to use it, but for people like me, who simply have
> >> no other choice?
> >>
> >> --- In OpenCV@yahoogroups.com, Samuel Audet<samuel.audet@> wrote:
> >>>
> >>> Ah, then you could use JavaCV:
> >>> http://code.google.com/p/javacv/
> >>> in a Java applet with the "new" JNLP support:
> >>> http://jdk6.dev.java.net/plugin2/jnlp/
>

#72844 From: Samuel Audet <samuel.audet@...>
Date: Mon Aug 2, 2010 10:51 am
Subject: Re: Re: Using OpenCV in a web application
guardia36
Send Email Send Email
 
Well, like I said you should try something that is still supported..
Nobody is updating cvcam anymore, so it could stop working at any point,
and also I don't think it supports V4L2 or anything else currently
supported under Linux

FFmpeg seems like a good candidate.. It supports VfW under Windows and
V4L, V4L2, libdc1394 and dv1394 under Linux. They might very well be
adding more stuff in the future..

Besides, maybe your hardware works fine with highgui in OpenCV 2.1

Samuel

On 2010-08-02 18:57, naveen.chwl wrote:
> Having looked at cvcam, all the functions to be called by the "user" are
straight global functions (is that what you meant by C functions?). But there
seems to be other C++ stuff going on in the background. Does that mean it's
still easily JavaCV-able? (But I wouldn't know how to JavaCV it myself)
>
> All I know is that cvcam performs about 20 times better than highgui for 2
cameras. Therefore I'd rather cvcam be available in JavaCV as a performance
benchmark to compare the portable libraries to first, if that makes sense. If
the performance of the portable library with 2 cams is anything less that 70%
I'll be sticking with cvcam when the user is running Windows/Linux.
>
> --- In OpenCV@yahoogroups.com, Samuel Audet<samuel.audet@...>  wrote:
>>
>> Or was cvcam written in C? Don't remember... anyway, if so, yes it's
>> quite easy to call C functions from Java.. But if you're going to use
>> Java anyway, it's better to use other portable libraries that are still
>> supported

#72845 From: Samuel Audet <samuel.audet@...>
Date: Mon Aug 2, 2010 2:31 pm
Subject: Re: Using OpenCV in a web application
guardia36
Send Email Send Email
 
Hello,

With the "new" JNLP support in JDK 6, there is AFAIK no functional
difference between a Java applet and a Java application. The only
difference is that the applet renders as a plugin alongside HTML content
(it's basically part of the page), while a Java application started
using Web Start opens as another window and another process (so you
can't communicate with the page via JavaScript for example).

With either a Java applet or a Java application, you can do anything you
can usually do with Java, as long as you specify the required access in
the JNLP file

If you want to know about Java applet, Web Start, JNLP, etc. you're
probably better asking in a Java forum...

Samuel

On 2010-08-02 21:45, naveen.chwl wrote:
> Ok I hope it works ok!
>
> I'm trying to make a user interface using cameras as input. If I use applets,
then every time someone opens a web app that uses that interface, another
instance of the vision processing functionality has to start, which is somewhat
wasteful.
>
> So instead, can I make a Java desktop app as the user interface, and then
access the events and variables in that application from the web application?
For example, onPersonAppearing() would fire when a person appears... could I
access this event in the JavaScript web app somehow?
>
> Furthermore, could I access such events and variables in native applications
on the user's computer?
>
> Ideally, I'd like the JavaCV app to fire events and manipulate variables that
can be accessed system-wide.
>
> This would be an awesome application for JavaCV if possible.

#72846 From: Jean-Baptiste BUTET <ashashiwa@...>
Date: Mon Aug 2, 2010 3:22 pm
Subject: Python-wrapper and webcam propertie
ashashiwa@...
Send Email Send Email
 
Hi all :)

I'm using python-opencv to use my webcam in order to do some spectroscopy.

http://outilsphysiques.tuxfamily.org/pmwiki.php/Oppl/Livespectra

Soft works well, computing is OK and work as expected !! (Yeah !!!!!!!!!!!!!
thanks opencv :) )

But I have an issue in capture frame on webcam :
-> driver is on "automatic"

I was thought set properties in an other control software (qastrocam for
example : http://3demi.net/astro/qastrocam/doc/ ) and save there on camera
will do the job.

/o\...

no opencv open camera and re-define its state.

Here is the code :
self.capture = cv.CreateCameraCapture(self.webcam_index)
frame = cv.QueryFrame(self.capture)

I can't use : cv.cvGetCaptureProperty because it has only
CV_CAP_PROP_POS_MSEC
CV_CAP_PROP_POS_FRAMES
CV_CAP_PROP_POS_AVI_RATIO
  CV_CAP_PROP_FRAME_WIDTH
CV_CAP_PROP_FRAME_HEIGHT
  CV_CAP_PROP_FPS and CV_CAP_PROP_FOURCC    properties.

I need to acceed some stuf as "contrast, gains, exposure..."

I've seen some examples in C++ (I never try C++...) but I don't see how do
this in python at all.

Any hints ?

clear skies,

JB


[Non-text portions of this message have been removed]

#72847 From: "Hao" <hao.liu82@...>
Date: Mon Aug 2, 2010 3:25 pm
Subject: Ho to evaluate image segmentation approach performance?
hao.liu82
Send Email Send Email
 
I have a new approach for image segmentation... How to compare its performance
with other approaches, say a simple predefined skin
color model?

How do they get the false-positive, false-negative values in many papers?

Can you tell me the evaluation steps? Thanks!

#72848 From: Robin Hewitt <get_imaginary@...>
Date: Mon Aug 2, 2010 3:33 pm
Subject: Re: Ho to evaluate image segmentation approach performance?
get_imaginary
Send Email Send Email
 
Google "segmentation dataset" to find ground truth data you can use.

- Robin



________________________________
From: Hao <hao.liu82@...>
To: OpenCV@yahoogroups.com
Sent: Mon, August 2, 2010 8:25:54 AM
Subject: [OpenCV] Ho to evaluate image segmentation approach performance?


I have a new approach for image segmentation... How to compare its performance
with other approaches, say a simple predefined skin
color model?

How do they get the false-positive, false-negative values in many papers?

Can you tell me the evaluation steps? Thanks!







[Non-text portions of this message have been removed]

#72849 From: "Paeng" <paper_1_2_3bag@...>
Date: Mon Aug 2, 2010 4:09 pm
Subject: How to know if cv window was closed?
paper_1_2_3bag
Send Email Send Email
 
Hi guys, I'm using the GUI of opencv for my project

and I'm wondering if how can I know if the cvNamedWindow("test",1);

I have made was closed by the user at the middle of the runtime

that's all and thank you.

#72850 From: *farhan Khan* <farhanhbk@...>
Date: Mon Aug 2, 2010 4:14 pm
Subject: motion templates matching using mahalanobis
fheartbreakkid
Send Email Send Email
 
Hi,

I am trying to create human motion detector /activity  recognization like
standing , sitting etc. I have used the motempl technique to generate the
silhouette and then i made few motion templates like walking sitting etc. but
when i use mahalanobis distance function it gives most of the time wrong
distance ...i believe if motion template is sort of equall to the current frame
it shows value less than 4.0. But sometimes even non matched item returns lesser
value..

i am not sure what is the mistake i am doing  below is my code ...the only
problem is mahalanobis matching

     double dist1 = cvMahalanobis(motionVec, M1, invC1);
     double dist2 = cvMahalanobis(motionVec, M2, invC2);

they sometime return wrong result ....




void CPoseDetectionDlg::OnBnClickedButton4ByAviHu()
{

     if(m_strVideoFile.GetLength()>3)
     {

     IplImage* motion = 0;
         IplImage* motionGray = 0;
         CvCapture* capture = 0;
         CvScalar color;

         CvMat* Ctest = cvCreateMat(7, 7, CV_64FC1);
         CvMat* CtestInv = cvCreateMat(7, 7, CV_64FC1);
         CvMat* MTest = cvCreateMat(1, 7, CV_64FC1);

         bool done = false;
         bool checkDecision = false;

         IplImage *im = NULL;

         IplImage *temporal11 = NULL;
         IplImage *temporal12 = NULL;

         IplImage *temporal21 = NULL;
         IplImage *temporal22 = NULL;

         const int count = 2;
         int confirmActivity = 0;
         CvMat **vects1 = new CvMat*[count];
         CvMat **vects2 = new CvMat*[count];
         const CvArr *vectsTest[count];

         CvMoments temporalMoments, temporalMoments1;
         CvHuMoments temporalHu, motionHu, temporalHu1, temporalHu2;
         CvHuMoments temporalHu21, temporalHu22;

         M1=M2=C1=C2=NULL;

         double total1 = 0, total2 = 0;

         MhiImage mhi;
         initialize_mat();
         int i;
         capture = cvCaptureFromAVI(m_strVideoFile.GetBuffer());


     if( capture )
     {


         cvNamedWindow( "Motion", 2);
         cvNamedWindow("template 1", 2);
         cvNamedWindow("template 2", 2);


         char str[300];
         GetModuleFileNameA(NULL,str,300);
         CStringA strPath = str;
         strPath = strPath.Left(strPath.ReverseFind('\\'));

         CStringA strImg1 = strPath.GetBuffer();
         CStringA strImg2 = strPath.GetBuffer();
         CStringA strImg3 = strPath.GetBuffer();
         CStringA strImg4 = strPath.GetBuffer();

         strImg1+="\\motion1.bmp";
         strImg2+="\\motion2.bmp";
         strImg3+="\\motion3.bmp";
         strImg4+="\\motion4.bmp";



         temporal11 =  cvLoadImage((char*)strImg1.GetBuffer() ,
CV_LOAD_IMAGE_GRAYSCALE);
         temporal12 =  cvLoadImage((char*)strImg2.GetBuffer(),
CV_LOAD_IMAGE_GRAYSCALE);

         temporal21 =  cvLoadImage((char*)strImg3.GetBuffer(),
CV_LOAD_IMAGE_GRAYSCALE);
         temporal22 =  cvLoadImage((char*)strImg4.GetBuffer(),
CV_LOAD_IMAGE_GRAYSCALE);


         cvShowImage("template 1", temporal21);
         cvShowImage("template 2", temporal11);

         calculateHuMoments (temporal12, temporalHu1);
         calculateHuMoments (temporal11, temporalHu);

         calculateHuMoments (temporal21, temporalHu21);
         calculateHuMoments (temporal22, temporalHu22);



         calculateCovarMatrix(vects1, temporalHu21, temporalHu22, M1, C1, count);
         calculateCovarMatrix(vects2, temporalHu, temporalHu1, M2, C2, count);


         //printCovar(C);

         cvInvert(C1, invC1, CV_SVD);
         cvInvert(C2, invC2, CV_SVD);

         //printCovar(invC);

         // Clean up after training
         for (int i = 0; i < count; i++) {
             CvMat *tmp1 = (CvMat*)vects1[i];
             CvMat *tmp2 = (CvMat*)vects2[i];
             cvReleaseMat(&tmp1);
             cvReleaseMat(&tmp2);
         }


         for(;;)
         {

             IplImage* image;
             if( !cvGrabFrame( capture ))
                    break;
             image = cvRetrieveFrame( capture );

             if( image )
             {
                    if( !motion )
                    {
                        motion = cvCreateImage(
cvSize(image->width,image->height), 8, 3 );
                        cvZero( motion );
                        motion->origin = image->origin;
                    }
             }

             mhi.update_mhi( image, motion, 30 );

             if (!motionGray)
                 motionGray = cvCreateImage(cvSize(image->width, image->height),
8, 1);
             cvCvtColor( motion, motionGray, CV_BGR2GRAY);
             calculateHuMoments (motionGray, motionHu);

             CvMat *motionVec = cvCreateMat(1, 7, CV_64FC1);

             CV_MAT_ELEM (*motionVec, double, 0, 0) = motionHu.hu1;
             CV_MAT_ELEM (*motionVec, double, 0, 1) = motionHu.hu2;
             CV_MAT_ELEM (*motionVec, double, 0, 2) = motionHu.hu3;
             CV_MAT_ELEM (*motionVec, double, 0, 3) = motionHu.hu4;
             CV_MAT_ELEM (*motionVec, double, 0, 4) = motionHu.hu5;
             CV_MAT_ELEM (*motionVec, double, 0, 5) = motionHu.hu6;
             CV_MAT_ELEM (*motionVec, double, 0, 6) = motionHu.hu7;

             double dist1 = cvMahalanobis(motionVec, M1, invC1);
             double dist2 = cvMahalanobis(motionVec, M2, invC2);

             if (dist1<4)
             {
                 //dist1 /= 2;
                 cout<<"The distance is: "<<dist1<<endl;

                 CString strOut,strPrev;

                
((CEdit*)(GetDlgItem(IDC_EDIT1_OUTPUT)))->GetWindowText(strPrev);

         //        strOut.Format(L"\r\n he distance is: %f \r\n %s
",dist1,strPrev);

                 ((CEdit*)(GetDlgItem(IDC_EDIT1_OUTPUT)))->SetWindowText(strOut);


             }
             if (dist2<4)
             {
                 cout<<""<<dist2<<endl;

                 CString strOut,strPrev;

                
((CEdit*)(GetDlgItem(IDC_EDIT1_OUTPUT)))->GetWindowText(strPrev);

         //        strOut.Format(L"\r\n The xxxxxxxxxxxxxx distance is: %f \n %s
",dist2,strPrev);

                 ((CEdit*)(GetDlgItem(IDC_EDIT1_OUTPUT)))->SetWindowText(strOut);

             }



             if (dist1<4 || dist2<4)
             {
                 confirmActivity++;
                 total1 += dist1;
                 total2 += dist2;
                 //cout<<"total1: "<<total1<<endl;
                 //cout<<"total2: "<<total2<<endl;
                 //cout<<"check: "<<checkDecision<< endl;
                 //cout<<"confirmAct: "<<confirmActivity<<endl;
                 checkDecision = true;
             }
             else
             {
                 if(checkDecision == true)
                 {
                     if (confirmActivity > 4)
                     {
                         double averageDist1 = total1/confirmActivity;
                         double averageDist2 = total2/(confirmActivity);

                         if (averageDist1 < averageDist2)
                         {
                             cout<<" UP!!"<<endl; //cout<<"Aver 1
"<<averageDist1<<" "<<averageDist2<<endl;

                             CString strOut,strPrev;

                            
((CEdit*)(GetDlgItem(IDC_EDIT1_OUTPUT)))->GetWindowText(strPrev);

                             strOut.Format(L"\r\n hands UP \r\n %s ",strPrev);

                            
((CEdit*)(GetDlgItem(IDC_EDIT1_OUTPUT)))->SetWindowText(strOut);


                         }
                         else
                         {
                             cout<<"move left!!!!"<<endl;// cout<<"Aver 2
"<<averageDist2<<" "<<averageDist1<<endl;

                             CString strOut,strPrev;

                            
((CEdit*)(GetDlgItem(IDC_EDIT1_OUTPUT)))->GetWindowText(strPrev);

                             strOut.Format(L"\r\n move left \r\n %s ",strPrev);

                            
((CEdit*)(GetDlgItem(IDC_EDIT1_OUTPUT)))->SetWindowText(strOut);


                         }

                         checkDecision = false;
                         confirmActivity = 0;
                         total1 = 0;
                         total2 = 0;
                         //cout<<"What"<<endl;
                     }
                     else
                     {
                     checkDecision = false;
                     confirmActivity = 0;
                     total1 = 0;
                     total2 = 0;
                     //cout<<"Whatcxx"<<endl;
                     }
                 }
                 else
                 {
                     confirmActivity = 0;
                 }
             }

             /*if (dist1<1.5) confirmActivity++;
             else confirmActivity = 0;

             if (confirmActivity > 1)
                 cout<<"Activity 1 confirm"<<endl;
             */

             time_t t;
             time(&t);

             char buffer[450];
             sprintf(buffer,"D:\\WORK\\Programming Work\\Clients\\mnaini\\Project
Data Processing\\Sources\\SkinDetectDemo\\PoseDetection\\pos\\current.bmp");
             cvSaveImage(buffer,image);


             char ch=0;
             if ((ch=cvWaitKey(4)) == -1) {
                 cvShowImage( "Motion", motion );
             }
             else if(ch==27)
             {
                 break;
             }
             else{
                 if (done == false)
                 {
                 //    cvSaveImage("motion0.bmp",motion);
                     done = true;
                 }
                 else {
                 //    cvSaveImage("motion1.bmp", motion);
                     done = false;
                 }
             }
         }
         cvReleaseCapture( &capture );

         cvReleaseImage( &temporal11);
         cvReleaseImage( &temporal12);
         cvReleaseImage( &temporal21);
         cvReleaseImage( &temporal22);

         cvDestroyWindow( "Motion" );

         }

     }
     else
     {
         AfxMessageBox(L"Browse Avi file before check");
     }


}


[Non-text portions of this message have been removed]

#72851 From: "leonidchern" <lchlet@...>
Date: Mon Aug 2, 2010 4:46 pm
Subject: Deallocation of sequences
leonidchern
Send Email Send Email
 
To create a new sequence CvSeq we have to specify the memory storage where the
sequence will be allocated. If the sequence is created inside some function we
have to transmit corresponding memory storage to the function. To remove the
sequence from memory we need to deallocate memory storage object.
   But in some cases the sequence created inside OpenCV functions (cvReadByName
for example)  without any indication of storage object. So, my questions:
1) In which storage is  creates sequence in this case?
2) How to release memory occupied by the sequence?

Thanks in advance

#72852 From: "elektrischerpinguin" <NurEinDummy@...>
Date: Mon Aug 2, 2010 7:27 pm
Subject: Kalman filter experts? Any help appreciated!
elektrischer...
Send Email Send Email
 
Hi! As proposes by Utkarsh I'm trying to use OpenCV's kalman filter
to stabilize the resulting rect of a haarcascade facetracking.

Problem is that after I update (correct) the filter with a new measurement
the next prediction is very close to the last measurement.

To put it another way: I get a big "jump" from the old prediction
to the new measurement, what's making the result not very smooth.

Output:

time = cpu time
dt = time delta since last kalman update/correcting (will be put in transition
matrix)
Faceheight: height of face relative to screen size

time: 84028 - dt:  136 - UPDATED Faceheight: 0.558333
time: 84028 - dt:    0 - Predicted Faceheight: 0.554502
time: 84035 - dt:    7 - Predicted Faceheight: 0.555239
time: 84043 - dt:   15 - Predicted Faceheight: 0.556082
time: 84060 - dt:   32 - Predicted Faceheight: 0.557873
time: 84076 - dt:   48 - Predicted Faceheight: 0.559558
time: 84094 - dt:   66 - Predicted Faceheight: 0.561454
time: 84109 - dt:   81 - Predicted Faceheight: 0.563034
time: 84142 - dt:  114 - Predicted Faceheight: 0.566509
time: 84159 - dt:  131 - Predicted Faceheight: 0.568300
time: 84176 - dt:  148 - Predicted Faceheight: 0.570090
time: 84177 - dt:  149 - UPDATED Faceheight: 0.554167
time: 84181 - dt:    4 - Predicted Faceheight: 0.557157
time: 84193 - dt:   16 - Predicted Faceheight: 0.557566

=>
old prediction: 0.570
measured height: 0.554
next prediction: 0.557 (way too big jump from 0.57)

and it goes on like this...


time: 84209 - dt:   32 - Predicted Faceheight: 0.558112
time: 84226 - dt:   49 - Predicted Faceheight: 0.558692
time: 84243 - dt:   66 - Predicted Faceheight: 0.559272
time: 84263 - dt:   86 - Predicted Faceheight: 0.559954
time: 84299 - dt:  122 - Predicted Faceheight: 0.561182
time: 84309 - dt:  132 - Predicted Faceheight: 0.561523
time: 84310 - dt:  133 - UPDATED Faceheight: 0.554167
time: 84313 - dt:    3 - Predicted Faceheight: 0.555746
time: 84327 - dt:   17 - Predicted Faceheight: 0.555761
time: 84347 - dt:   37 - Predicted Faceheight: 0.555781
time: 84360 - dt:   50 - Predicted Faceheight: 0.555795
time: 84377 - dt:   67 - Predicted Faceheight: 0.555813
time: 84393 - dt:   83 - Predicted Faceheight: 0.555830
time: 84440 - dt:  130 - Predicted Faceheight: 0.555879
time: 84449 - dt:  139 - Predicted Faceheight: 0.555888
time: 84449 - dt:  139 - UPDATED Faceheight: 0.558333
time: 84453 - dt:    4 - Predicted Faceheight: 0.557895
time: 84474 - dt:   25 - Predicted Faceheight: 0.558149
time: 84480 - dt:   31 - Predicted Faceheight: 0.558221
time: 84497 - dt:   48 - Predicted Faceheight: 0.558426
time: 84511 - dt:   62 - Predicted Faceheight: 0.558596
time: 84526 - dt:   77 - Predicted Faceheight: 0.558777
time: 84543 - dt:   94 - Predicted Faceheight: 0.558982
time: 84577 - dt:  128 - Predicted Faceheight: 0.559393
time: 84593 - dt:  144 - Predicted Faceheight: 0.559587
time: 84593 - dt:  144 - UPDATED Faceheight: 0.562500
time: 84597 - dt:    4 - Predicted Faceheight: 0.562040
time: 84610 - dt:   17 - Predicted Faceheight: 0.562365
time: 84627 - dt:   34 - Predicted Faceheight: 0.562789
time: 84660 - dt:   67 - Predicted Faceheight: 0.563613
time: 84666 - dt:   73 - Predicted Faceheight: 0.563762
time: 84676 - dt:   83 - Predicted Faceheight: 0.564012
[...]


What I'm doing:
1) I get a new measurement, feeding the filter with it and saving the current
time:

updateKalmanForRect(float measured_width_rel, float measured_height_rel, clock_t
current_CPU_clock)

2) While waiting for a new measurement I keep make predictions regarding the
time delta since the last update

predictKalmanForRect(clock_t current_CPU_clock)



Does dt need to be between 0 and 1?
Don't think so... or does it?



The source code may be found here:

http://nopaste.info/45f4789d88.html

( I put it at nopaste to make it a bit easier to read )

#72853 From: patel deven <deven.patel2@...>
Date: Tue Aug 3, 2010 2:02 am
Subject: trouble reading videos.
duffer_dev
Send Email Send Email
 
i have installed opencv 2.1. the cmake details are as below.

-- Extracting svn version, please wait...
-- SVNVERSION:
-- Detected version of GNU GCC: 44 (404)
-- checking for module 'libdc1394-2'
--   package 'libdc1394-2' not found
-- checking for module 'libdc1394'
--   package 'libdc1394' not found
-- checking for module 'libxine'
--   package 'libxine' not found
-- checking for module 'libv4l1'
--   package 'libv4l1' not found
-- Could NOT find Jasper  (missing:  JASPER_LIBRARY JASPER_INCLUDE_DIR)
Traceback (most recent call last):
   File "<string>", line 1, in <module>
ImportError: No module named numpy.distutils
-- IPP detected:
-- Parsing 'cvconfig.h.cmake'
running mkdir -p "/root/OpenCV-2.1.0/release/unix-install/"  2>&1
--
-- General configuration for opencv 2.1.0
=====================================
--
--     Built as dynamic libs?:    ON
--     Compiler:
--     C++ flags (Release):         -Wall -Wno-long-long -pthread
-ffunction-sections  -O3 -DNDEBUG  -fomit-frame-pointer -O3 -ffast-math
-msse -msse2 -DNDEBUG
--     C++ flags (Debug):           -Wall -Wno-long-long -pthread
-ffunction-sections  -g  -O0 -DDEBUG -D_DEBUG
--     Linker flags (Release):
--     Linker flags (Debug):
--
--   GUI:
--     GTK+ 2.x:                  1
--     GThread:                   1
--
--   Image I/O:
--     JPEG:                      TRUE
--     PNG:                       TRUE
--     TIFF:                      TRUE
--     JPEG 2000:                 build
--
--   Video I/O:
--     DC1394 1.x:                0
--     DC1394 2.x:                0
--     FFMPEG:                    1
--       codec:                   1
--       format:                  1
--       util:                    1
--       swscale:                 1
--       gentoo-style:            1
--     GStreamer:                 1
--     UniCap:                    FALSE
--     PvAPI:
--     V4L/V4L2:                  1/1
--     Xine:                      0
--
--   Interfaces:
--     Old Python:                0
--     Python:                    ON
--     Python interpreter:        /usr/bin/python2.6
--     Python numpy:              0
--     Use IPP:                   NO
--     Use TBB:                   NO
--     Build Documentation        0
--
--     Install path:              /usr/local
--
--     cvconfig.h is in:          /root/OpenCV-2.1.0/release
-- -----------------------------------------------------------------
--
-- Configuring done
-- Generating done
-- Build files have been written to: /root/OpenCV-2.1.0/release
---------------------------------------------------

the ffmpeg and gstream packages have been successfully been detected. but
still for some reason  beyond me, i am not able to read videos.
the below code..

#include <stdio.h>
#include "cv.h"
#include "highgui.h"

int main( int argc, char** argv )
{
         IplImage  *frame;
         int       key;
          assert( argc == 2 );
         CvCapture *capture = cvCaptureFromAVI( argv[1] );
         if( !capture ) return 1;           /*THE CODE EXITS AT THIS POINT*/
         int fps = ( int )cvGetCaptureProperty( capture, CV_CAP_PROP_FPS );
         cvNamedWindow( "video", 0 );
         while( key != 'q' ) {
                 frame = cvQueryFrame( capture );
                 if( !frame ){printf("\n no frame\n"); break;}
                 cvShowImage( "video", frame );
                 key = cvWaitKey( 1000 / fps );
         }
         cvReleaseCapture( &capture );
         cvDestroyWindow( "video" );

         return 0;
}

the   cvCaptureFromAVI() seems to return  a NULL. i also
tried cvCreateFileCapture(), but the wasn't able to read the avi file.


[Non-text portions of this message have been removed]

#72854 From: yang martin <sohomartin@...>
Date: Tue Aug 3, 2010 2:25 am
Subject: developing application with OpenCV on iPhone
sohomartin
Send Email Send Email
 
Hi
anyone knows where I am get information or howto for developing application with
OpenCV on iPhone platform.

Or

someone can introduce people to me for this.

thanks
Martin

#72855 From: "Rana" <rzaman_mctr@...>
Date: Tue Aug 3, 2010 4:16 am
Subject: Mathematical expression or function for cvSetImageROI
rzaman_mctr
Send Email Send Email
 
Dear developers of OpenCV

Can you please tell me what is the mathematical expression for cvSetImageROI of
opencv function?

Your kind response would be greatly appreciated!

Thanks

Rana

#72856 From: vineet agrawal <bkvineet@...>
Date: Tue Aug 3, 2010 6:09 am
Subject: Problem in connecting to an IP camera
bkvineet
Send Email Send Email
 
hi,

I am trying to connect to a network camera using OpenCV( I am using C).
The camera is a D-link  DCS-5200 IP camera.

Using a web-browser I can connect to the camera by simply entering its ip
address(http://10.7.136.4) and watch live feed from the camera.
Also I am able to record its live streaming video using VLC player by giving the
following address: rtsp://10.7.136.4/live.sdp

I have gone through many posts on how to access camera but none of them seems to
be working.

Please help me with this.




[Non-text portions of this message have been removed]

#72857 From: "razmichael1626" <razmichael1626@...>
Date: Tue Aug 3, 2010 8:21 am
Subject: problem
razmichael1626
Send Email Send Email
 
hi
i work with ocv mvs c++.
my program works with web camera
when i activeite(F5)the file iget this message:First-chance exception at
0x7c95eb74 in ocv2.exe: 0xC0000008: An invalid handle was specified.
break/continue/ignore
then ipress on continue twise,and it works ok
what is the reason for the appriance of this mesage

michael
#include "stdafx.h"
	 #include <cv.h>
	 #include <cxcore.h>
	 #include <highgui.h>
	 #include <iostream>
     #include <ml.h>
     #include <cxtypes.h>

int main(int argc, char* argv[])
{

	 int x;
	 int y;
	 int ind=0;
     long sumx=0;
	 long sumy=0;
	 int rohav;
	 int gova;
     int thickness = 2;
	 int connectivity = 8;
     int radius = 15;

     cvNamedWindow( "wl", 0);
	 CvCapture* capture = cvCreateCameraCapture(0);
	 IplImage* frame;

	 CvScalar blue = CV_RGB(250,0,0);


	 CvScalar z;
	 while(1)
	 {
		 sumx=0;
         sumy=0;
		 ind=0;
	     frame = cvQueryFrame( capture );
	     rohav=frame->width;
	     gova=frame->height;


         if( !frame ) break;
	     for(x=0;x<rohav;x=x+10)
	       {
	         for(y=0;y<gova;y=y+10)
	           {
                   z = cvGetAt(frame,y,x); //row i, column j

	                 if(z.val[0]<90)
	                    {
                          sumx=sumx+x;
                          sumy=sumy+y;
		                  ind++;
	                   }
               }
	       }
	    if(ind==0)
		    ind=1;
	    sumy=sumy/ind;
	    sumx=sumx/ind;

	    CvPoint pt1 = cvPoint(sumx,sumy);
	    cvCircle(frame,pt1,radius,blue,thickness,connectivity);
        cvShowImage( "wl", frame );

        char c = cvWaitKey(33);
        if( c == 27 ) break;
	 }


      cvReleaseCapture( &capture );
	  cvDestroyWindow("wl");

	 return 0;


}

#72858 From: "ahuber3987" <ahuber3987@...>
Date: Tue Aug 3, 2010 10:01 am
Subject: Object recognition from images using MLP and OpenCV
ahuber3987
Send Email Send Email
 
Hi,

I have some background in machine learning and neural networks
and would like to practice my skills by building a object recognition system for
images. It seems that OpenCV could help me performing this task (especially 
CvANN_MLP) but since I have never done anything with MLP related to images and
I'm a OpenCV newbie I have some questions:

I plan to use one of the standard datasets in CV (VOC2005 as example) for my
task. Before I start training the neural network, what preprocessing should be
done on the images (note I have never used a NN on image data)? They all have
differend dimensions, is this a problem? Is it wise to perform all on grayscale
images (currently they are in color). Basically the dataset consists of images
containing or not containing cars. As far as I understand the NN should learn
the feature description of images containing / not containing cars, but do I
perform everything on the raw images? Or should I extract key points (e.g. with
SIFT) and perform the training on that?

I have seen the samples/c/letter_recog.cpp but from there I cannot see
how the image data should be preprocessed to be used with the MLP.

Hope anyone can clear my questions.

have a nice day,
ahuber

#72859 From: "aklsdjfl" <craftindo@...>
Date: Tue Aug 3, 2010 11:42 am
Subject: change value of histogram
sutonoe
Send Email Send Email
 
dear all,
Does anyone know how to modify a bin value inside a histogram?

We have a command "cvQueryHistValue2D().

But, how can we modify it?

thanks

#72860 From: "Hao" <hao.liu82@...>
Date: Tue Aug 3, 2010 11:54 am
Subject: mean shift segmentation is so slow?
hao.liu82
Send Email Send Email
 
I used opencv mean shift segmentation function cvPyrMeanShiftFiltering. If I
want to get reasonable segmentation performance, the processing would be too
slow.

Better way to improve ? Thx!Or even can I use parallel processes to
improve?

#72861 From: "Paeng" <paper_1_2_3bag@...>
Date: Tue Aug 3, 2010 1:15 pm
Subject: Re: How to know if cv window was closed?
paper_1_2_3bag
Send Email Send Email
 
--- In OpenCV@yahoogroups.com, "Paeng" <paper_1_2_3bag@...> wrote:
>
> Hi guys, I'm using the GUI of opencv for my project
>
> and I'm wondering if how can I know if the cvNamedWindow("test",1);
>
> I have made was closed by the user at the middle of the runtime
>
> that's all and thank you.
>

My code look something like this

cvNamedWindow("Webcam",1);
...
while(1){
...
cvShowImage("Webcam", image);
}

I need to know if the cvwindow webcam was closed by the user so that I
know when can I break the loop.

im looking for a code that looks like this if there are any
cvWindowExist("Webcam") returns true if yes and false otherwise

Another option that I'm considering is to disable the close,minimize, maximize
of the cvwindow but then again I don't know how to do it.

any suggestions would be much appreciated
tnx again.

#72862 From: "snehaarumalla" <snehaarumalla@...>
Date: Tue Aug 3, 2010 1:48 pm
Subject: saving video into file
snehaarumalla
Send Email Send Email
 
Hello all

  I wrote a below code to display the video

#include <highgui.h>

int main(int argc, char *argv[])
{
     // Create a "Capture" object from 1st command line argument
     CvCapture *video = cvCaptureFromFile(argv[1]);
     // this is the structure that will store the frames
     IplImage *frame = NULL;
     // create a window to display the video
     cvNamedWindow("Video", CV_WINDOW_AUTOSIZE);
     // get the next frame
     while (frame = cvQueryFrame(video) )
     {
         // display it in the window we created
         cvShowImage("Video", frame);
         // wait 1000/fps milliseconds
         cvWaitKey((int)(1000/cvGetCaptureProperty(video, CV_CAP_PROP_FPS)));

     }
}
AND NOW instead ofdisplaying the video i would like to save the output video
into a file.i tried with cvsaveimage and cvcaptureiamge.
but dont know exactly how to use them where to use them
can anyone please modfy my above to save the output into file
many many thanks in advance

Messages 72833 - 72862 of 90774   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help