I have a series of images of droplet impacting on another droplet. The images are in RGB color and I converted to grayscale and binarizeid it. Now from the code (using 'ginput') given below I could calculate the pixel distance from end to end of the horizontal spreading part. But I have a series (50 images) of images where the spread length is changing continously. Hence I need to identify a ROI and from that calculate the spreading distance automatically. How do I do so? Does 'ginput' give the pixel distance accurately after pointing and clicking on the two extremeties of white zone in the binary image?
clc;clear;folder = 'C:\Users\Pragyan\Documents\MATLAB\Image processing';baseFileName = '0.25_cmc_2mm_8_bit.jpg';fullFileName = fullfile(folder, baseFileName);[grayImage,map] = imread(fullFileName);%impixelinfo;
grayImage = rgb2gray(grayImage);imshow(grayImage,map)binaryImage = ~imbinarize(grayImage);imshow(binaryImage)[x y]=ginput(6);x=round(x);y=round(y);image_dist=sqrt((x(2)^2-x(1)^2)+y(2)^2-y(1)^2)
Best Answer