This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-03-08 19:17:57

Reverberated3
Scratcher
Registered: 2011-02-24
Posts: 100+

Weird thing...

Picture Tilt

So, this program is supposed to tilt a picture, make it look like it's being held at an angle.  It does a pretty good job, but has a serious problem with the scanning.  It will, at times, skip over sections of the picture, ruining the effect.  Is there any way to make sure it doesn't skip?

Thanks in advance.


http://i53.tinypic.com/2zs0bah.jpghttp://i51.tinypic.com/30jtrbl.jpg

Offline

 

#2 2011-03-08 20:01:06

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Weird thing...

I first want to say that this is very impressive. Nice job! I believe that the skipping is because of turbo mode. I'm not exactly sure what turbo mode does, but it causes things to be rather inaccurate and skip around when they move. As a result, the scanning sprite is probably jumping over some pixels. You'll notice that if you run the project in normal speed, it reproduces the image just fine.


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#3 2011-03-08 20:17:55

Reverberated3
Scratcher
Registered: 2011-02-24
Posts: 100+

Re: Weird thing...

Harakou wrote:

I first want to say that this is very impressive. Nice job! I believe that the skipping is because of turbo mode. I'm not exactly sure what turbo mode does, but it causes things to be rather inaccurate and skip around when they move. As a result, the scanning sprite is probably jumping over some pixels. You'll notice that if you run the project in normal speed, it reproduces the image just fine.

Nope, I tried it out side turbo mode, still misses around 300 pixels.  Depending on which picture it is, it runs better if it's the one of the two guys and not the cat one.


http://i53.tinypic.com/2zs0bah.jpghttp://i51.tinypic.com/30jtrbl.jpg

Offline

 

#4 2011-03-08 21:03:00

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Weird thing...

Reverberated3 wrote:

Harakou wrote:

I first want to say that this is very impressive. Nice job! I believe that the skipping is because of turbo mode. I'm not exactly sure what turbo mode does, but it causes things to be rather inaccurate and skip around when they move. As a result, the scanning sprite is probably jumping over some pixels. You'll notice that if you run the project in normal speed, it reproduces the image just fine.

Nope, I tried it out side turbo mode, still misses around 300 pixels.  Depending on which picture it is, it runs better if it's the one of the two guys and not the cat one.

Hm... testing. Give me a minute.

Update: Hm, I'm seeing the problem too. One thing I'm seeing is that the list for the Scratch cat image should be 10,605 items long, but it's only 9,802 lines long. Let me see if that's consistent.

Update 2: 9,802 is consistent, making me suspect that this is a code issue. It may be a problem with the color sensing; let me check that and get back to you.

Last edited by Harakou (2011-03-08 21:24:09)


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#5 2011-03-08 21:28:23

Reverberated3
Scratcher
Registered: 2011-02-24
Posts: 100+

Re: Weird thing...

Thanks, I think i might have a method that would work to solve it, but I'll wait to see what you find.


http://i53.tinypic.com/2zs0bah.jpghttp://i51.tinypic.com/30jtrbl.jpg

Offline

 

#6 2011-03-08 21:33:33

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Weird thing...

Yup, it was your color sensing. I added a conditional to the end that added a 6 to the list is it was touching none of the colors you had listed, and the number of items came out perfectly. That would also explain why the Scratch cat was the only one not working, because the other image didn't contain that color. (Still trying to figure out which color that is.)

Last edited by Harakou (2011-03-08 21:35:19)


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#7 2011-03-08 21:49:41

Reverberated3
Scratcher
Registered: 2011-02-24
Posts: 100+

Re: Weird thing...

Harakou wrote:

Yup, it was your color sensing. I added a conditional to the end that added a 6 to the list is it was touching none of the colors you had listed, and the number of items came out perfectly. That would also explain why the Scratch cat was the only one not working, because the other image didn't contain that color. (Still trying to figure out which color that is.)

Thanks!  I think it's just a slight difference, that happens all the time in paint.  If your method doesn't completely work, I would just use a counting variable to make sure the list is the right length.


http://i53.tinypic.com/2zs0bah.jpghttp://i51.tinypic.com/30jtrbl.jpg

Offline

 

#8 2011-03-08 21:50:34

puppetadventurer
Scratcher
Registered: 2011-02-20
Posts: 1000+

Re: Weird thing...

amazing


3

Offline

 

#9 2011-03-08 23:20:21

what-the
Scratcher
Registered: 2009-10-04
Posts: 1000+

Re: Weird thing...

Why does this look like my 3D height map creator?

Black and white image to list converter
http://scratch.mit.edu/projects/what-the/1529978

Black and white image in list form to 3D map. (Remove one block and it does the exact same thing as what yours does) RrrRr

http://scratch.mit.edu/projects/what-the/1530181

Explain yourself. Nowz.


http://imageshack.us/m/64/9034/ddfss.pngMy site
Find someone post count. Click posts under username. Find number of pages. Times that by 40 for min and 60 for max and you have a rough estimate of post count.

Offline

 

#10 2011-03-08 23:25:58

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Weird thing...

what-the wrote:

Why does this look like my 3D height map creator?

Black and white image to list converter
http://scratch.mit.edu/projects/what-the/1529978

Black and white image in list form to 3D map. (Remove one block and it does the exact same thing as what yours does) RrrRr

http://scratch.mit.edu/projects/what-the/1530181

Explain yourself. Nowz.

This seems different to me. His just takes an image and tilts it, whereas yours converts the colors in an elevation map to an array and renders a 3D height map.  hmm


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#11 2011-03-08 23:29:41

what-the
Scratcher
Registered: 2009-10-04
Posts: 1000+

Re: Weird thing...

Harakou wrote:

what-the wrote:

Why does this look like my 3D height map creator?

Black and white image to list converter
http://scratch.mit.edu/projects/what-the/1529978

Black and white image in list form to 3D map. (Remove one block and it does the exact same thing as what yours does) RrrRr

http://scratch.mit.edu/projects/what-the/1530181

Explain yourself. Nowz.

This seems different to me. His just takes an image and tilts it, whereas yours converts the colors in an elevation map to an array and renders a 3D height map.  hmm

Download the 3D height map and remove the "change y by" in the final loop under the stamp. Now it does the same thing

Look at the code. It is layed out very similarly. (You must download all three projects)

Last edited by what-the (2011-03-08 23:31:30)


http://imageshack.us/m/64/9034/ddfss.pngMy site
Find someone post count. Click posts under username. Find number of pages. Times that by 40 for min and 60 for max and you have a rough estimate of post count.

Offline

 

#12 2011-03-08 23:30:44

Reverberated3
Scratcher
Registered: 2011-02-24
Posts: 100+

Re: Weird thing...

It is partially influenced by your project, but mainly in the idea of using a grayscale.  It's easier than scanning tons of different colors.


http://i53.tinypic.com/2zs0bah.jpghttp://i51.tinypic.com/30jtrbl.jpg

Offline

 

#13 2011-03-08 23:40:36

what-the
Scratcher
Registered: 2009-10-04
Posts: 1000+

Re: Weird thing...

Reverberated3 wrote:

It is partially influenced by your project, but mainly in the idea of using a grayscale.  It's easier than scanning tons of different colors.

http://img836.imageshack.us/img836/5227/dddddddf.png

Hmm. I see a lot alike.


http://imageshack.us/m/64/9034/ddfss.pngMy site
Find someone post count. Click posts under username. Find number of pages. Times that by 40 for min and 60 for max and you have a rough estimate of post count.

Offline

 

#14 2011-03-09 07:08:34

Reverberated3
Scratcher
Registered: 2011-02-24
Posts: 100+

Re: Weird thing...

I did not copy your project.  Only some of the ideas.


http://i53.tinypic.com/2zs0bah.jpghttp://i51.tinypic.com/30jtrbl.jpg

Offline

 

Board footer