How extract data from image saved in fig format?

23 visualizaciones (últimos 30 días)
mosayyeb
mosayyeb el 3 de Mzo. de 2014
Respondida: mosayyeb el 3 de Mzo. de 2014
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

Respuesta aceptada

Walter Roberson
Walter Roberson el 3 de Mzo. de 2014
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

Más respuestas (1)

mosayyeb
mosayyeb el 3 de Mzo. de 2014
Thanks alot

Categorías

Más información sobre Image Data Workflows en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by