In order to solve the problem of phase compensation errors in the
traditional 2π phase compensation method caused by a
rough surface and complex structure of objects in dual-wavelength
digital holographic microscopy, a phase compensation algorithm based
on image segmentation was proposed. First, the phase less than zero in
the phase obtained by an equivalent wavelength is compensated for by
adding 2π initially. Then the phase after the
initial compensation is binarized, and the small connected areas in
the binarized graph are removed, so as to obtain a new binarized
graph. Finally, according to the two binarized graphs, the phase of
the object after the initial 2π phase compensation is recompensated
for in different regions, so as to obtain the continuous phase
distribution of the object. Based on the dual-wavelength digital
holographic microscopy experimental system with an adjustable
equivalent wavelength, the proposed algorithm is used to perform
three-dimensional imaging of the channel of the microfluidic chip. The
experimental results show that the proposed method can effectively
obtain the continuous real phase of the object when the structure of
the object is known, so as to obtain a more accurate and reliable
three-dimensional topography of the object. The above results provide
a new idea for the high-quality three-dimensional imaging of the
microfluidic system.