This is my first time doing matlab and I've never coded before. This was a compulsory Uni paper that I have had to take. Prior to this task I've managed to complete various other tasks but this is challenging me beyond what I've learned in the last three weeks.
This is what ive got down so far in my script file inroder to attempt to solve this problem.
function [Points] = SelectKRandomPoints (Image, K)
Image = imread('logo.jpg') %logo.jpg is the image we are dealing with
Image1 = size(Image) %This will give the size on the Image 256 x 102 x 3
This is all I understand and I dont even know if its the correct way to start. What I dont know how to do is to select a bunch of random numbers form the image size matrix. I also dont understand how to write such a code that if I input 'k' to be 5 in my function I will have 5 rows and 2 columns of random numbers.
If you could help it would be great! :) P.S. I dont want answers, just advice/guidance
SelectKRandomPointsPurpose generates a list of k randomly selected pixelsfrom an image.
Input(s)It takes twoinputs in the following order:
1)A 3D image array from which to select points from
2)The number of points to randomly selectOutput(s)
It returns a singleoutput, a 2D array, containing k rows and 2 columns, representing k randomly selected points (pixels).
Example :
Here are some examples of calls to SelectKRandomPoints assuming that A is a 256x256x3 array representing an RGB image,
>> points = SelectKRandomPoints(A,6) points = [150 192 ; 219 40 ; 9 37 225 ; 154 103 ; 65 ; 10 40 ]
What I have tried:
function [Points] = SelectKRandomPoints (Image, K)
Image = imread('logo.jpg') %logo.jpg is the image we are dealing with
Image1 = size(Image) %This will give the size on the Image 256 x 102 x 3