I`m kind of new in OpenCV. I have a task to automate breast cage area calculation based on mouse x-ray. So now i only have o body contour.
Code i use
import cv2 as cv
img = cv.imread("sample.jpg")
gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
gray_gauss = cv.GaussianBlur(gray, (9, 9), 0)
ret, thresh = cv.threshold(gray_gauss, 130, 255, cv.THRESH_BINARY)
contours, _ = cv.findContours(thresh, cv.RETR_TREE, cv.CHAIN_APPROX_NONE)
cv.drawContours(img, contours, -1, (0, 255, 255), 2)
cv.imshow("thresh", thresh)
cv.imshow("main", img)
cv.waitKey(0)
cv.destroyAllWindows()
This is sample image mouse x-ray
The result i have enter image description here
Is any chance i can find only breast cage contour in this image?
If you want to go the tedious classic path, I would try finding rules step by step:
If you find that the quality of the input image is too low and even a human being has to guess the area or estimate its position by experience then you will have to define rules for guessing, too.
It's nearly impossible to find adequate rules from only one image and without human experience. This is why training a model with many examples and input from experts often is more reliable.