diff --git a/.vs/opencvlearn/v16/.suo b/.vs/opencvlearn/v16/.suo index d61f435..cdeadf0 100644 Binary files a/.vs/opencvlearn/v16/.suo and b/.vs/opencvlearn/v16/.suo differ diff --git a/.vs/opencvlearn/v16/Browse.VC.db b/.vs/opencvlearn/v16/Browse.VC.db index 30e494e..ad58aa5 100644 Binary files a/.vs/opencvlearn/v16/Browse.VC.db and b/.vs/opencvlearn/v16/Browse.VC.db differ diff --git a/.vs/opencvlearn/v16/ipch/AutoPCH/33ddc3be1ca733d8/OPENCV_TEST.ipch b/.vs/opencvlearn/v16/ipch/AutoPCH/33ddc3be1ca733d8/OPENCV_TEST.ipch index 00e929a..bc52cec 100644 Binary files a/.vs/opencvlearn/v16/ipch/AutoPCH/33ddc3be1ca733d8/OPENCV_TEST.ipch and b/.vs/opencvlearn/v16/ipch/AutoPCH/33ddc3be1ca733d8/OPENCV_TEST.ipch differ diff --git a/.vs/opencvlearn/v16/ipch/AutoPCH/a069662d55113280/TEST.ipch b/.vs/opencvlearn/v16/ipch/AutoPCH/a069662d55113280/TEST.ipch index 21d7071..249917d 100644 Binary files a/.vs/opencvlearn/v16/ipch/AutoPCH/a069662d55113280/TEST.ipch and b/.vs/opencvlearn/v16/ipch/AutoPCH/a069662d55113280/TEST.ipch differ diff --git a/opencv_test.cpp b/opencv_test.cpp index e59dd1f..5b9f35f 100644 --- a/opencv_test.cpp +++ b/opencv_test.cpp @@ -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(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; + } + } + } +} diff --git a/opencv_test.h b/opencv_test.h index 45f51d1..ce5cb55 100644 --- a/opencv_test.h +++ b/opencv_test.h @@ -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: }; diff --git a/test.cpp b/test.cpp index f2dffb4..2eabb25 100644 --- a/test.cpp +++ b/test.cpp @@ -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); diff --git a/x64/Debug/opencv_test.obj b/x64/Debug/opencv_test.obj index bae2434..1ccfb80 100644 Binary files a/x64/Debug/opencv_test.obj and b/x64/Debug/opencv_test.obj differ diff --git a/x64/Debug/opencvlearn.exe b/x64/Debug/opencvlearn.exe index 47856db..7e109a1 100644 Binary files a/x64/Debug/opencvlearn.exe and b/x64/Debug/opencvlearn.exe differ diff --git a/x64/Debug/opencvlearn.ilk b/x64/Debug/opencvlearn.ilk index 355453c..15fed37 100644 Binary files a/x64/Debug/opencvlearn.ilk and b/x64/Debug/opencvlearn.ilk differ diff --git a/x64/Debug/opencvlearn.pdb b/x64/Debug/opencvlearn.pdb index bb6ccc3..dc7b398 100644 Binary files a/x64/Debug/opencvlearn.pdb and b/x64/Debug/opencvlearn.pdb differ diff --git a/x64/Debug/test.obj b/x64/Debug/test.obj index d21f054..fa18efb 100644 Binary files a/x64/Debug/test.obj and b/x64/Debug/test.obj differ diff --git a/x64/Debug/vc142.idb b/x64/Debug/vc142.idb index e3de692..d3db28b 100644 Binary files a/x64/Debug/vc142.idb and b/x64/Debug/vc142.idb differ diff --git a/x64/Debug/vc142.pdb b/x64/Debug/vc142.pdb index e51298c..ffaa130 100644 Binary files a/x64/Debug/vc142.pdb and b/x64/Debug/vc142.pdb differ