Revision 32006eb7
ID | 32006eb7cceaf9bbd39d44169a7eaa8a9fbda929 |
Fixed segfault in opencvdetect
vision/src/converteroverwrite.cpp | ||
---|---|---|
57 | 57 |
if ((pos / nc) != nc - 1){ |
58 | 58 |
if (isDown(image, pos)) return true; |
59 | 59 |
} |
60 |
else return false;
|
|
60 |
return false; |
|
61 | 61 |
} |
62 | 62 |
|
63 | 63 |
/* Detects the blobs in an image within above defined constraints. Transforms image into 255 |
... | ... | |
87 | 87 |
int comXSum = 0; |
88 | 88 |
int comYSum = 0; |
89 | 89 |
int blobPixelCount = 0; |
90 |
for (int i = 0; i < image->width * image->height; i+=nChannels){ |
|
90 |
for (unsigned int i = 0; i < image->width * image->height; i+=nChannels){
|
|
91 | 91 |
if ( !(image->data[i] == 255 && hasAnAdjacent(image, i)) ){ |
92 | 92 |
image->data[i] = 0; |
93 | 93 |
image->data[i + 1] = 0; |
... | ... | |
118 | 118 |
|
119 | 119 |
// get the max, set it as v |
120 | 120 |
|
121 |
for (int i = 0; i < orig->height * orig->width; i += nChannels){ |
|
121 |
for (unsigned int i = 0; i < orig->height * orig->width; i += nChannels){
|
|
122 | 122 |
int h; |
123 | 123 |
int s; |
124 | 124 |
int v; |
Also available in: Unified diff