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
120a3b75
Commit
120a3b75
authored
Nov 28, 2010
by
Ethan Rublee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimizing calibration for android
parent
56313594
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
31 deletions
+7
-31
Calibration.cpp
android/android-jni/jni/Calibration.cpp
+2
-27
chessnumbers.xml
android/android-jni/res/values/chessnumbers.xml
+1
-0
settingnumbers.xml
android/android-jni/res/values/settingnumbers.xml
+1
-1
ChessBoardChooser.java
...oid-jni/src/com/opencv/calibration/ChessBoardChooser.java
+1
-1
CameraConfig.java
android/android-jni/src/com/opencv/camera/CameraConfig.java
+2
-2
No files found.
android/android-jni/jni/Calibration.cpp
View file @
120a3b75
...
...
@@ -160,34 +160,9 @@ bool Calibration::detectAndDrawChessboard(int idx, image_pool* pool)
if
(
grey
.
empty
())
return
false
;
vector
<
Point2f
>
corners
;
IplImage
iplgrey
=
grey
;
patternfound
=
cvCheckChessboard
(
&
iplgrey
,
patternsize
);
if
(
!
patternfound
)
return
false
;
float
factor
=
grey
.
cols
/
320.0
f
;
if
(
factor
<
1
)
factor
=
1
;
cv
::
Size
r_size
=
cv
::
Size
(
grey
.
cols
/
factor
,
grey
.
rows
/
factor
);
Mat
grey_sub
;
while
(
patternfound
&&
(
r_size
.
width
<
grey
.
size
().
width
))
{
cv
::
resize
(
grey
,
grey_sub
,
r_size
);
patternfound
=
findChessboardCorners
(
grey_sub
,
patternsize
,
corners
);
if
(
patternfound
)
{
r_size
.
width
*=
2
;
r_size
.
height
*=
2
;
}
else
{
return
false
;
}
}
// hopefully if we're going to fail we fail on a smaller size image in the while-loop
patternfound
=
findChessboardCorners
(
grey
,
patternsize
,
corners
);
patternfound
=
findChessboardCorners
(
grey
,
patternsize
,
corners
,
CALIB_CB_FILTER_QUADS
+
CALIB_CB_ADAPTIVE_THRESH
+
CALIB_CB_NORMALIZE_IMAGE
+
CALIB_CB_FAST_CHECK
);
Mat
img
=
pool
->
getImage
(
idx
);
if
(
corners
.
size
()
<
1
)
...
...
android/android-jni/res/values/chessnumbers.xml
View file @
120a3b75
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array
name=
"chesssizes"
>
<item>
2
</item>
<item>
3
</item>
<item>
4
</item>
<item>
5
</item>
...
...
android/android-jni/res/values/settingnumbers.xml
View file @
120a3b75
...
...
@@ -3,7 +3,7 @@
<string-array
name=
"image_sizes"
>
<item>
320x240
</item>
<item>
400x300
</item>
<item>
6
00x40
0
</item>
<item>
6
40x48
0
</item>
<item>
800x600
</item>
<item>
1000x800
</item>
</string-array>
...
...
android/android-jni/src/com/opencv/calibration/ChessBoardChooser.java
View file @
120a3b75
...
...
@@ -17,7 +17,7 @@ public class ChessBoardChooser extends Activity {
public
static
final
String
CHESS_SIZE
=
"chess_size"
;
public
static
final
int
DEFAULT_WIDTH
=
6
;
public
static
final
int
DEFAULT_HEIGHT
=
8
;
public
static
final
int
LOWEST
=
3
;
public
static
final
int
LOWEST
=
2
;
class
DimChooser
implements
OnItemSelectedListener
{
private
String
dim
;
...
...
android/android-jni/src/com/opencv/camera/CameraConfig.java
View file @
120a3b75
...
...
@@ -51,8 +51,8 @@ public class CameraConfig extends Activity {
// Restore preferences
SharedPreferences
settings
=
ctx
.
getSharedPreferences
(
CAMERA_SETTINGS
,
0
);
size
[
0
]
=
settings
.
getInt
(
IMAGE_WIDTH
,
6
0
0
);
size
[
1
]
=
settings
.
getInt
(
IMAGE_HEIGHT
,
4
0
0
);
size
[
0
]
=
settings
.
getInt
(
IMAGE_WIDTH
,
6
4
0
);
size
[
1
]
=
settings
.
getInt
(
IMAGE_HEIGHT
,
4
8
0
);
}
...
...
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