|
Please give me the code of edge detection.
It will be so nice of you.
Thanks
|
|
|
|
|
did you try searching codeproject? did you try google?
-c
Cheap Oil. It's worth it!
|
|
|
|
|
one method to detect edge:
do convolution on your image, and you'll get the edge.
Search for "image processing" and you'll get the algorithm.
|
|
|
|
|
Knowledge Seeker wrote:
Knowledge Seeker
You're not seeking very hard. Search the site.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
I've got an application to develop and am just modifying the MTTTY sample from MSDN for now. I've got to be able to record data to disk at 115K. I've got several questions and considerations.
1) I am assembling 8 and/or 14 byte messages that must be time stamped somewhat accurately but at a 10th of a second time resolution. Thus, I don't want a large buffer since many msgs may be in it and they would probably receive the same time stamp.
2) The time stamp and one other attribute has to be added to the 8 or 14 byte msgs and all msgs written to disk are 20 bytes in length so the msgs are padded if necessary. I've already thought that data will be written in 2K blocks or 200 msgs at a time to disk.
3) The read thread from mttty sample has it's ReadFile function in overlapped mode, has a 512 byte buffer, and uses WaitForMultipleObjects with a 500 ms timeout. The WaitForMultipleObjects looks for a GetOverlappedResult() from the ReadFile() where it may have data. I'm thinking and I'm not sure but after the 500 ms timeout is when all processing is allowed and that's when I would be able to parse the data read and add my timestamp and even write the data to disk.
4) At 115K baud a character is received in about 87 usecs and an entire msg would take about 720 usecs to 1.2 msecs. I'm thinking my buffer should be alot smaller perhaps maybe about 6 bytes (so I don't have same timestamp for each msg even if it was less than 500 ms delay in between) which means I'll have to lower the timeout too. What would be a decent value for the timeout? I'm thinking 5 msecs.
5) Would there be enough time to process the msgs and write the data to disk in the same thread or should there be a separate thread to write the data to disk?
Does any of this make sense? Any suggestions?
|
|
|
|
|
You can setup the thread that does the reads to return immediately when a call to ReadFile is done. You can also get the number of bytes read from the buffer from the call. I do this for a serial application, and build up any messages etc in a local buffer. You can then Sleep() your thread if no data is comming in in 1ms intervals.
COMMTIMEOUTS timeouts ;
timeouts.ReadIntervalTimeout = MAXDWORD ;
timeouts.ReadTotalTimeoutConstant = 0 ;
timeouts.ReadTotalTimeoutMultiplier = 0 ;
timeouts.WriteTotalTimeoutConstant = 0 ;
timeouts.WriteTotalTimeoutMultiplier = 0 ;
SetCommTimeouts(m_hSerialPort, &timeouts) ;
...
while (TRUE)
{
if (!ReadFile(m_hSerialPort, buffer, 1, &dwNumBytesRead, NULL))
{
int error = GetLastError() ;
TRACE("Serial port read fail, error %1d\n", error) ;
}
if (dwNumBytesRead == 0)
{
Sleep(1) ;
continue ;
}
}
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
What about a separate thread for writing the msgs to disk? Do you think I need that? Also, is it best to do a memcpy of whatever data you received from ReadFile's buffer to another buffer or is the data not written to that buffer until you call ReadFile()? I'm wondering if the data in the buffer could be corrupted in between calls to ReadFile() especially in the overlapped situation.
|
|
|
|
|
Here's a problem for the shell gurus:
I'm writing a namespace extension which primary purpose is to take over certain folders and display their content in a different way. I do not know beforehand what folders my NSE should handle so each folder it should handle will get a hidden desktop.ini file with the appropriate entries:
[.ShellClassInfo]
CLSID={33F9BE31-5B67-4fb6-AE60-CEF29F193045}
These special folders should get a custom icon. This is accomplished through some registry magic: "HKEY_CLASSES_ROOT\CLSID\{33F9BE31-5B67-4fb6-AE60-CEF29F193045}\DefaultIcon" will get a default string value that contains the path to my NS followed by the ID of the icon that should be displayed for these folder.
And this works both under Win98, WinNT and Win2000. However, under WinXP it doesn't. I've tried to fix that by adding these lines to the desktop.ini file:
IconFile=<path to my NS>
IconIndex=<index of my icon>
but no luck. I also tried to specify in the registry settings the path to shell32.dll and an ID of some icon that I know that works but no luck either.
Does anyone have a solution to this problem? Or is perhaps noone creating namespace extensions using this technique?
With best regards,
Daniel
|
|
|
|
|
There is a setting in the control panel -> Power Options-> Power schemes tab, for setting Stanby and Hibernate time. i.e. after what unit of time the system should go into stand-by state and similar combo box is also present for hibernate state.
I have tried to use the API GetCurrentPowerPolicies(). In this a structure is filled for POWER_POLICY->MACHINE_POWER_POLICY. In that accoding to MSDN values for stand-by and hibernate should get filled , but it does not.
I am getting the time for disk spindown and video time out and also the Poer Scheme, but I am not getting the standy-by and hibernate time.
Can anyone of you tell me how to obtain the standby and hibernate time.
|
|
|
|
|
I'm trying to get VC6 to use the Windows Debug Symbols, but VC6 does not load them from the installed location (c:\windows\Symbols\...).
I have setup the _NT_SYMBOL_PATH to point to the proper dir.
I have tried putting some directories in the PATH: c:\windows;c:\windows\Symbols;c:\windows\Symbols\Dll.
Neither is successfull with VC6 (But WndDbg is loading symbols alright).
OTOH when I copy the .PDB to the same directory as the DLL they match VC6 happily loads them symbols.
What's going on?
Is there some setting in the VC6 environment that I should have made?
If it matters then I am on WinXP, with VC6 SP5 applied.
MBHansen
|
|
|
|
|
VC6 loads only .dbg file from _NT_SYMBOL_PATH not .pdb. There was a kb article about it.
|
|
|
|
|
Does this mean that there is no way that VC6 will find .pdb files for for example kernel32.dll, EXCEPT if the kernel32.PDB is placed in the same directory as kernel32.dll?
Do you have some info about the KB article? I tried searching for variations over the following words: VC6 VC PDB DBG _NT_SYMBOL_PATH...
MBH
|
|
|
|
|
Oops! Found it: Q304989
Thanks for the help!
MBH
|
|
|
|
|
This is a new one. I didn't know about the "pdb dirs" regkey. So thank you!!
|
|
|
|
|
I would like to do this in GDI+:
Create graphics object;
Write a string to it;
Get a GIF representation of the graphics object.
Is this possible?
James
Drinking In The Sun
Forgot Password?
|
|
|
|
|
|
[James Pullicino] wrote:
Ask me for source code if you wish.
I wish.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
more than that -it's easy. Where are you stuck ?
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
Christian Graus wrote:
-it's easy.
Damn right it is! I'd like to thank you by the way for the tutorials. Getting started on a new technology is always difficult at first.
Drinking In The Sun
Forgot Password?
|
|
|
|
|
Hi all,
I would like to make a program which converts normal text to a gif. What technologies should I be looking at? GDI? GDI+?
I am looking for something lightweight and fast.
Thanks,
James
Drinking In The Sun
Forgot Password?
|
|
|
|
|
You'll need to find a library that can create a .GIF file. You can either try and find the spec and code it yourself, or find a third-party library that does that kind of conversion. Beware though, that unless you have a license from Unisys (I think that's who owns the patent on the compression used in .GIF format), your code will technically be illegal!
No generalization is 100% true.
Not even this one.
|
|
|
|
|
it would only be illegal if it's used commercially
|
|
|
|
|
"Unisys has frequently been asked whether a Unisys license is required in order to use LZW software obtained by downloading from the Internet or from other sources. The answer is simple. In all cases, a written license agreement or statement signed by an authorized Unisys representative is required from Unisys for all use, sale or distribution of any software (including so-called "freeware") and/or hardware providing LZW conversion capability (for example, downloaded software used for creating/displaying GIF images). "
this is from the Unisys website. (they've moved the pages and now i can't find the page i got this from, though it was there like two weeks ago). note that this is a change in their position from earlier times (pre-1995), when they did allow non-commercial use.
see burnallgifs and "A Software Developer's Perspective" for some interesting reading.
-c
Cheap Oil. It's worth it!
|
|
|
|
|
|
i don't know. i haven't seen anything that talks about it. but, if you're using the program to do something that ends up in public (like, using the code on a webserver to generate a web page hit counter, for example), then it's not really "personal" use.
save yourself the hassle, just use the PNG format. it compresses as well or better than GIF, is more flexible, has no patent concerns; the basic flavors are supported on all browsers.
-c
Cheap oil. It's worth it!
|
|
|
|