|
Essentialy i do not need to fill objects. I need to know sizes and locations of objects in image. Image is an array of pixels (BYTE).
I need simething like this:
http://rsb.info.nih.gov/ij/docs/menus/analyze.html
But here is too compound system and its makes too much unuseless calculations. And sources are on Java, and I wanna use it in vc++.
This system find all object in one cycle, so its very quick.
P.S. no, no more processes except quickfill and opera. i think its becouse memory in windows assignes in such way.
|
|
|
|
|
Sounds more like a simple line scan algorithm of some sort is needed, something to how you would fill a polygon (only without knowing where the edges are first.
METHOD 1:
First you'll need a storage item something like the following:
struct bucket
{
int x1, x2;
struct bucket* pNext;
};
Then create an array equal to the height of the image:
bucket* pLineArray = new bucket[height];
Now start scanning at the upper left courner. When you encounter an leading edge: create a new bucket
pBucket = new bucket;
memset(pBucket,0,sizeof(bucket);
and store the location in x1 (left side of edge). Next skip over the edge, then scan until you reach the next edge. Now find the trailing edge (right side of edge) and store that in x2. Insert the bucket in the list at the current line.
void AddBucket(int nLine, bucket* pBucket)
{
bucket* pNext;
pNext = pLineArray[nLine];
if( !pNext )
pLineArray[nLine] = pNext
else {
while( pNext->pNext )
pNext = pNext->pNext;
pNext = pBucket;
}
}
Continue to scan the line adding new buckets as you go.
NOTE: The top and bottom of each object are special cases where the left and right edges are the same (Example: a single pixel at top would contain the same values for x1 and x2.
Repeat the above for each line in the image.
Now that the information stored you can write a function to analyse the information to produce a line list for each of the individual objects.
METHOD 2:
Simulare to method 1, accept that when you encounter an edge you trace all the way around the object, storing the infomation in its own line list. Then exclude that region from futhur scanning.
This method requires multiple scans and that you maintian a list of line lists.
FINALY:
Method 1 will store the information in one pass, but requires futher anasyse to produce the final information (list of line lists).
Method 2 will probably be slower, but may be easier to code.
In either method, you would have one top level function that would be called and return a list of line lists.
I do not know if my ideas help! I do hope they give you some idea of whats envoled.
Recommend reading:
"Computer Graphics: Principles and Practice in C (2nd Edition)".
"Graphics Programming" by Michael Abrash.
The Graphics Gems books, much of the code in these books are available online.
Good Luck!
INTP
|
|
|
|
|
Thanx a lot. Problem is solved.
Now problem is in Gaussing blur. It takes 120 ms for 720*575 image. We wana it takes not more than 40-50 ms. I think only assembler realisation of algorithm can improve performance.
|
|
|
|
|
The best graphics library I know of for speed is Fastgraph by Ted Gruber Software, Inc., written in hand-optimized assembly language.
The algorithm I originaly designed (in C) used assembly level routines (direct video access via hardware support) to read/write the pixel data, that is where the main bootleneck is. It was not intended to be used for image proccessing, but for simple fills like that used by the paint program that comes with Windows.
INTP
|
|
|
|
|
Hi i am looking for the VK code for the subtract key on the main part of the keyboard not the number pad i need to capture both but i can only find the code for the one on the number pad any help you can provide is appreciated thanks
|
|
|
|
|
Spy++ says it's VK_OEM_MINUS
|
|
|
|
|
Hi
Can we load a third party toolbar into our application.
Eg: I have a view class derived from CHtmlView.How can i load the additional toolbars downloaded for the Internet explorer.
Thanks
|
|
|
|
|
As my knowledge, you need 2 toolbars. One supplied by MFC framework, and the other supplied by yourself. If so, read bellow. If not, leave now.
In CMainFrame, create a CToolBar member variable, for example, it may be CToolBar m_tbNew; .
In CMainFrame::OnCreate , add the following code:
<br />
m_tbNew.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, CRect(0,0,0,0), ID_NEW_TOOLBAR);<br />
m_tbNew.SetWindowText("Caption here");<br />
m_tbNew.LoadToolBar(IDR_NEW_TOOLBAR_RESOURCE);<br />
m_tbNew.EnableDocking(CBRS_ALIGN_ANY);<br />
DockControlBar(&m_tbNew);<br />
The second toolbar will show beside default toolbar.
Good luck.
|
|
|
|
|
Thanks for your reply.
And i wanted to know that can we load the Google toolbar or Yahoo Toolbar into our application.
Thanks
|
|
|
|
|
I have Help->Contents menu in my project. And I have a help.hlp file.
What I need is : On click of the contents menu, I need to display this help.hlp file. How do i do it ??
Could someone help me on this, please. I thank in advance.
Mughi
|
|
|
|
|
::WinHelp(0,".\\MY.HLP",HELP_CONTEXT,19028);
|
|
|
|
|
Its working.
Thanks for your support.
And by the way, I would like to know on how to run any other program, not only HLP files but also to invoke other files like documents, executables, etc.,
Once again, I thank you for your support.
|
|
|
|
|
there are two ways:
if you do NOT need control over the other programm use
WinExec
if you need the control, to determine, wheter the other programm is still running use
CreateProcess / OpenProcess / WaitForSingleObject
|
|
|
|
|
thanks for your support
cheers
|
|
|
|
|
ShellExecute (...)
Try above mantioned Win32 Shell API.
Jitendra
|
|
|
|
|
thanks for your support
cheers
|
|
|
|
|
hai,
can anybody tell me how to change the size of a cview.
i want to display cview just above the status bar.
thanx.
|
|
|
|
|
The CView by default is above the status bar.
I don' tthink u need to do anything about this.
I am assuming you are using MDI or SDI?
Sonork 100.41263:Anthony_Yio
Life is about experiencing ...
|
|
|
|
|
hai,
i want to know whether the coordinates of Cview can b specified .
i want to disp a cview at the bottom.
|
|
|
|
|
abins20 wrote:
i want to know whether the coordinates of Cview can b specified .
Yes. In the CFrameWnd -derived class, override
OnGetMinMaxInfo() .
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi All,
I am writing a COM Dll in ATL to integrate 2 applications that talk to each other using sockets. I am new to sockets and have a few queries --
I am using the MFC based CSockets to read and write. When the API,
"Accept" is used, a new socket is created with the same properties which can be used to write to a target socket. Can we use the same socket for reading data that is being written on my socket ?
I would like to spawn different thread for reading and writing. Is it advisable to use the same socket ?
Cheers
Raja
|
|
|
|
|
In your first question you have asked, as I understand that you want to read/write operations on a same socket. it is absolutely valid. When a client connect to the server. The server accepts it and a new socket is created that represent the client socket on the server. In tern when you write something on it in the server, is send to the client for the reading. And when client write something, that is sent to the server and the server can read that content on the same socket that is representing the client.
According to the second question, you are using the CSocket class of MFC. The CSocket provides the various notifications on the socket like something is received or sent on the socket. These notifications Functions are inherited from its base class CAsyncSocket. And you can override these functions to get the processing done of these notifications. You don't have to you the thread manually in your application for that processing. The MFC Framework already implements it. But if the SDK/Win32 API programming is the choice than you have to manually implement all this functionality.
You can find an example app based on CSocket implementation in MSDN at the below link.
Hope it would help you.
Jitendra
|
|
|
|
|
Hi Jitendra
Thanks so much for clarifying my qn. Wanted to reply to you immediately but could not login to this site (
I have realised that when I use a COM dll loaded into my App and wait for Data to receive on my socket (though it is multithreaded, I am using this from VB script of my app), my app hangs until data is recieved.
I am now trying to use the Async Method. Could you please help me in this regard?
I have generated a COM dll using the ATL COM APP wizard. I inserted a Full control that actually exposes interfaces.
I have then defined my own Class, say MySocket derived publicly from AsyncSocket. I now want to use this dll to get notification when there is data to be read, asynchronously.
In my interface implementation,
I created an instance of MySocket. How do I get notified of the event?
Can you email me ur id, so I could send my code to you for better understanding?
My email id is shekar_raja@indiatimes.com
This is very critical to me, please take time for this.
Thanks heaps in advance....
Cheers
Raja
|
|
|
|
|
Hi Friends,
Is there any way to install office 2000 developer on named instance?
VikramS
|
|
|
|
|
a character string can be implemented as a linked list of characters.I have to write a C++ class called "Newstring" that uses linked lists to implement the following string operations (in all examples, string1 and string2 are of type Newstring):
string1.concatenate(string2)
concatenates string2 onto the end of string1
string1.concatenate(ch)
concatenates the single character ch to end of string1
string1.display()
displays string1 on standard output (cout)
string1.length()
returns length of string1
string1.substring(string2)
returns 1(true)if string2 is a substring of string1
and 0 (false) otherwise
In implementing this class, i have to write additional, private methods to assist the others and a program to test the class. This is an exercise not a test and it has me confused really bad.They say its a full programming exercise,what does that mean?I am new at this kind of thing ,please help if you can .
Thanks
main( )
{
StringType str1, str2;
char word;
cin>>word;
StringType str3(word);
str2 = str3;
~str3;
str2.Length();
cin>>str1;
Concatanate(str1, str2);
str2.Display();
if (str1 == str2)
cout<<"SAME";
else
cout<<"DIFFERENT";
}
i have an idea how to do it but haven't had any experience with classes.
|
|
|
|