Stéphane,

There are two problems with this approach. The first one is that there is no way to know how many 
disks cover a given point so the "heat map" would have only two levels: a given point 
belongs or not to the impact area. Charles hasn't carified, but the term "heat map" he 
used suggests a graded plot. The second problem is that you need to resource to a function not 
directly available in Scilab so you need to install a toolbox. Moreover, you need to create an 
intermediate file.

By the way, I always wondered why imread() isn't part of Scilab's core, as is 
wavread(). Maybe image processing is a very specialized subject demanding a 
complete toolkit to deal with it, but some basic functions like imread() or 
imwrite() would be very handy to ensure easy interoperabilty with other 
software packages.

It is also a pity that xs2bmp() cannot provide an array output with the pixel 
data corresponding to the figure image (2x2x3 for color graphs).

Regards,

Federico Miyara


On 17/03/2023 12:17, Stéphane Mottelet wrote:

Hello,

I would propose this solution, inspired by my remark abour using xfarcs and the bitmap idea from 
Frederico. The idea is to plot the disks then export the graph under a bitmap format, the read the 
image back (needs "imread" e.g.from IPCV) then count the black pixels ("true" 
value in x below). The ratio between black pixels and total number of pixels gives you the 
proportion of covered area:

clf

n = 17;
xc = grand(1,n,"unf",0,5);
yc = grand(1,n,"unf",0,5);
radius = grand(1,n,"unf",0,1);

drawlater
arcs=[xc-radius
        yc-radius
        2*radius
        2*radius
        zeros(1,n)
       zeros(1,n)+360*64];
st=ones(1,n);
a1 = newaxes();
a1.margins=[0 0 0 0];
xfarcs(arcs,st);
a1.data_bounds = [0,5,0,5];
isoview on
s=gcf().axes_size;
gcf().axes_size=[400 400]
drawnow

xs2bmp(0,"im.bmp");
x=imread("im.bmp");

disp(sum(x)/size(x,"*"))

S.

Le 16/03/2023 à 18:43, Federico Miyara a écrit :

Charles,

I assume the area of each impact point is circular (but it could be abapted for 
other forms). Then you could start with a n*m matrix filled with zeros. Then, 
according to a convenient scale, each impact point is approximated by a 
component of the matrix. The horizontal and vertical positions (column and row) 
will represent quantized coordinates.

Then, if the coordinates of an impact point ar p (column) and q (row) and the 
radius of its impact area is R, expressed using the same scale, for column k = 
(p - R):(p + R) you add 1 to the rows from q - sqrt(R^2-k^2) to q + 
sqrt(R^2-k^2).

You repeat that for all impact points (with a for loop) and at the end you have 
that each component of the matrix (which represent pixels) will be exactly the 
number of overlapping areas at the location represented by the component. For 
instance, if at component u, v you have 7, that means 7 impact areas contain 
that component.

This could be adapted even to a graded impact area, replacing 1 by the result 
of a function with a maximum at the center fading down to 0 at the perimeter of 
the impact area

You must be careful near the boundary so that components don't exceed the 
limits (for instance, not smaller than 1 or greater than n or m)

This is not probably the most efficient way, but assuming the impact area is 
small it should work fine and reasonably fast for a few thousand impact points.

Regards.

Federico Miyara


On 16/03/2023 00:45, charles marcotte wrote:
Hello,

I have 2d scatter plot where each marker represents an impact point. The impact 
point has a defined area.
1.  I am trying to assign each point the impact area to visualize how much of 
the surface is impacted.
Defining the marker size does not work because I change the scale between 
simulations and I can't find a definition of the marker size vs diameter or 
perimeter.

2. is there a way to calculate the overlap on the area through the chart with a 
heat map for example?

Thank you
Charles

This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/




_______________________________________________
users mailing list - users@lists.scilab.org<mailto:users@lists.scilab.org>
Click here to unsubscribe: 
<mailto:users-unsubscr...@lists.scilab.org><mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users




________________________________
[Avast logo] <https://www.avast.com/antivirus>

El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
www.avast.com<https://www.avast.com/antivirus>



This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/




_______________________________________________
users mailing list - users@lists.scilab.org<mailto:users@lists.scilab.org>
Click here to unsubscribe: 
<mailto:users-unsubscr...@lists.scilab.org><mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users


--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet


This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/




_______________________________________________
users mailing list - users@lists.scilab.org<mailto:users@lists.scilab.org>
Click here to unsubscribe: 
<mailto:users-unsubscr...@lists.scilab.org><mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users



This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/

_______________________________________________
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users

Reply via email to