How can I make a variable defined in one script make change also in a second script?
1 view (last 30 days)
Show older comments
Emerson De Souza on 5 Feb 2012
MOTIVATION: I wrote the following lines to obtain the distance of a give moving point between two images:
base_points_0 = [ 75 24 ];
input_points_0 =[ 75 24 ];
imagea = imread('0.bmp');
imageb = imread('1.bmp');
image1 = rgb2gray(imagea);
image2 = rgb2gray(imageb);
y = zeros(1,2,4);
[input_points, base_points] = cpselect(image2,image1, input_points_0, base_points_0, 'wait', true);
y(:,:,1) = base_points;
corrected_inputs = cpcorr(input_points, base_points, image2, image1);
y(:,:,2) = corrected_inputs;
input_points = corrected_inputs;
base_points = corrected_inputs;
filename1 = '1.bmp';
PROBLEM: The value 4 of variable P2 should be assigned to the correlation size (CORRSIZE = P2) in cpcorr.m but unfortunately I obtain the following error:
??? Undefined function or variable 'P2'.
Error in ==> cpcorr at 76
CORRSIZE = P2;
QUESTION: How can I write a value in the calculation script that makes a change in cpcorr.m without needing to change that number manually?
Thank you for your help
More Answers (0)
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!