fixed_image = imref2d(size(image_1));
movingimage_2 = imref2d(size(image_2));
fixedPoints = detectMSERFeatures(image_1,'ThresholdDelta',1.466667,'RegionAreaRange',[14 25083],'MaxAreaVariation',0.812500);
movingPoints = detectMSERFeatures(image_2,'ThresholdDelta',1.466667,'RegionAreaRange',[14 25083],'MaxAreaVariation',0.812500);
[fixedFeatures,fixedValidPoints] = extractFeatures(image_1,fixedPoints,'Upright',false);
[movingFeatures,movingValidPoints] = extractFeatures(image_2,movingPoints,'Upright',false);
indexPairs = matchFeatures(fixedFeatures,movingFeatures,'MatchThreshold',20.833333,'MaxRatio',0.208333);
fixedMatchedPoints = fixedValidPoints(indexPairs(:,1));
movingMatchedPoints = movingValidPoints(indexPairs(:,2));
MOVINGREG.FixedMatchedFeatures = fixedMatchedPoints;
MOVINGREG.MovingMatchedFeatures = movingMatchedPoints;
tform = estimateGeometricTransform(movingMatchedPoints,fixedMatchedPoints,'affine');
MOVINGREG.Transformation = tform;
MOVINGREG.RegisteredImage = imwarp(image_2, movingimage_2, tform, 'OutputView', fixed_image, 'SmoothEdges', true);
MOVINGREG.SpatialRefObj = fixed_image;