How to find out the best threshold to convert these images to binary?

3 ビュー (過去 30 日間)
Penny13
Penny13 2019 年 8 月 14 日
コメント済み: Penny13 2019 年 8 月 15 日
Hello,
I want to convert these attached images to binary, I have used imbiarize built-in function but the resulted images are not what they should be(either too white or too black, so they are not much the same as the RGB images). Are there other ways to get the optimum threshold?
Thank you

採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 8 月 14 日
Try following ones:
  1. If you are interetsted for greens to be segment, no need to go for binary, you can directly segment it for RGB image.
  2. If you used the inbuilt imbinirize function, you can change the threshold value on gray images, by defauly the value is 0.5
  3. If the 1,2 are not the solutions, apply the Global image threshold using Otsu's method graythresh(grayImage)
  4. If 1,2,3, fails, try histeq, then apply the above solutuons
From the sample attach images, I dont think there will bea any issue to perfectly binarize the images. Although, if you share the final objective from the images, it would be helpful to recomemned any specific approach.
Lets keep learning!
  2 件のコメント
Penny13
Penny13 2019 年 8 月 15 日
Thank you so much for your answer KALYAN, I tried adapthisteq and greythresh as follows:
ab1 = imread('./Few_Antibodies/11ccr3.jpg');
ab1_g = rgb2gray(ab1);
ab1_g_eq= adapthisteq(ab1_g);
ab1_br = imbinarize(ab1_g_eq,graythresh(ab1_g_eq));
and I got the resulted image, what do you think?
Actually, every image is a specific antibody and I want to binarize the image then assume that every binary image concludes several objects, so I need to find objects and using regionprops properties, define properties as seperate features of the objects, then using a classifier like SVM and the resulted features, I need to prove the for example ccr3 and pccr3 are from 2 different classes, Do you think that my overal approach is correct to classify images to two classes?
Penny13
Penny13 2019 年 8 月 15 日
The resulted image that I mentioned above is the attached image.

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by