Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


6 Pages<1234>»
Options
Go to last post Go to first unread
Offline Davide Carpi  
#21 Posted : 20 March 2016 12:26:22(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Alex, Good

before introducing multiple images I would suggest you to improve the code of the plugin. As for what I can see, LoadImage() is everywhere, that seems to me a waste of performances (especially for svg, psd, dxf, pdf, dwg files, where you have to read a lot of data and initialize it at any call); you should identify when the file must be accessed (when it is loaded the first time, on some specific actions, on evaluation?), everything else can be addressed using an internal resource (storing imageEo and/or the original resource in an global object)
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Alex M.  
#22 Posted : 20 March 2016 18:37:23(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
Im trying to set the width / height pramaters in the scg file by hand
Code:
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">


This code does not work and some iteration of it should. Any ideas?

Code:


using (FileStream streamSVG = new FileStream(loadFromPath, FileMode.Open, FileAccess.ReadWrite))
                    {
                        
                        XmlDocument svgFile = new XmlDocument();
                        svgFile.Load(streamSVG);
                        XmlElement svg = (XmlElement)svgFile.SelectSingleNode("//svg");
                        //if (!(svg.HasAttribute("viewbox") || svg.HasAttribute("viewBox") || svg.HasAttribute("Viewbox") || svg.HasAttribute("ViewBox")))
                        //{
                            svg.SetAttribute("width", "100%"); // Set to new value.
                            svg.SetAttribute("height", "100%"); // Set to new value.
                        //} 
                        svgFile.Save(streamSVG);
                    }

Edited by user 26 March 2016 22:36:02(UTC)  | Reason: Not specified

thanks 1 user thanked Alex M. for this useful post.
on 21/03/2016(UTC)
Offline Alex M.  
#23 Posted : 20 March 2016 18:48:23(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
Originally Posted by: RFreund Go to Quoted Post
Alex - Do you have an example(s) of how you typically use this plugin?

Thanks!


Use it all the time for:

1. Visually confirming and documenting correctness of excel_IO input output
2. Displaying part of excel sheet in SMath

For 1 and 2 you would benefit from "counter variable" formula kindly provided by Davide (to automate naming of excel screenshots)
http://en.smath.info/for...variable---function.aspx

3. Sketching. This is big. PDF is very good choice for this; here is workflow, you will need Bluebeam and Inkscape:

Method 1 (I use it 70% of the time):
- take a PDF from CAD team for further markup / sketching
- Bluebeam screen capture feature capures vector graphics (surprise!)
- insert image region, set its size on the page, select extension "PDF"
- double click to be opened in Bluebeam
- Insert copied vector graphics
- Markup, or save and open in Inkscape to edit vector graphics directly

Method 2 :

- insert image region, set its size on the page, select extension "PDF"
- double click
- markup in bluebeam - there is enough basic sketching tools for you not to need anything else

There are also supported CAD formats which you can use if you want..

Edited by user 20 March 2016 18:54:58(UTC)  | Reason: Not specified

Offline Alex M.  
#24 Posted : 20 March 2016 18:53:41(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
... max size to upload 5.859 MB
the file of this peanut 4.19MB

REFUSED !

Here is that peanut

Tea Pot.gif




Hi Jean, allow me to be frank here.

It is very clear that image region is not useful much to you. Myself, and at least a couple of other people use it all the time at work, i.e. it is not "dead in the water".

I would not benefit much from overlaying a tiny teapot over a tiny persian carpet. Unfortunately use of large files is limited by the speed of matrix operations in SMath when you have 10's of the in one document, and I do.

Can we just leave it at that? This plugin is useful for some but not all..
thanks 1 user thanked Alex M. for this useful post.
on 20/03/2016(UTC)
Offline Alex M.  
#25 Posted : 20 March 2016 18:58:25(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
Originally Posted by: Davide Carpi Go to Quoted Post
Alex, Good

before introducing multiple images I would suggest you to improve the code of the plugin. As for what I can see, LoadImage() is everywhere, that seems to me a waste of performances (especially for svg, psd, dxf, pdf, dwg files, where you have to read a lot of data and initialize it at any call); you should identify when the file must be accessed (when it is loaded the first time, on some specific actions, on evaluation?), everything else can be addressed using an internal resource (storing imageEo and/or the original resource in an global object)


I agree that some cleanup could be useful.. To be fair though, once LoadImage() is called, it will not reload it again till the image was changed (there is a Boolean flag for that).

So abundance of LoadImage() calls does not slow down the worksheet after initial loading.

thanks 1 user thanked Alex M. for this useful post.
on 21/03/2016(UTC)
Offline RFreund  
#26 Posted : 20 March 2016 23:52:49(UTC)
RFreund


Rank: Advanced Member

Groups: Registered
Joined: 25/09/2013(UTC)
Posts: 325
United States
Location: IL

Was thanked: 19 time(s) in 17 post(s)
Alex,

Thanks for the explaining that. I can see this being useful for including sketches in our calculation reports.

I can't remember - do you do structural engineering?

However I'm trying to understand the difference here - I could just make a sketch then take a screen shot and paste it into the calculation. It seems that with your plugin the sketch would be permanently linked to the smath sheet. So if I opened up the pdf with some editing software, made changes or added markups, this would then update in Smath. This is the general benefit, right?

Thanks again!
Offline Alex M.  
#27 Posted : 21 March 2016 00:02:11(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
Originally Posted by: RFreund Go to Quoted Post
Alex,

Thanks for the explaining that. I can see this being useful for including sketches in our calculation reports.

I can't remember - do you do structural engineering?

However I'm trying to understand the difference here - I could just make a sketch then take a screen shot and paste it into the calculation. It seems that with your plugin the sketch would be permanently linked to the smath sheet. So if I opened up the pdf with some editing software, made changes or added markups, this would then update in Smath. This is the general benefit, right?

Thanks again!


That's the idea, the sketch file is saved within SMath workbook so you can edit it in future by double clicking. Works great for making changes to sketches you created.

You could of course take a new screenshot every time you make an edit. And keep track of the sketch files your are inserting into workbook.

Edited by user 21 March 2016 00:05:15(UTC)  | Reason: Not specified

Offline Alex M.  
#28 Posted : 26 March 2016 22:37:05(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
Still working on DISLIN botched SVG file, need to edit it to workable form.

I'm trying to set the width / height pramaters in the scg file by hand
Code:
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">


This code does not work and some iteration of it should. Any ideas?

Code:


using (FileStream streamSVG = new FileStream(loadFromPath, FileMode.Open, FileAccess.ReadWrite))
                    {
                        
                        XmlDocument svgFile = new XmlDocument();
                        svgFile.Load(streamSVG);
                        XmlElement svg = (XmlElement)svgFile.SelectSingleNode("//svg");
                        //if (!(svg.HasAttribute("viewbox") || svg.HasAttribute("viewBox") || svg.HasAttribute("Viewbox") || svg.HasAttribute("ViewBox")))
                        //{
                            svg.SetAttribute("width", "100%"); // Set to new value.
                            svg.SetAttribute("height", "100%"); // Set to new value.
                        //} 
                        svgFile.Save(streamSVG);
                    }



The exception is caught @ "setattribute"
"Object reference not set to an instance of an object."

Edited by user 26 March 2016 22:56:40(UTC)  | Reason: Not specified

Offline Alex M.  
#29 Posted : 27 March 2016 19:05:54(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
This code successfully sets width & height to 100% if there is no viewbox (to fix the DISLIN svg) for ALL svg files but the one generated by DISLIN. It seems that the code hangs (literally) when trying to load DISLIN svg as a XML document. All other .svg files are loaded as XML document OK...



Code:
if (Path.GetExtension(loadFromPath).Equals(".svg") || Path.GetExtension(loadFromPath).Equals(".svgz"))
            {
                try
                {
                    using (FileStream streamSVG = new FileStream(loadFromPath, FileMode.Open, FileAccess.ReadWrite))
                    {

                        XmlDocument svgFile = new XmlDocument();
                        svgFile.Load(streamSVG);
                        streamSVG.SetLength(0);
                        //XmlElement svg = (XmlElement)svgFile.SelectSingleNode("//svg");
                        XmlElement svg = svgFile.DocumentElement;
                        if (!(svg.HasAttribute("viewbox") || svg.HasAttribute("viewBox") || svg.HasAttribute("Viewbox") || svg.HasAttribute("ViewBox")))
                        {
                            svg.SetAttribute("width", "100%"); // Set to new value.
                            svg.SetAttribute("height", "100%"); // Set to new value.
                        }


                        //svgFile.DocumentElement.SetAttribute("width", "100%");
                        //svgFile.DocumentElement.SetAttribute("height", "100%");

                        svgFile.Save(streamSVG);

                        streamSVG.Close();
                    }
                    var SVGdoc = SvgDocument.Open(loadFromPath);
                    if (!(SVGdoc.OwnerDocument.ViewBox.Width == 0 || SVGdoc.OwnerDocument.ViewBox.Height == 0))
                    {
                        //SVGdoc.OwnerDocument.ViewBox = new SvgViewBox(0, 0, SVGdoc.Width, SVGdoc.Height);
                        // SVGdoc.ViewBox = new SvgViewBox(0, 0, baseWidth, baseHeight);
                        if (select_rotation == "90°" || select_rotation == "270°")
                        {
                            SVGdoc.Height = Size.Width;
                            SVGdoc.Width = Size.Height;
                        }
                        else
                        {
                            SVGdoc.Height = Size.Height;
                            SVGdoc.Width = Size.Width;
                        }
                        OLDheight = Convert.ToInt32(SVGdoc.OwnerDocument.ViewBox.Height);
                        OLDwidht = Convert.ToInt32(SVGdoc.OwnerDocument.ViewBox.Width);
                    }
                   
                    using (MemoryStream stream = new MemoryStream())
                    {
                        SVGdoc.Draw().Save(stream, System.Drawing.Imaging.ImageFormat.Png);
                        loadedImage = System.Drawing.Image.FromStream(stream);
                        imageWasChanged = false;
                        imageXml = System.Drawing.Image.FromStream(stream);
                    }
                    rotateImage(loadedImage, select_rotation);
                }
                catch
                {
                }
            }
Offline Alex M.  
#30 Posted : 27 March 2016 20:20:41(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
I figured out why I cannot load DISLIN generated .svg as an XML document. Its the presence of this within the .svg:
Code:
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
  "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">

What is the quickest way to remove it from file before loading it as XML?

Once done, I could complete the fix for DISLIN .svg files.

Note that resulting svg file will be zoomable within SMath, but reset to original size will not work since the actual size of the plot is not present within .svg by DISLIN

Edited by user 29 March 2016 01:04:32(UTC)  | Reason: Not specified

Offline Alex M.  
#31 Posted : 29 March 2016 01:06:09(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
If I modify / remove the offending line by hand (edit the .svg file) it works. If I do it using the following code, it seems like it works but it doesn't... (xml reader cannot file the root element <svg>Wink

Code:


if (Path.GetExtension(loadFromPath).Equals(".svg") || Path.GetExtension(loadFromPath).Equals(".svgz"))
            {
                try
                {
                    //...modify svg file if necessary
                    using (FileStream streamSVG = new FileStream(loadFromPath, FileMode.Open, FileAccess.ReadWrite))
                    {
                        //...change the string in a file...not used
                        StreamReader readerSVG = new StreamReader(streamSVG);
                        string stringSVG = readerSVG.ReadToEnd();
                        if (stringSVG.Contains("<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 20010904//EN\""))
                            stringSVG = stringSVG.Replace("<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 20010904//EN\"", "");
                        if (stringSVG.Contains("\"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\">"))
                            stringSVG = stringSVG.Replace("\"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\">", "");
                        byte[] arraySVG = Encoding.ASCII.GetBytes(stringSVG);
                        streamSVG.SetLength(0);
                        streamSVG.Write(arraySVG, 0, arraySVG.Length); 
                        //...done...change the string in a file...not used
                        //...edit XML if necessary
                        XmlDocument svgFile = new XmlDocument();
                        svgFile.Load(streamSVG);
                        streamSVG.SetLength(0);
                        //-this line was not used- did not work - XmlElement svg = (XmlElement)svgFile.SelectSingleNode("//svg");
                        XmlElement svg = svgFile.DocumentElement;
                        if (!(svg.HasAttribute("viewbox") || svg.HasAttribute("viewBox") || svg.HasAttribute("Viewbox") || svg.HasAttribute("ViewBox")))
                        {
                            double d;
                            if (double.TryParse(svg.GetAttribute("width"), out d) && double.TryParse(svg.GetAttribute("height"), out d))
                            {
                                OLDheight = Convert.ToInt32(svg.GetAttribute("height"));
                                OLDwidht = Convert.ToInt32(svg.GetAttribute("width"));
                            }                            
                            svg.SetAttribute("width", "100%"); // Set to new value.
                            svg.SetAttribute("height", "100%"); // Set to new value.
                        }
                        //...done...edit XML if necessary

                        svgFile.Save(streamSVG);

                        streamSVG.Close();
                    }
                    //...done...modify svg file if necessary
                    var SVGdoc = SvgDocument.Open(loadFromPath);
                    if (SVGdoc.OwnerDocument.ViewBox.Width == 0 || SVGdoc.OwnerDocument.ViewBox.Height == 0)
                    {
                        SVGdoc.OwnerDocument.ViewBox = new SvgViewBox(0, 0, Convert.ToInt32(SVGdoc.OwnerDocument.GetDimensions().Width), Convert.ToInt32(SVGdoc.OwnerDocument.GetDimensions().Height));
                        SVGdoc.Height = Convert.ToInt32(SVGdoc.OwnerDocument.GetDimensions().Height);
                        SVGdoc.Width = Convert.ToInt32(SVGdoc.OwnerDocument.GetDimensions().Width);
                    }
                    if (select_rotation == "90°" || select_rotation == "270°")
                    {
                        SVGdoc.Height = Size.Width;
                        SVGdoc.Width = Size.Height;
                    }
                    else
                    {
                        SVGdoc.Height = Size.Height;
                        SVGdoc.Width = Size.Width;
                    }
                    OLDheight = Convert.ToInt32(SVGdoc.OwnerDocument.ViewBox.Height);
                    OLDwidht = Convert.ToInt32(SVGdoc.OwnerDocument.ViewBox.Width);
                    using (MemoryStream stream = new MemoryStream())
                    {
                        SVGdoc.Draw().Save(stream, System.Drawing.Imaging.ImageFormat.Png);
                        loadedImage = System.Drawing.Image.FromStream(stream);
                        imageWasChanged = false;
                        imageXml = System.Drawing.Image.FromStream(stream);
                    }
                    rotateImage(loadedImage, select_rotation);                    
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }

Offline Davide Carpi  
#32 Posted : 29 March 2016 01:58:29(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Originally Posted by: Alex.M Go to Quoted Post
I figured out why I cannot load DISLIN generated .svg as an XML document. Its the presence of this within the .svg:
Code:
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
  "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">

What is the quickest way to remove it from file before loading it as XML?

Once done, I could complete the fix for DISLIN .svg files.

Note that resulting svg file will be zoomable within SMath, but reset to original size will not work since the actual size of the plot is not present within .svg by DISLIN

I may be wrong but I guess this is because XmlDocument attempts to download the DTD

Instead of edit/removing the DOCTYPE, you can try using:

Code:
XmlDocument svgFile = new XmlDocument();
svgFile.XmlResolver = null;

Edited by user 29 March 2016 02:00:45(UTC)  | Reason: Not specified

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Alex M.  
#33 Posted : 29 March 2016 06:23:36(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
After many-many attempts (I have literally spent good 6 hours to fix display of DISLIN svg) I have found the "correct" way of fixing the missing viewport parameter.

Plugin was updated.

Code:


if (SVGdoc.OwnerDocument.ViewBox.Width == 0 || SVGdoc.OwnerDocument.ViewBox.Height == 0)
                    {
                        SVGdoc.Height = 1;
                        SVGdoc.Width = 1;
                        SVGdoc.Height = SVGdoc.Height.ToPercentage();
                        SVGdoc.Width = SVGdoc.Width.ToPercentage();

                        SVGdoc.OwnerDocument.ViewBox = new SvgViewBox(SVGdoc.OwnerDocument.Bounds.Left, SVGdoc.OwnerDocument.Bounds.Top, Convert.ToInt32(SVGdoc.OwnerDocument.GetDimensions().Width), Convert.ToInt32(SVGdoc.OwnerDocument.GetDimensions().Height));
                        SVGdoc.Height = Convert.ToInt32(SVGdoc.OwnerDocument.GetDimensions().Height);
                        SVGdoc.Width = Convert.ToInt32(SVGdoc.OwnerDocument.GetDimensions().Width);
                    }


Seems like an extremely simple piece of code now... Doesn't it always.
thanks 2 users thanked Alex M. for this useful post.
on 29/03/2016(UTC),  on 29/03/2016(UTC)
Offline Alex M.  
#34 Posted : 29 March 2016 07:49:21(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
Originally Posted by: Davide Carpi Go to Quoted Post
Alex, Good

before introducing multiple images I would suggest you to improve the code of the plugin. As for what I can see, LoadImage() is everywhere, that seems to me a waste of performances (especially for svg, psd, dxf, pdf, dwg files, where you have to read a lot of data and initialize it at any call); you should identify when the file must be accessed (when it is loaded the first time, on some specific actions, on evaluation?), everything else can be addressed using an internal resource (storing imageEo and/or the original resource in an global object)


Davide, I made an attempt to clean up function calls.

Would love to hear your comments / suggestions if any.

Thanks
Offline mikekaganski  
#35 Posted : 17 April 2016 07:20:04(UTC)
mikekaganski


Rank: Advanced Member

Groups: Registered
Joined: 17/01/2013(UTC)
Posts: 296
Man
Russian Federation
Location: Khabarovsk, Russia

Was thanked: 151 time(s) in 107 post(s)
Please excuse me if this has been discussed already.
Is it possible to extend the plugin to accept matrices of 3(4)-numbers matrices (vectors/rows), where members are R, G, B (and optional Alpha)? And maybe functions to read to this structure / write it to image?

Or alternatively, a system of 3(4) usual matrices with corresponding values?

Edited by user 17 April 2016 07:41:56(UTC)  | Reason: Not specified

Best regards,
Mike Kaganski
Offline Alex M.  
#36 Posted : 17 April 2016 08:22:05(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
Originally Posted by: mikekaganski Go to Quoted Post
Please excuse me if this has been discussed already.
Is it possible to extend the plugin to accept matrices of 3(4)-numbers matrices (vectors/rows), where members are R, G, B (and optional Alpha)? And maybe functions to read to this structure / write it to image?

Or alternatively, a system of 3(4) usual matrices with corresponding values?


Mike, I am somewhat busy this weekend, but I will look into this mid week or next weekend. It would greatly simplify my task if you were to find a C# guide that talks about converting numerical matrices to color image.

Alex
thanks 1 user thanked Alex M. for this useful post.
on 17/04/2016(UTC)
Offline mikekaganski  
#37 Posted : 17 April 2016 09:01:59(UTC)
mikekaganski


Rank: Advanced Member

Groups: Registered
Joined: 17/01/2013(UTC)
Posts: 296
Man
Russian Federation
Location: Khabarovsk, Russia

Was thanked: 151 time(s) in 107 post(s)
Originally Posted by: Alex.M Go to Quoted Post
Mike, I am somewhat busy this weekend, but I will look into this mid week or next weekend. It would greatly simplify my task if you were to find a C# guide that talks about converting numerical matrices to color image.


Thank you very much!
I'm not quite sure I understand what information do you mean.
I suppose that the place to change is lines starting from 349 in ImageRegion.cs (public method void ImageRegion.OnEvaluation(SMath.Math.Store store) - where it processes matrix). If you will support systems, then third choice would likely be required - "else if (obj is SMath.Math.Numeric.TSystem)" (I suppose the name is TSystem).

Lines 381-392 assign same (gray) values to R, G and B channels. I suppose, here the current mode should be kept if our matrix contains numbers, otherwise if its contents in this position is another matrix of length 3 (4), then assign R, G and B to individual channels. To do so, line 383 should change from unconditionally getting byte value, to a code that checks what is there at matrix.unit[y, x].obj, and if it is SMath.Math.Numeric.TMatrix, then extract its 3 members, otherwise go old way.

Here I see a method to set alpha channel; maybe it's good to always use alpha channel, and set it always to 0 unless it's present in the pixel?

EDIT: generating and manipulation separate R, G, B and Alpha matrices is much more efficient than matrices of matrices, so if you decide to implement this request, then please allow second variant, too (I mean system of 3(4) separate matrices).

Edited by user 17 April 2016 12:27:11(UTC)  | Reason: Not specified

Best regards,
Mike Kaganski
Offline Jean Giraud  
#38 Posted : 17 April 2016 17:07:11(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: Alex.M Go to Quoted Post
Please excuse me if this has been discussed already.
Is it possible to extend the plugin to accept matrices of 3(4)-numbers matrices (vectors/rows), where members are R, G, B (and optional Alpha)? And maybe functions to read to this structure / write it to image?


In other words, you are asking for an RGB image region, something like the Mathcad
"Picture Operator". I found no independent tool from the web that would do same.
The Mthcad "PicOp" allows lot of useful manipulations: various color scheme, extract selected region from the image... Are you familiar with the Mathcad "PicOp" ?

That's all what I understand from Smath 5346

Forum Image COLOR.gif

Offline mikekaganski  
#39 Posted : 17 April 2016 17:20:01(UTC)
mikekaganski


Rank: Advanced Member

Groups: Registered
Joined: 17/01/2013(UTC)
Posts: 296
Man
Russian Federation
Location: Khabarovsk, Russia

Was thanked: 151 time(s) in 107 post(s)
Yes, Jean, I was asking for this Good And exactly because of your Ventouri rotation task Good - I wanted to see it rotated coloured.
Best regards,
Mike Kaganski
Offline Jean Giraud  
#40 Posted : 17 April 2016 17:23:55(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
In short: Smath Image region does not read color image, it "Imports" [nuance].
Once in work sheet, "Image region" does 0 processing by itself.
From external user processing, you can:
1. replace part of image
2. zoom Fourier small image [zoom up 2]
3. vetorise for light intensity.
4. mirror image, rotate +/- 90° by matrix manipulation
5. scale overal image to user grayscale.
6. what else ... extract band valued pixels, specific valued [locate]
7. more specific vetorise to highlight contour region.
..... Jean
Users browsing this topic
Guest
6 Pages<1234>»
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.