From matlab image processing to opencv python

Hello,
I am very interested in translating the below script (matlab image processing toolbox TO python opencv ). Any piece of advice about the equivalent functions are very welcome.
Thanks, Alex.

% start with an image
A = imread(‘thermal1.bmp’);
% extract the colormap from one image
% if the colormap is the same for all images, this can be reused
CT = A(50:270,219:229,:); % extract the colorbar region
CT = permute(mean(CT,2),[1 3 2]); % sample average
CT = unique(CT,‘rows’,‘stable’); % discard duplicate rows
CT = CT/255; % assuming input was uint8
CT = flipud(CT);
% somehow extract the numbers from the image
% i don’t have any OCR stuff, so i’m just going to do this manually
cblimits = [26.1 32.3];
% crop out the usable part of the image
A = A(32:end,1:200,:);
% now you have one image rescaled into temperature units
Ath = double(rgb2ind(A,CT))/size(CT,1);
Ath = rescale(Ath,cblimits(1),cblimits(2));
imshow(Ath,)
% do the same things again for another image
B = imread(‘thermal2.bmp’);
B = B(32:end,1:200,:);
cblimits = [22.3 26.9];
Bth = double(rgb2ind(B,CT))/size(CT,1);
Bth = rescale(Bth,cblimits(1),cblimits(2));
% display both images with a common scale and colormap
displaycbrange = [22 34]; % the common scale
subplot(1,2,1)
imshow(Ath,displaycbrange)
colormap(CT)
colorbar
subplot(1,2,2)
imshow(Bth,displaycbrange)
colormap(CT)
colorbar