Exemplo n.º 1
0
			
		# main loop
		while frame != None:
			
			if frame != None:

				px_pos = framecount * lh
				if reverse:
					px_pos *= -1

				print px_pos, offset, imgcount, slitcount
								
				if offset <= px_pos:
					if (not overwriteExisting  and slitscanner.fileExists()):
						# add frame - if full save logs
						isFull = slitscanner.addButDontScanFrame()
						if verbose:
							print "EXISTS frame #%05d (%s) to file: %s" % \
							 (totalframecount, moviefile, slitscanner.getFileName())							
					else:
						#jp4 mode pre-processing
						if jp4:
							cv.SaveImage("tmp_frame.jpg",frame)
							subprocess.call("elphel_dng %d tmp_frame.jpg tmp_frame.dng" % jp4_gamma,shell=True)
							subprocess.call(["dcraw","-W","-q","3", "tmp_frame.dng"])
							img_frame = Image.open("tmp_frame.ppm")
							subprocess.call("rm tmp_frame*", shell=True)						
						else:
							img_frame = Ipl2PIL(frame)
							img_frame = swapRGB(img_frame)
						pi = img_frame
Exemplo n.º 2
0
                track.getPointId(),
                track.getLat(),
                track.getLon(),
                track.getBearing(),
                track.getDistanceToLast(),
                track.getDistance() / 1000,
            ),

            if cache_only or process_images:
                if not ((not overwriteExisting) and slitscanner.fileExists()):
                    img = imgloader.getImageATLatLon(track.getLat(), track.getLon())

            if process_images:

                if (not overwriteExisting) and slitscanner.fileExists():
                    slitscanner.addButDontScanFrame()
                else:
                    img = imgloader.getImageATLatLon(track.getLat(), track.getLon())

                    bearing = track.getBearing()

                    if bearing < 90:
                        angle = -(90 - bearing)
                    else:
                        angle = bearing - 90

                    img_rot = img.rotate(angle, Image.BICUBIC, True)
                    rot = img_rot.crop(
                        (
                            img_rot.size[0] / 2 - size[0] / 2,
                            img_rot.size[1] / 2 - size[1] / 2,