I am using OpenCV to develop a computer vision application. Last night, I woke up in the middle of the night and tried to debug the method which I do PCA (Principal Component Analysis) and calculating the EigentObject.
But when I run cvCalcEigenObject() method from the cvaux library, the application crashed with memory error. I tried to solve this problem for a few hours and finally find out that images that I used for calculation of Eigen object have different height and width (in pixels). It should be same size and width to run the cvCalcEigenObject() correctly. I tried to adjust the image size and the problem was gone without changing a single line of code.
Friday, December 3, 2010
Reading Configuration file from DLL
If you want to read the configuration file from DLL, it should be under the same folder with "exe". So when you run the main application which called DLL, it can read the setting from the configuration file.
http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/c97b709d-d04c-4fd1-95e4-d8eb3a1ac477/
http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/c97b709d-d04c-4fd1-95e4-d8eb3a1ac477/
Sunday, November 28, 2010
Mapping Network Drive to Local Folder
To Map a network drive letter to local folder, I found that I can use the following command at the command prompt.
subst [Drive]: C:\FolderName
For example, I can map "C:\Temp" folder to K: drive using the command.
subst K: C:\Temp
subst [Drive]: C:\FolderName
For example, I can map "C:\Temp" folder to K: drive using the command.
subst K: C:\Temp
Friday, June 18, 2010
TCPClient.Connected property
I was writing TCP server application which is written in Microsoft Visual C# 2008. I need to accept TCPClient which sent connection request to my server. One of the features that I need to implement is to keep track of the client status whether it was connected to my server or it had already been disconnected from my server.
I found the TCPClient.Connected property in .NET and so I used it to keep track of the client status. But it was totally unreliable. I still could receive TCPClient.Connected property as true even if the client had already been shutdown. I scratched my head to find out what was the cause of the problem. As usual, I searched Internet to find out if other people had encountered same problem before.
To my surprise, TCPClient.Connected property was not actually reflecting the current status of the client. It would only show the status that last time when the server was trying to communicate to client. So it can consider unreliable.
I hate to do it but I need to implement additional logic to keep track of my client. I need to keep record of the time when the client was trying to connected to my server and compare those value with timeout.
I found the TCPClient.Connected property in .NET and so I used it to keep track of the client status. But it was totally unreliable. I still could receive TCPClient.Connected property as true even if the client had already been shutdown. I scratched my head to find out what was the cause of the problem. As usual, I searched Internet to find out if other people had encountered same problem before.
To my surprise, TCPClient.Connected property was not actually reflecting the current status of the client. It would only show the status that last time when the server was trying to communicate to client. So it can consider unreliable.
I hate to do it but I need to implement additional logic to keep track of my client. I need to keep record of the time when the client was trying to connected to my server and compare those value with timeout.
Raising Event from DLL
I am currently developing a new software for a new machine. I need to interface my .NET program to COM DLL to control the hardware. I was writing one DLL for common methods which I can reuse in future applications. I was also writing Windows Application for the methods specific to that machine.
The COM DLL that I am calling from my DLL is written by "ADLink" technology which interfaced to Motion Control module and I/O modules. I was trying to drive servo motors from that DLL. I could successfully drive the servo but it took 10 seconds for my Windows application to receive motion complete event from Servo. I was trying to troubleshoot servo and motion control card but I have no clue what was actually happening.
Finally, I found the problem when I carefully log every line of code in my program. It took 10 seconds to receive the event from DLL to my Windows Application. I tried to move the event raising to Windows application and the problem was solved.
The COM DLL that I am calling from my DLL is written by "ADLink" technology which interfaced to Motion Control module and I/O modules. I was trying to drive servo motors from that DLL. I could successfully drive the servo but it took 10 seconds for my Windows application to receive motion complete event from Servo. I was trying to troubleshoot servo and motion control card but I have no clue what was actually happening.
Finally, I found the problem when I carefully log every line of code in my program. It took 10 seconds to receive the event from DLL to my Windows Application. I tried to move the event raising to Windows application and the problem was solved.
Subscribe to:
Posts (Atom)