Hi All,
I am using the "fcvCornerFast9InMasku8" function to take good features in the particular region by masking that pixels as 1 and others as 0. But unfortunately thats not happening. I am giving code below
Will some one help me in this please.
int count = dataBufWidth*dataBufHeight; // =48000 uint8_t maskArray[count]; memset(maskArray, 0, dataBufWidth*dataBufHeight*sizeof(uint8_t)); for(int i = 0; i < count ; i++ ) { // Randomly selected region if ((i > 15000) && (i < 30000)) { maskArray[i] = (uint8_t)1; } else { maskArray [i] =(uint8_t) 0; } } // uint8_t *maskArraypointer = (uint8_t)maskArray[count]; fcvCornerFast9InMasku8 ( (uint8_t*)dataBuf, dataBufWidth, dataBufHeight, 0, state.cornerThreshold, 7, state.corners, MAX_CORNERS_TO_DETECT, &state.numCorners, maskArray, dataBufWidth, dataBufHeight );
Thanks in advance,
Cheers,
Shravan
Hi
The mask is a bitmask where each bit codes for one pixel. The sample below shows how u can set it up.
Cheers
-Guy
Hi,
Thanks for your reply. I got your point but still its not working if I do follow changes. Actually I am trying the fastcorner example itself, by using mask but its not happening. I dint understand why this is happening.
Hi,
What is the exact failure that you are observing ? Would you please describe the input you are prodiving the expected output and the actually incorrect output. Also please note that a bit value of 1 indicates that the pixel is excluded and 0 indicates that it is included.
Cheers
Guy
Hi,
I understood the concept of mask. I understood that for every pixel value we use one bit and the 1 or 0 value in the bit will consider that to include or exclude. What I am trying is I want to extract features or points from the image in certain region or in rectangle only. Thats what the for loop I have written there. But when I do that I am getting the dots(points) I mean the features or corners in the entire image. I want to get the corners only in particular region or rectangular area. The output what I am getting is the corners in the entire image. The input I am giving is,
maskArray[i>>3] |=(0x10000000>>(i%8));
maskArray [i>>3] &=~(0x10000000>>(i%8));
maskArray[i>>3] |=(0x80>>(i%8));
maskArray [i>>3] &=~(0x80>>(i%8));
maskArray[i>>3] |= (0x80 >> (i & 0x07));
maskArray [i>>3] &= ~(0x80 >> (i
& 0x07));Hi Cyril
You are absolutely right. Thanks for the catch :)
Cheers,
Guy