标题:几道matlab题,r g b分离等等!
取消只看楼主
HJsun
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-9-23
 问题点数:0 回复次数:0 
几道matlab题,r g b分离等等!

very urgent,help!!


A. Write a matlab program called channelstats.m that does the following:
{ Load a color image of your choosing (make sure you hand in the image you used).
{ Display the image in a gure window.
{ Separate the image into it's RGB components. Display each component in a separate
gure window. Put an appropriate title on each gure.
{ Determine the mean and standard deviation of the pixel intensities in each component
image. Print out the results.
{after determining the mean and standard deviation of each component image,
display each color component (in separate gure windows) as a surface. Put appropriate titles
on each surface gure window. Apply a di erent colormap to each surface. Apply shading
and lighting to each surface (consult the matlab online documentation, or DIP using Matlab
to learn how to do this).


B. Write a function in its own .m le called funwithimages.m that takes the name of an image
le as a parameter, and has two output parameters. The function must do the following:
{ Load the image (note: your function should be able to handle an image with arbitrary
dimensions).
{ If the image is not a greyscale image, convert it to a greyscale image of type uint8.
NOTE: in all subsequent steps, the \original image" refers to this converted greyscale
image.
{ Display the original image.
{ Rotate the original image 90 degrees clockwise.
{ Compute the \negative" of the original image. (ie - intensity 0 becomes 255, intensity 1
becomes 254, intensity 2 becomes 253, etc.)
{ Create a new image with the same dimensions as the original image such that a pixel in
the new image is white if the original pixel had intensity between 25 and 75, otherwise,
set the pixel in the new image to black.
{ Shrink the original image to half it's size by removing every second pixel in each dimension.
(ie - keep only pixels whose (x; y) coordinates are both even).
{ Display all four new images (rotated, negated, black and white, and shrunk images) in
the same gure window (hint: check out the subplot function).
{ Give each image its own descriptive title.
{ Return the dimensions (in pixels) of the original image.



C. Write a function called mosaic in it's own .m le which does the following:
{ Use the dir function to obtain the names of all le that have the extension .pgm.
{ Load all of the images into a 1D cell array.
{ Determine whether all of the images are the same size.
{ If they are, create single mosaic image by tiling the images. Use horizontal and vertical
concatenation to create a single image matrix. The program should determine the largest
number of images that can be put in one row of the mosaic such that the width of the
mosaic image does not exceed 1024 pixels.
{ Display the mosaic image.
{if not all images are the same size, determine size of the largest image, scale all
images up to that size, and create and display the mosaic image (hint: look for functions in
the image processing toolbox to help you!).

[此贴子已经被作者于2007-9-23 2:59:36编辑过]

搜索更多相关主题的帖子: matlab image gure RGB Display 
2007-09-23 02:44



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-172203-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.186860 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved