Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
want to reag .pgm images in matlab but get an error index exceeds matrix dimension
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
imwrite(imread('divya.pgm'),'C:\Users\div\Desktop\myfirstimage.jpg')
i am using this to read a pgm file..but i get an error index exceeds matrix dimention.please help
0 Kommentare
Antworten (1)
Image Analyst
am 2 Jun. 2013
Let's break it down so we can see where the error is coming from:
originalImage = imread('divya.pgm')
imshow(originalImage);
imwrite(originalImage,'C:\Users\div\Desktop\myfirstimage.jpg')
Now what happens? Paste all the red error message text - don't paraphrase or cut anything.
2 Kommentare
Image Analyst
am 2 Jun. 2013
Wow - that's really bizarre. That doesn't look anything like your original code, or my code. Are createLightSource(), cut(), and varianceCut() your functions? Or something from some toolbox?
One thing that looks weird is:
G = round(sin(phi) * sum(sum(image(up:down,left:right,2))));
image() is a built in function that takes an image variable and displays it. It's probably getting confused when you pass it two 2-element arrays and a scalar (2). You don't have an image anywhere in your code that you gave the name "image" to, do you? That would be bad. If you do, call your variable something else, like grayImage, originalImage, croppedImage, rgbImage, or something, anything, other than "image".
Diese Frage ist geschlossen.
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!