|
because i need save the current raw data to Xn for the next call,while the current Xn is the image that grabed last time.
you can see code below:
//get current ccd buffer
pXn = m_pAcqExBuffers->GetImageAddress(nCurBufIndex);
//m_pRawXn is the raw image data grabed in last call
memcpy((void*)m_pXn_1, (void*)m_pRawXn, 2097152);
//get ccd buffer that had been processed in last call
nPreIndex = GetBufferIndex(nCurBufIndex, -1);
pYn_1 = m_pAcqExBuffers->GetImageAddress(nPreIndex);
//save the current raw data
memcpy((void*)m_pRawXn, (void *)pXn, 2097152);
//the image process function , the pXn(it is ccd buffer) is changed in the function
DeNoisePro((WORD *)pXn, (WORD *)m_pXn_1, (WORD *)pYn_1, 1024, 1024, 0, 6, 2);
Happy Gemini
|
|
|
|
|
I understood it, but I think you did not understand me: the problem is that with the call m_pAcqExBuffers->GetImageAddress(nCurBufIndex), the responsibility for allocating memory is in the m_pAcqExBuffers object. I don't know if this class can be modified by you, but imagine if you can call something like m_pAcqExBuffers->SetImageAddress(nCurBufIndex, m_pXn_1); This way you won't need to memcpy a single byte, as the ccd will put the data right were you want.
Even if this fails, if you implement a circular buffer and preserve it between calls, you'll need only 1 memcpy per pass: you don't need to call GetBufferIndex amd GetImageAddress on the last image, as it will be on the circular buffer already.
But you'll still facing problems, as you'll be reducing a memory transfer of 400MB/second to 200MB/second. 200MB/second is still a big figure, and if you change the code as I pointed, you'll be able to avoid it completely.
Perl combines all the worst aspects of C and Lisp: a billion different sublanguages in one monolithic executable. It combines the power of C with the readability of PostScript. -- Jamie Zawinski
|
|
|
|
|
Daniel Turini wrote:
as you'll be reducing a memory transfer of 400MB/second to 200MB/second. 200MB/second is still a big figure
i dont understand .
thanks.
as you said ,the ccd buffer is circular.u can see the denoise-func below:
Yn = a*Xn + b*Yn_1 + c*Xn_1
Yn is the image that is denoised and will be showed.Xn is the raw image that ccd grab currently.Xn_1 is the raw image that was grabed last time, Yn_1 is the image that was processed last time.that is ,ccd buffer carrys raw data before process and carrys ripe data after it.we must save copy raw data to Xn_1 and Xn .so that is why I must copy data twice.
I think that there maybe not have the better method to solve the problem.Now I just pin my hope on the update of the computer hardware.
thanks a lot
Happy Gemini
|
|
|
|
|
You could also try using physical memory...
AllocateUserPhysicalPages();
If you are using windows
|
|
|
|
|
I am programming a program to use modem dialup to retrieve data from SQL 2000 Server...
What would be a good solution for the connection between client pc and SQL 2000 server machine?
JW
DJ
|
|
|
|
|
well for fast access you need high speed connectivity, else the process will be very slow for large retrival.
|
|
|
|
|
thank you Mr.Prakash,
The concern is the project budget instead of the connection speed as data will not be that big.
You also are welcome to read the next message posted by me about this issue.
JW
DJ
|
|
|
|
|
Use dial up networking which is part of windows. Create an incomming connection on the server and a dial out connection on the client. You can have either side create a fixed ip address and get the client to autodial. If you want you can also use MS-CHAP which will give you an encrypted connection.
John
|
|
|
|
|
thanks John,
But the problem is after a dialup connection established between the PC Client and the DB Server, I could not login through The SQL Query Analyzer which resides on the PC side also.
Error message says the DB ( on the DB Server) does not exist or access denied.
COuld this be that the OS running on DB Server is Pro instead of win 2k Server? Any other ideas?
JW
DJ
|
|
|
|
|
Did you try to connect to the database using the ip address instead of the machine name?
John
|
|
|
|
|
I tried the IP address in SQL QUERY Analyzer. It did not work either.
I am trying to access using code:
sDSN = "Provider=sqloledb;" &_
"Data Source=TEST\SEAN;" &_
"Initial Catalog=test;" & _
"User Id=sa;" &_
"Password=password"
\
thanks
DJ
|
|
|
|
|
Thanks a lots.
The problem was caused by some OS modules corrupted in Win 2k.
I changed to another SQL server on a third machine, now I can access via SQL Query Analyzer and my program.
DJ
|
|
|
|
|
I have an SQL Server 2k (personal edition) running on Windows 2000 Pro for testing.
I tried to connect from other PC running SQL server to this databse. However,
from SQL Query Analyzer on the local PC, I could not find the database once I clicked on the ... which is right to the SQL Sever: text box.
The connection between the PC and the Database machine is modem dialup. From either side, I can ping to each other without any problem.
Moreover, once I connected my PC to the intranet, I can access/login to any SQl server database which is within the intranet environment.
ANy help are greatly appreciated.
JW
DJ
|
|
|
|
|
What exactly isthe question??? 
|
|
|
|
|
Sorry I forgot the problem description itself.
The problem is that after the PC client and DB Server (currently SQL 2000 sever running on WIndows 2k Pro) were connected via a dialin service, from the PC site I can not see the DB on the DB Server, nor could I login to the SQL residing on DB Server of course.
ANy idea, again?
JW
DJ
|
|
|
|
|
Ok, I think i know the problem now,
You can access the DB when you are connected to the intranet but now able to access it via dial in. That is because the firewall of the intarnet is not allowing to make connection from outside the intranet.
This is to prevent hackers/viruses to connect to the network. You need to talk to the network administrator of your organization and how he can allow access to the DB only from outside the intranet.
|
|
|
|
|
But what I had done was to dial up directly into the DB Server from the PC client. and from either side, I can ping successfully to each other.
SO there is no firewall between the PC client and The DB Server.
Any suggestion?
JW
DJ
|
|
|
|
|
Thanks a lots.
The problem was caused by some OS modules corrupted in Win 2k.
I changed to another SQL server on a third machine, now I can access via SQL Query Analyzer and my program.
JW
DJ
|
|
|
|
|
I would like to know how to create an instance of a program run within the window of the calling program (like the start or web tab in the older versions of Kazaa when it would open an instance of Microsoft Word for example to view a document) could someone please help me.
Mr. Man
|
|
|
|
|
Look into COM and Embedded Document stuff. (I've just exhausted my knowledge on the subject...)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
I would like to know how to create an instance of a program run within the window of the calling program (like the start or web tab in the older versions of Kazaa when it would open an instance of Microsoft Word for example to view a document) could someone please help me.
Mr. Man
|
|
|
|
|
I'm brand new to C++ and I have to figure this out really fast. I'm almost completely lost so I could use all the help I can get. Thanks in advance. This is what I need to do:
Write a program that allows you to add two time durations expressed in hours, minutes and seconds. Your program should prompt the user to enter these fields for both times and the display the result including a day field. Here’s an example of what your output might look like:
First time duration
Enter hours: 12
Enter minutes: 23
Enter seconds: 32
Second time duration
Enter hours: 13
Enter minutes: 26
Enter seconds: 47
Total time is 1 day and 01:50:19.
|
|
|
|
|
double difftime(
time_t timer1,
time_t timer0
);
defined in time.h
|
|
|
|
|
And....?
What is your doubt, exactly?
We don't do your homework here, but we may help you to understand it better...
Perl combines all the worst aspects of C and Lisp: a billion different sublanguages in one monolithic executable. It combines the power of C with the readability of PostScript. -- Jamie Zawinski
|
|
|
|
|
If you expressed each field as a ratio of that part of a day, you'd have something like:
(12/24) + (23/1440) + (32/86400) =
0.5 + 0.015972 + 0.0003703 = 0.5163425926 (a little more than half a day) Do the same for the second duration yields 0.5602662037. The sum of those is 1.0766087963, which is 1 day, 1 hour, 50 minutes, and 19 seconds.
Or, you could add the fields individually, like:
s3 = s1 + s2
if s3 >= 60
s3 = 0
m1 = m1 + 1
end
m3 = m1 + m2
if m3 >= 60
m3 = 0
h1 = h1 + 1
end
h3 = h1 + h2
if h3 >= 24
h3 = 0
d3 = 1
end
print d3+" days,"+h3+" hours,"+m3+" minutes,"+s3+" seconds"
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|