Hello, I am working on code that inputs an image of an object, and finds the edge contrast around that object. It does this by creating a rectangular ROI on the image, the user then moves the roi to different edge positions around the object, and takes the maximum and minimum values in the rectangular roi, finally getting the contrast from the difference between the max and min. I am wanting to plot the contrast for each position that the roi has moved to using a scatter plot. However, when I do this it creates 8 data points instead of just 1 data point, and I am not sure why. Could I get some help please? Thank you!
The picture on the bottom is an example of this. I moved the ROI to 3 different positions on the edge of my object. It created 3 different contrast values, but 8 different values for my region number. I think it is somewhere in my for loop or how I am scatter plotting..
roi = drawrectangle('StripeColor','r','FaceAlpha',0.2);
h(1,1:2) = floor(h(1,1:2));
h(1,3:4) = ceil(h(1,3:4));
arr = IM(h(1,2):h(1,2)+h(1,4),h(1,1):h(1,1)+h(1,3));