How extract data from image saved in fig format?

조회 수: 19 (최근 30일)
mosayyeb
mosayyeb 2014년 3월 3일
답변: mosayyeb 2014년 3월 3일
I saved my images as fig in matlab. How extract it's data now? I use gcf(get, but I can not find it,d date(maybe Cdata). what I have in variable editor are:
axesObjs.Alphamap, axesObjs.BeingDeleted, axesObjs.BusyAction, axesObjs.ButtonDownFcn, axesObjs.Children, axesObjs.Clipping, axesObjs.CloseRequestFcn, axesObjs.Color, axesObjs.Colormap, axesObjs.CreateFcn, axesObjs.CurrentAxes, axesObjs.CurrentCharacter, axesObjs.CurrentObject, axesObjs.CurrentPoint, axesObjs.DeleteFcn, axesObjs.DockControls, axesObjs.DoubleBuffer, axesObjs.FileName, axesObjs.FixedColors, axesObjs.HandleVisibility, axesObjs.HitTest, axesObjs.IntegerHandle, axesObjs.Interruptible, axesObjs.InvertHardcopy, axesObjs.KeyPressFcn, axesObjs.KeyReleaseFcn, axesObjs.MenuBar, axesObjs.MinColormap, axesObjs.Name, axesObjs.NextPlot, axesObjs.NumberTitle, axesObjs.PaperOrientation, axesObjs.PaperPosition, axesObjs.PaperPositionMode, axesObjs.PaperSize, axesObjs.PaperType, axesObjs.PaperUnits, axesObjs.Parent, axesObjs.Pointer, axesObjs.PointerShapeCData, axesObjs.PointerShapeHotSpot, axesObjs.Position, axesObjs.Renderer, axesObjs.RendererMode, axesObjs.Resize, axesObjs.ResizeFcn, axesObjs.Selected, axesObjs.SelectionHighlight, axesObjs.SelectionType, axesObjs.Tag, axesObjs.ToolBar, axesObjs.Type, axesObjs.UIContextMenu, axesObjs.Units, axesObjs.UserData, axesObjs.Visible, axesObjs.WindowButtonDownFcn, axesObjs.WindowButtonMotionFcn, axesObjs.WindowButtonUpFcn, axesObjs.WindowKeyPressFcn, axesObjs.WindowKeyReleaseFcn, axesObjs.WindowScrollWheelFcn, axesObjs.WindowStyle, axesObjs.WVisual, axesObjs.WVisualMode

채택된 답변

Walter Roberson
Walter Roberson 2014년 3월 3일
fig = openfig('FigFileName.fig', 'new', 'invisible');
imgs = findobj(fig, '-type', 'image');
thiscmap = get(fig, 'colormap');
for K = 1 : length(imgs)
thisimg = get(imgs(K), 'CData');
%now do something with it for illustration purposes
thisfilename = sprintf('extracted_image_%03d.jpg', K);
imwrite(thisimg, thiscmap, thisfilename);
end

추가 답변 (1개)

mosayyeb
mosayyeb 2014년 3월 3일
Thanks alot

Community Treasure Hunt

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

Start Hunting!

Translated by