Yes, it is possible. Assuming that you have already segmented the image properly, you can fit a bounding rect to the analysed object and get its heght and width, which will be similar to the dimensions you have marked. This docs will get you started:
http://docs.opencv.org/2.4/doc/tutori...
http://docs.opencv.org/2.4/doc/tutori...
Another possibility is to find a pair of points in the segmented contour - one that has the least x coordinate and the other that has the highest x coordinate. Distance between these points if one of the dimensions you seek. Do the same for y coordinate and compare the distances to determine which is height and which is width.
You may also try fitting an ellipse to the segmented contour if all the objects are of a shape that is more or less oval. This may give better results as it's going to account for possible tilt:
http://docs.opencv.org/2.4/modules/im...
Of course these methods won't give you the exact results, but it seems to me that in this case it's not clear what an exact result is (I would say the width could be drawn in several other ways in this image unless I don't know something about the methodology) and every measurement is only an approximation and we are looking for the one that is acceptable.
Hi do u get any solution. I also facing same problem.