在图像中检测点

问题描述

挑战: 是否有包含问题的在线测验->检测给定图像的确切部分?

情况:我可以使用下面的代码片段从图片中获得点击点,

Widget getImagePointWidget(){

  Image image = Image.network(
    'https://www.w3schools.com/w3css/img_lights.jpg',/// <--- placeholder image[![enter image description here][1]][1]
    height: SizeConfig.safeBlockHorizontal * 50,width: SizeConfig.safeBlockHorizontal * 100,);
  /// getting the original image size
  Completer<ui.Image> completer = new Completer<ui.Image>();
  image.image
      .resolve(ImageConfiguration())
      .addListener(ImageStreamListener((ImageInfo imageInfo,bool synchronousCall){
    completer.complete(imageInfo.image);

    print('\n\n original image width ${imageInfo.image.width} to local device width >>> ${SizeConfig.safeBlockHorizontal * 100}\n\n');
    print('\n\n original image height ${imageInfo.image.height} to local device height >>> ${SizeConfig.safeBlockVertical * 50}\n\n');
  }));

  return  GestureDetector(
    onPanUpdate: (DragUpdateDetails details){
      setState(() {
        _offset = details.localPosition;
        addImagePosition(_offset,answerOptions);
      });
    },onPanStart: (DragStartDetails details){
      setState(() {
        _offset = details.localPosition;
        addImagePosition(_offset,onTapDown: (TapDownDetails details){
      setState(() {
        _offset = details.localPosition;

        addImagePosition(_offset,child: Stack( children: <Widget>[

      image,// on screen touch indicator
      Container(
        child: ClipOval(
          clipper: CircleClipper(_offset),child: Container(
            height:  SizeConfig.safeBlockHorizontal * 50,color: Colors.red,),]),);
}

和模拟器上的屏幕:

screen from the emulator with selected point

与网络团队一起查看正确答案时,这是错误的

screen from the dashboard with user-selected point (green mark)

这是用户应在其中选择一个点的形状

enter image description here

我尝试的方法:我尝试将给定图像宽度和高度的不同移动媒体查询进行比较,但这给出了错误的观点。

我需要做的:应该将用户在图像内选择的点计算为给定的图像,而不是不是设备媒体查询

感谢您的帮助, 预先感谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...