|
If you want to reply to toxcct , than you have to use the reply button at the end of the message comes from toxcct .
This is an hidden rule of this forum-board.
-- modified at 4:57 Thursday 27th September, 2007
Russell
|
|
|
|
|
Russell` wrote: toxxct
misspelt. toxcct
|
|
|
|
|
|
How to identify given image is too dark or light?
Input format of the file is tif and jpg.
|
|
|
|
|
By taking a look at it I suppose...
Please don't mark your topic with the word Urgent.
Waldermort
|
|
|
|
|
WalderMort wrote: Please don't mark your topic with the word Urgent.
'5' for this
|
|
|
|
|
images are made of pixel, then every pixel has got a color, the color is a combination of red-green-blue (RGB).
white is RGB(255,255,255), black is RGB(0,0,0).
Convert your image in a gray scale:
take the color of every pixel (r,g,b) then compute c=(r+g+b)/3, so the gray pixel of a new image can be RGB(c,c,c), but you can simply store c somewhere.
Then compute the mean value of c on all the image and compare it with a treshold.
do something like this:
if c_mean is less then 50 the image is too dark
if c_mean is greater then 200 the image is too light
hope helps
Russell
|
|
|
|
|
Russell` wrote: compute c=(r+g+b)/3,
But the brightness is not simply the average, right? Red has low intensity compared to others. I dont remember the exact ratio.
- NS -
|
|
|
|
|
I think you are right.
If you find the right formula please post it here, I'll be happy to learn it.
In this case I think that him doesn't need an accurate extraction of the gray-scale, the simple formula (r+g+b)/3 can be enough.
Russell
|
|
|
|
|
Russell` wrote: If you find the right formula please post it here
The one I know is Y = 0.3*R + 0.59*G + 0.11*B
Russell` wrote: the simple formula (r+g+b)/3 can be enough
If it is not for human recognition... right?
- NS -
|
|
|
|
|
NS17 wrote: Y = 0.3*R + 0.59*G + 0.11*B
Yes! I was forgetting this!
(r+g+b)/3 it only an approssimation of the right formula... I used this in past to implement a fast algorithm, but of course it isn't exact.
Russell
|
|
|
|
|
What exactly are those constants 0.3 , 0.59 and 0.11 ?
Sreedhar DV
[Real success is having courage to meet failure without being defeated.]
|
|
|
|
|
Our eye is more sensitive on the green light and less on red.
So, that constants are related to the features of the human eye.
hope it helps.
Russell
|
|
|
|
|
make a bitmap out of and test the pixels. -> CXImage article at CP
Greetings from Germany
|
|
|
|
|
I am trying to call a web service on Pocket PC (ARM processor) using HTTPSendRequest. But when doing InternetReadFile it is giving me incomplete string like this
|
|
|
|
|
I got such incomplete information after calling this web service 2 to 3 times. Initially 2 times i got blank reply.
Now When I used HTTPQueryInfo it showed following message
H T T P / 1 . 1 4 0 0 B a d R e q u e s t
S e r v e r : M i c r o s o f t - I I S / 5 . 0
D a t e : F r i , 2 8 S e p 2 0 0 7 0 8 : 3 5 : 5 1 G M T
X - P o w e r e d - B y : A S P . N E T
X - A s p N e t - V e r s i o n : 2 . 0 . 5 0 7 2 7
C a c h e - C o n t r o l : p r i v a t e
C o n t e n t - L e n g t h : 0
My web service contains just one method “HelloWorld” which does not take any input parameters and returns the “HelloWorld” string to the calling application.
My code of calling web service is following.
LPTSTR AcceptTypes[2] = {TEXT("text/xml"), NULL};
DWORD dwFlags = INTERNET_FLAG_NO_CACHE_WRITE |INTERNET_FLAG_KEEP_CONNECTION;
HINTERNET hNet = InternetOpen(L"EvcWebService", INTERNET_OPEN_TYPE_PRECONFIG,
NULL, NULL, 0 );
if (hNet)
{
HINTERNET hSession = InternetConnect(hNet, _T("10.37.54.93"), INTERNET_DEFAULT_HTTP_PORT, _T(""), _T(""), INTERNET_SERVICE_HTTP, 0, 0);
if (hSession)
{
HINTERNET hRequest = HttpOpenRequest(hSession, _T("POST"), _T("/TestService/Service.asmx?wsdl"), TEXT("HTTP/1.1"),NULL, (LPCTSTR*)AcceptTypes, dwFlags, 0);
if (hRequest)
{
TCHAR szSoapAction[256];
_tcscpy( szSoapAction, _T("Content-Type: text/xml;charset=utf-8\n") );
_tcscat( szSoapAction, _T("SOAPAction: \"") );
_tcscat( szSoapAction, _T("http://tempuri.org/HelloWorld") );
_tcscat( szSoapAction , _T("\"\0\r\n\r\n") );
TCHAR szSoap[512];
_tcscpy(pszSoap, _T("") );
_tcscat(pszSoap, _T("<soap:envelope xmlns:soap="\"http://schemas.xmlsoap.org/soap/envelope/\"" \="" xmlns:xsi="\"http://www.w3.org/2001/XMLSchema-instance\"" xmlns:xsd="\"http://www.w3.org/2001/XMLSchema\"">") );
_tcscat(pszSoap, _T("<soap:header>") );
_tcscat(pszSoap, _T("") );
_tcscat(pszSoap, _T("<soap:body>") );
_tcscat(pszSoap, _T("<helloworld \
="" xmlns="\"http://tempuri.org/\"">") ); //
_tcscat(pszSoap, _T("") );
_tcscat(pszSoap, _T("") );
_tcscat(pszSoap, _T("") );
BOOL bSent = HttpSendRequest(hRequest, szSoapAction, _tcslen(szSoapAction), szSoap, _tcslen(szSoap) );
if(bSent)
{
called HTTPQueryInfo.....
}
This HTTPQueryInfo returns bad request. But this code works fine on Win32 and give Bad Request on WinCE.
Please let me know how should i build soap packet for EVC so that it will call web service on Pocket PC?
|
|
|
|
|
Hi All,
I have developed a ActiveX control that is invoked in IE(Internet Explorer) using Java Script. Now when the control is executing something, and the user switches to some other window and then back to IE, IE does not repaint itself. The screen is not getting painted uniformaly and the control does not get displayed until and unless the processing for the task being executed is over.
Has someone ever encountered this problem? I want IE to show even when the processing is done within the ActiveX control.
Any help would be appreciated.
|
|
|
|
|
I am making a toolbar for a website. initially the toolbar is normal and when the yser login the toolbar changes and takes the setting for the logged in user as is in the case of Yahoo.
If the user does not work on the website application for 18 minutes i.e. if he takes no action he should be logged out and the toolbar should be in its initial state.
Now the problem for me is i am not able to track that no event has been fired and the session of 18 minutes has expired and because of which I am not able to change my toolbar as a aresult of which what happens is that even if the yser is logged out of the site after 18 minutes still my toolbar is having the users settings.
I am using WIN32 ATL and WTL.
Please help me what to do.
Thanks in Advance.
Dhiraj
Dhiraj Kumar Saini
|
|
|
|
|
how to retrieve no of columns in alistView control ?
Thanks
|
|
|
|
|
nitin3 wrote: how to retrieve no of columns in alistView control ?
int nColumnCount = m_List.GetHeaderCtrl()->GetItemCount();
|
|
|
|
|
in a CListCtrl every first column in a row is an item and every other column is a subitem of the item.
I mean:
If a Matrix of MxN, then you have M rows, where column 1 are items and columns [2, N] are subitems. So you have M items and N-1 subitems.
So you can use:
CListCtrl::GetColumn
BOOL GetColumn( int nCol, LVCOLUMN* pColumn ) const;
Return Value
Nonzero if successful; otherwise zero.
put it in an iteration and the last time you get nonzero as return is the number of columns.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
can anybody tell me how to incorporate MS Office packeage file into my API??? to be specific, i want my API to be executed when somebody tries to open a specific pre decided file of MS Office package....
|
|
|
|
|
Or doing it by associating your programm to office in the registry,
or doing a message-spy looking at which programm is being called and, if office... then call your as well.
But sorry, I can't tell you code.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
doing something with office registry will not be feasible for me... can u elaborate on message spy thing???? not exactly code but some referrence ...
thanks
|
|
|
|
|
If I need to do it I will do it, but at the moment... I can give you (and I have given you) the idea how to go in that way. There are articles and message in forum in this website. And you have google. Use it
I have read an article that intercepts mesenger and makes some things. I guess is something similar.
Look for info about HOOKS, THREADS and MESSAGES RECEPTION you should find something to use
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|