Пример #1
0
void stereo_RGB2Gray_R(void* inputFIFOs[], void* outputFIFOs[], Param inParams[], Param outParams[]){
	RGB2Gray(
		/* size */ (Param) inParams[0],
		/* rgb  */ (uint8_t*) inputFIFOs[0],
		/* gray */ (uint8_t*) outputFIFOs[0]
	);
}
INT32T ComputeDataCost(INT32T index, INT32T l){
	INT32T gray, cost;
	gray = RGB2Gray(image_Correction[index]);
	switch (l)
	{
	case 0: {cost = max2(gray - 10, 0) + 80; break;}
	case 1: {cost = max2(210 - gray, 0) + 10; break;}
	case 2: {if (image_Canny[index] > 0) cost = 1; else cost = max2(max3(image_Correction[index].r, image_Correction[index].g, image_Correction[index].b), max3(255 - image_Correction[index].r, 255 - image_Correction[index].g, 255 - image_Correction[index].b)) * 7 / 10;  break; }
	default: {cost = 0; break; }
	}
	//printf("(r=%d g=%d b=%d gray=%d) l=%d cost=%d\n", image_Correction[index].r, image_Correction[index].g, image_Correction[index].b, gray, l, cost);
	return cost;
}