|
Hey,
I want to write c++ codes that could compare two images. Which steps shoul I follow. And is Pixel per pixel comparison the best? How can I implement my codes.
Thanks in advance,
Franck
|
|
|
|
|
Have you tried reading the replies you got yesterday?
http://www.codeproject.com/Messages/3281531/compare-images.aspx[^]
I'm not saying if they're good or bad... but they deserve to be read and responded to.
Good luck with your problem,
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
It's a complex problem; because as soon as you think you found a good solution, you come to a test case where it fails and you need to add more and more exception and new tests and code.
What are the input images ? generic images or very spcific images (for example more or less all of the same images from security cameras)
What is the result of the comparison ?
- identical vs. not identical ? (pixel comparison based on images of same size),
- identical up to a % of difference ? how to quantify the difference ?
- shape recognition ? (take into account translation, scale, rotation)
- color difference ? ( blue square vs red square ?)
...
This is a good start (among tons of good links):
(link to PDF) http://cmm.ensmp.fr/~serra/communications_pdf/C-74.pdf[^]
Remember that the human brain is _VERY_ good at doing those kind of things, but computers are still very dumb at it.
Good luck.
This signature was proudly tested on animals.
|
|
|
|
|
Thanks for the replies,
the input images are black and white images of the same object(Boat in a water). I would like to be able to have a percentage(%)of differences and if possible, to make a pixel based comparison.
Thanks,
Franckesh
|
|
|
|
|
This may be of help.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi all,
I want to create a simple proxy server, the process is like this. From a defined URL the request comes to the proxy server, and the proxy server select a URL based on it external process and re-direct to another URL. How can I implement this? Any examples really appreciate.
Thanks a lot.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
|
HI All,
While installing my Application's MSI , it has to prompt for ODBC Data Source Administator Dialog screen , from which i can select my DSN name , UID , PASSWORD...
Please let me know ..
Ur Help much Appreciated.
Regds
Jain.
|
|
|
|
|
Hi Jain,
the ODBC Adminstrator dialog is a control panel applet named ODBCCP32.CPL. It is found in %WINDIR%\system32. The dialog is opened with control.exe like this.
C:\Windows\System32\control.exe ODBCCP32.CPL
Regards
Frank
|
|
|
|
|
Thanks a lot Frank...
Ur answer is really wounderful..
Meanwhile is there anyway to get a list of all available services in separate dialog box.
Regds
Jain
|
|
|
|
|
Hi, i am in trouble with the following:
//function declarations//
void function1();
void function2(BYTE *temp);
//functions//
void function1(){
BYTE temp;
function2(&temp);
}
void function2(BYTE *temp){
int i;
for(i=0;i<10;i++){
temp[i] = 1;
}
}
How come temp can be used as an array in function2 ? function2 requires a pointer to BYTE value not a BYTE array...
TY
|
|
|
|
|
yeah1000 wrote: function2 requires a pointer to BYTE value not a BYTE array...
in C/C++, there is no (syntactical) difference between a pointer to a single variable and a pointer to the start of an array.
|
|
|
|
|
|
Nemanja Trifunovic wrote: It is unfortunate that it compiles at all
I don't think so.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: I don't think so
Care to explain?
[edit] Never mind - my remark would make sense if his second function was declared to have an array as parameter - somehow I thought it was [/edit]
modified on Tuesday, November 24, 2009 2:24 PM
|
|
|
|
|
Well, which is cleaner?
1)
for (i = 0; i < 7; i++)
DoSomething (ptr [i]);
2)
for (i = 0; i < 7; i++)
DoSomething (*(ptr+i));
3)
for (i = 0; i < 7; i++)
DoSomething (*ptr++)
1 & 2 do the same thing.
3 messes up ptr too.
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
That's fine, but I don't see what it has to do with my observation that array decay was an unfortunate decision by creators of C.
If it wasn't for that, you could declare a function to accept either an array or a pointer, but it would be a compile error if you passed a pointer when an array is expected (look at OP).
[edit] Now that *I* looked at OP carefully, I see that my remark does not make sense. Somehow, I thought his second function was declared to take an array, and it really takes a pointer. [/edit]
modified on Tuesday, November 24, 2009 2:25 PM
|
|
|
|
|
See here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi there,
I have an application that should report the state of some sockets within the app but to different class. like if the socket number 0 is connected I send data 00010000 and if socket 0 is disconnected I send 00000000
if socket 1 is connected I send 00010001 and if it is disconnected I send 00000001 so the first 2 bytes shows if the socket is connected or not and the 2nd two bytes shows the socket number. here is the code:
void HHost::HCommsLink( LPVOID lpData )
{
MsgClass *pMsg;
pCmdWrapper_t CmdPkt;
TCHAR Buff[MIN_LOADSTRING];
INT BuffLen;
CmdPkt = ( pCmdWrapper_t )lpData;
try
{ if( CmdPkt )
{
// Format the State message.
memset( Buff, '\0', MIN_LOADSTRING );
BuffLen = 0;
// Socket State.
Buff[BuffLen++] = (( CmdPkt->Param1 >> 8 )& 0xFF );
Buff[BuffLen++] = ( CmdPkt->Param1 & 0xFF );
//Socket Number.
Buff[BuffLen++] = (( CmdPkt->Param2 >> 8 )& 0xFF );
Buff[BuffLen++] = ( CmdPkt->Param2 & 0xFF );
//send message to Ap.
if( pMsg = new MsgClass( HMSG_ORIGIN_IN, 0x00 ))
{
NewCnt++;
pMsg->Hdr.MsgType = 120;
pMsg->SetData( Buff, BuffLen );
// Send to APClass.
if( hMail->MboxPostTo( MBOX_WE_APClass, MBOX_DATA, ( LPVOID )pMsg, ( LPVOID )MBOX_LPARAM_MSG )> MBOX_ERR_SUCCESS )
{
LogError( "HHost", "HCommsLink", "Error: Sending Msg to AP class" );
delete pMsg;
DelCnt++;
}
}
}
}
catch( ... )
{
LogException( "HHost", "HCommsLink", 0 );
}
}
now I need to change the logic so that each message that I send has the info for all the sockets like if socket number 0 is up I send 00000001 and if socket 0 is down I send 00000000 and for socket 1 if it is up I send 00000010 .... finally if I send 00010111 that means sockets 0, 1, 2, and 4 are up and the rest are down, I need to care about 8 sockets, I am having difficulty implementing this.
I appreciate any help.
best Chan
|
|
|
|
|
start with
socketflags = 0;
then for each socket number (total of N sockets):
for (i = 0 ... N-1)
if (socket[i] is up)
socketflags |= 1 << i;
then socketflags will contain the value you want. I'm assuming thats your question?
|
|
|
|
|
Thanks a lot for response but I have problem displaying it in my code Param 1 shows the socket state and Param 2 shows the socket number, so I should have:
if ((CmdPkt->Param1 == 0x00) && (CmdPkt->Param2 == 0x00))
// socket 0 is down
{
//here I have to set the data to send to another class and I don't know how to show it
// like Buff[BuffLen++] = (( 0x00 >> 16 ) & 0xFF );
}
Thanks,
Chan
|
|
|
|
|
Try the below. If the socket is up, then it sets the bit for that socket in the flag variable.
flag = 0;
if (CmdPkt->Param1 != 0)
{
flag |= 1 << CmdPkt->Param2;
}
|
|
|
|
|
Thanks a lot, I needed array structure for this and finally could figure that one out.
Regards,
Chan
|
|
|
|
|
Hi,
Requirement : Need to add a service while installing a MSI ( in VS2005)
So I have added installutil.exe to my Setup project -> Custom Action
and i modified the installutil.exe properties as C:\program\testing1.exe ( in Argument Column)
After doing build and install, i am not able to see any service for my application , meanwhile ..i am able to see my application testing1.vshost.exe in TASKMANAGER.
your help much appreciated
Regds
Jain
|
|
|
|
|
Did you make sure the account you are using have the proper privilage to install a service?
|
|
|
|