I've seen this post before and I always pass it up because it's such a bad image.
The image content has been pretty much destroyed. It was once saved by a camera in JPG and then again it was likely transcoded by some program to an even lower-quality JPG. The final encoding is a roughly 40% quality 4:2:0 subsampled pixel salad. Maybe someone who is more familiar with the language could visually identify the characters based on their rough shape and the surrounding context, but I couldn't.
Still, I might as well give it a shot. Let's start by doing a perspective correction and getting rid of the background. That way we don't have to deal with it skewing all the adjustments.
inpict = imread('IMG_1549.jpeg');
inpict = im2double(inpict);
TF = fitgeotrans(boxm,boxf,'projective');
outview = imref2d(size(inpict));
inpict = imwarp(inpict,TF,'fillvalues',0,'outputview',outview);
Create a mask to try to select the blue highlighter marks. Again, this is more or less hopeless, since most of the chroma information (H and S) has been reduced to 20x20px blocks. The best we can do is get a rough mask and feather it.
[H,~,~] = imsplit(rgb2hsv(inpict));
mk = H >= 0.367 & H <= 0.784;
mk = imdilate(mk,ones(3));
mk = imgaussfilt(double(mk),2);
Try to correct for the highlighter marks:
gpict = rgb2gray(inpict);
adjpict = imadjust(gpict,[0.1 1],[0 1],0.55);
outpict = replacepixels(adjpict,gpict,mk);
Try to flatten the result:
lf1 = imgaussfilt(outpict,5);
lf2 = imgaussfilt(outpict,20);
lowfreq = imblend(lf1,lf2,1,'average');
outpict = imblend(lowfreq,outpict,1,'grainextract');
outpict = imlnc(outpict,'independent','g',0.8,'k',2);
Could I get more contrast out of it? Perhaps, but it's hard for me to judge at which point readability is being compromised (if it's not already a lost cause). For example, instead of performing flattening via a single 'grain extract' blend, we could use multiple techniques and combine them. The 'grain extract' method has weakness in some of the dark regions, whereas other regions tend to cause problems for the division used by imflatfield(). By using both, we can try to avoid the low-contrast problems in the SW corner.
lf1 = imgaussfilt(outpict,5);
lf2 = imgaussfilt(outpict,20);
lowfreq = imblend(lf1,lf2,1,'average');
flat1 = imblend(lowfreq,outpict,1,'grainextract');
flat2 = imflatfield(outpict,7);
outpict = imblend(imadjust(flat1),imadjust(flat2),1,'average');
outpict = imlnc(outpict,'independent','g',0.8,'k',2);
... but I don't know if that's really any better.
In this example, I'm using imlnc(), imblend() and replacepixels() from MIMT, though both could be done directly with little effort. I've posted examples on the forum before which show how to do what imlnc() and replacepixels() do. The 'grain extract' blend is simple enough to figure out.