error to display image
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
This error message ' MAP must be a m x 3 array ' when i want to process it to gray. I got the image by capture from webcam and want to display it to axes. Can someone tell me, what should i do to fix it ?
thank you
0 commentaires
Réponses (2)
Image Analyst
le 30 Juin 2013
You're passing it a colormap that is not correct. Try something like this:
snappedImage = getsnapshot(vidobj);
snappedImage = rgb2gray(snappedImage); % Convert from RGB to grayscale.
imshow(snappedImage);
colormap(gray(256));
colorbar;
Nitin
le 1 Juil 2013
If you are reading direclty from a video, you should probably use the step function:
For example:
filename = 'shaky_car.avi';
hVideoSrc = vision.VideoFileReader(filename, 'ImageColorSpace', 'Intensity');
imgA = step(hVideoSrc); % Read first frame into imgA
otherwise you might extract all the frames to a folder and load them using imread
You may find this link useful: http://www.mathworks.com.au/help/vision/examples/video-stabilization-using-point-feature-matching.html
2 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!