|
|
when i try to run the code it always return only a black screen..
here's the code..
private CvCapture VideoCapture;
private IplImage frame;
private IplImage imgMain;
private void btnVideo_Click(object sender, EventArgs e)
{
if (btnVideo.Text.Equals("Start Video"))
{
trainData();
videoCapture = highgui.CvCreateCameraCapture(0);
if (videoCapture.ptr == IntPtr.Zero)
{
MessageBox.Show("Failed");
return;
}
btnVideo.Text = "Stop Video";
highgui.CvQueryFrame(ref videoCapture);
timerGrab.Interval = 45;
timerFPS.Interval = 1100;
timerGrab.Enabled = true;
timerFPS.Enabled = true;
hc = new HaarCascade(this);
abs = new AbsoluteDiff(this);
}
else
{
btnVideo.Text = "Start Video";
timerFPS.Enabled = false;
timerGrab.Enabled = false;
if (videoCapture.ptr != IntPtr.Zero)
{
highgui.CvReleaseCapture(ref videoCapture);
videoCapture.ptr = IntPtr.Zero;
}
}
}
private void timerGrab_Tick(object sender, EventArgs e)
{
frame = highgui.CvQueryFrame(ref VideoCapture);
if (frame.ptr == IntPtr.Zero)
{
timerGrab.Stop();
MessageBox.Show("Invalid");
return;
}
imgMain = cxcore.CvCreateImage(cxcore.CvGetSize(ref frame), 8, 3);
cxcore.CvCopy(ref frame, ref imgMain);
cxcore.CvFlip(ref imgMain, 0);
pictureBox1.Image = highgui.ToBitmap(imgMain, false);
cxcore.CvReleaseImage(ref imgMain);
}
|
|
|
|
|
Have you stepped through the code in the debugger to see where it is failing?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
i dont know. hmm theres no failing and theres no error in the code
|
|
|
|
|
Somewhere in the code it is not giving the results you expect. Your job is to step through it and identify where.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
uhm sir can you help me find the error in the code? i really dont know where is my error in the code.
|
|
|
|
|
Did you write that code or copy it from somewhere?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
i copy it from somewhere.
|
|
|
|
|
would you mind in helping me sir?
|
|
|
|
|
I am helping you.
You need to find out how the code is supposed to work, and then step through it in the debugger to figure out where it is not working the right way.
Look up the function calls in the documentation to find out what they do.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
i think i know where the code is not working..
i think in the picturebox.image = highgui.tobitmap() its not really converting.
it looks like that its not querying any frame coming from the camera..
|
|
|
|
|
sir there's an error when i step through the debugger..
it says that cannot evaluate expression because a native frame is on top of the call stack.
what is that sir?
|
|
|
|
|
|
I found this, but it causes the aspx debug web browser to crash, when I remove it, the code works fine, but of course I'm not impersonating at that point.
private void BeginImpersonation(string domain)
{
EndImpersonation();
bool success = LogonUser(
"xxx",
"xxx",
"xxx",
2,
0,
ref _userToken);
// Did it work?
if (!success) throw new Exception(string.Format("LogonUser returned error {0}", System.Runtime.InteropServices.Marshal.GetLastWin32Error()));
WindowsIdentity fakeId = new WindowsIdentity(_userToken);
_impersonationContext = fakeId.Impersonate();
//("User After Impersonation: " + WindowsIdentity.GetCurrent().Name);
}
|
|
|
|
|
And the exception that it throws is?
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
It does not throw an exception, the browser closes and the output reads
The program '[7868] WebDev.WebServer.EXE: Managed' has exited with code 1 (0x1).
The thread 0x2248 has exited with code 0 (0x0).
The program '[10108] iexplore.exe: Script program' has exited with code 0 (0x0).
|
|
|
|
|
I would have a check of the event log to see if any errors from the WebDev.WebServer.Exe are there.
The problem might not be with code that you have written in your page, but an error caused by the webserver from values that you have passed into it.
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
Good call, I'm not sure what this means yet, but this is added each time it fails.
Watson report about to be sent to dw20.exe for process id: 9208, with parameters: E12, c-RTL-x86, 08.03.0083.006, W.WebServer, M.E.D.Directory, M.E.D.D.ConnectionPoolManager.BlockImpersonatedCallers, M.E.Common.FailFastException, 7f8b, 08.03.0083.000. ErrorReportingEnabled: False
|
|
|
|
|
|
I'm glad you found out why it was failing
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
Me too, except I have no way to do this now, except having the asp code write a file to a folder and have a service on the box that polls for the file and processes it.
|
|
|
|
|
We are trying to import GIS shapefiles into SQL. We found an open source lib for reading the shapefiles (Catfood). Our concept for importing into SQL is to build a WKT string and use the SQL conversion function to get the SQLGeometry type and stick that into the column we want. I think that part is pretty straight forward, but how do we go about converting the projections automatically? Is there something out there better then Catfood that we can use? Doesn't need to be open source, but we need to have control over how the row is created.
I know there are tools to import, but we need to have more control and we need to import around 10 layers and set them up properly, so we'd rather just write an app that the Operations group can just click a button and go.
|
|
|
|
|
|
Hi All,
I have published on desktop application on server which retrives data from SQL server which is there on the same server.
When i run the application from the server it takes one second to execute the Query
But when i run the same application from client system it takes lot of time to execute that Query.
Any reason why it is happening and any alternative for the same??
Any different approach for such latency issues?
|
|
|
|
|
What is your network speed?
Reducing volume of data sent over the wire should help you reduce this delay.
|
|
|
|