Thursday, 15 August 2013

image - Correcting non-uniform illumination on light background - matlab -



image - Correcting non-uniform illumination on light background - matlab -

i working on image segmentation using threshold. have tried both otsu's method , gonzalez's method. did this:

% apply different threshold methods otsu_thresh = graythresh(i); [bw, gw_thresh] = threshold_gw(i); i_ot = im2bw(i, otsu_thresh); i_g = im2bw(i, gw_thresh/255);

now, results shown below:

as can see having problems otsu's thresholding , assuming because of non uniform background illumination. have followed example: http://www.mathworks.nl/help/images/examples/correcting-nonuniform-illumination.html on correcting non uniform illumination, unfortunately in examples background dark , objects whiter imopen , substract background.

in case, background lighter objects performed imclose instead. have background:

the problem comes when seek subtract background original image becomes black. makes sense since objects black (so value 0). can't find method subtract background , maintain objects. has thought on this?

you utilize technique called adaptive thresholding, or alternatively utilize triangle method thresholding.

also, if substract background itself, of course of study black! indeed, want substract amount of blackness, 1-x x pixel value (or 255-x in case of integer image).

to substract amount of blackness, use

newimage = 1 - ((1-oldimage)-(1-background));

simplification left exercise reader...

image matlab background

No comments:

Post a Comment