![]() Img2 = zeros( size(img1) ) %% initialize arrays of the same size as img1 Merging RGB components: figure(3), subplot(1, 4, 1), imshow(img1), title( 'Original') Subplot(2, 2, 4), imshow(img1_b), title( 'Blue'), colorbar Subplot(2, 2, 3), imshow(img1_g), title( 'Green'), colorbar ![]() Subplot(2, 2, 2), imshow(img1_r), title( 'Red'), colorbar 8-bit representation gives a scale of 0 to 255, with 0 being the darkest and 255 the brightness in the particular color component. The overall color image is thus stored in an array of three indexing variables, as you can see in the summary of Workspace in MATLAB, or run the function size.Ī R/G/B component is represented by dafault using 8 bits (unsigned 8-bit integer or 'uint8' in MATLAB data type. The horizontal and vertical dimensions of each color matrix matches the size of the image in unit of pixels. A matrix is essentially an array indexed by two indexing variables typically for row and column.Įach of the three color matrices can be specified by the third indexing number - note the number 1 in the example below img(:,:,1), and so on. In image/video processing, it is also referred to as R/G/B channels. By default, a color image is stored by MATLAB using 3 matrices, each representing red, green and blue components of pixels.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |