我尝试在https://docs.opencv.org/master/d1/dc1/tutorial_ccm_color_ Correction_model.html 中转换颜色校正模块示例 ,但我遇到了一些困难,因为我不懂 C++,
//compte color correction matrix
ColorCorrectionModel model1(src, COLORCHECKER_Vinyl);
model1.run();
Mat ccm = model1.getCCM();
std::cout<<"ccm "<<ccm<<std::endl;
double loss = model1.getLoss();
std::cout<<"loss "<<loss<<std::endl;
Run Code Online (Sandbox Code Playgroud)
我用Python写成
colorCorrectionModel = cv2.ccm_ColorCorrectionModel(src, cv2.ccm.COLORCHECKER_Macbeth)
colorCorrectionModel.run()
ccmat = colorCorrectionModel.getCCM()
print(ccmat)
weigths = colorCorrectionModel.getWeights()
print(weigths)
Run Code Online (Sandbox Code Playgroud)
但给我这个错误
colorCorrectionModel.run()
cv2.error:OpenCV(4.5.1) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-sljz46fi\opencv\modules\core\src\arithm.cpp:234:错误:( -209:输入参数的大小不匹配)该操作既不是'array op array'(其中数组具有相同的大小和类型),也不是'array op scalar',也不是函数'cv ::中的'scalar op array'二进制操作'
我如何纠正这个错误