Unibrain API-810 Uživatelský manuál

Procházejte online nebo si stáhněte Uživatelský manuál pro Firewire kabely Unibrain API-810. Documentation Uživatelská příručka

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 95
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 0
Unibrain
Fire-i.net SDK manual
Programmer’s Manual & Reference
Zobrazit stránku 0
1 2 3 4 5 6 ... 94 95

Shrnutí obsahu

Strany 1 - Fire-i.net SDK manual

Unibrain Fire-i.net SDK manual Programmer’s Manual & Reference

Strany 2 - Table of Contents

10 Visual Studio automatically sets the name of the control to be “fireiPreviewControl1”, which for our purpose will do nicely. Now it’s time to edit

Strany 3

11 The above code fragment will iterate through the connected cameras, and stop at the first camera that is made by Unibrain. With the additional che

Strany 4 - Introduction

12 Camera = Manager.GetCameraFromGUID(guid); Next, we need to connect the Camera object to our FireiPreviewControl object. This is done with a singl

Strany 5 - Technical Details

13 The available choice will of course vary depending on which camera this is called upon; only supported formats will be presented. Also, the above

Strany 6 - Helpers

14 Running the program will show live video on our control on the form, after selecting the desired camera and streaming format. If only one camera i

Strany 7

15 see the reference section of this manual) of the camera, checks whether they support Auto setting and if they do, sets it. A GUI-driven way to man

Strany 8

16 Firstly, we enlarge our form, to make way for the new controls: Then, we add the two controls. It is also a good idea to change their correspondi

Strany 9

17 Camera. GetFeatures(true, FireiFeatureGroup.All). ForEach(f => FeaturesList.Items.Add(f.Name)); This takes care of the listbox population. Now

Strany 10

18 Next, we assign that method to the FrameReceived event. A good place for that would be immediately before calling Camera.Run: Camera.FrameReceived

Strany 11

19 This is what the outcome looks like: NOTE: The aliasing of the drawn lines and text is due to the enlargement of the picture in order for it to f

Strany 12

2 Table of ContentsTABLE OF CONTENTS ... 2 INTRODUCTION ...

Strany 13

20 operation, by using a derivative of the FireiStreamFormat object, called FireiUserDefinedStreamFormat (as opposed to the FireiFixedStreamFormat).

Strany 14

21 of FireiStreamFormat. This identifier can be used to retrieve this specific stream format from the camera, using its RetrieveStreamFormatFromIdent

Strany 15

22 Reference In the following reference of all interfaces implemented, “Long” is defined as a 32-bit signed integer value, and “Integer” is defined a

Strany 16

23 C# syntax string StringGUID = Guid.ToString(); InitFromString method Prototype public void InitFromString(string guidString) Comments The InitFrom

Strany 17

24 FireiManager The FireiManager object is the starting point for the selection and construction of cameras. It itself can be constructed directly. B

Strany 18

25 The dialog presented looks similar to: The method returns true if a selection was made by the user and false if “Cancel” was pressed (no selectio

Strany 19

26 It is most useful when: • A single camera is connected (a call with 0 index is sufficient). • The order in which the cameras are created is not

Strany 20

27 C# syntax FireiGUID guid; if (Manager.SelectCamera(out guid)) Camera = Manager.GetCameraFromGUID(guid); FireiRegister The FireiRegister object is

Strany 21

28 It is the equivalent of using the SetField method with the FromIndex and ToIndex parameters being equal to Index. Visual Basic syntax Reg.SetBit(5

Strany 22 - Reference

29 Visual Basic syntax Reg.SetField(5, 7, 6) C# syntax Reg.SetField(5, 7, 6); GetFieldLen method Prototype public uint GetFieldLen(byte fromIndex, by

Strany 23 - InitFromString method

3 MaxValueString property ... 62 Unit property ... 62 AbsoluteValu

Strany 24 - FireiManager

30 C# syntax Reg.SwapEndianess(); FireiTrigger The FireiTrigger object encapsulates all the Trigger functionality that the camera may support. An ins

Strany 25 - GetCameraFromIndex method

31 Visual Basic syntax Dim On As Boolean On = Trigger.Enabled 'get Trigger. Enabled = True 'set C# syntax bool On; On

Strany 26 - GetCameraFromGUID method

32 Value property Prototype public bool Value Comments This property reads/sets the Trigger_Value field of the camera trigger control register (bit 1

Strany 27 - FireiRegister

33 Comments This is a read only property that reflects the Presence_Inq field of the camera trigger inquiry register (bit 0). This property can alway

Strany 28 - GetField method

34 Comments This is a read only property that reflects the On/Off_Inq field of the camera trigger inquiry register (bit 5). It is a necessary require

Strany 29 - SwapEndianess method

35 Comments This property reads/sets the Parameter field of the camera trigger control register (bits 20 to 31). Since this is an optional field for

Strany 30 - FireiTrigger

36 Reload method Prototype Reload() Comments This method reloads the values of the trigger control register from the camera, so effectively it acts a

Strany 31 - Source property

37 C# syntax Trigger.Save(); FireiStreamFormat The FireiStreamFormat object encapsulates the video format settings relevant to a given camera. A Fir

Strany 32 - IsSupported property

38 Y_MONO, YUV_411, YUV_422, YUV_444, RGB_24, Y_MONO_16, RGB_48, S_Y_MONO_16, S_RGB_48, RAW_8, RAW_16 Visual Basic syntax Dim PixelFormat As FireiPix

Strany 33 - HasOnOff property

39 Visual Basic syntax Dim Resolution As FireiResolution Resolution = StreamFormat.Resolution C# syntax FireiResolution Resolution = StreamFormat.Re

Strany 34 - Parameter property

Introduction The Fire-i.net SDK is the latest addition to ubCore™ and the Unibrain APIs. It provides an entirely new and comprehensive way to interact

Strany 35 - IsModeSupported method

40 Comments This is a read only property that returns a unique identifier, in the form of a uint value that can be stored for later usage (e.g., to r

Strany 36 - Save method

41 RawModeOverride property Prototype FireiRawMode RawModeOverride Comments This is a read/write property that allows the programmer to establish if

Strany 37 - FireiStreamFormat

42 Height property Prototype ushort Height Comments This is a read only property that returns the resolution height of the streaming format. This is

Strany 38 - Resolution property

43 Visual Basic syntax StreamFormat.Save() C# syntax StreamFormat.Save();

Strany 39 - Identifier property

44 FireiFixedStreamFormat The FireiFixedStreamFormat object is derived from FireiStreamFormat. It carries any additional functionality that pertains

Strany 40 - UserDefined property

45 Comments This is a read/write property that can be used to retrieve or set the frame rate of the FireiFixedStreamFormat. It is represented by an e

Strany 41 - Width property

46 Comments This is a read only property that returns the number of packets per frame for this streaming format. This will be constant between succes

Strany 42 - ToString method

47 Visual Basic syntax Dim Supported As Boolean Supported = Fixed.IsFrameRateSupported(FireiFrameRate.fps30) C# syntax bool Supported = Fixed.IsFrame

Strany 43

48 FireiUserDefinedStreamFormat The FireiUserDefinedStreamFormat object is derived from FireiStreamFormat. It carries any additional functionality th

Strany 44 - FireiFixedStreamFormat

49 Visual Basic syntax Dim Top As UShort Top = UserDefined.Top C# syntax ushort Top = UserDefined.Top; Bottom property Prototype ushort Bottom Commen

Strany 45 - PacketsPerFrame property

5 Technical Details Architecture The following illustration shows how the various Unibrain APIs interact with each other, and how they are abstracted

Strany 46 - IsFrameRateSupported method

50 Visual Basic syntax Dim Height As UShort Height = UserDefined.Height C# syntax ushort Height = UserDefined.Height; MaxWidth property Prototype ush

Strany 47

51 HPosUnit = UserDefined.HorizontalPositionUnit C# syntax ushort HPosUnit = UserDefined.HorizontalPositionUnit; VerticalPositionUnit property Protot

Strany 48 - FireiUserDefinedStreamFormat

52 C# syntax ushort HUnit = UserDefined.HeightUnit; MaxPacketSize property Prototype ushort MaxPacketSize Comments This is a read only property that

Strany 49 - Bottom property

53 Setting this value to 0 means the SDK will try and determine the correct packet size automatically, either by setting it to the maximum possible,

Strany 50 - MaxHeight property

54 SetROI method Prototype SetROI(ushort left, ushort top, ushort width, ushort height) Comments This method is used to set the desired coordinates a

Strany 51 - HeightUnit property

55 FireiFeature The FireiFeature object encapsulates all functionality related to a camera feature. It contains all the information available through

Strany 52 - PacketSizeUnit property

56 Supported = Feature.IsSupported C# syntax bool Supported = Feature.IsSupported; HasAbsolute property Prototype Boolean HasAbsolute Comments This i

Strany 53 - F7Offset property

57 If this property is false, the Value property of FireiFeature should not be read, otherwise an exception would be thrown. This does not mean it ca

Strany 54 - SetROI method

58 HasManual property Prototype Boolean HasManual Comments This is a read-only property that will return whether this FireiFeature supports setting i

Strany 55 - FireiFeature

59 Absolute property Prototype Boolean Absolute Comments This is a read/write property that will retrieve or set whether this FireiFeature will use “

Strany 56 - HasOnePush property

6 MS 1394.sys driver, which is known to have various issues with popular operating systems (Windows XP Service Pack 2 and Windows Vista included). In

Strany 57 - HasAuto property

60 Visual Basic syntax Dim Auto As Boolean Auto = Feature.AutoMode 'get Feature.AutoMode = True 'set C# syntax bool Aut

Strany 58 - MaxValue property

61 C# syntax bool HasSoftAbsolute = Feature.HasSoftAbsolute; SoftAbsolute property Prototype Boolean SoftAbsolute Comments This is a read/write prope

Strany 59 - AutoMode property

62 Comments This is a read-only property that will retrieve the minimum allowed value of the feature as a textual representation. The string will inc

Strany 60 - HasSoftAbsolute property

63 Visual Basic syntax Dim Unit As FireiFeatureUnit Unit = Feature.Unit C# syntax FireiFeatureUnit Unit = Feature.Unit; AbsoluteValue property Protot

Strany 61 - MinValueString property

64 MaxAbsoluteValue property Prototype float MaxAbsoluteValue Comments This is a read-only property that will return the maximum value that can be se

Strany 62 - Unit property

65 This method is available only if HasOnePush is true; calling it otherwise will result in an exception. Visual Basic syntax Feature.OnePush() C# sy

Strany 63 - MinAbsoluteValue property

66 FireiFrame The FireiFrame object contains a single camera frame, allowing the programmer to read and write the image data pixel by pixel. It also

Strany 64 - OnePush method

67 GetRGB method Prototype GetRGB(ushort x, ushort y, out byte red, out byte green, out byte blue) Comments This method returns the color value as a

Strany 65

68 If for some reason the operation is unsuccessful, an exception will be thrown. Visual Basic syntax Frame.SaveToFile("c:\Frame1.bmp") C#

Strany 66 - FireiFrame

69 ToBitmap method Prototype System.Drawing.Bitmap ToBitmap() Comments This method will return the frame data as a System.Drawing.Bitmap object. Any

Strany 67 - SaveToFile method

7 Usage Scenario I – Simple video viewer Let’s start Microsoft Visual Studio 2008. Create a new empty project, of the “Windows Forms Application” var

Strany 68 - Negative method

70 Visual Basic syntax Frame.DrawLine(0, 0, 50, 50, Drawing.Color.Black) C# syntax Frame.DrawLine(0, 0, 50, 50, Drawing.Color.Black); DrawString meth

Strany 69 - DrawLine method

71 Visual Basic syntax Frame.DrawRectangle(0, 0, 50, 50, Drawing.Color.Black, False) C# syntax Frame.DrawRectangle(0, 0, 50, 50, Drawing.Color.Black,

Strany 70 - DrawRectangle method

72 Visual Basic syntax Frame.DrawStringRGB("Foo", 0, 0, Me.Font, 0, 0, 0) C# syntax Frame.DrawStringRGB("Foo", 0, 0, this.Font, 0

Strany 71 - DrawStringRGB method

73 FireiCamera The FireiCamera object encapsulates all functionality pertaining to the camera itself; therefore it could be considered to be the “cen

Strany 72 - DrawRectangleRGB method

74 Model property Prototype string Model Comments This is a read-only property that can be used to retrieve the model name of the camera, as a string

Strany 73 - FireiCamera

75 Trigger property Prototype FireiTrigger Trigger Comments This is a read-only property that will retrieve the currently selected FireiTrigger of th

Strany 74 - StreamFormat property

76 Gain property Prototype FireiFeature Gain Comments This is a read-only property that can be used to retrieve directly the FireiFeature object for

Strany 75 - AutoExposure property

77 ColorVR property Prototype FireiFeature ColorVR Comments This is a read-only property that can be used to retrieve directly the FireiFeature objec

Strany 76 - ColorUB property

78 Focus property Prototype FireiFeature Focus Comments This is a read-only property that can be used to retrieve directly the FireiFeature object fo

Strany 77 - Saturation property

79 Sharpness property Prototype FireiFeature Sharpness Comments This is a read-only property that can be used to retrieve directly the FireiFeature o

Strany 78 - Brightness property

8 This will bring up the reference selection dialog of VS. In the “.NET” tab, select “Firei.net” and click on OK: This will add the Fire-i.net assem

Strany 79 - RawConversion property

80 The three implemented algorithms are ordered “Best Performance → Best Quality”. BilinearInterpolation is the default setting. Please note that the

Strany 80 - ReadRegister method

81 C# syntax FireiRegister Register = Camera.ReadRegister(0x404); WriteRegister method Prototype void WriteRegister(uint offset, FireiRegister regist

Strany 81 - ReadCommand method

82 C# syntax FireiRegister Register = Camera.ReadCommand(&H504); WriteCommand method Prototype void WriteCommand(uint offset, FireiRegister regis

Strany 82 - WriteBlock method

83 Comments This is a method that can be used to write a block of registers (quadlets) on the camera, given its offset and a byte buffer as parameter

Strany 83 - GetMemoryPresetsCount method

84 GetFeature method Prototype FireiFeature GetFeature(string featureName) Comments This is a method that can be used to retrieve the FireiFeature ob

Strany 84 - SelectStreamFormat method

85 Comments This method when called will bring up a “Stream Format Selector” dialog, as constructed and maintained internally by the APIs. Through th

Strany 85

86 If on the other hand the DirectShow mode is currently running, the dialog will look similar to: Upon the return of the method, the streaming forma

Strany 86 - AttachPreviewCtrl method

87 C# syntax Camera.AttachPreviewCtrl(FireiPreviewCtrl1); Run method Prototype Run() Comments This method will start the streaming of the camera. If

Strany 87 - IsRunning method

88 Comments This method will return whether the camera is currently running. Please note that IsRunning will return true even if the camera was not s

Strany 88 - DisplayProperties method

89 The presented dialog is almost exactly the same in appearance, regardless if DirectShow or DLL is the currently selected underlying mode, and it l

Strany 89 - GetFeaturesEnumerator method

9 This will bring up the “Choose Control Items” dialog of Visual Studio. On the “.NET Framework Components” tab, select and mark the FireiPreviewCont

Strany 90 - GetCameraPhoto method

90 bool supportedOnly, FireiFeatureGroup featureGroup ) Comments This method will construct and return a generic list of FireiFeatures. It will cont

Strany 91 - LoadFromMemory method

91 ushort edgeSize, byte red, byte green, byte blue, byte alpha ) Comments This method constructs and returns a System.Drawing.Bitmap object, that co

Strany 92 - LoadFromXML method

92 Comments This method will load all current features from a memory preset channel of the camera. Since channel 0 is reserved for the camera default

Strany 93 - RetrieveStreamFormat method

93 If for any reason the settings cannot be loaded or set to the camera, an exception will be thrown. Visual Basic syntax Camera.LoadFromXML("c:

Strany 94 - BufferReceived event

94 Visual Basic syntax Dim Identifier As UInteger Identifier = Camera.StreamFormat.Identifier Dim StreamFormat As FireiStreamFormat StreamFormat = Ca

Strany 95 - CameraRemoved event

95 CameraRemoved event Prototype event System.EventHandler CameraRemoved Comments This event is only ever fired once during the lifecycle of the Fire

Komentáře k této Příručce

Žádné komentáře