If you please I want to link this instruction{ rgbImage = cat(3, redChannel, greenChannel, blueChannel);} with the rand() function until I get the following result ,,,How to do it
Ältere Kommentare anzeigen
If you please I want to link this instruction{ rgbImage = cat(3, redChannel, greenChannel, blueChannel);} with the rand() function until I get the following result ,,,How to do it

1 Kommentar
Jan
am 14 Mär. 2016
The question is not clear. Do you know how to create the image? Should the image appear in a figure or do you want to save it in an image file? Does the size of the patchs matter?
Antworten (3)
Walter Roberson
am 29 Mär. 2016
1 Stimme
Hint: randomly select color numbers. kron() with ones() to make copies of the numbers.
8 Kommentare
abory kikla
am 30 Mär. 2016
Bearbeitet: Walter Roberson
am 30 Mär. 2016
Walter Roberson
am 30 Mär. 2016
I said nothing about checkerboard. I said "randomly select color numbers". Where is your random selection of color numbers?
Image Analyst
am 30 Mär. 2016
Are you still trying to get this to work after more than 2 weeks?
abory kikla
am 30 Mär. 2016
abory kikla
am 30 Mär. 2016
Walter Roberson
am 30 Mär. 2016
Earlier you wrote the requirement as
",This required: Create checkerboard image using the matrix manipulation to implement a color chessboard image size 1024* 1024 ,where each stone size 32 * 32 without any loop statement.and by Using Conversion ,Rand function"
That does not require that you use the checkerboard() function. "Checkerboard" is the style of grid.
abory kikla
am 30 Mär. 2016
Walter Roberson
am 30 Mär. 2016
However, it does not need to be randomly colored. Also it is not clear that it requires using both of those: it could be requiring that you use at least one of them.
Geoff Hayes
am 13 Mär. 2016
abory - it isn't clear to me why you need to use cat or how you would link this with rand. Presumably, you wish to create randomly coloured squares and then patch them together. Rather than use cat and rand, I may do something like
% define the number of squares per edge (where the edge is the row or column)
numSqrsPerEdge = 8;
% define the number of pixels per square edge
numPixelsPerSqrEdge = 25;
The above would give us an 8x8 square of squares, where each sub-square is 25x25 whose colour is randomly generated.
% generate the random colour
sqrColour = uint8(randi(256,1,1,3) - 1);
% create the sub-square
subSquare = repmat(sqrColour, numPixelsPerSqrEdge, numPixelsPerSqrEdge);
You can use the above for each of the 64 (8x8) sub-squares, concatenating or (perhaps better) inserting each sub-square into an already sized 8x8 (or 200x200x3) array.
5 Kommentare
abory kikla
am 14 Mär. 2016
Geoff Hayes
am 14 Mär. 2016
abory - why three matrices? Why merge with some only? By matrix cells do you mean a cell array? Please clarify the algorithm that you are required to implement.
abory kikla
am 14 Mär. 2016
Bearbeitet: abory kikla
am 14 Mär. 2016
Geoff Hayes
am 14 Mär. 2016
So each square is 32x32 pixels, and there are 32 squares in each row (and column). Since you can't use a loop statement, what are you allowed to use? What is the Conversion function?
As this is homework, please present what you have tried so far.
Geoff Hayes
am 14 Mär. 2016
I hadn't realized that you had already posted this question earlier at http://www.mathworks.com/matlabcentral/answers/271727-i-am-new-at-matlab-and-i-want-create-color-checkerboard. Please don't post duplicate questions.
Muhammad Usman Saleem
am 26 Mär. 2016
0 Stimmen
use imread and then imshow.. Not understand your question?
5 Kommentare
abory kikla
am 27 Mär. 2016
abory kikla
am 29 Mär. 2016
Walter Roberson
am 29 Mär. 2016
The probability that you will get that exact output is virtually non-existent in practice. You would be running for millions of years, as there are 2^512 different color checkerboard patterns.
abory kikla
am 29 Mär. 2016
Muhammad Usman Saleem
am 30 Mär. 2016
you are little confuse. Please be confident always.
Kategorien
Mehr zu ROI-Based Processing finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
