Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ChessTrack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aylen Ricca
ChessTrack
Commits
45514dd8
Commit
45514dd8
authored
10 years ago
by
Aylen Ricca
Browse files
Options
Downloads
Patches
Plain Diff
show chessboard reconstruction fixed
parent
74a9d9f8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ProyectoAndroid/ChessTrack/src/uy/edu/fing/chesstrack/modulomodelador/Modelador.java
+11
-8
11 additions, 8 deletions
...src/uy/edu/fing/chesstrack/modulomodelador/Modelador.java
with
11 additions
and
8 deletions
ProyectoAndroid/ChessTrack/src/uy/edu/fing/chesstrack/modulomodelador/Modelador.java
+
11
−
8
View file @
45514dd8
package
uy.edu.fing.chesstrack.modulomodelador
;
import
org.opencv.core.Core
;
import
org.opencv.core.CvType
;
import
org.opencv.core.Mat
;
import
org.opencv.core.Point
;
import
org.opencv.core.Rect
;
import
org.opencv.core.Scalar
;
import
uy.edu.fing.chesstrack.modulovision.Calibracion
;
import
android.util.Log
;
...
...
@@ -42,8 +44,8 @@ public class Modelador {
int
anchoEscaque
=
(
int
)
Math
.
floor
(
ancho
/(
CANT_FILAS
+
2
)
);
Log
.
i
(
TAG
,
"largoEscaque= "
+
largoEscaque
);
Log
.
i
(
TAG
,
"anchoEscaque= "
+
anchoEscaque
);
for
(
int
i
=
0
;
i
<
1
;
i
++){
for
(
int
j
=
0
;
j
<
1
;
j
++){
for
(
int
i
=
0
;
i
<
CANT_FILAS
;
i
++){
for
(
int
j
=
0
;
j
<
CANT_FILAS
;
j
++){
int
rowStart
=(
int
)
Math
.
floor
(
largoEscaque
)+
i
*
largoEscaque
;
int
rowEnd
=
(
int
)
Math
.
floor
(
largoEscaque
)+
i
*
largoEscaque
+
largoEscaque
;
int
colStart
=
(
int
)
Math
.
floor
(
anchoEscaque
)+
j
*
anchoEscaque
;
...
...
@@ -57,14 +59,15 @@ public class Modelador {
Mat
tmp
=
Mat
.
ones
(
Calibracion
.
getInstance
().
getImagenCalibrada
().
size
(),
CvType
.
CV_8UC4
);
Mat
subm
;
//tmp.submat(new Rect(new Point(0,0) ,escaques[i][j].size()));
//escaques[i][j].copyTo(subm);
int
pos_x
=
15
;
int
pos_y
=
15
;
for
(
int
i
=
0
;
i
<
1
;
i
++){
for
(
int
j
=
0
;
j
<
1
;
j
++){
int
pos_x
=
0
;
int
pos_y
=
0
;
for
(
int
i
=
0
;
i
<
CANT_FILAS
;
i
++){
for
(
int
j
=
0
;
j
<
CANT_FILAS
;
j
++){
pos_x
=
(
int
)
(
escaques
[
i
][
j
].
size
().
width
*
i
);
pos_y
=
(
int
)
(
escaques
[
i
][
j
].
size
().
height
*
j
);
subm
=
tmp
.
submat
(
new
Rect
(
new
Point
(
pos_x
,
pos_y
)
,
escaques
[
i
][
j
].
size
()));
escaques
[
i
][
j
].
copyTo
(
subm
);
pos_x
=
(
int
)
(
escaques
[
i
][
j
].
size
().
width
*
i
+
1
);
pos_y
=
(
int
)
(
escaques
[
i
][
j
].
size
().
height
*
j
+
1
);
Core
.
putText
(
tmp
,
Integer
.
toString
(
i
)+
"-"
+
Integer
.
toString
(
j
),
new
Point
(
pos_x
+
1
,
pos_y
+
1
),
Core
.
FONT_HERSHEY_SIMPLEX
,
0.3
,
new
Scalar
(
255
,
0
,
0
));
}
}
return
tmp
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment