PDA

View Full Version : Scan2Docx camera not available brightness property while it's program can do it



wisit
August 3, 2014, 17:26:49
Hi,
I have scan2docx camera, this one
1716

and I need to develop my program with IC Imaging Control version 3.3 on VC# 2010 express.
I found problem when I writing code like this


if (VCDProp.Available(VCDIDs.VCDID_Brightness))
{
brightnessTrackBar.Minimum = VCDProp.RangeMin(Brightness.ToString());
brightnessTrackBar.Maximum = VCDProp.RangeMax(VCDIDs.VCDID_Brightness);
brightnessTrackBar.TickFrequency = (brightnessTrackBar.Maximum - brightnessTrackBar.Minimum) / 10;
brightnessTrackBar.Value = VCDProp.RangeValue[VCDIDs.VCDID_Brightness];
}


It's result false while this camera can be adjusted brightness when I run on program Scan2Docx.

1717

what is the problem, and how can I solve the problem.

Stefan Geissler
August 4, 2014, 08:54:14
You are right, the camera natively has no brightness as your source code tells you.

However, you may install the latest driver 2.7.9 from http://www.theimagingsource.com/en_US/support/downloads/details/icwdmuvccamtis/

wisit
August 4, 2014, 15:52:34
Hi Stefan,

It work for me, Thank you so much.

:-)

wisit
August 9, 2014, 09:53:05
Hi, Stefan,

I have one question, In original program scan2docx I can check box Auto color, Auto contrast, Unsharp mask and select color format. But I don't know VCD Properties name in VCD Property Inspection program.

Could you please tell me about VCD Properties's scan2docx camera? ( see my attach file)

regards.
wisit P.

1718

Stefan Geissler
August 11, 2014, 09:07:41
Hello Wisit

you can use the properties in S2D, because they are functions of the program. Therefore, there are functions, that look like properties and the program may also behave different than the camera driver. S2D does tons of image processing.

Unsharp masking is the same as sharpness in the driver. Color format is video format and sink format (pixelformat) in memory.

The properties of the S2D camera are the same as shown in the VCD Property Inspector installed by IC Imaging Control.

Play around with video formats. Play with the MemoryCurrentGrabberColorformat property of IC Imaging Control.

wisit
August 19, 2014, 18:57:47
Hello Wisit

Unsharp masking is the same as sharpness in the driver. Color format is video format and sink format (pixelformat) in memory.



Hi Stefan,

If you have a S2D camera in your hand, could you mind test with your code C#.net? I have many problem with IC Imaging Control .NET SDK. I'm newbie with development programming with C#.

Could you please show your code with relate some feature below
-Rotation flip (CW,CCW)
-Horizontal flip
-Vertical flip
-Auto Color
-Auto contrast
-Unsharp mask

BTW another feature of IC Imaging control SDK, I try to understand your manual and do it successful.

Hope you understand my request.
Thanks

Stefan Geissler
August 20, 2014, 08:53:41
Hi Wisit,

the rotate and flip is done with frame filters. Please refer to
http://www.theimagingsource.com/en_US/support/documentation/icimagingcontrol-dotnet/ref_stdfilter.htm

- Auto Color
What should this be?

-Auto contrast

Auto contrast is not available. Only the contrast parameter can be set


// ************************************************** **************
// C# functions for Contrast Value Range interface
// Usage :
// int Value, Minimum,Maximum;
// if( IsContrastValueAvailable(icImagingControl1) )
// {
// Value = GetContrastValueValue(icImagingControl1);
// Minimum = GetContrastValueMin(icImagingControl1);
// Maximum = GetContrastValueMax(icImagingControl1);
// SetContrastValueValue(icImagingControl1, 10);
// }

bool IsContrastValueAvailable(TIS.Imaging.ICImagingCont rol ic)
{
bool bResult = false;
if( ic.DeviceValid == true )
{
TIS.Imaging.VCDRangeProperty Property;
Property = (TIS.Imaging.VCDRangeProperty)ic.VCDPropertyItems. FindInterface(TIS.Imaging.VCDIDs.VCDID_Contrast, TIS.Imaging.VCDIDs.VCDElement_Value, TIS.Imaging.VCDIDs.VCDInterface_Range);
if (Property != null)
{
bResult = true;
}
}
return bResult;
}


int GetContrastValueValue(TIS.Imaging.ICImagingControl ic)
{
if( ic.DeviceValid == true )
{
TIS.Imaging.VCDRangeProperty Property;
Property = (TIS.Imaging.VCDRangeProperty)ic.VCDPropertyItems. FindInterface(TIS.Imaging.VCDIDs.VCDID_Contrast, TIS.Imaging.VCDIDs.VCDElement_Value, TIS.Imaging.VCDIDs.VCDInterface_Range);
if (Property != null)
{
return Property.Value;
}
}

return 0;
}

void SetContrastValueValue(TIS.Imaging.ICImagingControl ic, int Value)
{
if( ic.DeviceValid == true )
{
TIS.Imaging.VCDRangeProperty Property;
Property = (TIS.Imaging.VCDRangeProperty)ic.VCDPropertyItems. FindInterface(TIS.Imaging.VCDIDs.VCDID_Contrast, TIS.Imaging.VCDIDs.VCDElement_Value, TIS.Imaging.VCDIDs.VCDInterface_Range);
if (Property != null)
{
Property.Value = Value;
}
}
}

int GetContrastValueMin(TIS.Imaging.ICImagingControl ic)
{
if( ic.DeviceValid == true )
{
TIS.Imaging.VCDRangeProperty Property;
Property = (TIS.Imaging.VCDRangeProperty)ic.VCDPropertyItems. FindInterface(TIS.Imaging.VCDIDs.VCDID_Contrast, TIS.Imaging.VCDIDs.VCDElement_Value, TIS.Imaging.VCDIDs.VCDInterface_Range);
if (Property != null)
{
return Property.RangeMin;
}
}

return 0;
}

int GetContrastValueMax(TIS.Imaging.ICImagingControl ic)
{
if( ic.DeviceValid == true )
{
TIS.Imaging.VCDRangeProperty Property;
Property = (TIS.Imaging.VCDRangeProperty)ic.VCDPropertyItems. FindInterface(TIS.Imaging.VCDIDs.VCDID_Contrast, TIS.Imaging.VCDIDs.VCDElement_Value, TIS.Imaging.VCDIDs.VCDInterface_Range);
if (Property != null)
{
return Property.RangeMax;
}
}
return 0;
}







-Unsharp mask
Same as Sharpness


// ************************************************** **************
// C# functions for Sharpness Value Range interface
// Usage :
// int Value, Minimum,Maximum;
// if( IsSharpnessValueAvailable(icImagingControl1) )
// {
// Value = GetSharpnessValueValue(icImagingControl1);
// Minimum = GetSharpnessValueMin(icImagingControl1);
// Maximum = GetSharpnessValueMax(icImagingControl1);
// SetSharpnessValueValue(icImagingControl1, 10);
// }

bool IsSharpnessValueAvailable(TIS.Imaging.ICImagingCon trol ic)
{
bool bResult = false;
if( ic.DeviceValid == true )
{
TIS.Imaging.VCDRangeProperty Property;
Property = (TIS.Imaging.VCDRangeProperty)ic.VCDPropertyItems. FindInterface(TIS.Imaging.VCDIDs.VCDID_Sharpness, TIS.Imaging.VCDIDs.VCDElement_Value, TIS.Imaging.VCDIDs.VCDInterface_Range);
if (Property != null)
{
bResult = true;
}
}
return bResult;
}


int GetSharpnessValueValue(TIS.Imaging.ICImagingContro l ic)
{
if( ic.DeviceValid == true )
{
TIS.Imaging.VCDRangeProperty Property;
Property = (TIS.Imaging.VCDRangeProperty)ic.VCDPropertyItems. FindInterface(TIS.Imaging.VCDIDs.VCDID_Sharpness, TIS.Imaging.VCDIDs.VCDElement_Value, TIS.Imaging.VCDIDs.VCDInterface_Range);
if (Property != null)
{
return Property.Value;
}
}

return 0;
}

void SetSharpnessValueValue(TIS.Imaging.ICImagingContro l ic, int Value)
{
if( ic.DeviceValid == true )
{
TIS.Imaging.VCDRangeProperty Property;
Property = (TIS.Imaging.VCDRangeProperty)ic.VCDPropertyItems. FindInterface(TIS.Imaging.VCDIDs.VCDID_Sharpness, TIS.Imaging.VCDIDs.VCDElement_Value, TIS.Imaging.VCDIDs.VCDInterface_Range);
if (Property != null)
{
Property.Value = Value;
}
}
}

int GetSharpnessValueMin(TIS.Imaging.ICImagingControl ic)
{
if( ic.DeviceValid == true )
{
TIS.Imaging.VCDRangeProperty Property;
Property = (TIS.Imaging.VCDRangeProperty)ic.VCDPropertyItems. FindInterface(TIS.Imaging.VCDIDs.VCDID_Sharpness, TIS.Imaging.VCDIDs.VCDElement_Value, TIS.Imaging.VCDIDs.VCDInterface_Range);
if (Property != null)
{
return Property.RangeMin;
}
}

return 0;
}

int GetSharpnessValueMax(TIS.Imaging.ICImagingControl ic)
{
if( ic.DeviceValid == true )
{
TIS.Imaging.VCDRangeProperty Property;
Property = (TIS.Imaging.VCDRangeProperty)ic.VCDPropertyItems. FindInterface(TIS.Imaging.VCDIDs.VCDID_Sharpness, TIS.Imaging.VCDIDs.VCDElement_Value, TIS.Imaging.VCDIDs.VCDInterface_Range);
if (Property != null)
{
return Property.RangeMax;
}
}
return 0;
}

wisit
August 20, 2014, 14:34:58
Hi Wisit,

the rotate and flip is done with frame filters. Please refer to
http://www.theimagingsource.com/en_US/support/documentation/icimagingcontrol-dotnet/ref_stdfilter.htm

- Auto Color
What should this be?

-Auto contrast

Auto contrast is not available. Only the contrast parameter can be set


// ************************************************** **************
// C# functions for Contrast Value Range interface
// Usage :
// int Value, Minimum,Maximum;
// if( IsContrastValueAvailable(icImagingControl1) )
// {
// Value = GetContrastValueValue(icImagingControl1);
// Minimum = GetContrastValueMin(icImagingControl1);
// Maximum = GetContrastValueMax(icImagingControl1);
// SetContrastValueValue(icImagingControl1, 10);
// }

bool IsContrastValueAvailable(TIS.Imaging.ICImagingCont rol ic)
{
bool bResult = false;
if( ic.DeviceValid == true )
{
TIS.Imaging.VCDRangeProperty Property;
Property = (TIS.Imaging.VCDRangeProperty)ic.VCDPropertyItems. FindInterface(TIS.Imaging.VCDIDs.VCDID_Contrast, TIS.Imaging.VCDIDs.VCDElement_Value, TIS.Imaging.VCDIDs.VCDInterface_Range);
if (Property != null)
{
bResult = true;
}
}
return bResult;
}


int GetContrastValueValue(TIS.Imaging.ICImagingControl ic)
{
if( ic.DeviceValid == true )
{
TIS.Imaging.VCDRangeProperty Property;
Property = (TIS.Imaging.VCDRangeProperty)ic.VCDPropertyItems. FindInterface(TIS.Imaging.VCDIDs.VCDID_Contrast, TIS.Imaging.VCDIDs.VCDElement_Value, TIS.Imaging.VCDIDs.VCDInterface_Range);
if (Property != null)
{
return Property.Value;
}
}

return 0;
}

void SetContrastValueValue(TIS.Imaging.ICImagingControl ic, int Value)
{
if( ic.DeviceValid == true )
{
TIS.Imaging.VCDRangeProperty Property;
Property = (TIS.Imaging.VCDRangeProperty)ic.VCDPropertyItems. FindInterface(TIS.Imaging.VCDIDs.VCDID_Contrast, TIS.Imaging.VCDIDs.VCDElement_Value, TIS.Imaging.VCDIDs.VCDInterface_Range);
if (Property != null)
{
Property.Value = Value;
}
}
}

int GetContrastValueMin(TIS.Imaging.ICImagingControl ic)
{
if( ic.DeviceValid == true )
{
TIS.Imaging.VCDRangeProperty Property;
Property = (TIS.Imaging.VCDRangeProperty)ic.VCDPropertyItems. FindInterface(TIS.Imaging.VCDIDs.VCDID_Contrast, TIS.Imaging.VCDIDs.VCDElement_Value, TIS.Imaging.VCDIDs.VCDInterface_Range);
if (Property != null)
{
return Property.RangeMin;
}
}

return 0;
}

int GetContrastValueMax(TIS.Imaging.ICImagingControl ic)
{
if( ic.DeviceValid == true )
{
TIS.Imaging.VCDRangeProperty Property;
Property = (TIS.Imaging.VCDRangeProperty)ic.VCDPropertyItems. FindInterface(TIS.Imaging.VCDIDs.VCDID_Contrast, TIS.Imaging.VCDIDs.VCDElement_Value, TIS.Imaging.VCDIDs.VCDInterface_Range);
if (Property != null)
{
return Property.RangeMax;
}
}
return 0;
}







-Unsharp mask
Same as Sharpness


// ************************************************** **************
// C# functions for Sharpness Value Range interface
// Usage :
// int Value, Minimum,Maximum;
// if( IsSharpnessValueAvailable(icImagingControl1) )
// {
// Value = GetSharpnessValueValue(icImagingControl1);
// Minimum = GetSharpnessValueMin(icImagingControl1);
// Maximum = GetSharpnessValueMax(icImagingControl1);
// SetSharpnessValueValue(icImagingControl1, 10);
// }

bool IsSharpnessValueAvailable(TIS.Imaging.ICImagingCon trol ic)
{
bool bResult = false;
if( ic.DeviceValid == true )
{
TIS.Imaging.VCDRangeProperty Property;
Property = (TIS.Imaging.VCDRangeProperty)ic.VCDPropertyItems. FindInterface(TIS.Imaging.VCDIDs.VCDID_Sharpness, TIS.Imaging.VCDIDs.VCDElement_Value, TIS.Imaging.VCDIDs.VCDInterface_Range);
if (Property != null)
{
bResult = true;
}
}
return bResult;
}


int GetSharpnessValueValue(TIS.Imaging.ICImagingContro l ic)
{
if( ic.DeviceValid == true )
{
TIS.Imaging.VCDRangeProperty Property;
Property = (TIS.Imaging.VCDRangeProperty)ic.VCDPropertyItems. FindInterface(TIS.Imaging.VCDIDs.VCDID_Sharpness, TIS.Imaging.VCDIDs.VCDElement_Value, TIS.Imaging.VCDIDs.VCDInterface_Range);
if (Property != null)
{
return Property.Value;
}
}

return 0;
}

void SetSharpnessValueValue(TIS.Imaging.ICImagingContro l ic, int Value)
{
if( ic.DeviceValid == true )
{
TIS.Imaging.VCDRangeProperty Property;
Property = (TIS.Imaging.VCDRangeProperty)ic.VCDPropertyItems. FindInterface(TIS.Imaging.VCDIDs.VCDID_Sharpness, TIS.Imaging.VCDIDs.VCDElement_Value, TIS.Imaging.VCDIDs.VCDInterface_Range);
if (Property != null)
{
Property.Value = Value;
}
}
}

int GetSharpnessValueMin(TIS.Imaging.ICImagingControl ic)
{
if( ic.DeviceValid == true )
{
TIS.Imaging.VCDRangeProperty Property;
Property = (TIS.Imaging.VCDRangeProperty)ic.VCDPropertyItems. FindInterface(TIS.Imaging.VCDIDs.VCDID_Sharpness, TIS.Imaging.VCDIDs.VCDElement_Value, TIS.Imaging.VCDIDs.VCDInterface_Range);
if (Property != null)
{
return Property.RangeMin;
}
}

return 0;
}

int GetSharpnessValueMax(TIS.Imaging.ICImagingControl ic)
{
if( ic.DeviceValid == true )
{
TIS.Imaging.VCDRangeProperty Property;
Property = (TIS.Imaging.VCDRangeProperty)ic.VCDPropertyItems. FindInterface(TIS.Imaging.VCDIDs.VCDID_Sharpness, TIS.Imaging.VCDIDs.VCDElement_Value, TIS.Imaging.VCDIDs.VCDInterface_Range);
if (Property != null)
{
return Property.RangeMax;
}
}
return 0;
}







Hi Stefan,
Thank you for your code, Let me test its.
I am trying to make win application like Scan2Docx as my application working like Scan2docx but I added 3 push button (Digital usb switch) into my application so my application should be same feature like original application (Scan2Docx).

I'm afraid, my customer may ask me when he see something different with scan2doxc.

Let me try and I will update you again.

Thank you so much.

1720

wisit
August 21, 2014, 19:56:53
Hi Stefan,
It seem not feature auto contrast , auto color while scan2docx application can do that, I don't know why. BTW I decide disable these features in my application.

finally I want maintain video format when I click rotation button, I found the video format not match with icImagingControl on Form windows.

Could you suggest with me again, how to maintain video format when I rotate picture?
I want my application same with the original application.

Thanks

1721

Stefan Geissler
August 22, 2014, 08:45:34
How should "Auto contrast" work?

There is a contrast (without auto) only, if using driver 2.7.9.

Also (I guess I already wrote this above) Scan2Docx does a lot of image processing in its software. This has no relation to camera properties.


finally I want maintain video format when I click rotation button, I found the video format not match with icImagingControl on Form windows.

Does this mean, if you have a 640x480 iformat and want to rotates it by 90°, the image is resized smaller and displayed in 640 480 pixel size with a black frame on the left and right side? If yes, you have to program this on your own. Best way is doing this in a frame filter. I never did this before, therefore, I have no sample code.

How to create a frame filter is shown in the ".NET Users Guide" of IC Imaging Control. Also there is a frame filter wizard for Visual Studio, that generates the basic source code for a filter.