11-14-2007 09:04 AM - edited 11-14-2007 09:05 AM
11-15-2007 02:17 PM
Hi LukasM,
I tried running your code on a computer with Vision Development Module 8.2 and CVI 8.0.1 and received the same error message as you, however, I ran the same code on my personal computer with Vision Development Module 8.5 and CVI 8.1.1 and it ran just fine with no error, so apparently it was fixed along the way. I will do some checking and see if I can find a workaround for older versions to get you up and running, though.
11-15-2007 02:52 PM
Hello,
I did a little more testing and I am now able to run the code on the machine with CVI 8.0.1. I believe the problem is with the image you are reading and sending to imaqMorphology. When I got the error I was reading a JPG but saving as a BMP. My suspicion is that either that version of CVI cannot read certain image types or it cannot read in one type and then save the result as another. Try saving your original image as a .BMP and running the program again.
11-15-2007 11:10 PM
11-16-2007 01:49 AM
11-16-2007 01:53 AM
11-16-2007 01:56 PM - edited 11-16-2007 01:57 PM
Hello,
Let me clarify my image type post. I had taken a random picture (the National Instruments logo that I have attached) and named it "fname.jpg", ran your code, and got the same error you had posted. I then renamed the picture "fname.bmp" and ran the code multiple times without an error. I did notice in your code that in the IMAQReadFile function, you just had fname as the input, but I added the quotations and the file extention. That may make a difference.
04-28-2008 04:32 AM
04-29-2008 02:37 PM
Hi Leon,
Do you still get the error even when using the default syntax for a 3x3 structure as shown below?
myStructuringElement.matrixCols = 3
myStructuringElement.matrixRows = 3
myStructuringElement.hexa = FALSE
myStructuringElement.kernel = malloc(9 * sizeof(int))
myStructuringElement.kernel[0] = 1
myStructuringElement.kernel[1] = 0
myStructuringElement.kernel[2] = 1
myStructuringElement.kernel[3] = 1
myStructuringElement.kernel[4] = 0
myStructuringElement.kernel[5] = 1
myStructuringElement.kernel[6] = 1
myStructuringElement.kernel[7] = 0
myStructuringElement.kernel[8] = 1
int imaqMorphology(Image* dest, Image* source, MorphologyMethod, myStructuringElement);
Also, when you state that the program crashes every time, do you mean that you get the "out of bounds pointer" error?
04-29-2008 06:41 PM