opencv


cv::Canny throws mismatched/unsupported formats exception


I'm doing some pretty basic edge detection stuff. Part of my implementation involves copying from a custom Image class to a cv::Mat and then copying back to an Image. I'm working with this article as my guide for getting the edge detection and contour work (not shown in the current listing) done. In this example, PerturbedBorderFilter subclasses Image. Here is what I have:
void PerturbedBorderFilter::performFilter(const Image& src)
{
int h = src.Height(), w = src.Width();
cv::Mat
orig(h, w, CV_32FC3),
cannyOutput(h,w,CV_32FC1),
origGray(h,w,CV_32FC1);
src.copyTo(orig);
cv::cvtColor(orig, origGray, CV_RGB2GRAY);
cv::blur(origGray, origGray, cv::Size(3,3));
cv::Canny( origGray, cannyOutput, 0.1, 0.2, 3);
copyFrom(cannyOutput);
}
I end up with this runtime error:
OpenCV Error: Unsupported format or combination of formats () in cvCanny, file /build/buildd/opencv-2.3.1/modules/imgproc/src/canny.cpp, line 67
terminate called after throwing an instance of 'cv::Exception'
what(): /build/buildd/opencv-2.3.1/modules/imgproc/src/canny.cpp:67: error: (-210) in function cvCanny
From what I can tell, 'origGray' and 'cannyOutput' share the same type, depth, and channel count. I am not sure what else I should check into.
If somehow the implementation of copyTo() and copyFrom() are important I can give those as well.
Some additional information:
Class Image's native color space is RGB, 32-bit float depth, with values in [0,1].
Currently, copyTo() copies the image upside down but intact otherwise. I figured this had to be unrelated, but who knows, maybe it is useful...
cv::Canny supports only CV_8U image depth.

Related Links

Reprojection of calibrateCamera and projectPoints
How to calculate matrix rank in OpenCV?
GdkGLExt-WARNING **: Window system doesn't support OpenGL
incorrect size of vector when converting Mat to Vector
Mingw doesn't find file strsafe.h while compiling OpenVC library
Opencv image regitsration mask
Detect presence and location of a ball in video with opencv
use of undefined type 'cv::cuda::GpuMat'
Camera Calibration Error Estimation in OpenCv
Using Levenberg-Marquardt optimization algorithm via opencv projectPoints() to estimate Calibration Errors
alternate function for erode to reduce the processing time
OpenCV Python calcOpticalFlowPyrLK returning points out of the camera frame
camera coordinate to pixel coordinate opencv
Opencv contours detected discontinue
Latency in Device-host communication Opencv
Fast Difference if Gaussians

Categories

HOME
wpf
printing
web-applications
coffeescript
x-editable
appium-ios
rtmp
swashbuckle
windows-runtime
active-directory
google-analytics-api
sony-camera-api
range
push
tcplistener
sqlconnection
tapi
monaco-editor
watchservice
freetype
accelerated-mobile-page
django-autocomplete-light
c-strings
easendmail
background-subtraction
unsigned-integer
regex-group
nested-loops
localdb
spring-websocket
detach
pdfstamper
outlook-vba
double-click-advertising
powerbuilder-conversion
transpose
angular-xeditable
sagepay
sweet.js
federation
smartbanner
jasmine2.0
ios-app-group
ammonite
python-module
haste
android-touch-event
email-notifications
android-sdk-tools
sound-synthesis
amazon-dynamodb-streams
vb4android
ocsp
codeigniter-upload
submission
isapi-rewrite
mongolab
android-popupwindow
clientid
hjson
symbian
json4s
netbsd
xsb
avalonedit
treegrid
alienvault
windows-universal
centering
adserver
android-design-library
json-web-token
bitrock
sqlhelper
symfony-2.5
mui
iphone-privateapi
dirpagination
youtrack-api
xsltforms
pydatalog
simpleaudioengine
freemind
llblgenpro
buildout
pligg
semantic-markup
zephir
kmz
globbing
google-authorship
double-precision
symfony-2.2
haar-wavelet
cakephp-2.1
onmouseout
jsr223
rgba
boost-gil
demoscene
replay
noaa
adbwireless
fogbugz-on-demand
sqlprofileprovider

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App