Hi Raviteja,
From my understanding you would like to perform different operations on an image based on whether the image was captured from camera 1 or camera 2. I am assuming your images have the name with the format "<imagName>_<camType>.jpg"
fileName="img1_cam1.jpg";
imgName=strsplit(fileName,'_');
imgName=imgName(2);
camType=strsplit(imgName,'.');
camType=camType(1);
if (strcmp(camType,"cam1"))
% Crop the image of cam1
else
% Crop the image of cam2
end
For reading images in MATLAB use the imread function. You may refer to the link below.