Editable Image Region - Plugin Update

Editable Image Region - Plugin Update - Messages

#41 Posted: 4/17/2016 11:31:46 AM
Mike Kaganski

Mike Kaganski

184 likes in 434 posts.

Group: User

Oh, you play Captain Obvious again. I clearly understand the plugin purpose, and my request is quite clearly formulated, plugin's maintainer understands it. Please don't make it difficult to track this request by irrelevant info.
С уважением, Михаил Каганский
#42 Posted: 4/17/2016 11:34:31 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

Yes, Jean, I was asking for this And exactly because of your Venturi rotation task - I wanted to see it rotated coloured.



It can't rotate RGB for two reasons:
1. It does not rotate the grayscale from your suggestions
2. Smath does not have an RGB picture operator [something like Mathcad].


Frustration.gif

#43 Posted: 4/17/2016 11:41:17 AM
Mike Kaganski

Mike Kaganski

184 likes in 434 posts.

Group: User

Wrote

Wrote

Yes, Jean, I was asking for this And exactly because of your Venturi rotation task - I wanted to see it rotated coloured.



It can't rotate RGB for two reasons:
1. It does not rotate the grayscale from your suggestions
2. Smath does not have an RGB picture operator [something like Mathcad].


Frustration.gif



I rotate it using the algorithm you provided (and I fixed - see that topic). I only cannot see that already rotated matrix colored!
С уважением, Михаил Каганский
#44 Posted: 4/17/2016 2:09:32 PM
frapuano

frapuano

13 likes in 115 posts.

Group: User

Mike,

do not give up ..even if ... it is very hard.

Best Regards

Franco
#45 Posted: 4/17/2016 2:12:27 PM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: Moderator

Mike, Jean,

Can you decide on input format for and RGB? Matrix, system, etc...

RGB should not be too hard to implement, just a matter of finding some 4 hours of my time... Alpha is not as straightforward. Do we need alpha?
#46 Posted: 4/17/2016 7:01:18 PM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

Wrote

Mike, Jean,

Can you decide on input format for and RGB? Matrix, system, etc...

RGB should not be too hard to implement, just a matter of finding some 4 hours of my time... Alpha is not as straightforward. Do we need alpha?



Alex, you can setup easily different base schemes and parse each color channel with a function aside (then you have to check if the 3 dimensions are equal); alpha channel can be an optional 4th argument (maybe you can loot at PieChartRegion to see how to allow different schemes).

2016-04-17 23_58_41-SMath Studio Desktop - [Page1_].png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#47 Posted: 4/17/2016 7:36:50 PM
Mike Kaganski

Mike Kaganski

184 likes in 434 posts.

Group: User

Wrote

Can you decide on input format for and RGB? Matrix, system, etc...


I vote for system.
Matrix of 3(4)-element vectors should be easiest to implement, but creating it takes considerably longer, and managing it is less convenient.
Actually, system looks more natural in SMath If you would implement matrix of vectors, then please just in addition to system.

Mathcad seems to have another option - packed matrix that has its height equal to image height, and its width 3x image width, its first 1/3 cols being R, after that go 1/3 cols of G, and last are B. But I dislike that route, because then it's unclear when it's gray bitmap of triple width, and when it's RGB packed matrix.

Using matrix of 24-bit numbers isn't good, too, because it won't be easy and robust to tell 24(32)-bit from 8-bit. It's possible for an image to have only one color, so that it would be falsely treated as 8-bit.

Another option is 3(4)-element vector of matrices. I don't see much advantage in this compared to system.

Generalizing, one can think of more complex schemas: system of separate images where each image has own dimensions and position, thus creating patchwork.

But you know, my imagination is inflamed from sleepless night. Please scrap all this and do what you feel like.

Quote

RGB should not be too hard to implement, just a matter of finding some 4 hours of my time... Alpha is not as straightforward. Do we need alpha?


Personally I don't really need Alpha, and only wanted it for completeness.
But I don't see why it's not straightforward. At the link above that discusses it, I see that the only requirement for it is creating not PixelFormat.Format32bppRgb, but PixelFormat.Format32bppArgb, and then each pixel is defined with not 3, but 4 bytes (B,G,R,Alpha). So, I think, that if you simply detect that input is system, then check if it contains exactly 3 or 4 matrices, that all of them are same size, and then if 3, then create PixelFormat.Format32bppRgb and do 3-byte processing (like it is now for ordinary matrices), and if 4, then create PixelFormat.Format32bppArgb and do 4-byte.

Anyway, if you feel like it's overkill, then please skip it!
С уважением, Михаил Каганский
#48 Posted: 4/17/2016 7:53:42 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

Mike, Jean,

Can you decide on input format for and RGB? Matrix, system, etc...

RGB should not be too hard to implement, just a matter of finding some 4 hours of my time... Alpha is not as straightforward. Do we need alpha?



Alex,

The RGB image is a matrix of the side by side R,G,B.
In other word: RGB:=augment( R,G,B )

Image READ COLOR.sm (72 KiB) downloaded 65 time(s).
#49 Posted: 4/17/2016 8:03:17 PM
Mike Kaganski

Mike Kaganski

184 likes in 434 posts.

Group: User

Wrote

The RGB image is a matrix of the side by side R,G,B.
In other word: RGB:=augment(R,G,B )



That's what Mathcad uses. But I commented about that.
To support Mathcad-style packed matrices, I suggest providing a function like
RGB(PackedMatrix)
that takes Mathcad-style augmented RGB matrix, and returns a structure (e.g. system) that would be supported by the extension.
С уважением, Михаил Каганский
#50 Posted: 4/18/2016 1:20:51 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

That's what Mathcad uses. But I commented about that.
To support Mathcad-style packed matrices, I suggest providing a function like
RGB(PackedMatrix)
that takes Mathcad-style augmented RGB matrix, and returns a structure (e.g. system) that would be supported by the extension.



I think Mike, we are saying the same thing in different words.
Smath opens RGB in the same style as Mathcad. Smath does not
have a picture operator to resitute back the color channels.
The only things you can do in Smath is minimal processing on
each channel and restore back on the NTSC. That does not do much
useful, or exploitable.

Most interesting, cheers, Jean

PS: you don't shake hands every week end with Andrey
8761 km apart. A cyclo tour around Russia is quite a trip !

#51 Posted: 4/18/2016 2:59:43 AM
Вячеслав Мезенцев

Вячеслав Мезенцев

1402 likes in 1708 posts.

Group: Moderator

I want to remind you that we already have a function READRGB() which uses Mathcad style.

Wrote

Smath opens RGB in the same style as Mathcad


This is MathcadFileAccess plugin opens.
Russia ☭ forever, Viacheslav N. Mezentsev
1 users liked this post
Mike Kaganski 4/18/2016 6:40:00 AM
#52 Posted: 4/19/2016 9:52:58 PM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: Moderator

I am getting pretty close to posting an update with RGBA functionality.

I will need a little bit of your wisdom, Davide.

I added some new references to the .csproj file on my computer, and I had issues in the past editing the .csproj file in the SVN repo correctly. In fact I had many attempts at properly referencing the SMath libraries with no success (I still have static ioman.dll etc. instead). Could you show me how to do the following:

1. Add new references to the SVN by hand
2. Correctly reference the Smath Libraries in the .csproj file

I am attaching the local copy of the file here ImageEdit.csproj_.txt (6 KiB) downloaded 54 time(s).. Corresponding file from the SVN repo:
https://smath.info/svn/public/plugins/ImageEditRegion/
#53 Posted: 4/20/2016 5:27:59 AM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

Alex,

You can add the following lines of code in your *.csproj and then upload it with the project; you have just to compile in "Debug" mode for testing in local, the "Relase" mode will be used automatically by the Relase Manager. In this way you don't have to deal with the project file anymore (except in rare cases, f.e. if you want to add unmanaged code libraries)

  <PropertyGroup>
    <!-- Relase -> SMath Relase Manager -->
    <SMathDir Condition=" '$(SMathDir)' == '' AND '$(Configuration)' == 'Relase' ">..\..\..\Main\SMathStudio\canvas\bin\Debug</SMathDir>
    <!-- Debug -> local use -->
    <SMathDir Condition=" '$(SMathDir)' == '' AND '$(Configuration)' == 'Debug' ">C:\Program Files (x86)\SMath Studio</SMathDir>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <StartAction>Program</StartAction>
    <StartProgram>$(SMathDir)\SMathStudio_Desktop.exe</StartProgram>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="SMath.Controls">
      <HintPath>$(SMathDir)\SMath.Controls.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="SMath.Manager">
      <HintPath>$(SMathDir)\SMath.Manager.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="SMath.Math.Numeric">
      <HintPath>$(SMathDir)\SMath.Math.Numeric.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="SMath.Math.Symbolic">
      <HintPath>$(SMathDir)\SMath.Math.Symbolic.dll</HintPath>
      <Private>False</Private>
    </Reference>

ImageEdit.7z (1 KiB) downloaded 53 time(s).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#54 Posted: 4/20/2016 10:34:53 AM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: Moderator

Wrote

Alex,

You can add the following lines of code in your *.csproj and then upload it with the project; you have just to compile in "Debug" mode for testing in local, the "Relase" mode will be used automatically by the Relase Manager. In this way you don't have to deal with the project file anymore (except in rare cases, f.e. if you want to add unmanaged code libraries)

  <PropertyGroup>
    <!-- Relase -> SMath Relase Manager -->
    <SMathDir Condition=" '$(SMathDir)' == '' AND '$(Configuration)' == 'Relase' ">..\..\..\Main\SMathStudio\canvas\bin\Debug</SMathDir>
    <!-- Debug -> local use -->
    <SMathDir Condition=" '$(SMathDir)' == '' AND '$(Configuration)' == 'Debug' ">C:\Program Files (x86)\SMath Studio</SMathDir>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <StartAction>Program</StartAction>
    <StartProgram>$(SMathDir)\SMathStudio_Desktop.exe</StartProgram>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="SMath.Controls">
      <HintPath>$(SMathDir)\SMath.Controls.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="SMath.Manager">
      <HintPath>$(SMathDir)\SMath.Manager.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="SMath.Math.Numeric">
      <HintPath>$(SMathDir)\SMath.Math.Numeric.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="SMath.Math.Symbolic">
      <HintPath>$(SMathDir)\SMath.Math.Symbolic.dll</HintPath>
      <Private>False</Private>
    </Reference>

ImageEdit.7z (1 KiB) downloaded 53 time(s).



This works! Now, since I use the latest reference, I get this warning:
Warning 3 'SMath.Math.Decision.Preprocessing(SMath.Manager.Term[], ref SMath.Math.Store)' is obsolete: 'Use Entry instead of Term[]'
for
var out1 = Decision.Preprocessing(Terms, ref store);


Everything builds though on the local computer

In the release manager I get an error, here is the log for the updated .csproj file in SVN
report.log.txt (45 KiB) downloaded 53 time(s).
#55 Posted: 4/20/2016 12:21:21 PM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

Wrote

This works! Now, since I use the latest reference, I get this warning:
Warning 3 'SMath.Math.Decision.Preprocessing(SMath.Manager.Term[], ref SMath.Math.Store)' is obsolete: 'Use Entry instead of Term[]'
for
var out1 = Decision.Preprocessing(Terms, ref store);


This is because since SS 0.98 Andrey has changed the core:
Wrote

SMath Studio was completely switched from Term[] to Entry. Entry is a new way to store equations in SMath Studio. To allow plug-ins to work with new objects in more efficient manner new interface was introduced: IPluginLowLevelEvaluationFast.
But it is not required to update all your plug-ins to use new interface asap (f.e. built-in SpecialFunctions currently uses both interfaces: old and new). New interface is much better for implementing functions like "for", "while", "line", "if", etc.

Yes, IPluginLowLevelEvaluation a bit slower then IPluginLowLevelEvaluationFast just because we have to convert data from Entry to Term[] and back to proceed, but in most cases it is not a show stopper.


The warning shows the new way (not an error, as for now).

Wrote

In the release manager I get an error, here is the log for the updated .csproj file in SVN


I've updated the ImageEditRegion folder in the SVN:
- removed bin and obj folders (you can add these windows folders to the ignore list, so you can avoid to commit them unintentionally);

Show Spoiler


- fixed the *.csproj header: ToolsVersion "10.0" -> "4.0";
- RequestForEvaluation() updated to RequestEvaluation();
- removed references to the SS executable not driven by $(SMathDir);
- removed *.suo file, updated the project GUID in *.csproj, *.sln (not sure it is relevant, however seems more consistent);

I can run it successfully in Visual Studio 2015, SharpDevelop and the RelaseManager
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#56 Posted: 4/20/2016 12:40:52 PM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: Moderator

Davide, the tweaks you made still do not allow me to build the plugin using
http://smath.info/ReleaseManager/
(same errors as in previous log)



Are you saying it works for you? Is it something to contact Andrey about?

Of course I can switch back to using old .dll's but it is not the right way going forward... Also how do I use Entry instead of Term? Will it make working with RGBA matrix faster?

Thanks
#57 Posted: 4/20/2016 12:49:06 PM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

I confirm it works for me... which is the target version you are using?

2016-04-20 17_47_21-SMath Release Manager.png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#58 Posted: 4/20/2016 12:56:00 PM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: Moderator

Wrote

I confirm it works for me... which is the target version you are using?

2016-04-20 17_47_21-SMath Release Manager.png



Fails for me

RMerr.png
report.log.txt (38 KiB) downloaded 48 time(s).

Time to contact Andrey.

Also what is you comment on this?


Quote

Also how do I use Entry instead of Term? Will it make working with RGBA matrix faster?



Thanks!
#59 Posted: 4/20/2016 1:08:25 PM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

Wrote

Fails for me

Time to contact Andrey.



I think you are right...

warning MSB3245: Could not resolve this reference. Could not locate the assembly "SMath.Controls". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [{SourcesDir}\ImageEdit.csproj]
Since I don't know how it works the RM, I can only suppose that there is some sort of "cache effect" for your account because previously you have compiled the plugin with the old APIs (?)...


Wrote

Also how do I use Entry instead of Term? Will it make working with RGBA matrix faster?



It may worth the effort, since images are made of a lot of data (you have to change just one thing - but actually I have no idea how to convert base.Terms to an Entry); just to mention, if you use it, the updates for SS versions < 0.98 are a little bit more difficult to provide (since you have to change the code).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#60 Posted: 4/20/2016 6:12:42 PM
Andrey Ivashov

Andrey Ivashov

2269 likes in 3729 posts.

Group: Super Administrator

Wrote

Time to contact Andrey.


Error discovered in Release Manager. It is fixed now.
Please try to build plug-in again.

Best regards!
2 users liked this post
Alexander O. Melnik 4/20/2016 6:44:00 PM, Davide Carpi 4/20/2016 7:05:00 PM
  • New Posts New Posts
  • No New Posts No New Posts