Wednesday, September 10, 2014

Data extraction

Data extraction 

Procedures

  1. Perform OpenCv Haar Feature based Cascade classification on every frame of RGB video.
  2. Perform transforming/mapping for all frames of depth video. This should happen simultaneously with step one. After transforming, the depth pixels are relocated in  same co-ordinates as RGB coordinates. Then we can get depth information of interested region from depth. The result image will be referred as "Mapped" in following context. 
  3. For each area (left eye, right eye, mouth) detected in RGB frame , we can look up depth value for every pixel in "Mapped". And we stores the depth information of all area (eyes, mouth) in temporary images for later use.
  4. Resize temporary images to 36*24 for eyes, and 40*24 for mouth. (It is required for feature extraction and classification algorithm), and save all depth information in txt files. 

Problem 

The temporary image  mentioned in step 3 was created as an Opencv Ipimage.  The imageData of Ipimage is aligned in 4 bytes for better performance. For example, if we have a 50-by-50 (depth 8) image, and the imageData is aligned in 4 bytes. The size of reach row will not be (50*3 =150 bytes but 152 bytes i.e.152 % 4 = 0).  It is dangerous to use pointer to manipulate the imageData, because there is no boundary check, and values from other memory address may be returned. However, it is fast to use pointer if we have hundreds of thousand pixels need to be processed.



   



No comments:

Post a Comment