我正在研究糖尿病性视网膜病变。该数据库包含看起来像这样的2D图像:
现在,我只想从图像中提取视网膜部分,以使最终图像看起来像这样:
我尝试了<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" rel="stylesheet" />
<div class="row tableInvoice" id="commonDvScroll">
<table class="table table-bordered" id="tableInvoice">
<thead>
<tr>
<th id="itemNameth" class="commanth">Item Name</th>
<th id="itemCodeth" class="commanth">Item Code</th>
<th id="unitQtyth" class="commanth">Unit Qty</th>
<th id="purRateth" class="commanth">Pur.Rate</th>
<th id="discPercentageth" class="commanth">Disc%</th>
<th id="discAmtth" class="commanth">Disc Amt</th>
<th id="gstPercentageth" class="commanth">Gst%</th>
<th id="gstAmtth" class="commanth">Gst Amt</th>
<th id="totalAmtth" class="commanth">Total Amount</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
和Canny
,但是失败了。有什么方法可以使用HoughCircles
或OpenCv
或scikit-image
提取该区域?
答案 0 :(得分:1)
由于前景非常明显,因此您可以使用简单的阈值找到它,然后使用regionprops获得所需的作物:
from skimage import io, color, filters, measure
image = io.imread('https://i.stack.imgur.com/kKBiU.jpg')
grayscale = color.rgb2gray(image)
foreground = (grayscale > filters.threshold_otsu(grayscale)).astype(int)
foreground_properties = measure.regionprops(foreground)[0]
cropped = image[foreground_properties.slice]