Ask Your Question

Histogram calculation thrash at split procedure and how to fix?

asked 2013-04-02 02:42:53 -0500

SonNB1 gravatar image

Hi there,

I try to run the History calculation from your example code and stuck with it at split proc. The C++ debugged program thrash and show the message "Unhandled exception at 0x100068c1 in StudyOpenCV.exe: 0xC0000005: Access violation reading location 0x000000bc."

OpenCV version: 2.4.4 VS 2010. I also sent you the captured image for this.

I dont know how to fix, please help me to move forward. Thanks.

Regards, SơnNB1 C:\fakepath\OpenCV_SplitError.bmp

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2013-04-02 03:31:30 -0500

First of all I see yoy commented out C-style functionality and combine it with C++ style functionality. When using the old C-style approach, be sure to close pointers to elements in memory, since they lock access to the element in memory for other functions.

If you do not want problems with this, use only C++ style code. Can you display the function you use for reading your image? I am guessing you are not using the imread() C++ approach right?

edit flag offensive delete link more


Hi Steven,

I used the example code here: and got stuck with error at line split( src, bgr_planes );

SonNB1 gravatar imageSonNB1 ( 2013-04-02 05:38:51 -0500 )edit

If that line gives an error, be sure that you did not modify the above code. It seems you changed the information. Be sure that src has multiple channels and that bgr_planes is actually a vector of Mat elements or an Mat[]

StevenPuttemans gravatar imageStevenPuttemans ( 2013-04-02 05:47:45 -0500 )edit

It was solved, I change the declaration from vector<Mat> bgr_planes to Mat bgr_planes[3]={}; Thanks for your support, Steven. SonNB1

SonNB1 gravatar imageSonNB1 ( 2013-04-02 22:04:06 -0500 )edit

You are welcome. Feel free to accept answers if they sattisfied your needs.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-04-03 01:12:19 -0500 )edit

Question Tools


Asked: 2013-04-02 02:42:53 -0500

Seen: 413 times

Last updated: Apr 02 '13