Wikipedia:Reference desk/Archives/Computing/2015 July 27

From Wikipedia, the free encyclopedia
Computing desk
< July 26 << Jun | July | Aug >> July 28 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


July 27[edit]

."Wikipedia" - the name[edit]

How did The Free Encyclopedia get its name "Wikipedia"? Does the beginning of the name "Wiki" come from Latin?

"Wiki" is the Hawaiian word for "Quick" - see History of wikis. AndyTheGrump (talk) 00:54, 27 July 2015 (UTC)[reply]
See also Wikipedia. Dismas|(talk) 01:15, 27 July 2015 (UTC)[reply]
...And History of Wikipedia while we're at it :) — Rhododendrites talk \\ 16:49, 27 July 2015 (UTC)[reply]

Decoding QRCodes the hard way.[edit]

I want to write my own QRCode recognizer from the ground up...I have lots of programming and graphics experience - so you don't need to use baby-talk - but I've not done much image recognition.

What are the basic steps in doing such a thing? Assume I have a 2D array of pixels from a camera at no particular angle to the QRcode as a starting point.

24.242.75.217 (talk) 01:26, 27 July 2015 (UTC)[reply]

Erm? Do you want someone to write you a tutorial? Have you read QR? There are more than a few resources online for similar projects. Vespine (talk) 01:32, 27 July 2015 (UTC)[reply]
Hmmm - I doubt either of those things will be of much use to our OP. QR Code doesn't say how it's decoded, and the Swift-reader description you linked can be summarized as "Call the QR-code reading library". Our OP said "from the ground up". I can't find a 'ground up' explanation.
I believe you start off using some kind of edge-recognition approach to recognize the three corner boxes (to be honest, I'm a little vague on that part!) - and once you know those positions, you can generate a matrix that you can use to transform the image of the QR code into a simple, axially aligned 2D square...and from that point on, it's just a matter of reading and thresholding the pixels in the areas where you expect the data dots to lie. There is an error-correcting code (Reed–Solomon error correction) that is applied to extract the actual data.
First you need to detect that there is a QR code. To do that you need to search for the FIPs (the three "finder pattern" squares). This paper talks about using Haar-like features; this discussion talks about using contour detection and analysis, which is a kind of feature extraction. Both of those examples use OpenCV to do the lower level stuff, but you can always choose to do that yourself. The ISO QR spec gives a rather simpler scanline-ratio based algorithm, but I don't know how robust that will be for real-world photos of QR codes. Once you've figured out the locations of the three corner FIPs, you need to transform the image so that it's square (because a real picture of a QR code will likely have some perspective distortion and some rotation) - that's discussed in the second link I give above. At some point (I guess now) you'll need to downscale so one black/white box becomes one pixel, and convert to a 1-bit image (a clever system will presumably use contrast for that, to accomodate images which have a shade gradient over them; a simple decoder might just choose to use a threshhold (based on the range of tones within the inter-FIP area)). From there, you can use the decode algorithm detailed in the ISO specification - this page links to that. If you want to read someone else's code that already solves the problem, you could try Zbar's, although I had a brief look at their QR code and it's rather tulgey. -- Finlay McWalterTalk 11:18, 27 July 2015 (UTC)[reply]
The algorithms to locate barcodes can be explained rather easily. Locating a linear one, like an EIN or UPC, is nearly identical to locating a QR.
  1. Pick an angle from 0 to 180 degrees (this can be random, it can step through the angles, whatever...)
  2. Begin at a location on the left or top of the image and follow the angle across the image (the starting point can be random or step through every point...)
  3. If the pixel is blackish, record a 1.
  4. If the pixel is whitish, record a 0. (Some algorithms preprocess the image to get a point halfway between the darkest and lightest pixel to be the border between black and white)
  5. Scan the image for the sequence that indicates the beginning/end of the code, such as 1n0n1n1n0n1n where n is a quantity. You would match 101101 or 110011110011 or 111000111111000111 or 111100001111111100001111. Some algorithms allow for variance. So, this would match even though there is a missing 0: 11110000111111110001111.
  6. If you didn't find TWO beginning/end sequences (most barcodes require a special code at the beginning and end, so they come in pairs), go to the first step and start over.
  7. For QR codes, you now have a beginning/end box and the angle of the line between them. Scan at a 90 degree angle off both boxes to find the elusive third box. If you don't find it, go back to the first step.
Once you have the beginning and end of the barcode, scanning the lines or squares between them is a completely different process. This is just for locating the barcode. There are many algorithms that do this. The big trick is finding the "fastest" and "most reliable" method of locating the beginning/end codes. 209.149.113.45 (talk) 13:24, 27 July 2015 (UTC)[reply]
That sounds OK for 1D barcodes - but for 2D QRCodes, picked up via a camera - not so much. What you suggest presumes that the plane of the camera sensor is more or less parallel to the plane of the QR code so that a right angle in the QR code is a right angle in the photograph. If it's not then the lines between the top-left corner box and the top-right and bottom-left boxes aren't at right angles and the sizes of the blocks in the code will vary from one place in the image to another due to perspective and such. Also, the pattern of 110011110011 (or whatever) shows up in places other than the corner box. The QR code for my website (http://RenaissanceMiniatures.com) has that pattern showing up in several places - close to the bottom-left corner of the QR code for example).
A good algorithm should also verify that the detection of the three corner boxes is correct by looking for the smaller 4th box that's inset a few blocks in from the bottom-right corner of the code.
SteveBaker (talk) 19:22, 27 July 2015 (UTC)[reply]
Often an approximation of a Hough transform is used to estimate how the rotation of a photo of a 2D barcode. Then image rectification attempts to remove most of that rotation. Sometimes perspective control is used to remove most of the perspective projection distortion.
Alternately, I hear that some people use something like a generalized Hough transform#Circle detection process to detect the precise position of the 3 big fiducials (and sometimes the smaller fiducials), then use linear interpolation/extrapolation from those positions to find the approximate size and position of each "module".
Some of these steps are exactly the same for almost every 2D barcode.
"How to put your logo in a QR code" has a few details.
You might be interested in seeing how other people decode QR codes. There are several open-source barcode scanners available, including:
  • ZXing ("zebra crossing")
  • QrCode.Net [1]
  • Open Source QR Code Library [2]
  • ZBar bar code reader [3] (Thank you, Finlay McWalter)
(My understanding is that Wikibooks: Android/PhoneGap#Barcodes uses ZXing).
Is there a better place to describe and discuss techniques for decoding 2D barcodes "from the ground up", and ideas for designing entirely new 2D barcodes that are even easier to decode? (My understanding is that Wikibooks is more accepting of such "how-to" information than Wikipedia WP:NOTHOWTO).
--DavidCary (talk) 01:33, 29 July 2015 (UTC)[reply]

Movie file[edit]

Hello, I recently collected a movie of two copies, one of which is 1.56GB and the other 4.00GB.

  1. Which one of this should I keep in my ‘treasure box’?; both copies look alike without any defects/pixel issues…
  2. What software decreases the GB?
  3. What do I lose, together with the ‘kb/Mb/Gb’/What's the difference between the two files I possess; rather than the 'GB'?

Space Ghost (talk) 18:41, 27 July 2015 (UTC)[reply]

@Russell.mo: What format are the two files? What information do you have about them? Are these DVD rips? Captured streaming video?
The relevant articles are video file format, Comparison of video container formats (these two articles are actually a little redundant, it appears), and video coding format.
Basically a movie is a bunch of video data (for which there are multiple formats) and audio data (for which there are multiple formats) wrapped one of many "containers". The size of the original audio and video data, the kind of compression, and the level of compression are what lead to varying file sizes. Practically speaking, if they look exactly alike [and sound exactly alike] what kind of rationale would there be to keep the bigger one? — Rhododendrites talk \\ 19:02, 27 July 2015 (UTC)[reply]
It might be that the larger one has a higher resolution, but this difference isn't visible at the resolution he is using. The place I find the resolution is most obvious is in the credits, particularly the tiny tiny ones at the end, like these: [4]. StuRat (talk) 19:17, 27 July 2015 (UTC)[reply]
@StuRat: Where is the resolution in that image? Are you talking about the kind of film/camera/aspect ratio the film was shot in? It's indeed true that the resolution of the bigger file may be higher than in the smaller one and the difference is small enough that OP would need a bigger display to really notice. I suppose it's possible that the credits vary based on medium such that the DVD, BluRay, streaming, etc. versions all have their own figures, but that wouldn't be the same as what resolution the video file is, because not only can you reduce the resolution to reduce the size, but you can also artificially increase the resolution (no real gain, but it would certainly take up much more space). The resolution of the file should be visible in the properties of the file as visible through any playback application. — Rhododendrites talk \\ 20:38, 27 July 2015 (UTC)[reply]
You may have misunderstood me. I don't mean that they list the resolution there, I mean that you can get an idea of the resolution by viewing tiny credits. If they are blurry, it's low res. The image I linked to is only 640×360, and, as you can see, it's rather blurry. A 1920×1080 image would look crystal clear, but of course, only if you displayed it at full resolution, and it had never been downconverted then upconverted back to full HD, had a lossy compression applied, etc. So, when I get a copy of a movie, I go right to the credits to see if it's a good version or if it's crap. (If it's total crap, I may try to find a better copy or just not bother watching it.)
And yes, I have noticed that newer 1920×1080 movies have started using even smaller credits, just when I finally was able to read them all. It's a conspiracy I tell you ! StuRat (talk) 20:46, 27 July 2015 (UTC)[reply]
Ah. Yes. I did misunderstand. I see now that you're suggesting a practical test for comparing image resolution (focusing on a detail with high contrast). Makes sense. — Rhododendrites talk \\ 22:00, 27 July 2015 (UTC)[reply]
That's right. Just looking at what it claims is the resolution won't tell you if it's been downconverted then back up, or had a lossy compression applied, but this test will. StuRat (talk) 22:30, 27 July 2015 (UTC)[reply]
Rhododendrites, StuRat: '.avi' is on 1.56GB and '.mp4' is on 4GB. I heard and checked on the internet something similar to what both of you said, a long time ago, can't recall now, that either the picture/sound (or both) is affected. Based on your experience, up to what 'Kb/Mb/GB' would you guys suggest, in order to retain a movie? The bigger the better of course, but...? -- Space Ghost (talk) 22:55, 27 July 2015 (UTC)[reply]
In my experience it's a completely personal preference. Sometimes I don't mind retaining even a 800MB file of a movie, but sometimes i want to retain the 4GB or larger version. Is the movie very "visual"? Does it rely on special effects and amazing cinematography? (Big file). Or is it a indy drama filmed on a low budget? (small file). Would I watch it with friends if I'm having a movie night? or am I likely to watch it on the train on my ipad? (Small file). And, certainly not the least consideration: how much disk space do you have left? ;) but if you watch both and you literally can't tell the difference, just keep the small file. Vespine (talk) 23:10, 27 July 2015 (UTC)[reply]
Points you stated, noted, thank you.
1TB (931GB) RHDD, 560GB available. I have many useful softwares, good games and movies, and at least 10GB of adult videos (you’ll never get tired of it). I’m planning to make it a ‘treasure’ box (RHDD) for my upcoming future. -- Space Ghost (talk) 19:02, 28 July 2015 (UTC)[reply]
On the large end are VOB files, which is what commercial non-BluRay DVDs use. I find they take about 8 GB for a 2 hour movie. Did you do my suggested test and look at the smallest credits ? That will allow you to compare the visual quality. StuRat (talk) 00:08, 28 July 2015 (UTC)[reply]
Yes I have, thereafter messaging you guys yesterday, a slight blurriness seen that can be tolerated I guess, as I would not have known/noticed it if you didn’t point it out…thanks. -- Space Ghost (talk) 19:02, 28 July 2015 (UTC)[reply]

I thought mathematics could be used to estimate, for example if 1.50GB (.avi) file producing credible quality resolution and sound - comparing with the 4GB (.mp4) - then will at least (or less than) 1GB movie file do the trick, for treasuring purpose? Or does it also depend on the 'file extension'? If so, what 'file extension' is the best? -- Space Ghost (talk) 19:02, 28 July 2015 (UTC)[reply]

Well, it's all going to depend on the time, resolution, color depth, frames per second, etc., and some types of video (like traditional animation with large areas of constant color) will compress far better than others (like a dark scene with live action). And then there's personal preference for how much quality you are willing to trade off for how much space savings. Somebody might be able to answer on which formats (file extensions) are better, although again with lots of caveats. For your particular case, since you said the visual quality is acceptable on the smaller file, I'd use that one. StuRat (talk) 19:08, 28 July 2015 (UTC)[reply]
Hey buddy, I thought I messaged you yesterday, but the message did not appear... Anyway, I wrote "Okay, I'll. Thanks" or something like that... Take care! -- Space Ghost (talk) 18:14, 29 July 2015 (UTC)[reply]
file extension is meaningless. Even if the extension is the normal extension, the vast majority of common video container formats support different video codecs in the spec (if there even is one). Even WebM now supports VP8 and VP9. And even if you have the same video codec and the same source file, the quality is going to depend on the settings used for the codec (profile etc), and the actual encoder used. Nil Einne (talk) 20:17, 29 July 2015 (UTC)[reply]
I don't believe file extensions are meaningless, since they determine the default program used to open or run that file. For example, an HTML extension file is typically opened with a browser, capable of displaying HTML. If you change the extension to TXT, then it will likely open with a text editor, and you will be able to edit it, but not display it, which is quite a different action. (Yes, you could alter the default actions for each file extension, but changing those two would really mess up how your PC handles those common file types.) StuRat (talk) 13:52, 30 July 2015 (UTC)[reply]
I understand what you both said. I guess file extension is nothing to worry about 'for the time being' or 'ever' unless I'm dealing with it in a professional manner... -- Space Ghost (talk) 18:49, 30 July 2015 (UTC)[reply]

Migrating Fedora Linux to a new hard drive[edit]

My 2 TB hard drive for Fedora 20 Linux is almost filling up. I think it won't even last until Christmas. I can buy a new 4 TB hard drive, which should last for several years, but how do I transfer my system to it? I know I can just plug both hard drives in at the same time and use cp to copy my entire /home directory partition and the entire partition where I keep my photographs in (which takes up the vast bulk of the drive). But what about the /boot and / partitions? Can I just use cp to copy them across as well and have a bootable system?

I'm also planning to finally upgrade to Fedora 22 Linux in the process. But a fresh install of Fedora 22 Linux would mean I would lose all my installed programs, only keeping my personal data and my photographs. Is there a way to copy them across or do I have to reinstall them all over again? JIP | Talk 20:59, 27 July 2015 (UTC)[reply]

Copy the old disk to the new (boot sectors, partition tables, etc.) wholesale from the old disk to the new with dd (Unix). Then use GNU Parted to resize the partitions on the new disk to fill the disk up. I don't know anything about upgrading Fedora. 84.51.142.140 (talk) 21:18, 27 July 2015 (UTC)[reply]
With Fedora, you should be using lvm virtual file system. You can put in the new drive and expand your virtual partition to contain the new drive. See the many lvm expand tutorials for how to's.
Though brief, I agree with this. If you have the ability to add the new drive along with the old drive, use LVM. Fedora's Anaconda uses LVM by default (even if you only have 1 drive). So, you should have an LVM drive that you are using - which is a virtual drive that encompasses your current drive. Now, add the new drive. Now, hopefully, you installed system-config-lvm. Run that. It is a nice and easy GUI. You will see the second drive listed as unused. Select it and add it to your LVM. Now, you will see both drives as a single 6TB drive and you won't have to copy/move any files. 209.149.113.45 (talk) 13:47, 28 July 2015 (UTC)[reply]
That would be a good idea, but my current computer is actually my company's property, and it only has two drive bays, both filled up. One has my Fedora 20 Linux system and the other has a Windows 8 system I'm not allowed to wipe clean in order to install Linux there, it must remain intact. However, I haven't actually used the Windows 8 system in over a year. I might be able to simply remove it and keep it in a safe place, and then put the new 4 TB Linux drive in its place. If my company ever wants the computer back, I can simply swap the drives again, putting the Windows 8 system back in place. Then I have to buy a new computer with more drive bays. JIP | Talk 17:06, 28 July 2015 (UTC)[reply]
I would ask if you could just drop the Windows. The immediate answer is always "No", but sometimes you get a delayed, "Well, if you never use it and never update it and it is just sitting there wasting space, go ahead and remove it." I've been lucky. I haven't had to use Windows since 1994. 209.149.113.45 (talk) 18:36, 28 July 2015 (UTC)[reply]
The thing is, everything about this computer except the Linux drive and the Linux on it is actually my company's property, not mine. It's technically just on loan. The company has a finite amount of Windows licences and likes to hold on for them, and as well as that, the Windows drive has my company's own proprietary code on it. So wiping the Windows drive is not an option. Temporarily removing it is. And anyway, I've never used LVM like that before. My current Linux drive has separate partitions for /boot, /, /home and /storage. The last one is by far the largest and has all my photographs on it. It would be that partition I want to expand, keeping the others intact. Is that possible? And how does LVM across several physical drives even work? If the drives ever separate, will each have its own share of files or are the files themselves somehow spread? How is it determined which drive gets which files? JIP | Talk 18:45, 28 July 2015 (UTC)[reply]
I have never converted a hard partition into an LVM partition because, since about F16, LVM was default. I'm not certain that it is possible. But, as for working across multiple disks, that is exactly what LVM is used for. Instead of having multiple mount points, you have one root. Internally, it manages the disks (kind of like a RAID with no striping or mirroring). Once you have LVM running, you can add disks, remove disks, resize the volume, etc... I've also used it to get around problems. For example, I had a JBOD with 12T of data on a very old Gateway machine (yes - that old). The server would corrupt the disks all the time because, as I discovered, the SCSI driver never expected more than 4T of space to work with. So, I split the JBOD into 4 3T logical drives (staying well below 4T) and then used LVM to make it all one volume. I've also done what you are trying to do. I added a disk to an LVM, which was rather quick. Then, I told the LVM that I didn't want to use an older disk. It took a while to get everything off the old disk. Then, when it was done, I popped out the old disk and I was done. 209.149.113.45 (talk) 19:17, 28 July 2015 (UTC)[reply]
Well, if LVM was default since about F16 and I have F20, it might be that I'm already using it. I'll have to check. But I still need an answer to my question about the files. Does each physical drive get its own share of the files, or is the data spread out at a lower level? And how is it decided which drive gets which data? I need to know this so I know what to do when I have to update the drives again. And I think that to preserve the integrity of the files, it's a good idea to copy them all to a new drive every couple of years instead of keeping them on the same drive for decades. After all, every physical medium is prone to fault, and physical faults in the drive's disks themselves will corrupt the files. JIP | Talk 19:54, 28 July 2015 (UTC)[reply]
I just found out that F20 dropped system-config-lvm. So, there's no GUI for LVM. Why? They switched from LVM to LVM2 and the old tool wasn't apparently designed to handle LVM2. So, you are apparently stuck using command-line tools. They aren't actually complicated, just not as easy as the GUI. For example, sudo lvdisplay will quickly tell you if you are using LVM by displaying all logical volumes in use. 209.149.113.45 (talk) 13:50, 29 July 2015 (UTC)[reply]

Downloadable link sought[edit]

Friends, has anybody seen the 2D (cartoon) version of 'Transformers'? I'm planning to download the complete version (full/all the episodes or seasons) using 'YTD' (Youtube Downloader), would anyone kindly guide me to the link(s) please? I'm also willing to change the 'downloader' if required...whatever you guys recommend... -- Space Ghost (talk) 23:08, 27 July 2015 (UTC)[reply]

Just a note that doing so is likely illegal wherever you may live. There's a 15 disc version available for purchase. Dismas|(talk) 13:19, 28 July 2015 (UTC)[reply]
[[File:|25px|link=]] Yeah, I forgot. Sorry.
I'd be grateful if you could let me know the title of the 15 disc version one... If can, does it have everything? All the seasons, episodes, and so on? -- Space Ghost (talk) 18:18, 28 July 2015 (UTC)[reply]
Which series of Transformers are we talking about? If it's the original 1980s one I'd also be interested in purchasing this 15 disc version. JIP | Talk 19:14, 28 July 2015 (UTC)[reply]
The 15-disc version is, to my knowledge, the original series (80's). To be certain, this is the series with Peter Cullen as Optimus Prime. See it here. 209.149.113.45 (talk) 19:24, 28 July 2015 (UTC)[reply]
That's exactly what I was wanting. And the price seems affordable as well. But will the DVDs play here in Finland? After all, the entertainment industry seems to be doing its utmost to set up limits on how people can use the content they bought fully legally and paid good money for. JIP | Talk 19:46, 28 July 2015 (UTC)[reply]
Only if you have a DVD player that will play Region 1 DVDs. Here is a link to the Transformers: The Complete Original Series in Region 2. CambridgeBayWeather, Uqaqtuq (talk), Sunasuttuq 00:54, 29 July 2015 (UTC)[reply]

Okay guys, thanks... -- Space Ghost (talk) 18:14, 29 July 2015 (UTC)[reply]