Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
futbot
futbot2014
Commits
60722216
Commit
60722216
authored
Sep 05, 2014
by
Aylen Ricca
Browse files
a lot of debug msg
parent
c7ea9d45
Changes
4
Hide whitespace changes
Inline
Side-by-side
visrob2/src/integrando/clasification.c
View file @
60722216
...
...
@@ -114,7 +114,7 @@ struct blob* vision_cls_getNextFrame(unsigned short int force_frame) {
blobs
=
iVisionModule_getNextFrame
(
HaViMo_id
);
}
}
else
{
if
(
blobs
==
NULL
)
return
NULL
;
if
(
blobs
==
NULL
)
{
printf
(
"null blobs
\n
"
);
return
NULL
;
}
}
//Preprocesamiento del array de blobs
...
...
@@ -123,17 +123,20 @@ struct blob* vision_cls_getNextFrame(unsigned short int force_frame) {
unsigned
short
int
blobs_merged
;
do
{
blobs_merged
=
0
;
for
(
i
=
0
;
i
<
CANT_REGIONS
;
i
++
)
{
if
(
blobs
[
i
].
region_index
!=
INVALID_REGION
)
{
for
(
i
=
0
;
i
<
CANT_REGIONS
;
i
++
)
{
printf
(
"procesar
\n
"
);
if
(
blobs
[
i
].
region_index
!=
INVALID_REGION
)
{
printf
(
"no es invalida
\n
"
);
if
(
blobs
[
i
].
max_x
-
blobs
[
i
].
min_x
<=
MIN_PX_SIZE_FOR_BLOB
||
blobs
[
i
].
max_y
-
blobs
[
i
].
min_y
<=
MIN_PX_SIZE_FOR_BLOB
)
{
//Invalidamos el blob
//Invalidamos el blob
printf
(
"invalido blobs
\n
"
);
blobs
[
i
].
region_index
=
INVALID_REGION
;
}
else
{
for
(
j
=
i
+
1
;
j
<
CANT_REGIONS
;
j
++
)
{
if
(
blobs
[
j
].
region_index
!=
INVALID_REGION
&&
blobs
[
i
].
region_color
==
blobs
[
j
].
region_color
&&
vision_cla_canBlobsBeMerged
(
blobs
[
i
],
blobs
[
j
],
THRESHOLD_X
,
THRESHOLD_Y
))
{
vision_cla_canBlobsBeMerged
(
blobs
[
i
],
blobs
[
j
],
THRESHOLD_X
,
THRESHOLD_Y
))
{
//Se combinan los blobs
printf
(
"blobs combinados
\n
"
);
blobs
[
j
].
region_index
=
INVALID_REGION
;
if
(
blobs
[
i
].
max_x
<
blobs
[
j
].
max_x
)
...
...
@@ -151,7 +154,7 @@ struct blob* vision_cls_getNextFrame(unsigned short int force_frame) {
}
}
}
}
}
else
printf
(
"es invalida
\n
"
);
}
}
while
(
blobs_merged
);
...
...
visrob2/src/integrando/main.c
View file @
60722216
...
...
@@ -13,6 +13,6 @@ int main() {
return
-
1
;
vision_checkVision
(
0
);
vision_terminate
();
printf
(
"FINAL FELIZ..."
);
printf
(
"FINAL FELIZ...
\n
"
);
return
0
;
}
visrob2/src/integrando/utilsBlobs.cpp
View file @
60722216
...
...
@@ -34,8 +34,8 @@ int frameNumber;
//cv::Scalar calibsMAX [] = {cv::Scalar(24,249,125),cv::Scalar(113,132,58),cv::Scalar(15,226,184),cv::Scalar(179,187,102)};
// AMARILLO - AZUL - NARANJA - MAGENTA -cam CSI
cv
::
Scalar
calibsMIN
[]
=
{
cv
::
Scalar
(
16
,
1
0
6
,
145
),
cv
::
Scalar
(
121
,
83
,
46
),
cv
::
Scalar
(
13
,
229
,
75
),
cv
::
Scalar
(
-
4
,
172
,
42
)};
cv
::
Scalar
calibsMAX
[]
=
{
cv
::
Scalar
(
1
10
,
24
7
,
25
4
),
cv
::
Scalar
(
1
36
,
116
,
73
),
cv
::
Scalar
(
1
9
,
2
55
,
241
),
cv
::
Scalar
(
11
,
255
,
145
)};
cv
::
Scalar
calibsMIN
[]
=
{
cv
::
Scalar
(
9
,
1
5
6
,
44
),
cv
::
Scalar
(
121
,
83
,
46
),
cv
::
Scalar
(
13
,
229
,
75
),
cv
::
Scalar
(
-
4
,
172
,
42
)};
cv
::
Scalar
calibsMAX
[]
=
{
cv
::
Scalar
(
1
7
,
24
5
,
12
4
),
cv
::
Scalar
(
1
21
,
83
,
46
),
cv
::
Scalar
(
1
3
,
2
29
,
75
),
cv
::
Scalar
(
-
4
,
172
,
42
)};
/**
* Inicializa las estructuras que utiliza. Carga archivo de configuracion
...
...
@@ -132,7 +132,7 @@ struct blob fillZeros(){
res
.
min_x
=
(
unsigned
int
)
0
;
res
.
max_y
=
(
unsigned
int
)
0
;
res
.
min_y
=
(
unsigned
int
)
0
;
/*
printf("===== START DEBUG =====\n");
printf("reg_idx: %u\n", res.region_index);
printf("reg_col: %u\n", res.region_color);
...
...
@@ -144,15 +144,15 @@ struct blob fillZeros(){
printf("maxim_y: %u\n", res.max_y);
printf("minim_y: %u\n", res.min_y);
printf("===== FIN DEBUG =====\n");
*/
return
res
;
}
struct
blob
infoToBlob
(
CvBlob
info
,
unsigned
int
region_idx
){
struct
blob
res
;
res
.
region_index
=
MY_GOAL_REGION
;
res
.
region_color
=
region_idx
;
res
.
region_index
=
region_idx
+
1
;
res
.
region_color
=
BALL_REGION
;
res
.
number_of_pixels
=
info
.
area
;
res
.
sum_of_x_coord_high
=
0
;
...
...
@@ -165,7 +165,7 @@ struct blob infoToBlob(CvBlob info, unsigned int region_idx){
res
.
min_x
=
info
.
minx
;
res
.
max_y
=
info
.
maxy
;
res
.
min_y
=
info
.
miny
;
/*
printf("===== START DEBUG =====\n");
printf("reg_idx: %u\n", res.region_index);
printf("reg_col: %u\n", res.region_color);
...
...
@@ -177,7 +177,7 @@ struct blob infoToBlob(CvBlob info, unsigned int region_idx){
printf("maxim_y: %u\n", res.max_y);
printf("minim_y: %u\n", res.min_y);
printf("===== FIN DEBUG =====\n");
*/
return
res
;
}
...
...
@@ -217,7 +217,7 @@ void utilBlobs_getBlobs(struct blob* result){
CvBlobs
blobsitos
;
for
(
int
i
=
0
;
i
<
CANT_CALIBRACIONES
;
i
++
){
IplImage
*
labelImg
=
cvCreateImage
(
cvGetSize
(
frame
),
IPL_DEPTH_LABEL
,
1
);
getOneColorBlobs
(
hsv
,
labelImg
,
blobsitos
,
imgSize
,
calibsMIN
[
i
],
calibsMAX
[
i
]);
getOneColorBlobs
(
hsv
,
labelImg
,
blobsitos
,
imgSize
,
calibsMIN
[
0
],
calibsMAX
[
0
]);
cvRenderBlobs
(
labelImg
,
blobsitos
,
frame
,
frame
,
CV_BLOB_RENDER_BOUNDING_BOX
);
CvBlobs
::
const_iterator
it
=
blobsitos
.
begin
();
...
...
visrob2/src/integrando/vision.c
View file @
60722216
...
...
@@ -56,7 +56,8 @@ void vision_setRobotHeight(double height) {
void
processBlobs
(
void
)
{
//Identificamos la bola
vision_objRec_detectBall
();
unsigned
short
int
hayPelota
=
vision_objRec_detectBall
();
printf
(
"PELOTA = %d
\n
"
);
//Identificamos los agentes
vision_objRec_detectAllies
();
...
...
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