Filter löschen
Filter löschen

Can I extract the ROIs into separate images for classification?

4 Ansichten (letzte 30 Tage)
If I use the ROI tool to generate a bunch of ROIs, is it possible to extract those ROIs into separate images? It seems to me that some classification schemes, like the example that use HOG features, require separate images. I have one image of a bunch of resistor symbols. Rather than taking a bunch of images, it'd be nice to be able to just extract them from the ROIs themselves.
  2 Kommentare
Cong Ba
Cong Ba am 31 Jul. 2017
Could you clarify which ROI tool you are using? I did something like this before and used a script to save those ROIs into separate images. The logic was just like I_ROI = I_original(...) and imwrite(I_ROI). But it seems you are using more advanced tools :/
Michael Cooper-Stachowsky
Michael Cooper-Stachowsky am 31 Jul. 2017
I'm using the "Training image labeller" tool. However, I think you might be on to something. If I can extract the ROIs (I think I can...) then I just imwrite? How did you generate the different file names?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Cong Ba
Cong Ba am 31 Jul. 2017
Bearbeitet: Cong Ba am 31 Jul. 2017
Try something like this: (assume you've got your ROIs as seperate matrices, I_ROI_1, I_ROI_2, etc. )
I{1} = I_ROI_1;
I{2} = I_ROI_2;
for i = 1:2
imwrite(I{i}, ['ROI_', num2str(i), '_', datestr(now,'mm-dd HH-MM'),'.jpg']);
end

Weitere Antworten (0)

Kategorien

Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by