''Error using reshape: To RESHAPE the number of elements must not change''
조회 수: 1 (최근 30일)
이전 댓글 표시
in image one you can say it is showing no error ,but in second image (b.img) it is showing ,error . why this is happening?
댓글 수: 0
채택된 답변
Image Analyst
2017년 12월 27일
Use this:
[rows, columns, numberOfColorChannels] = size(I);
F = reshape(I, rows*columns, numberOfColorChannels);
댓글 수: 5
marie lasz
2019년 10월 12일
hello Bhanveet,
Did you find out the solution of this error? because I am also getting the same error and I am also working on watermarking.
Image Analyst
2019년 10월 12일
The image array called "message" is most likely color. Use rgb2gray() to cast it to gray scale.
추가 답변 (1개)
Benjamin Kraus
2017년 12월 27일
What is the size of I both before and after calling imresize on the second image? Is one of the images grayscale or black and white? If so, it is possible the third dimension of the image is 1 instead of 3.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!