|
I'm not sure if this is what your looking for but in there are contrast and RGB filter examples with the SDK.
\SDKRoot\Samples\C++\DirectShow\Filters\Contrast
and
\SDKRoot\Samples\C++\DirectShow\Filters\RGBFilters
I am currently trying to get to the Saturation, Contrast, and Brightness settings for the filter and will let you know if and hopfully when I figure this out--Happy Hunting!!!
|
|
|
|
|
It seems like the ProcAmp control would be a way to edit the image's brightness, contrast, ect... However, I'm not sure how to tie it into an app (ActiveX control in my case)-- Or if its the way to do this! Please someone come up with something I just want to adjust the brightness and prehaps contrast of the image for the love of god!!!!
|
|
|
|
|
I have conducted some test on GraphEdit for changing the contrast,brighness,hue properties ,
and able to change brightness with VMR9 ProcAmp ..
rest of the featues seems not supported by the Filter ..
Anyway i worked arond and found we could change the settings from the source/device filter itself .
You may try this ..please let me know how it works ....
Assuming you have the CVMR_Capture code
Step 1
declare a class member on CVMR_Capture class say ...
IAMVideoProcAmp *m_VPA;
Step2
Inside the function CVMR_Capture::Init
Query "IID_IAMVideoProcAmp" after InitVideoWindow
HRESULT CVMR_Capture::Init(int iDeviceID,HWND hWnd, int iWidth, int iHeight) function
{
.........
hr = InitVideoWindow(hWnd,iWidth, iHeight);
//Query for IID_IAMVideoProcAmp after fixing the Video Size .
hr = m_pDF->QueryInterface(IID_IAMVideoProcAmp,(void**)&m_VPA);
.......
Here you Go ....
}
Step 3 :
you have got the ProcAmp Interface Ready
get the MIN, MAX, DEFAULT values of each property using the function "IAMVideoProcAmp::GetRange"
Then using the functions below You can change each properties with respect to the MIN and MAX obtained from IAMVideoProcAmp::GetRange function
HRESULT Set(
long Property,
long lValue,
long Flags
);
and HRESULT Get(
long Property,
long *lValue,
long *Flags
);
let me know the result
|
|
|
|
|
Thank you very much! I can use IAMVideoProcAmp to change contrast, brightness, satuation, etc...
But my webcam still changes its brightness automatically. When seeing white object, it still turn darker automatically. I can't fix it...
|
|
|
|
|
try checking with other webcam
i guess its a hardware issue
R&D Researcher,
Seoul,Korea
|
|
|
|
|
I have tried two webcams, both of them are the same. Should I buy a better webcam?
|
|
|
|
|
No, you should just turn it off from the properties of the video capture filter.
|
|
|
|
|
Hi krssagar,
Could U tell me how can I set flickerless(anti-flicker) property (set local power line frequence)???
|
|
|
|
|
I am trying to use a call to IAMVfwCaptureDialogs to display the camera control dialogs (Brightness, Saturation, Contrast, ect...) I am getting an Automation error telling me the object has been disconnected though. Does anyone know how you can get these dialogs to come up?
|
|
|
|
|
is this you want ?
void DisplayProperties()
{
CComPtr<ispecifypropertypages> pPages;
HRESULT hr = pCameraOutput->QueryInterface(IID_ISpecifyPropertyPages, (void**)&pPages);
if (SUCCEEDED(hr))
{
PIN_INFO PinInfo;
pCameraOutput->QueryPinInfo(&PinInfo);
CAUUID caGUID;
pPages->GetPages(&caGUID);
OleCreatePropertyFrame(
NULL,
0,
0,
L"Property Sheet",
1,
(IUnknown **)&(pCameraOutput),
caGUID.cElems,
caGUID.pElems,
0,
0,
NULL);
CoTaskMemFree(caGUID.pElems);
PinInfo.pFilter->Release();
}
}
|
|
|
|
|
Thanks for all the help so far, I just have one more issue that I'm having trouble working out. I want to save the captured image to a BMP file. I'm trying to write the Bitmap File Header (14 bytes) then the Bitmap Info Header(40 bytes) followed by the RGB image Bits. Is there and easy way to do this or do I have to write them one at a time!??? Right now I have around 18 or so WriteFile statements to do this but I'm not sure its going to work.
|
|
|
|
|
Here is the code that I added to ImageCapture to create the BMP file... However, there must be a way to avoid all of the WriteFile() commands. Any thaughts???
<br />
WriteFile(hFile,&bmType,sizeof(short),&dwWritten,NULL);<br />
WriteFile(hFile,&bmFileSize,sizeof(long),&dwWritten,NULL);<br />
WriteFile(hFile,&bmLongZero,sizeof(long),&dwWritten,NULL);<br />
WriteFile(hFile,&bmHeadBytes,sizeof(long),&dwWritten,NULL);<br />
<br />
WriteFile(hFile,&bmLongForty,sizeof(long),&dwWritten,NULL);<br />
WriteFile(hFile,&bmXact,sizeof(long),&dwWritten,NULL);
WriteFile(hFile,&bmYdim,sizeof(long),&dwWritten,NULL);<br />
WriteFile(hFile,&bmPlanes,sizeof(short),&dwWritten,NULL);<br />
WriteFile(hFile,&bmBitsPixel,sizeof(short),&dwWritten,NULL);<br />
WriteFile(hFile,&bmLongZero,sizeof(long),&dwWritten,NULL);
WriteFile(hFile,&bmBytes,sizeof(long),&dwWritten,NULL);<br />
WriteFile(hFile,&bmPPM,sizeof(long),&dwWritten,NULL);
WriteFile(hFile,&bmPPM,sizeof(long),&dwWritten,NULL);
WriteFile(hFile,&bmLongZero,sizeof(long),&dwWritten,NULL);
WriteFile(hFile,&bmLongZero,sizeof(long),&dwWritten,NULL);
<br />
WriteFile(hFile, (LPCVOID)pImage , m_nFramelen, &dwWritten, 0);<br />
|
|
|
|
|
Finally I manged to comile the program.
Now it does not work.
1. Maybe because I have a 4 port card.
The card is "Grand X-Guard 4 port Digital Surveiiance System"
Do you know what do I have to do to make it work?
Shlomo
|
|
|
|
|
would you able to see the your device in that COMBO Box ?
in the above application available video capture devices/will display in combo box
|
|
|
|
|
Ok, so I added the following lines to the "strmif.h" file (at the top)
typedef int ULONG_PTR
typedef ULONG_PTR DWORD_PTR
typedef ULONG_PTR LONG_PTR
not all three files were compiled ok, but I receive the following 2 link errors:
unresolved external symbol _IID_IVMRWindowlessControl
unresolved external symbol _IID_IVMRFilterConfig
unresolved external symbol _CLSID_VideoMixingRendere
|
|
|
|
|
use the complete path for includes
and keep directx includes under "Tools->Option" Applet in the first place .
i think directX typedef's are clashing with some other includes/header files ..
R&D Researcher,
Seoul,Korea
|
|
|
|
|
|
I have the same error... My version is directx 9.0 (2004 Summer Update)... and I'm using Visual Studio 6... Also I found out that there are two "strmif.h" files... one in the visual studio C++ include directory and the other one in the directx directory... What am I to do?
|
|
|
|
|
Post your Error Here!!!
The first message in this thread have got 2 diferent kind of Errors .
One is due to DirectX version and Other is coz of DirectX Headers clashing with some other includes/header files
So pls Post your Error !!!I will try to help
|
|
|
|
|
I tried the solution given by the other guy of adding some statements to the "strmif.h" file... It's now working... My question now is how to open the file created by the ImageCapture function... since this is a topic off the thread, maybe you can just e-mail me... thanks!!! nice program by the way
|
|
|
|
|
if using BCB, add following statements:
const IID IID_IVMRFilterConfig = {0x9e5530c5,0x7034,0x48b4,{0xbb,0x46,0x0b,0x8a,0x6e,0xfc,0x8e,0x36}};
const IID IID_IVMRWindowlessControl = {0x0eb1088c,0x4dcd,0x46f0,{0x87,0x8f,0x39,0xda,0xe8,0x6a,0x51,0xb7}};
link with strmiids.lib in omf format.
Regards
Michal Pawluk
|
|
|
|
|
I added the DirectX and added the include files as the first line in Tools->Options->Directories.
No I receive two errors (* 3 files)
in the directx\include\strmif.h:
missing ';' before identifier 'MSEMAPHORE'
It looks like the DWORD_PTR is not defined
Shlomo
|
|
|
|
|
Please keep the "directX includes " in the first place
contact me at krssagar@firsteccom.co.kr for more help
|
|
|
|
|
I am trying to create an ActiveX control that will use DirectX to display a video preview and capture single frames for image processing. However, this is my first attempt at writing such a control. Can I use the InitalizeWindowlessVMR to display a preview image with out having an hWnd to a Dialog box... Or would I need to go about this some other way??? Thanks for the help!
_Flomp_
|
|
|
|
|
You can derive the ActiveX object from public CVMR_Capture,
and attach the handle
CVMR_Capture::Init (nDeviceId,this->m_hWndCD,nWidth,nHeight);
m_hWndCD is the handle to activex window ..
that will do the job and
for painting
HRESULT OnDrawAdvanced(ATL_DRAWINFO& di)
{
HRESULT hr;
RECT& rc = *(RECT*)di.prcBounds;
Rectangle(di.hdcDraw, rc.left, rc.top, rc.right, rc.bottom);
if(pWC)
{
hr = pWC->RepaintVideo(m_hWndCD, di.hdcDraw);
}
}
YOu may follow this code
I am using ATL to create this control .
Hope this helps
|
|
|
|
|