diff --git a/port/linux/package/pikascript/pikascript-lib/PikaCV/PikaCV_Image.c b/port/linux/package/pikascript/pikascript-lib/PikaCV/PikaCV_Image.c index dd78419f7..54dfe3ee9 100644 --- a/port/linux/package/pikascript/pikascript-lib/PikaCV/PikaCV_Image.c +++ b/port/linux/package/pikascript/pikascript-lib/PikaCV/PikaCV_Image.c @@ -251,28 +251,13 @@ void PikaCV_Image_add(PikaObj *self, PikaObj* image){ /* add two images */ for (i = 0; i < (src->size)/3; i++) { result=src_data[i * 3] + img_data[i * 3]; - if(resultsize)/3; i++) { result=src_data[i * 3] - img_data[i * 3]; - if(result>MIN(src_data[i * 3],img_data[i * 3])){ - src_data[i * 3]=0; - } - else{ - src_data[i * 3]=result; - } + src_data[i * 3] = ((resultMIN(src_data[i * 3 + 1],img_data[i * 3 + 1])){ - src_data[i * 3 + 1]=0; - } - else{ - src_data[i * 3 + 1]=result; - } + src_data[i * 3 + 1] = ((result>MIN(src_data[i * 3 + 1],img_data[i * 3 + 1]))?0:result); result=src_data[i * 3 + 2] - img_data[i * 3 + 2]; - if(result>MIN(src_data[i * 3 + 2],img_data[i * 3 + 2])){ - src_data[i * 3 + 2]=0; - } - else{ - src_data[i * 3 + 2]=result; - } + src_data[i * 3 + 2] = ((result