c++ - OpenCV crashing at resize function -


i'm getting crash inside iphone app using opencv code. exception thrown @ following line:

cv::mat backup_f = m_color_feature; cv::mat backup_t = m_map; double r = m_options.m_opt_height / m_color_feature.rows; 

cv::resize(m_color_feature, m_color_feature, cv::size(), r,r); cv::resize(m_map, m_map, cv::size(), r, r);

i don't have idea wrong. there no logs, stack functions or exceptions thrown in xcode me figure out going on. crashed there...

this images xcode:

enter image description here enter image description here

i tried modifications see if it's memory problem don't seems case.

    cv::mat backup_f = m_color_feature; cv::mat backup_t = m_map; double r = m_options.m_opt_height / m_color_feature.rows; cv::mat resizedcolor = cv::mat(m_color_feature.rows,m_color_feature.cols,m_color_feature.type()); cv::mat newtest = cv::mat(m_color_feature.rows,m_color_feature.cols,m_color_feature.type()); cv::resize(resizedcolor, newtest, cv::size(), r,r); cv::resize(m_map, m_map, cv::size(), r, r); 

if knows of guide me solution great. i'm sorry got no idea of opencv , little experience c++.

thanks lot.

opencv resize not "in place" operator

try this:

cv::mat temp; cv::size newdim(...); cv::resize(m_color_feature, temp, newdim); m_color_feature = temp.clone(); 

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -