How to classify images depending on the shape of each image's object ?

조회 수: 9 (최근 30일)
Mohamed Elbeialy
Mohamed Elbeialy 2021년 4월 21일
댓글: Amit 2021년 6월 5일
  댓글 수: 6
Mohamed Elbeialy
Mohamed Elbeialy 2021년 4월 24일
5 classes of cars, flowers, buidlings, trees, dogs. The point is to classify them according to the shape of the object inside each image. Using max value of the image is just a hint. if you have another way to determine the shape of object, ues it .
Amit
Amit 2021년 6월 5일
Follow following steps,
  1. First of all you need to binarize the image and find edges of image using canny edge detection.
  2. Then you need use regionprops to extract various isolated regions in the image.
  3. You need to find centroid of regions.
  4. Then at various angles, you can find distance between centroid of region and point on edge of image.
  5. This makes your shape descriptors.
  6. You can compare these descriptors with descriptors of known share to categorize your query or unkown object.
This should work for you.
I have my IEEE paper published regarding above process, you can send request to me on, amit.kenjale@gmail.com, I will send you my IEEE paper where this process is explained in details with images showing intermediate results.

댓글을 달려면 로그인하십시오.

답변 (3개)

Mahesh Taparia
Mahesh Taparia 2021년 4월 24일
Hi
There is already an existing answer similar to this problem. You can refer this link for that.

Image Analyst
Image Analyst 2021년 4월 24일
Try the transfer learning example with CNN/AlexNet. There should be demos in the Deep Learning Toolbox.
  댓글 수: 30
Mohamed Elbeialy
Mohamed Elbeialy 2021년 4월 27일
Here it is. how to make sure that the network will detect all random shapes of all images inside the imageData store
Image Analyst
Image Analyst 2021년 4월 27일
To get a binary image mask of inside where you traced the outline:
binaryImage = grayImage < someValue;
You'd have to train (label) your training images all with the outline and with the class you know them to be (car, dog, etc.)

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2021년 4월 25일
imageInputLayer([227 227 3],"Name","data","Normalization","rescale-zero-one")
This will rescale each input image to have a maximum value of 1.
  댓글 수: 20
Mohamed Elbeialy
Mohamed Elbeialy 2021년 4월 27일
here it is, however, I stucked with (gTruth ) which does not allow me to insert all imageData store images [imds,blds] = objectDetectorTrainingData(gTruth)
Image Analyst
Image Analyst 2021년 4월 27일
You asked: "I do find the code for detecting object inside image, but I do not know how to apply to the whole imageDatastore." So, try this:
ds = imageDatastore('*.png')
numFiles = numel(ds.Files)
% Apply "code for detecting object inside image" to "the whole
% imageDatastore" - apply to every image in the image datastore.
for k = 1 : numFiles
thisFullFileName = ds.Files{k};
fprintf('Analyzing #%d of %d : "%s" ...\n', k, numFiles, thisFullFileName);
theImage = imread(thisFullFileName);
imshow(theImage);
[folder, baseFileNameNoExt, ext] = fileparts(thisFullFileName);
title(baseFileNameNoExt, 'Interpreter', 'none');
drawnow;
% Now give code to do something to analyze theImage...
% Put your existing code "for detecting object inside image" here:
end

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

태그

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by