How to access the register's value when using the IAMVideoProAmp

Signaler
Messages postés
3
Date d'inscription
vendredi 21 juillet 2006
Statut
Membre
Dernière intervention
22 juillet 2006
-
Messages postés
3
Date d'inscription
vendredi 21 juillet 2006
Statut
Membre
Dernière intervention
22 juillet 2006
-
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

HKR,%9600Brit%,DefaultValue,0x10001, 0x00
HKR,%9600Brit%,DefaultFlags,0x10001, 1
HKR,%9600Brit%,MinValue,0x10001, 0xffffff80
HKR,%9600Brit%,MaxValue,0x10001, 0x7f
HKR,%9600Brit%,Step,0x10001, 1

;#####################################

HKR,%9600Cntr%,PropertyId,0x10001, 1
HKR,%9600Cntr%,MapMethod,0x10001, 0
HKR,%9600Cntr%,RelatedRegister,1,eb
;true or false
HKR,%9600Cntr%,RelateUsbRegister,1,1

HKR,%9600Cntr%,DefaultValue,0x10001, 0x80
HKR,%9600Cntr%,DefaultFlags,0x10001, 1
HKR,%9600Cntr%,MinValue,0x10001, 0
HKR,%9600Cntr%,MaxValue,0x10001, 255
HKR,%9600Cntr%,Step,0x10001, 1

;#####################################

HKR,%9600Col%,PropertyId,0x10001, 6
HKR,%9600Col%,MapMethod,0x10001, 1
HKR,%9600Col%,NumberOfValues,0x10001, 2
HKR,%9600Col%\0000,Value,0x10001, 0
HKR,%9600Col%\0000,UsbRegisters,1, f0,00,ff
HKR,%9600Col%\0000,CamRegisters,1, 01,80,ff,02,80,ff,24,80,ff,25,70,ff
HKR,%9600Col%\0001,Value,0x10001, 1
HKR,%9600Col%\0001,UsbRegisters,1, f0,01,ff
HKR,%9600Col%\0001,CamRegisters,1, 24,b0,ff,25,90,ff

HKR,%9600Col%,DefaultValue,0x10001, 1
HKR,%9600Col%,MinValue,0x10001, 0
HKR,%9600Col%,MaxValue,0x10001, 1
HKR,%9600Col%,Step,0x10001, 1

;#####################################

;HKR,%9600Wb%,Registers,0x10001,
;#####################################
;HKR,%9600Wb%,PropertyId,0x10001, 7

;HKR,%9600Wb%,MapMethod,0x10001, 0
;HKR,%9600Wb%,RelatedRegister,1,01

;HKR,%9600Wb%,DefaultValue,0x10001, 80
;HKR,%9600Wb%,DefaultFlags,0x10001, 1
;HKR,%9600Wb%,MinValue,0x10001, 0
;HKR,%9600Wb%,MaxValue,0x10001, 255
;HKR,%9600Wb%,Step,0x10001, 1

I guess the vidcap32.exe buffers the register values. How can I read/write
the registers?

Any comments should be appreciated!

3 réponses

Messages postés
3
Date d'inscription
vendredi 21 juillet 2006
Statut
Membre
Dernière intervention
22 juillet 2006

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?

Thanks a lot.
Messages postés
14947
Date d'inscription
lundi 11 juillet 2005
Statut
Modérateur
Dernière intervention
21 janvier 2021
93
More information can be found on MSDN here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/registry_functions.asp

Buno
----------------------------------------
L'urgent est fait, l'impossible est en cours. Pour les miracles, prévoir un délai...
Le site de mon mariage
Messages postés
3
Date d'inscription
vendredi 21 juillet 2006
Statut
Membre
Dernière intervention
22 juillet 2006

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.

Thanks for any suggestion.