从64位十六进制值中获取四个16位数字 [英] Get four 16bit numbers from a 64bit hex value

查看:726
本文介绍了从64位十六进制值中获取四个16位数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经通过了这些相关问题:



但是我没有得到答案,可能是因为我不明白64位或16位值。

我在Picasa和脸部检测中发布了一个问题,使用Picasa的脸部检测功能从包含许多图片的照片中获取单张照片。 使用API​​进行自动面部检测



回答 @Joel Martinez 链接到 picasa help 其中说:


rect64()是一个64位的十六进制数字。




  • 将其分成四个16位数字。

  • 将每个数除以最大的无符号16位数(65535),并且您将有4个
    数字,介于0和1之间。
  • ul>

全文


@oedious写道: - 这将会是
有点技术性的,所以请继续。 *包含在rect64()中的
数字是一个64位
十六进制数字。 *将
分成四个16位数字。 *除以最大无符号16位
数字(65535)
,你将有四个
数字,介于0和1之间。*四个
数字保留给你的亲戚面元矩形的
坐标:
(左,上,右,下)。 *如果您的
想要以绝对的
坐标结束,请将左边和右边的
右边的图片宽度和上边的
以及底部的图片高度相加。


示例picasa.ini文件:

  [1.jpg] 
backuphash = 65527
faces = rect64(5520c092dfb2f8d),615eec1bb18bdec5; rect64(dcc2ccf1fd63e93e),bc209d92a3388dc3; rect64(52524b7c785e6cf6),242908faa5044cb3
crop = rect64(0)

如何从64位十六进制中获得4个数字?



我很抱歉,目前我不明白答案。我想我必须学习一些C ++(我是一个PHP和Java Web开发人员,在数学方面存在弱点),然后我可以在一些坐标的帮助下跳入并编写一些将图像剪切成多个图像的东西。我正在研究 CodeLab 为Paint.net创建插件



除以0x10000(65536)的其余部分将会给你第一个数字。



取出结果,然后再除以0x10000(65536),其余的将给你第二个数字。



将结果再次除以0x10000(65536),其余的将给你第三个数字。



结果是第四个数字。 p>

I have been through these related questions:

But I did not get an answer probably because I do not understand 64bit or 16bit values.

I had posted a question on Picasa and face detection, to use the face detection that Picasa does to get individual pics from a photo containing many pictures. Automatic Face detection using API

In an answer @Joel Martinez linked to an answer on picasa help which said:

The number encased in rect64() is a 64-bit hexadecimal number.

  • Break that up into four 16-bit numbers.
  • Divide each by the maximum unsigned 16-bit number (65535) and you'll have four numbers between 0 and 1.

the full text

@oedious wrote:- This is going to be somewhat technical, so hang on. * The number encased in rect64() is a 64-bit hexadecimal number. * Break that up into four 16-bit numbers. * Divide each by the maximum unsigned 16-bit number (65535) and you'll have four numbers between 0 and 1. * The four numbers remaining give you relative coordinates for the face rectangle: (left, top, right, bottom). * If you want to end up with absolute coordinates, multiple the left and right by the image width and the top and bottom by the image height.

A sample picasa.ini file:

[1.jpg]
backuphash=65527
faces=rect64(5520c092dfb2f8d),615eec1bb18bdec5;rect64(dcc2ccf1fd63e93e),bc209d92a3388dc3;rect64(52524b7c785e6cf6),242908faa5044cb3
crop=rect64(0)

How do I get the 4 numbers from the 64 bit hex?

I am sorry people, currently I do not understand the answers. I guess I will have to learn some C++ (I am a PHP & Java Web Developer with weakness in Math) before I can jump in and write a something which will cut up an image into multiple images with the help of some co-ordinates. I am looking into CodeLab and creating plugins for Paint.net too

解决方案

Here is the algorithm:

The remainder of the division by 0x10000 (65536) will give you the first number.

Take the result then divide by 0x10000 (65536) again, the remainder will give you the second number.

Take the result the divide by 0x10000 (65536) again, the remainder will give you the third number.

The result is the fourth number.

这篇关于从64位十六进制值中获取四个16位数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆