MATLAB Answers

Hi. Is it possible to code an image crop then proceeds to block matching and finally run a newton rhapson power flow method?

1 view (last 30 days)
need to use for our project
  13 Comments
Walter Roberson
Walter Roberson on 15 Nov 2018
"Can I use it to have a loop statement regarding the change in values of the mask portion of the components (when some of the mas portion was removed)? "
Yes, if you can find some meaning for that statement; I am having difficulty understanding that, though.
"Can I just assign variables in the matrix coordinate of each line so that when the value of it changes, I can determine where the cut was made. If yes, how? "
It is possible to define a matrix in which each location stores the component number associated with a location in the image. Then you could take
changed_components = component_label_matrix(big_change);
That is certainly possible. However, it would require that you find some way to construct the matrix in which each pixel is the corresponding component number. You could construct it by a number of assignment statements after you had done careful analysis of the image, I suppose. But in my experience it is much easier to use imfreehand() or related routines to overlay an ROI on an image to create mask matrices. But if you had your heart set on a single label matrix then you could certainly create one, such as by using find() on the mask matrices created by overlaying ROIs.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 15 Nov 2018
if size(original_image,3) == 1
original_image = original_image(:,:,[1 1 1]); %convert to RGB
end
img_diff = sum((double(original_image)-double(new_image)).^2,3);
big_change = img_diff > SomeThreshold;
for K = 1 : number_of_components
num_changed_in_component(K) = nnz( mask_for_component{K} & big_change );
end
That is, you would create a series of logical masks, one for each important component, each one true where a component is in the original image, and you would calculate the number of points significantly changed in that component. That would permit you to figure out which components had been affected and how much. For example you should be able to estimate that about half of the circle was changed and change the value associated with the component appropriately.
... Watch out for the possibility that the change in the image disconnects the circuit: you could end up with equations that generate singularities.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!