Signed-off-by: lls <staying_liu_1@163.com>
This commit is contained in:
lls 2025-03-07 12:00:23 +08:00
parent b8f5bb14fb
commit 5467684710
14 changed files with 27 additions and 2 deletions

Binary file not shown.

Binary file not shown.

View File

@ -40,3 +40,28 @@ void opencv_t::visit_xiangsu(Mat& temp)
}
}
}
void opencv_t::visit_xiangsu(Mat& temp, int a)
{
int w = temp.cols;
int h = temp.rows;
int dims = temp.channels();
for (int row = 0; row < h; row++)
{
uchar* curr = temp.ptr<uchar>(row);
for (int col = 0; col < w; col++)
{
if (dims == 1)
{
int pv = *curr;
*curr++ = 255 - pv;
}
else if (dims == 3)
{
*curr++ = 255 - *curr;
*curr++ = 255 - *curr;
*curr++ = 255 - *curr;
}
}
}
}

View File

@ -8,7 +8,7 @@ public:
~opencv_t();
static opencv_t* create_new();
void visit_xiangsu(Mat& temp);//MatĎńËŘśÁĐ´ˇĂÎĘ
void visit_xiangsu(Mat& temp,int a);//MatÏñËØ¶Áд·ÃÎÊ,
private:
};

View File

@ -14,7 +14,7 @@ int main(int argc, char** argv)
Mat gray, hsv;
opencv_t* csss = opencv_t::create_new();
csss->visit_xiangsu(src);
csss->visit_xiangsu(src,1);
//cvtColor(src, hsv, COLOR_BGR2HSV);
imshow("ĘäČëÍźĎń", src);
waitKey(0);

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.