From 1782df47c617c22fc86adbceea1eede8bd1d11aa Mon Sep 17 00:00:00 2001 From: BearJan <757419920@qq.com> Date: Wed, 13 Jul 2022 08:31:00 +0000 Subject: [PATCH] update PikaCV_Image.c. --- .../pikascript-lib/PikaCV/PikaCV_Image.c | 42 +++---------------- 1 file changed, 6 insertions(+), 36 deletions(-) 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