Help using rectangle() function to generate a matrix for image processing
Hi y’all i have a question about the function rectangle(), im using it to make 6x4 disk grid.
I was trying to use viscircles() as it would be much easier, but i cant fill them in appropiately.
Im using it to generate circles, but for the life of me I can not figure out how to save the figure output.
My code currently reads:
for i=1:24
h=rectangle('Position', [px(i) py(i) d d],'Curvature',[1,1],'FaceColor',[0 0 (1/24)*i]);
end
Where px and py are the specific positions where i want the disks printed, and d is the diameter of those disks.
These were read from imfindcircles(), giving me specific points that each circle is from.
Each one needs to be a different value (preferably 1:24). a circle of 1’s then 2’s and so on an so forth.
this is what im getting, which is exaclty what i need. But i have no way of saving it as data.
I have an idea to try the insertshape() command, but it seems like i couldnt save it as a [0 255] value instead of a color.
If you have any ideas or suggestions please reach out.
NOTE:-
Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help , Finance Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.
To save the figure generated by the code provided by you, you can use the savefig function as follows:
savefig();
If you wish to save the data (attributes of each rectangle) of the figure, you can create a structure and log the data into it with every iteration.
%dummy arrays
px=[1,1,1,2,2,2];
py=[1,2,3,1,2,3];
d=1;
rect_data = struct; for i=1:6
SEE COMPLETE ANSWER CLICK THE LINK