MATLAB Answers

how to get a good threshold so i can calculate the length and width of that thin line using pixel

1 ビュー (過去 30 日間)
SAADIAH RUSLI 2018 年 12 月 13 日
コメント済み: Rahul punk 2019 年 3 月 1 日
original picture

  1 件のコメント

Jan 2019 年 2 月 15 日
Which "thin line"?! What does "using pixel" mean? The gray area contains a lot if details and is not sufficient for a serious measurement, in my opinion. A simple threshold will not be reliable, but you need a local increase of the contrast.

Sign in to comment.

回答 (1 件)

Rahul punk
Rahul punk 2019 年 2 月 15 日

  5 件のコメント

表示 2 件の古いコメント
Jan 2019 年 2 月 15 日
@Rahul punk: I cannot use your code on my PC due to some missing toolboxes and hardware devices. obj=videoinput('winvideo',1) requires a camera. Your function does not have a useful help section, therefore I do not get any idea about what the code should do. Therefore I cannot guess, how to use it. The description
"real time multiple particle to extracted bigger particle using microscope and pc camera to count particle and its size"
does not sound like your tool is useful to solve the question:
"get a good threshold so i can calculate the length and width of that thin line".
SAADIAH RUSLI 2019 年 2 月 15 日
Dear Rahul, thanks for you answer, however i got some difficulty here.
Does this mean i need to have a video instead of picture to be able to use this code ? Because for my case I only have data in .png format.
If this code can give me really ggod threshold, that would be enough for now, because you don't have any idea, how many trial and error have i done in order to get really good threshold.
And dear Jan, if you know, how to get a good contrast for this, please help, i even several nethod already, still got unsastisfied result.
Rahul punk
Rahul punk 2019 年 3 月 1 日
use this
% Read in a standard MATLAB demo image of coins (US nickles and dimes, which are 5 cent and 10 cent coins)
baseFileName = 'coins.png';
folder = fileparts(which(baseFileName)); % Determine where demo folder is (works with all versions).
fullFileName = fullfile(folder, baseFileName);
if ~exist(fullFileName, 'file')
% It doesn't exist in the current folder.
% Look on the search path.
if ~exist(baseFileName, 'file')
% It doesn't exist on the search path either.
% Alert user that we can't find the image.
warningMessage = sprintf('Error: the input image file\n%s\nwas not found.\nClick OK to exit the demo.', fullFileName);
fprintf(1, 'Finished running BlobsDemo.m.\n');
% Found it on the search path. Construct the file name.
fullFileName = baseFileName; % Note: don't prepend the folder.
% If we get here, we should have found the image file.
originalImage = imread(fullFileName);

Sign in to comment.




Translated by