Used below lines of code for contour detection and its corresponding area calculation during printing the area all values are printed but while saving only last value got saved in CSV file
for cnt in contours:
M= cv2.moments(cnt)
#print(M)
if M["m00"] != 0:
cx = int(M["m10"] / M["m00"])
cy = int(M["m01"] / M["m00"])
else:
cx, cy = 0,0
center = (cx,cy)
area = cv2.contourArea(cnt)
#V1 = np.asarray(area)
print(area)
df = pd.DataFrame()
df['Area'] = area
df.to_csv("C:pfmdataframe_csvL501.csv")
See Question&Answers more detail:os