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
108fc3f4
Commit
108fc3f4
authored
Jun 19, 2011
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed problem with non 4:3 cameras (ticket #142)
parent
873b72ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
cap_dshow.cpp
modules/highgui/src/cap_dshow.cpp
+12
-9
No files found.
modules/highgui/src/cap_dshow.cpp
View file @
108fc3f4
...
...
@@ -2893,7 +2893,7 @@ public:
protected
:
void
init
();
int
index
;
int
index
,
width
,
height
;
IplImage
*
frame
;
static
videoInput
VI
;
};
...
...
@@ -2911,6 +2911,7 @@ CvCaptureCAM_DShow::CvCaptureCAM_DShow()
{
index
=
-
1
;
frame
=
0
;
width
=
height
=
-
1
;
}
void
CvCaptureCAM_DShow
::
close
()
...
...
@@ -2921,6 +2922,7 @@ void CvCaptureCAM_DShow::close()
index
=
-
1
;
cvReleaseImage
(
&
frame
);
}
width
=
height
=
-
1
;
}
// Initialize camera input
...
...
@@ -2977,27 +2979,28 @@ double CvCaptureCAM_DShow::getProperty( int property_id )
bool
CvCaptureCAM_DShow
::
setProperty
(
int
property_id
,
double
value
)
{
int
width
=
0
,
height
=
0
;
switch
(
property_id
)
{
case
CV_CAP_PROP_FRAME_WIDTH
:
width
=
cvRound
(
value
);
height
=
width
*
3
/
4
;
break
;
case
CV_CAP_PROP_FRAME_HEIGHT
:
height
=
cvRound
(
value
);
width
=
height
*
4
/
3
;
default
:
return
false
;
}
if
(
width
!=
VI
.
getWidth
(
index
)
||
height
!=
VI
.
getHeight
(
index
)
)
if
(
width
>
0
&&
height
>
0
)
{
VI
.
stopDevice
(
index
);
VI
.
setupDevice
(
index
,
width
,
height
);
if
(
width
!=
VI
.
getWidth
(
index
)
||
height
!=
VI
.
getHeight
(
index
)
)
{
VI
.
stopDevice
(
index
);
VI
.
setupDevice
(
index
,
width
,
height
);
}
width
=
height
=
-
1
;
return
VI
.
isDeviceSetup
(
index
);
}
return
VI
.
isDeviceSetup
(
index
)
;
return
true
;
}
...
...
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