MATLAB: Obtain a difference image digital image processingimage processingMATLAB Can any body guide me How to obtain a difference image by taking first-order horizontal differences? Best Answer diffImage = conv2(grayImage, [1, -1], 'same'); Related SolutionsMATLAB: Difference If I remember correctly, diff works across the first non-singleton dimension. So diff(A) works across columns and diff(A(1, :)) works across rows.x = [1,2,3; 4,5,6];diff(x, [], 1)ans = 3 3 3diff(x, [], 2)ans = 1 1 1 1 MATLAB: Cropping image To crop you can use imcrop(), or simply use indexing:croppedImage = fullImage(row1:row2, col1:col2); Related QuestionFrame Difference
Best Answer