Hi, I was doing video capturing lately. However I need to do some processing on the raw data before I display the image on the monitor. However I do not see the correct output image obtained after processed. Here's a part of the coding where I have did some editing on the main image capturing part. It's a grayscale loopback.
I was first defined 2 arrays for intermediate processing. The resolution that I'm using is 800 * 600.
#include "img_median_3x3.h"
unsigned char inputRawData[480000]={0};
unsigned char processedRawData[480000]={0};while(1){
for(i = 0; i < numLines; i++) {
DAT_copy(capFrameBuf->frame.iFrm.y1 + i * capLinePitch, inputRawData, disLinePitch); //Copy the raw data from captured frame buffer to an array(inputRawData)
CACHE_wbInvAllL2(CACHE_WAIT);
}
IMG_median_3x3_c(inputRawData, 800, processedRawData); //Sending the inputRawData into the IMGLIB to process.
for(i=0;i < numLines; i++) {
DAT_copy(processedRawData, disFrameBuf->frame.rpFrm.buf + i * disLinePitch, disLinePitch); //Copy the processed data and display on monitor.
CACHE_wbInvAllL2(CACHE_WAIT);
}FVID_exchange(disChan, &disFrameBuf);
frames ++;
}
It does show something on monitor but it is not desired ones. Here's the image before processing and after processing. Any idea what I should do to resolve that problem?
I had checked on the processing in between the input image and output, it suppose does not give any error.
@Tim: Temporarily on hold communication part. Had read your reply and thanks for helping.
Edited on 21/01/2008: As I tried to check on the input data, which i was trying to copy the image data into inputRawData array, I found that the data copied is incorrect. What I'm trying to check is by doing this way.
#include "img_median_3x3.h"
unsigned char inputRawData[480000]={0};
unsigned char processedRawData[480000]={0};while(1){
for(i = 0; i < numLines; i++) {
DAT_copy(capFrameBuf->frame.iFrm.y1 + i * capLinePitch, inputRawData, disLinePitch); //Copy the raw data from captured frame buffer to an array(inputRawData)
CACHE_wbInvAllL2(CACHE_WAIT);
}
//IMG_median_3x3_c(inputRawData, 800, processedRawData); //Sending the inputRawData into the IMGLIB to process.DAT_copy(inputRawData, processedRawData, disLinePitch);
for(i=0;i < numLines; i++) {
DAT_copy(processedRawData, disFrameBuf->frame.rpFrm.buf + i * disLinePitch, disLinePitch); //Copy the processed data and display on monitor.
CACHE_wbInvAllL2(CACHE_WAIT);
}FVID_exchange(disChan, &disFrameBuf);
frames ++;
}
At this stage I found that it's not a proper image. I will try on getting the raw data captured by camera while waiting for comments and guides at the same time.
Regards,
Matthew