मैं निम्नलिखित कोड के साथ एक छवि का एक निश्चित स्थान में कैनी ऑपरेटर लागू करने के लिए कोशिश कर रहा हूँ:OpenCV - इनपुट तर्क के आकार से मेल नहीं खाते - addWeighted
//region of interest from my RGB image
Mat devilROI = img(Rect(r->x+lowerRect.x,
r->y + lowerRect.y,
lowerRect.width,
lowerRect.height));
Mat canny;
//to grayscale so I can apply canny
cvtColor(devilROI, canny, CV_RGB2GRAY);
//makes my region of interest with Canny
Canny(canny, canny, low_threshold, high_threshold);
//back to the original image
addWeighted(devilROI, 1.0, canny, 0.3, 0., devilROI);
और यह मुझे निम्न त्रुटि जब दे रहा है addWeighted निष्पादित किया गया है:
OpenCV Error: Sizes of input arguments do not match (The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array') in arithm_op, file C:\OpenCV2.3\ opencv\modules\core\src\arithm.cpp, line 1227 terminate called after throwing an instance of 'cv::Exception' what(): C:\OpenCV2.3\opencv\modules\core\src\arithm.cpp:1227: error: (-209) The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array' in function arithm_op
क्या आपके पास कोई समस्या है कि समस्या क्या हो सकती है? मैं इस पर लंबे समय से फंस गया हूं ...
धन्यवाद।
का उपयोग करने के लिए समान संख्या में चैनलों की आवश्यकता है जो विशेष रूप से त्रुटि को फेंकता है? - कोई चिंता नहीं, मुझे लगता है कि यह 'addWeighted' है। –
@ गणितीय.coffee addWeighted, सवाल संपादित किया। धन्यवाद। – mrcaramori