Unable to perform assignment because the left and right sides have a different number of elements. Picture is 464x464 pixels.
조회 수: 1 (최근 30일)
이전 댓글 표시
img=imread('wingding-star.jpg');
%Task 1.B take white pixels and make them into random color
% Generate random number
rng(0,'twister');
a=0;
b=255;
random=(b-a).*rand(1000,1)+a;
%capture all white pixels
wpixels=red==255&green==255&blue==255;
% make white pixels random
red(wpixels)=random;
blue(wpixels)=random;
green(wpixels)=random;
rgbImage=cat(3,red,green,blue);
subplot(2,2,3);imshow(rgbImage);
댓글 수: 1
Walter Roberson
2019년 4월 17일
random is length 1000 exactly. The number of pure-white pixels is probably not exactly 1000.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!