Timeline for How to peel the labels from marmalade jars using Mathematica?
Current License: CC BY-SA 3.0
32 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 4, 2018 at 17:53 | comment | added | Niki Estner |
@Ita: No, that was an ad-hoc invention. The idea was: The angle on the cylinder should be ArcSin[x*c1+y*c2+c3] for some constants c1..c3 , if we ignore perspective distortion. But fitting ArcSin didn't work well with FindMinimum , so I used a Taylor series that's close enough in the angle range I'm interested in, and real for all x and y .
|
|
Jun 4, 2018 at 17:27 | comment | added | Ita | Do you happen to have a reference to the cylindrical mapping? And also perhaps for an inverse mapping? | |
Jan 6, 2018 at 2:26 | comment | added | David Doria |
@NikiEstner You say: This minimizes the mapping coefficients, so the points on the left border are mapped to {0, [anything]}, the points on the top border are mapped to {[anything], 1} and so on. Why are the points on the top border not mapped to have their column be 0 (not 1)? And what about the bottom and right borders? How do you know their values? (i.e. how do you know the width/height of the output image?)
|
|
Jan 6, 2018 at 2:21 | comment | added | David Doria | Can you explain where you got this term 'c1 + c2*x + c3*y + c4*x*y' ? | |
Apr 13, 2017 at 12:56 | history | edited | CommunityBot |
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
|
|
Apr 13, 2017 at 12:47 | history | edited | CommunityBot |
replaced http://dsp.stackexchange.com/ with https://dsp.stackexchange.com/
|
|
Dec 14, 2016 at 11:06 | history | edited | LCarvalho | CC BY-SA 3.0 |
deleted 41 characters in body
|
Oct 12, 2012 at 15:52 | comment | added | Niki Estner | @JYelton: I use it almost exclusively for that. I've tried both Matlab and Mathematica; they're more or less equal in image processing/computer vision capabilities (if you buy the right MatLab toolboxes), but the Mathematica language is way more powerful. | |
Oct 12, 2012 at 15:37 | comment | added | JYelton | @nikie It seems Mathematica can be used for machine vision type image processing techniques. I saw this answer and added an account for Mathematica just because of my interest in this. Thanks for an excellent demonstration. | |
May 20, 2012 at 21:55 | vote | accept | Dr. belisarius | ||
May 18, 2012 at 14:43 | comment | added | Niki Estner | @Szabolcs: Done. I'll leave the "evolution version" of the answer here and link to the "intelligent design" version on dsp, that makes it look like I had known how to do it right away. | |
May 18, 2012 at 14:26 | comment | added | cormullion | @nikie That's a great answer, thanks! It teaches a lot about image processing in Mathematica. (I just looked in my cupboard, and the only jam i could find one of these - octagonal labels... :) | |
May 18, 2012 at 14:23 | history | edited | Niki Estner | CC BY-SA 3.0 |
added 237 characters in body
|
May 18, 2012 at 13:49 | comment | added | Szabolcs | Could you perhaps summarize your answer in a new answer to this question and also link back here? Then I could remove my answer. | |
May 18, 2012 at 13:18 | history | edited | Niki Estner | CC BY-SA 3.0 |
added 1260 characters in body
|
May 18, 2012 at 9:27 | history | edited | Niki Estner | CC BY-SA 3.0 |
added 166 characters in body
|
May 18, 2012 at 9:15 | comment | added | Szabolcs | If we look at the label exactly from the front and centre, so it appears as a rectangle, then the outline provides no information about how much we'd need to correct for the distortion near the left and right edges. The label could still be very small (covering a small angle of the cylinder, small distortion), or large, covering 150 of the cylinder (big distortion). I guess there's no way out... | |
May 18, 2012 at 9:15 | comment | added | Szabolcs | @nikie Thanks for adding those pictures, it's very nice, and it just made your answer a lot cooler! The remaining problem is the distortion on the extreme left and extreme right, clearly visible on the very last example. I'm not really sure how to tackle that without making the method more fragile and potentially introducing even greater distortions ... | |
May 18, 2012 at 8:53 | history | edited | Niki Estner | CC BY-SA 3.0 |
added 166 characters in body
|
May 18, 2012 at 8:34 | history | edited | Niki Estner | CC BY-SA 3.0 |
added 1033 characters in body
|
May 18, 2012 at 8:29 | comment | added | Niki Estner | @Szabolcs: I really don't know how general/stable it is. I've tried it on a few images (see Add 3) and it worked quite well as long as the label was brighter than the rest of the image (because of the binarization). | |
May 18, 2012 at 8:28 | history | edited | Niki Estner | CC BY-SA 3.0 |
added 1033 characters in body
|
May 18, 2012 at 7:50 | comment | added | Szabolcs | (In other words, is the question ready to be shared with a wider audience to amaze them? :-) ) | |
May 18, 2012 at 7:49 | comment | added | Szabolcs | How general is this? Have you tried it on many images, or does it only work on a few? I realize the label detection part is more trouble, so a practical solution would be something that doesn't require a lot of precision manual intervention, but alows some. E.g. we could manually crop the images to a rectangular area around the labels. If we do this, will it work automatically for peeling off many different kinds of labels? | |
May 18, 2012 at 1:05 | comment | added | wxffles | +1 This is a nice practical example of using Mathematica's image processing capabilities. They seem quite comprehensive, but I haven't seen them used much around here (and I find the built in help a bit lacking). | |
May 18, 2012 at 0:06 | history | edited | Niki Estner | CC BY-SA 3.0 |
added 2390 characters in body
|
May 17, 2012 at 21:58 | comment | added | acl | good idea with using the known fact that the label is a rectangle... +1 | |
May 17, 2012 at 21:51 | history | edited | Niki Estner | CC BY-SA 3.0 |
added 816 characters in body
|
May 17, 2012 at 21:25 | comment | added | Dr. belisarius | @nikie Thanks for your answer, I'll experiment a bit with the code. As for better images, there are relatively easy to find a few in the Internet. For example: kitchengardenpreserves.co.uk/newsb/wp-content/uploads/2011/12/… | |
May 17, 2012 at 20:47 | comment | added | azdahak | That's very nice. +1 | |
May 17, 2012 at 20:41 | history | edited | Niki Estner | CC BY-SA 3.0 |
added 634 characters in body
|
May 17, 2012 at 19:26 | history | answered | Niki Estner | CC BY-SA 3.0 |