PDA

View Full Version : Symbian ARToolkit


dustman
July 27th, 2005, 06:45 AM
Hi. This is my first post here. I am very interested in all the work you've done here and I sincerely hope I can be able to contribute in any way to the development of this project.

I am currently trying to create a sample app for the Series 60 Symbian phones(Nokia 6630) using the API from the UMAR Project. However, I am unable to recreate the simpleTest on the mobile device, obviously due to its many differences with its PC counterpart.

I basically divided the project into 3 parts. The openGLES, the Camera and the ARToolkit, it is kinda obvious what am planning to do so I won't explain anymore the 3 parts.

The problem occurs when I get a bitmap object from the camera and I pass the data address of its 1st pixel to the "arDetectMarker" function. Btw, i've already set the arImXsize & arImYsize to 176 & 144 respectively same as the bitmap image.

This is the loop where the error takes place. What happens is I get an access violation in the "arLabeling/labeling2" function when j=102 & i=166.

pnt = &(image[(arImXsize+1)*3]);
poff = 3;

for(j = 1; j < lysize-1; j++, pnt+=poff*2, pnt2+=2) {
for(i = 1; i < lxsize-1; i++, pnt+=poff, pnt2++) {

if( *(pnt+0) + *(pnt+1) + *(pnt+2) <= thresh ) {
//#endif
pnt1 = &(pnt2[-lxsize]);
if( *pnt1 > 0 ) {
*pnt2 = *pnt1;
work2[((*pnt2)-1)*7+0] ++;
work2[((*pnt2)-1)*7+1] += i;
work2[((*pnt2)-1)*7+2] += j;
work2[((*pnt2)-1)*7+6] = j;
}
else if( *(pnt1+1) > 0 ) {
if( *(pnt1-1) > 0 ) {
m = work[*(pnt1+1)-1];
n = work[*(pnt1-1)-1];
if( m > n ) {
*pnt2 = n;
wk = &(work[0]);
for(k = 0; k < wk_max; k++) {
if( *wk == m ) *wk = n;
wk++;
}
}
else if( m < n ) {
*pnt2 = m;
wk = &(work[0]);
for(k = 0; k < wk_max; k++) {
if( *wk == n ) *wk = m;
wk++;
}
}
else *pnt2 = m;
work2[((*pnt2)-1)*7+0] ++;
work2[((*pnt2)-1)*7+1] += i;
work2[((*pnt2)-1)*7+2] += j;
work2[((*pnt2)-1)*7+6] = j;
}
else if( *(pnt2-1) > 0 ) {
m = work[*(pnt1+1)-1];
n = work[*(pnt2-1)-1];
if( m > n ) {
*pnt2 = n;
wk = &(work[0]);
for(k = 0; k < wk_max; k++) {
if( *wk == m ) *wk = n;
wk++;
}
}
else if( m < n ) {
*pnt2 = m;
wk = &(work[0]);
for(k = 0; k < wk_max; k++) {
if( *wk == n ) *wk = m;
wk++;
}
}
else *pnt2 = m;
work2[((*pnt2)-1)*7+0] ++;
work2[((*pnt2)-1)*7+1] += i;
work2[((*pnt2)-1)*7+2] += j;
}
else {
*pnt2 = *(pnt1+1);
work2[((*pnt2)-1)*7+0] ++;
work2[((*pnt2)-1)*7+1] += i;
work2[((*pnt2)-1)*7+2] += j;
if( work2[((*pnt2)-1)*7+3] > i ) work2[((*pnt2)-1)*7+3] = i;
work2[((*pnt2)-1)*7+6] = j;
}
}
else if( *(pnt1-1) > 0 ) {
*pnt2 = *(pnt1-1);
work2[((*pnt2)-1)*7+0] ++;
work2[((*pnt2)-1)*7+1] += i;
work2[((*pnt2)-1)*7+2] += j;
if( work2[((*pnt2)-1)*7+4] < i ) work2[((*pnt2)-1)*7+4] = i;
work2[((*pnt2)-1)*7+6] = j;
}
else if( *(pnt2-1) > 0) {
*pnt2 = *(pnt2-1);
work2[((*pnt2)-1)*7+0] ++;
work2[((*pnt2)-1)*7+1] += i;
work2[((*pnt2)-1)*7+2] += j;
if( work2[((*pnt2)-1)*7+4] < i ) work2[((*pnt2)-1)*7+4] = i;
}
else {
wk_max++;
if( wk_max > WORK_SIZE ) {
return(0);
}
work[wk_max-1] = *pnt2 = wk_max;
work2[(wk_max-1)*7+0] = 1;
work2[(wk_max-1)*7+1] = i;
work2[(wk_max-1)*7+2] = j;
work2[(wk_max-1)*7+3] = i;
work2[(wk_max-1)*7+4] = i;
work2[(wk_max-1)*7+5] = j;
work2[(wk_max-1)*7+6] = j;
}
}
else {
*pnt2 = 0;
}
}
if( arImageProcMode == AR_IMAGE_PROC_IN_HALF ) pnt += arImXsize*AR_PIX_SIZE;
}

Any ideas or suggestions that can shed light on the matter would be greatly appreciated. Also if anyone can point me to a sample codes/apps created w/ the Symbian ARToolkit, that would also be a great help.