For this project we want you to build an interactive image manipulation tool. Yo
ID: 3622308 • Letter: F
Question
For this project we want you to build an interactive image manipulation tool.Your code should display a menu that lists the operations the user can perform
the menu should include at least these operations
1) open a new image file
2) display the current image file
3) display relevant information about the image (number of pixels, dimensions, etc.)
4) count the number of pixels of a particular color in the image
5) perform edge detection on the image
6) determine the number of "objects" that appear in the image
7) resize and save the new image according to a scaling factor and filename obtained from the user
8) create a pixelated image (if you wanted to create a mosaic of an image using limited colors)
9) quit
Explanation / Answer
I am not doing the project for you but here is where you need to start: 1) im = imread(file) This opens the file and sets im equal to it 2) imshow(im) This will show you the image 3) [r c l] = size(im) *If you forget the l it will multiply c by 3 since l is the number of layers. This will give you the number of rows, cols, and layers. 4) This will need to be a mask where each index is a color so if you wanted a mask of where it was black you would say (:,:,1)==0 & (;,:,2)==0 & (;,:,3)==0. 5) go to the matlab help section and search for edge detection 6) This is unclear please specify objects 7) Here is how to increase by a factor of 2 you can solve this for yourself: new_cols = linspace(1,cols,2*cols) new_rows = linspace(1,rows,2*rows) im = im(new_rows,new_cols,:) *DONT FORGET THE :* 8) to limit color you need to do kinda the same as you did with the mask said earlier just set your values and if they exceed then set a ciel for them 9) close all I know that it's not exact but I hope this helps. Good luck on your assignment.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.