Home > error 27 > error -27 null array pointer is passed in function cvgetmat

Error -27 Null Array Pointer Is Passed In Function Cvgetmat

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up OpenCV Error: Null pointer with canny up vote 0 down vote favorite I'm trying to learn C and OpenCV. I'm using the following code, inspired from O'Reilly Learning OpenCV, but I get an error and the image doesn't show as expected. Is there something wrong with this code? # include "cv.h" # include "highgui.h" IplImage * doCanny(IplImage *in, double lowThresh, double highThresh, int aperture) { if(1 != in->nChannels){ return 0; } IplImage *out = cvCreateImage(cvGetSize(in), IPL_DEPTH_8U, 1); cvCanny(in, out, lowThresh, highThresh, aperture); return out; } /* This layout works with other functions like cvPyrdown, but for some reason it doesn't work with cvCanny */ int main() { double lowThresh = 50; double highThresh = 150; int aperture = 3; IplImage *img = cvLoadImage("/tmp/lena.jpg", CV_LOAD_IMAGE_UNCHANGED); IplImage *out = doCanny(img, lowThresh, highThresh, aperture); cvNamedWindow("Example2-6", CV_LOAD_IMAGE_UNCHANGED); cvShowImage("Example2-6", out); cvWaitKey(0); cvReleaseImage(&img); cvReleaseImage(&out); cvDestroyWindow("Example2-6"); return 0; } The output I get on Mac OS X Yosemite is: OpenCV Error: Null pointer (NULL array pointer is passed) in cvGetMat, file /opt/local/var/macports/build/.../opencv-2.4.11/.../array.cpp, line 2382 c opencv share|improve this question edited Jul 26 '15 at 13:50 honk 3,177102544 asked Jul 26 '15 at 10:37 ling 1,35611418 please, use opencv's c++ api, not the outdated, and no more maintained c-api –berak Jul 26 '15 at 13:45 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote accepted Your jpg image is most likely a three-channel image. You pass this image as in into your doCanny() function. The following code will cause the doCanny() function to return 0: if(1 != in->nChannels){ return 0; } Then you don't check if the return value of your doCanny() function is valid. Therefore you pass a null pointer to the following function which might cause your null pointer error: cvShowImage("Example2-6", out); In order to make your code working

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Getting error in capturing image through a program in Python up vote 0 down vote favorite I am new to the http://stackoverflow.com/questions/31635986/opencv-error-null-pointer-with-canny Python opencv. Can anybody please help me to sort out the error import cv cv.NamedWindow("w1", cv.CV_WINDOW_AUTOSIZE) camera_index = 1 capture = cv.CaptureFromCAM(camera_index) def repeat(): global capture #declare as globals since we are assigning to them now global camera_index frame = cv.QueryFrame(capture) cv.ShowImage("w1", frame) c = cv.WaitKey(100) if(c=="n"): #in "n" key is pressed while the popup window is in focus camera_index += 1 #try the next camera index capture = cv.CaptureFromCAM(camera_index) if not capture: #if http://stackoverflow.com/questions/14094153/getting-error-in-capturing-image-through-a-program-in-python the next camera index didn't work, reset to 0. camera_index =1 capture = cv.CaptureFromCAM(camera_index) while True: repeat() this is the error what I am getting - OpenCV Error: Null pointer (NULL array pointer is passed) in cvGetMat, file /home/paraste/OpenCV-2.3.1/modules/core/src/array.cpp, line 2382 Traceback (most recent call last): File "dualcamara.py", line 10, in img = cv.GetMat(cv.QueryFrame(capture), 500) cv2.error: NULL array pointer is passed opencv python-2.6 share|improve this question asked Dec 30 '12 at 20:00 parastenitk22f 11 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote It seems likely that either cv.CaptureFromCAM() or cv.QueryFrame() is failing (maybe camera_index is wrong?), and thus you get a NULL in frame which causes that error. You should check the result of those two functions and make sure they succeed (I'm just printing a message in this case, you could of course do something else): capture = cv.CaptureFromCAM(camera_index) if not capture: print "Failed to initialize capture" frame = cv.QueryFrame(capture) if not frame: print "Failed to get frame" share|improve this answer answered Dec 31 '12 at 3:26 WildCrustacean 4,63611636 hello, Thank you for your reply. The CaptureFromCAM function is returning some hexadecimal value but the QueryFrame function is returning none. i thought camera is not on so, i manually switched it on using cheese command but there is no c

12:20 AMHi, I'm experimenting with making a python script which handles webcam input. I've found this (http://www.jperla.com/blog/2007/09/26/capturing-frames-from-a-webcam-on-linux/) one that uses OpenCV to capture images. Sadly, it doesn't seem to work for me. https://ubuntuforums.org/archive/index.php/t-1199249.html Running it gives antimatter15@antimatter15-desktop:~/Desktop/mirrortouch$ python webcam2.pyTraceback (most recent call last): File "webcam2.py", line 29, in im = get_image() File "webcam2.py", line 14, in get_image im = opencv.cvGetMat(im) File "/var/lib/python-support/python2.6/opencv/cv.py", line 3826, in cvGetMat return _cv.cvGetMat(*args) RuntimeError: openCV Error: Status=Null pointer function name=cvGetMat error message=NULL array pointer is passed file_name=cxarray.cpp line=2780 I'm not certain if it's related to this, but running v4l-conf shows antimatter15@antimatter15-desktop:~/Desktop/mirrortouch$ v4l-conf v4l-conf: using X11 error -27 display :0.0 dga: version 2.0 WARNING: No DGA direct video mode for this display. mode: 2880x1200, depth=24, bpp=32, bpl=11520, base=unknown /dev/video0 [v4l2]: no overlay support Which I've seen in other posts, but I can't find any way to fix it. Does anyone know how to either fix this or know another way to capturing frames from a webcam in python? soltanisJune 29th, 2009, 05:47 AMI don't know for certain error -27 null but this is probably v4l messing up, not necessarily OpenCV or your program. I get that error too whenever I try to test my webcam, and it only ever works with Skype and xawtv (and NEVER with anything else). Do you have one of the Ricoh webcams (like I do)? These are very poorly supported by the UVC driver, for some reason, and there is a kernel module driver for it, but it's old and unmaintained, then there's a newer userspace driver for it which is new and doesn't always work, so as is usual you get the pick of the old buggy driver or the new unfinished driver. Or you might have another unsupported cam, in any case, you'd be better off asking about this in the hardware support forum, since I'm pretty sure its your webcam. As far as I know there is no other way to get webcam streams other than v4l or v4l2. loellJune 29th, 2009, 06:09 AMhave you tried python gstreamer yet? http://giss.tv/sahabuntu/doc/gstreamer-v4l.html antimatter15June 29th, 2009, 01:54 PMI don't understand how to process the individual frame snapshots with GStreamer. I have a Creative NX. Powered by vBulletin Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.

 

Related content

d3 friend invite error 3

D Friend Invite Error table id toc tbody tr td div id toctitle Contents div ul li a href Battlenet Error a li li a href Bnet Error a li li a href Diablo a li li a href Overwatch a li ul td tr tbody table p Aus NZ General Discussion Console Discussion Clans and Communities New Player Help Community Creations CLASSES Barbarian Crusader Demon Hunter Monk Witch Doctor Wizard SUPPORT Blizzard Archive Bug Report Console Bug relatedl Report Technical Support Mac Technical Support GAMES ENTERTAINMENT AND TECHNOLOGY p h id Battlenet Error p Games Technology Movies Books and

canon198 error 27

Canon Error table id toc tbody tr td div id toctitle Contents div ul li a href Error Canon Mp a li li a href Canon Mp Resetter Free Download a li li a href Canon Pixma Mp Resetter a li ul td tr tbody table p Resetter Canon MP Error E How to Resetter Canon MP Error E - Canon Pixma MP Picture all-in-one Printer assistance ChromaLife Photo System which could store up in order to -year album life when relatedl new ink as well as Photo Paper Professional or Photo driver canon Document Plus GlossyII or even Photo

diablo 3 error sending friend invite error 3

Diablo Error Sending Friend Invite Error table id toc tbody tr td div id toctitle Contents div ul li a href Battle net Error a li li a href Bnet Error a li li a href Blzbntbgs f a li ul td tr tbody table p Entertainment and Science Blizzard Archive Console GAMEPLAY Crafting and Items Hardcore Quests and Achievements Brawling Lore and Characters CLASSES Barbarian Demon Hunter Monk Witch Doctor Wizard Crusader UNDER DEVELOPMENT relatedl SUPPORT Technical Support Games World of Warcraft Diablo III StarCraft battlenet error II Hearthstone Heroes of the Storm Overwatch Classic Games Shop Your account

error 27 partition magic cannot lock drive

Error Partition Magic Cannot Lock Drive p Display results as threads More Useful Searches Recent Posts Menu Forums Forums Quick Links Search Forums Recent relatedl Posts Menu Log in Sign up AnandTech Forums Technology Hardware Software and Deals Forums Software Software for Windows Partition Magic and Chkdsk Cannot Lock Drive or Cannot Lock Volume for Direct Access Discussion in 'Software for Windows' started by fuzzybabybunny Sep fuzzybabybunny Moderator br Digital Video Cameras Moderator Joined Jan Messages Likes Received I'm trying to run both chkdsk and create a new partition on my primary HDD When I do chkdsk with the fix

error 27 partition magic 8.0

Error Partition Magic p DriverDoc WinSweeper SupersonicPC FileViewPro About Support Contact Errors Troubleshooting rsaquo Runtime Errors rsaquo PowerQuest Corporation rsaquo PartitionMagic rsaquo Error How To Fix PartitionMagic Error Error relatedl Number Error Error Name Error Partition Magic Error Description Error PartitionMagic has encountered a problem and needs to close We are sorry for the inconvenience Developer PowerQuest Corporation Software PartitionMagic Applies to Windows XP Vista Download NowWinThruster - Scan your PC for computer errors Compatible with Windows Vista XP and Symptoms of Error Error appears and crashes the active program window Your PC frequently crashes with Error when running the

error 27 unrecognized command grub4dos

Error Unrecognized Command Grub dos table id toc tbody tr td div id toctitle Contents div ul li a href L i Error Unrecognized Command a li li a href Grub Filesystem Type Unknown a li li a href Grub List Disks a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you relatedl might have Meta Discuss the workings and policies of grub error unrecognized command this site About Us Learn more about Stack Overflow the company Business Learn p h id L i Error Unrecognized

error 27 cannot lock driver

Error Cannot Lock Driver p Display results as threads More Useful Searches Recent Posts Menu Forums Forums Quick Links Search Forums Recent Posts Menu Log in Sign up AnandTech Forums Technology Hardware Software and Deals Forums Software relatedl Software for Windows Partition Magic and Chkdsk Cannot Lock Drive or Cannot Lock Volume for Direct Access Discussion in 'Software for Windows' started by fuzzybabybunny Sep fuzzybabybunny Moderator br Digital Video Cameras Moderator Joined Jan Messages Likes Received I'm trying to run both chkdsk and create a new partition on my primary HDD When I do chkdsk with the fix command in

error 27 unrecognized command grub

Error Unrecognized Command Grub table id toc tbody tr td div id toctitle Contents div ul li a href Grub Ls Unrecognized Command a li li a href L i Error Unrecognized Command a li li a href Grub Ls Error Unrecognized Command a li ul td tr tbody table p Ask a question help others and get answers from the community Discussions Start a thread and discuss today's topics with top experts Blogs Read the latest tech blogs written by experienced community members VIEW ALL relatedl POSTS Open Source Software and Linux laquo Troubleshooot your Linux boot process yumi

error 27 unrecognized command grub gentoo

Error Unrecognized Command Grub Gentoo table id toc tbody tr td div id toctitle Contents div ul li a href Error Kernel Must Be Loaded Before Booting a li li a href Grub Legacy Commands a li ul td tr tbody table p Ask a question help others and get answers from the community Discussions Start a thread and discuss today's topics with top experts Blogs Read the latest tech blogs written by experienced community members VIEW ALL relatedl POSTS Open Source Software and Linux laquo Troubleshooot your Linux boot grub error unrecognized command process with GRUB Netbooks Notebooks Windows

error 27 unrecognised command

Error Unrecognised Command table id toc tbody tr td div id toctitle Contents div ul li a href Unrecognised Command Line Option -std c a li li a href Grub Error Unrecognized Command a li li a href Grub Ls Error Unrecognized Command a li li a href Grub Filesystem Type Unknown a li ul td tr tbody table p Ask a question help others and get answers from the community Discussions Start a thread and discuss today's topics with top relatedl experts Blogs Read the latest tech blogs written by cabal unrecognised command sandbox experienced community members VIEW ALL

error 27

Error table id toc tbody tr td div id toctitle Contents div ul li a href Kdc Error a li li a href Error Unrecognized Command a li li a href Error Final Cut Pro a li ul td tr tbody table p can not post a blank message Please type your message and try again TS Get help with iOS update relatedl and restore errors Learn about Get help with iOS error update and restore errors MikeVis Level points Q Unknown error itunes error unable to restore I have just installed the latest Apple software update on my iPhone

error sending friend invite error 3

Error Sending Friend Invite Error table id toc tbody tr td div id toctitle Contents div ul li a href Battlenet Error a li li a href Bnet Error a li ul td tr tbody table p Entertainment and Science Blizzard Archive Console GAMEPLAY Crafting and Items Hardcore Quests and Achievements Brawling Lore and Characters CLASSES Barbarian Demon Hunter Monk Witch Doctor Wizard Crusader UNDER DEVELOPMENT SUPPORT Technical Support relatedl Games World of Warcraft Diablo III StarCraft II Hearthstone Heroes of p h id Battlenet Error p the Storm Overwatch Classic Games Shop Your account Log In Account Settings Support

error sending friend invite diablo 3

Error Sending Friend Invite Diablo p Entertainment and Science Blizzard Archive Console GAMEPLAY Crafting and Items Hardcore Quests and Achievements relatedl Brawling Lore and Characters CLASSES Barbarian Demon battlenet error Hunter Monk Witch Doctor Wizard Crusader UNDER DEVELOPMENT SUPPORT Technical Support battle net error Games World of Warcraft Diablo III StarCraft II Hearthstone Heroes of the Storm Overwatch Classic Games bnet error Shop Your account Log In Account Settings Support Diablo III Forums Technical Support There was an error sending the friend invite Error There was an battle net account management error sending the friend invite Error Technical Support Reaper

friend invite error 3

Friend Invite Error table id toc tbody tr td div id toctitle Contents div ul li a href Battlenet Error a li li a href Battle net Account Management a li ul td tr tbody table p Aus NZ General Discussion Console Discussion Clans and Communities New Player Help Community Creations CLASSES Barbarian Crusader Demon Hunter Monk Witch Doctor Wizard SUPPORT relatedl Blizzard Archive Bug Report Console Bug Report Technical Support p h id Battlenet Error p Mac Technical Support GAMES ENTERTAINMENT AND TECHNOLOGY Games Technology Movies Books and battle net error TV Games World of Warcraft Diablo III StarCraft

got error 27 on write

Got Error On Write table id toc tbody tr td div id toctitle Contents div ul li a href Restore Iphone Error a li li a href Iphone Error Fix a li li a href Error Ipad a li li a href Itunes Error Iphone s a li ul td tr tbody table p CommunityOracle User Group CommunityTopliners CommunityOTN Speaker BureauJava CommunityError You don't have JavaScript enabled This tool uses JavaScript and much of it will not work correctly without it enabled Please turn JavaScript back on relatedl and reload this page Please enter a title You can error itunes

grub loader error 27

Grub Loader Error table id toc tbody tr td div id toctitle Contents div ul li a href Error Unrecognized Command Grub Centos a li li a href Error Unknown Filesystem Grub Rescue Windows a li li a href Grub Rescue Commands a li ul td tr tbody table p Ask a question help others and get answers from the community Discussions Start a thread and discuss today's topics with top experts Blogs Read the latest tech blogs written by experienced relatedl community members VIEW ALL POSTS Open Source Software and Linux laquo grub error unrecognized command Troubleshooot your Linux

grub error 27

Grub Error table id toc tbody tr td div id toctitle Contents div ul li a href Grub Filesystem Type Unknown a li li a href Grub Unrecognized Command a li li a href Grub Legacy Commands a li ul td tr tbody table p Ask a question help others and get answers from the community Discussions Start a thread and relatedl discuss today's topics with top experts Blogs Read grub ls error unrecognized command the latest tech blogs written by experienced community members VIEW ALL POSTS error unrecognized command grub centos Open Source Software and Linux laquo Troubleshooot your

grub quit error 27 unrecognized command

Grub Quit Error Unrecognized Command table id toc tbody tr td div id toctitle Contents div ul li a href Error Kernel Must Be Loaded Before Booting a li li a href Grub Legacy Commands a li ul td tr tbody table p manually installing grub on moved Ubuntu now on a diff HDD Predator September th relatedl AMHello I just moved Ubuntu from one hard grub error unrecognized command drive to another everything is there permissions correct I set the HDD grub ls error unrecognized command I copied everything to as primary in the boot order and I removed

grub error 27 unrecognized command

Grub Error Unrecognized Command table id toc tbody tr td div id toctitle Contents div ul li a href Grub Ls Error Unrecognized Command a li li a href Error Kernel Must Be Loaded Before Booting a li li a href Grub Command Line a li li a href Grub Command Line Boot a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn relatedl more about Stack Overflow the company Business Learn

grub root error 27

Grub Root Error table id toc tbody tr td div id toctitle Contents div ul li a href Grub Ls Error Unrecognized Command a li li a href Grub Rescue No Such Partition a li li a href Grub Rescue Commands List a li li a href Grub Filesystem Type Unknown a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more relatedl about Stack Overflow the company Business Learn more about

ipad unknown error 27

Ipad Unknown Error table id toc tbody tr td div id toctitle Contents div ul li a href Error Ipad a li li a href Iphone Error Fix a li li a href Itunes Error Iphone s a li li a href Itunes Error a li ul td tr tbody table p basic stepswhen you see this message The iPhone device relatedl name could not be restored An unknown error p h id Error Ipad p occurred error number If you still see the error message error iphone find your error below to learn what to do Choose your error

itunes unknown error 27

Itunes Unknown Error table id toc tbody tr td div id toctitle Contents div ul li a href Iphone Error Fix a li li a href Itunes Error Iphone s a li li a href There Was A Problem Downloading The Software For The Iphone An Unknown Error Occurred - a li ul td tr tbody table p basic stepswhen you see this message The iPhone device name could not be restored An unknown error occurred error number If you still see the error message relatedl find your error below to learn what to do Choose error iphone your error

master file error

Master File Error table id toc tbody tr td div id toctitle Contents div ul li a href Fcpx Export Error a li li a href Delete Project Render Files Fcpx a li li a href Final Cut Pro Share Failed a li ul td tr tbody table p p p p p p p first Author Message JazzopSendmessage Joined Dec Posts Message - Posted Jul UTC I am posting this here because I get this error for multiple projects It began after upgrading from ver x to running on a Win Server R machine Any thoughts ID middot AgelessVolunteer

poivy error code 27

Poivy Error Code table id toc tbody tr td div id toctitle Contents div ul li a href Error Code Iphone a li li a href Code Police a li li a href Apple Error a li ul td tr tbody table p post a blank message Please type your message and try again sreek Level points Q error code i am facing error code problem while restoring my iphone il have checked all the relatedl possibilities but couldn't been solved please help me on how to fix the p h id Error Code Iphone p error iPhone Posted on