[Scilab-users] Fwd: plotting dots vs xfarc

classic Classic list List threaded Threaded
5 messages Options
der_Phil der_Phil
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] Fwd: plotting dots vs xfarc

Dear community,

I need to create images, which includes exact dot-coordinates, drawn as filled circles.

All pixel coordinates of such an area would have to have exactly one single pixel value.

The resulting graphic right now is stored via:      xs2bmp.


to create the dots I naturally would use:      plot (x,y,'o')

Issues here:  
- It seems that the resulting pixels of the dot in the final image are not equally colored.
- Especially pixels at the right lower "corner" seem to be off-colored.
 

So I tried:  xfarc:
Issue here:    
- xfarc() seems not always to find the correct x-y-location.

See example attached.

 - The dots by plot() are colored white.
 - The xfarc is colored blue.

I left some dots without xfarc() to demonstrate the issue of plot().

I think I could "brute-force" pixel values of the underlying image (not black for real purpose) to correct pixel values.
But actually I wanted to avoid that.

Any hint?

Used: Scilab 6.1.0

Best regards,
Philipp









_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users

randomDistribution.png (10K) Download Attachment
Rafael Guerra Rafael Guerra
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: plotting dots vs xfarc

Hi,

 

Type in help:  pixel_drawing_mode

Could this help for your problem?

 

Regards,

Rafael

 

 

From: users <[hidden email]> On Behalf Of P M
Sent: Wednesday, September 30, 2020 5:50 PM
To: International users mailing list for Scilab. <[hidden email]>
Subject: [Scilab-users] Fwd: plotting dots vs xfarc

 

Dear community,

 

I need to create images, which includes exact dot-coordinates, drawn as filled circles.

 

All pixel coordinates of such an area would have to have exactly one single pixel value.

 

The resulting graphic right now is stored via:      xs2bmp.

 

 

to create the dots I naturally would use:      plot (x,y,'o')

 

Issues here:  

- It seems that the resulting pixels of the dot in the final image are not equally colored.

- Especially pixels at the right lower "corner" seem to be off-colored.

 

 

So I tried:  xfarc:

Issue here:    

- xfarc() seems not always to find the correct x-y-location.

 

See example attached.

 

 - The dots by plot() are colored white.

 - The xfarc is colored blue.

 

I left some dots without xfarc() to demonstrate the issue of plot().

 

I think I could "brute-force" pixel values of the underlying image (not black for real purpose) to correct pixel values.

But actually I wanted to avoid that.

 

Any hint?

 

Used: Scilab 6.1.0

 

Best regards,

Philipp

 

 

 

 

 

 

 

 


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Dang Ngoc Chan, Christophe Dang Ngoc Chan, Christophe
Reply | Threaded
Open this post in threaded view
|

Re: {EXT} Fwd: plotting dots vs xfarc

In reply to this post by der_Phil
Hello,

> De la part de P M
> Envoyé : mercredi 30 septembre 2020 16:50
>
> exact dot-coordinates, drawn as filled circles.
> All pixel coordinates of such an area would have to have exactly one single pixel value.
> The resulting graphic right now is stored via:      xs2bmp.
> [...]
> - It seems that the resulting pixels of the dot in the final image are not equally colored.

I suspect the following thing: pixels are squares, not dots.

So it may be that xs2bmp somehow inter-/extrapolate the colours.
You then have a "leak" between the coloured pixel and its neighbours.

You may try to draw squares of the exact size of the final pixel (e.g. 1/320 width and 1/200 height of the graphical window for a 320 × 200 raster picture).

You may also try some functions from the image processing toolboxes.

Hope this helps

Regards

--
Christophe Dang Ngoc Chan
[hidden email]

General
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Antoine Monmayrant Antoine Monmayrant
Reply | Threaded
Open this post in threaded view
|

Re: {EXT} Fwd: plotting dots vs xfarc


On 01/10/2020 09:05, Dang Ngoc Chan, Christophe wrote:

> Hello,
>
>> De la part de P M
>> Envoyé : mercredi 30 septembre 2020 16:50
>>
>> exact dot-coordinates, drawn as filled circles.
>> All pixel coordinates of such an area would have to have exactly one single pixel value.
>> The resulting graphic right now is stored via:      xs2bmp.
>> [...]
>> - It seems that the resulting pixels of the dot in the final image are not equally colored.
> I suspect the following thing: pixels are squares, not dots.
>
> So it may be that xs2bmp somehow inter-/extrapolate the colours.
> You then have a "leak" between the coloured pixel and its neighbours.
>
> You may try to draw squares of the exact size of the final pixel (e.g. 1/320 width and 1/200 height of the graphical window for a 320 × 200 raster picture).
>
> You may also try some functions from the image processing toolboxes.
Well, another approach would be to:
- use Matplot to display your image as a matrix, let's say [0:255] range.
- modify the data in the matrix to be displayed where you went to get
your "dot": like your change your data to 256
- use a colormap that is grayscale from [0:255] and has a fancy color
for 256 (blue?).

If you do this, you should get a perfect co-registration of your image
and your "overlayed" markers.
Of course, your markers will not be circular dots, just a single pixel
with what I described above, but you can also generate your own shapes
(bigger squares, crosses, ~circles), provided that you use an odd number
of pixels.

Hope it helps,

Antoine

>
> Hope this helps
>
> Regards
>
> --
> Christophe Dang Ngoc Chan
> [hidden email]
>
> General
> This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users
>
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
der_Phil der_Phil
Reply | Threaded
Open this post in threaded view
|

Re: {EXT} Fwd: plotting dots vs xfarc

Hi,

I think I'll modify the pixels in the image....like: img(x,y) = 255;

If necessary I will also change some neighboured pixels to enlarge the "dot"-size.

I do not need them blue...this was just to demonstrate that

      plot(x,y,'o')  ( = white)

and

     xfarc(x_arc,y_arc, w_arc,h_arc,0,360*64)   (= blue)

do not always plot at the same location....even all coordinates are just simple integers.

So far I could see, this does not change, even if one changes the pixel_drawing_mode attribute.

Thanks for your ideas,
Philipp

Am Do., 1. Okt. 2020 um 10:25 Uhr schrieb Antoine Monmayrant <[hidden email]>:

On 01/10/2020 09:05, Dang Ngoc Chan, Christophe wrote:
> Hello,
>
>> De la part de P M
>> Envoyé : mercredi 30 septembre 2020 16:50
>>
>> exact dot-coordinates, drawn as filled circles.
>> All pixel coordinates of such an area would have to have exactly one single pixel value.
>> The resulting graphic right now is stored via:      xs2bmp.
>> [...]
>> - It seems that the resulting pixels of the dot in the final image are not equally colored.
> I suspect the following thing: pixels are squares, not dots.
>
> So it may be that xs2bmp somehow inter-/extrapolate the colours.
> You then have a "leak" between the coloured pixel and its neighbours.
>
> You may try to draw squares of the exact size of the final pixel (e.g. 1/320 width and 1/200 height of the graphical window for a 320 × 200 raster picture).
>
> You may also try some functions from the image processing toolboxes.
Well, another approach would be to:
- use Matplot to display your image as a matrix, let's say [0:255] range.
- modify the data in the matrix to be displayed where you went to get
your "dot": like your change your data to 256
- use a colormap that is grayscale from [0:255] and has a fancy color
for 256 (blue?).

If you do this, you should get a perfect co-registration of your image
and your "overlayed" markers.
Of course, your markers will not be circular dots, just a single pixel
with what I described above, but you can also generate your own shapes
(bigger squares, crosses, ~circles), provided that you use an odd number
of pixels.

Hope it helps,

Antoine

>
> Hope this helps
>
> Regards
>
> --
> Christophe Dang Ngoc Chan
> [hidden email]
>
> General
> This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users
>
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users