How to access the register's value when using the IAMVideoProAmp
retinex
Messages postés3Date d'inscriptionvendredi 21 juillet 2006StatutMembreDernière intervention22 juillet 2006
-
21 juil. 2006 à 10:32
retinex
Messages postés3Date d'inscriptionvendredi 21 juillet 2006StatutMembreDernière intervention22 juillet 2006
-
22 juil. 2006 à 11:48
Hi,
I am a newbie to DirectShow. Recently I am developing an Image Acquisition
software for a microscope. I want to save the parameters such as brightness,
hue and whitebalance, which are got from the IAMVideoProAmp interface to be
the default parameters for the next startup. However, I found if I set the
ColorEnable property to be manual, the saved values can not make a correct
display, especially the color, while the vidcap32.exe can. The following is
copied from the camera driver info ( *.set file):
;[OVT.9600.Properties]
;Standard properties
ROPSETID_VIDCAP_VIDEOPROCAMP
; KSPROPERTY_VIDEOPROCAMP_BRIGHTNESS, // RW O 0
; KSPROPERTY_VIDEOPROCAMP_CONTRAST, // RW O 1
; KSPROPERTY_VIDEOPROCAMP_HUE, // RW O 2
; KSPROPERTY_VIDEOPROCAMP_SATURATION, // RW O 3
; KSPROPERTY_VIDEOPROCAMP_SHARPNESS, // RW O 4
; KSPROPERTY_VIDEOPROCAMP_GAMMA, // RW O 5
; KSPROPERTY_VIDEOPROCAMP_COLORENABLE, // RW O 6
; KSPROPERTY_VIDEOPROCAMP_WHITEBALANCE, // RW O 7
; KSPROPERTY_VIDEOPROCAMP_BACKLIGHT_COMPENSATION,// RW O 8
HKR,%9600Brit%,PropertyId,0x10001, 0
;Control method 0-->just write calculated value to register (one register)
;Control method 1-->Range look up table, write one or more registers for
value within a range
HKR,%9600Brit%,MapMethod,0x10001, 0
HKR,%9600Brit%,RelatedRegister,1,6
;true or false
HKR,%9600Brit%,RelateUsbRegister,1,0
HKR,%9600Brit%,SupportAuto,0x10001,0 ;0 not support, 1 support
;Auto control method 0-->when turn off auto, just write current value to
register
;Auto control method 1-->when turn off auto, just read register value as
current value
HKR,%9600Brit%,PropertyId,0x10001, 0
HKR,%9600Brit%,MapMethod,0x10001, 0
HKR,%9600Brit%,RelatedRegister,1,ec
;true or false
HKR,%9600Brit%,RelateUsbRegister,1,1
retinex
Messages postés3Date d'inscriptionvendredi 21 juillet 2006StatutMembreDernière intervention22 juillet 2006 21 juil. 2006 à 10:37
Let me detail the problem.
I use IAMVideoProAmp to Get/Set the properties to control the video display. I get the properties and save them in an ini file. I found a question:
1. I set the ColorEnable property to be the Auto mode to obtain a correct color display;
2. then I switch the ColorEnable Item to be the Manual mode(after this,the video display does not change the color);
3. now I save all the properties that I can get from IAMVideoProAmp.
4. However, when I restart my program to read the ini file to set the saved properties to the camera, the color display is not the original one.
The same procedures are taken by using vidcap32 except that the properties can not be saved. Namely,
1. open the video source dialog to set the ColorEnable item to be the auto mode to obtain a correct color display;
2. then switch it to manual mode (after this,the video display does not change the color);
3. close the vidcap32.
4. If I restart the vidcap32, the color display remains the same as it was before I close the vidcap32.
I have checked the Registry but I did not find any solution. So I guess the vidcap32 buffers the video register values. How can I read/write the values?
Buno
----------------------------------------
L'urgent est fait, l'impossible est en cours. Pour les miracles, prévoir un délai...
Le site de mon mariage
retinex
Messages postés3Date d'inscriptionvendredi 21 juillet 2006StatutMembreDernière intervention22 juillet 2006 22 juil. 2006 à 11:48
Thanks for your kind reply:)
I have tried your suggestion. If the USB camera is connected to the PC or the PC is not turned off, no matter how many times I restart the vidcap32 or my program, the display will not be changed(the ColorEnable property is manual mode); however, if the camera is pluged off or the PC is restarted, the display will be shifted. Therefore, I guess that some properties that compensate the color display are buffered in the hardware rather than stored in the Registry to control the display. How to get those parameters or access the related hardware buffers thru directshow interfaces?
I found a third software that is not specially designed for my camera can store the parameters to obtain the correct color display. I am curious about how it achieves this.