Page 1 of 1

Less outputs?

Posted: 2018-01-23T11:41:18-07:00
by Hal300
I am trying to convert an image (black and white for now) into coordinates (x and y). I am using the command "convert image.png -threshold 50% txt:". Currently, whatever image I convert IM replies with around 640k sets of coordinates (800 in the x axis and 800 in the y axis). I need to send these coordinates to a stepper motor which is only able to make 200 steps. Is there a way of reducing the number of coordinates or at least minimising it? I need the image to be printed afterwards onto A3 sized paper for my project and so do not want to loose any resolution. Any help would be much appreciated.

Re: Less outputs?

Posted: 2018-01-23T12:21:57-07:00
by snibgo
Your question isn't clear to me.

If your stepper motor "is only able to make 200 steps" (in each direction?), then that's the resolution available. You "do not want to loose any resolution", but you don't have a choice?

Re: Less outputs?

Posted: 2018-01-23T14:06:01-07:00
by Hal300
Sorry, I should of been more clear. I each direction my stepper motor is able to move 200 steps as it has a step angle of 1.8 degrees. I want to move the object left and right so the object can move 200 steps left and 200 steps back to the right. Same with it moving upwards and downwards. 200 steps upwards and 200 steps back down from the top. However, IM is giving me 800 coordinates in each direction. So it starts from (0,0) and goes all the way up to (800,800). Is there a way I can reduce the number of coordinates it gives me. To my understanding, it converts each pixel into a coordinate. Is it possible to group pixels so there are less sets of coordinates? I will try to add an image of my results to help illustrate my point.

Re: Less outputs?

Posted: 2018-01-23T14:19:59-07:00
by Bonzo
Resize the input image?

Re: Less outputs?

Posted: 2018-01-23T14:47:43-07:00
by Hal300
Thank you Bonzo. Completely forgot I could do that. Now it works perfectly.