Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

Divide an image iteratively

2 views (last 30 days)
NC
NC on 30 Jun 2018
Closed: MATLAB Answer Bot on 20 Aug 2021
The images are classified as resampled or not by the SVM. If the label of the classifed image is resampled which is one I want to divide the image again and apply the SVM until the exact location of resampling is found and draw a rectangle around the resampled area. My code for saved SVM classifier and main script is given below and the other coddes are attched. How to do this ?
function label = classifyImages(f1,f2,f3,f4)
load ImageFeaturesPredict.csv
t = ImageFeaturesPredict(1:end,:);
CompactMdl = loadCompactModel('SVMImageData');
label = predict(CompactMdl,t);
if label==0
fprintf('Non-Resampled');
end
if label==1
fprintf('Resampled');
end
end
mainScript.m
close all;
clear all;
clc;
%img = imread('Original\ucid\ucid00101.tif');
%img = imread('Original\ucid\ucid00099.tif');
img = imread('Original\ucid\ImageDataSet\ucid00426.tif');
img = rgb2gray(img);
img = double(img);
[f1,f3,f4,f5] = extractFeaturesFunctionNew(img);
label = classifyImages()
if true
% code
end if (label==1)
disp('This is a resampled image');
%resampled location finder
resamplelocator(img);
else
disp('This image is not resampled');
end
if true
% code
end
  1 Comment
Image Analyst
Image Analyst on 30 Jun 2018
Unfortunately it seems you forgot to attach your tif images, so no one is likely to do anything until you do.

Answers (0)

This question is closed.

Community Treasure Hunt

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

Start Hunting!