Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
2dcad1eb
Commit
2dcad1eb
authored
Jun 25, 2010
by
Stefano Fabri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some paramter to set exposure, adaptable packet size
parent
2d0b20df
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
cap_pvapi.cpp
modules/highgui/src/cap_pvapi.cpp
+18
-6
No files found.
modules/highgui/src/cap_pvapi.cpp
View file @
2dcad1eb
...
@@ -185,7 +185,7 @@ bool CvCaptureCAM_PvAPI::open( int index )
...
@@ -185,7 +185,7 @@ bool CvCaptureCAM_PvAPI::open( int index )
PvAttrUint32Get
(
Camera
.
Handle
,
"Height"
,
&
frameHeight
);
PvAttrUint32Get
(
Camera
.
Handle
,
"Height"
,
&
frameHeight
);
PvAttrEnumGet
(
Camera
.
Handle
,
"PixelFormat"
,
pixelFormat
,
256
,
NULL
);
PvAttrEnumGet
(
Camera
.
Handle
,
"PixelFormat"
,
pixelFormat
,
256
,
NULL
);
maxSize
=
8228
;
maxSize
=
8228
;
PvAttrUint32Get
(
Camera
.
Handle
,
"PacketSize"
,
&
maxSize
);
//
PvAttrUint32Get(Camera.Handle,"PacketSize",&maxSize);
if
(
PvCaptureAdjustPacketSize
(
Camera
.
Handle
,
maxSize
)
!=
ePvErrSuccess
)
if
(
PvCaptureAdjustPacketSize
(
Camera
.
Handle
,
maxSize
)
!=
ePvErrSuccess
)
return
false
;
return
false
;
//printf ("Pixel Format %s %d %d\n ", pixelFormat,frameWidth,frameHeight);
//printf ("Pixel Format %s %d %d\n ", pixelFormat,frameWidth,frameHeight);
...
@@ -272,6 +272,9 @@ double CvCaptureCAM_PvAPI::getProperty( int property_id )
...
@@ -272,6 +272,9 @@ double CvCaptureCAM_PvAPI::getProperty( int property_id )
case
CV_CAP_PROP_FRAME_HEIGHT
:
case
CV_CAP_PROP_FRAME_HEIGHT
:
PvAttrUint32Get
(
Camera
.
Handle
,
"Height"
,
&
nTemp
);
PvAttrUint32Get
(
Camera
.
Handle
,
"Height"
,
&
nTemp
);
return
(
double
)
nTemp
;
return
(
double
)
nTemp
;
case
CV_CAP_PROP_EXPOSURE
:
PvAttrUint32Get
(
Camera
.
Handle
,
"ExposureValue"
,
&
nTemp
);
return
(
double
)
nTemp
;
}
}
return
-
1.0
;
return
-
1.0
;
}
}
...
@@ -289,12 +292,21 @@ bool CvCaptureCAM_PvAPI::setProperty( int property_id, double value )
...
@@ -289,12 +292,21 @@ bool CvCaptureCAM_PvAPI::setProperty( int property_id, double value )
break;
break;
*/
*/
case
CV_CAP_PROP_MONOCROME
:
case
CV_CAP_PROP_MONOCROME
:
char
pixelFormat
[
256
];
if
(
value
==
1
)
{
PvAttrEnumGet
(
Camera
.
Handle
,
"PixelFormat"
,
pixelFormat
,
256
,
NULL
);
char
pixelFormat
[
256
];
if
((
strncmp
(
pixelFormat
,
"Mono8"
,
NULL
)
==
0
)
||
strncmp
(
pixelFormat
,
"Mono16"
,
NULL
)
==
0
)
{
PvAttrEnumGet
(
Camera
.
Handle
,
"PixelFormat"
,
pixelFormat
,
256
,
NULL
);
monocrome
=
true
;
if
((
strncmp
(
pixelFormat
,
"Mono8"
,
NULL
)
==
0
)
||
strncmp
(
pixelFormat
,
"Mono16"
,
NULL
)
==
0
)
{
monocrome
=
true
;
}
else
return
false
;
}
else
monocrome
=
false
;
break
;
case
CV_CAP_PROP_EXPOSURE
:
if
(
PvAttrUint32Set
(
Camera
.
Handle
,
"ExposureValue"
,(
tPvUint32
)
value
)
==
ePvErrSuccess
)
break
;
break
;
}
else
else
return
false
;
return
false
;
default
:
default
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment